a couple of fixes

This commit is contained in:
ZXMushroom63 2025-01-26 14:12:09 +08:00
parent 0e58351444
commit b56d38c174

View File

@ -14,8 +14,7 @@
var entitySuper = ModAPI.reflect.getSuper(entityClass, (x) => x.length === 2);
var nme_EntityCube = function nme_EntityCube($worldIn) {
entitySuper(this, $worldIn);
this.$setCreativeTab(creativeMiscTab);
this.$preventEntitySpawning = 1;
//this.$preventEntitySpawning = 1;
this.$setSize(1, 1);
}
ModAPI.reflect.prototypeStack(entityClass, nme_EntityCube);
@ -23,6 +22,13 @@
nme_EntityCube.prototype.$canBePushed = function () { return 0 };
nme_EntityCube.prototype.$getCollisionBox = function () { return this.$getEntityBoundingBox() };
nme_EntityCube.prototype.$getCollisionBoundingBox = function () { return this.$getEntityBoundingBox() };
nme_EntityCube.prototype.$readEntityFromNBT = function (nbtTagCompount) { // Needed, is an abstract method in parent class
nbtTagCompount = ModAPI.util.wrap(nbtTagCompount);
};
nme_EntityCube.prototype.$writeEntityToNBT = function (nbtTagCompount) { // Needed, is an abstract method in parent class
nbtTagCompount = ModAPI.util.wrap(nbtTagCompount);
};
nme_EntityCube.prototype.$getCollisionBoundingBox = function () { return this.$getEntityBoundingBox() }; // Needed, is an abstract method in parent class
nme_EntityCube.prototype.$entityInit = function () { console.log("Cube entity created!") }; // Needed, is an abstract method in parent class
// END CUSTOM ENTITY
@ -103,4 +109,5 @@
ModAPI.mc.renderManager.entityRenderMap.put(ModAPI.util.asClass(data.EntityCube), new data.RenderCube(ModAPI.mc.renderManager.getRef()));
});
console.log(data);
})();