Jump to content

TomEVoll

Members
  • Posts

    21
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

TomEVoll's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. i get infinite loop when i have a barrel inside the barrel, the data prepared in handleItemState, when getquads is called it contains the data for the barrel that contains the item still, and does not call handleitem state on the contained item/barrel before getquads.
  2. I have a barrel in my mod that can be picked up as a itemblock. Problem I'm having is in getQuads state is ofc null, and the last item it checked for override is not always what it get quads for, i end up getting the wrong item overlay on the barrels, and even empty barrels show content. The stored item is in NBT on the itemstack. It seems to use the last item on the shortcut bar every time. I'm most likely not doing this right, it would be nice if someone have a small example on how to do this right, i also need some text displayed on the block/item. in 1.7.x it was all just a TESR. Solved: Pushing the models on to a stack and poping them of as getQuads are called
  3. I posted the old way and the new way, new way will only spawn pig, dont matter if you use the function that create the egg as well as register it, or register the egg manually. I was just listing both as i believe i was doing it wrong since the new way was not working correctly, I now know that is caused by a current bug in forge that is being corrected, https://github.com/MinecraftForge/MinecraftForge/pull/2587 Main problem now seems to be any entity or modded entity at least will vanish when a map is reloaded, the entity is still alive, can take damage, and will collide with the player, but is not visible until some update is triggered, like in the video i posted i use ender pearls to teleport threw the entity making me coolide with it causing some damage and the entity is then visible.
  4. im not using globalID, egg dont work without it, but i spawn in the entity with a item, and do not register it using the globalID. This should show what i mean by vanishing..
  5. Should add everything works fine until u save and reload the map, if you stay in the game after spawning a entity it stays visible, only when loading the map it vanishes. but you can still get pushed around by it, and collide with it, pushing it into a chest made it become visible, might be random
  6. public class RobotHelper extends EntityCreature { private static final DataParameter<Integer> PROFESSION = EntityDataManager.<Integer>createKey(RobotHelper.class, DataSerializers.VARINT); private int randomTickDivider; private boolean isMating; private boolean isPlaying; Village villageObj; private int timeUntilReset; /** addDefaultEquipmentAndRecipies is called if this is true */ private boolean needsInitilization; /** Last player to trade with this villager, used for aggressivity. */ private int careerId; /** This is the EntityVillager's career level value */ private int careerLevel; private boolean isLookingForHome; private boolean areAdditionalTasksSet; private InventoryBasic inventory; public RobotHelper(World worldIn) { this(worldIn, 0); } public RobotHelper(World worldIn, int professionId) { super(worldIn); System.out.println("Constructed :" + professionId); this.inventory = new InventoryBasic("Items", false, ; this.setProfession(professionId); this.setSize(0.6F, 1.95F); ((PathNavigateGround)this.getNavigator()).setBreakDoors(true); this.setCanPickUpLoot(true); this.setCustomNameTag("ROBOT"); this.setAlwaysRenderNameTag(true); //this.persistenceRequired = true; this.enablePersistence(); this.entityAge = 0; } protected void entityInit() { super.entityInit(); this.dataWatcher.register(PROFESSION, Integer.valueOf(0)); this.entityAge = 0; } @Override public void onEntityUpdate() { // TODO Auto-generated method stub this.entityAge = 0; super.onEntityUpdate(); } protected void initEntityAI() { super.initEntityAI(); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D)); //this.tasks.addTask(1, new EntityAITradePlayer(this)); //this.tasks.addTask(1, new EntityAILookAtTradePlayer(this)); //this.tasks.addTask(2, new EntityAIMoveIndoors(this)); //this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); //this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); //this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); //this.tasks.addTask(6, new EntityAIVillagerMate(this)); //this.tasks.addTask(7, new EntityAIFollowGolem(this)); this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); //this.tasks.addTask(9, new EntityAIVillagerInteract(this)); //this.tasks.addTask(9, new EntityAIWander(this, 0.6D)); //this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); } private void setAdditionalAItasks() { if (!this.areAdditionalTasksSet) { this.areAdditionalTasksSet = true; if (this.isChild()) { // this.tasks.addTask(8, new EntityAIPlay(this, 0.32D)); } else if (this.getProfession() == 0) { // this.tasks.addTask(6, new EntityAIHarvestFarmland(this, 0.6D)); } } } public void writeEntityToNBT(NBTTagCompound tagCompound) { super.writeEntityToNBT(tagCompound); tagCompound.setInteger("Profession", this.getProfession()); tagCompound.setInteger("Career", this.careerId); tagCompound.setInteger("CareerLevel", this.careerLevel); NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.inventory.getSizeInventory(); ++i) { ItemStack itemstack = this.inventory.getStackInSlot(i); if (itemstack != null) { nbttaglist.appendTag(itemstack.writeToNBT(new NBTTagCompound())); } } tagCompound.setTag("Inventory", nbttaglist); } /** * (abstract) Protected helper method to read subclass entity data from NBT. */ public void readEntityFromNBT(NBTTagCompound tagCompund) { super.readEntityFromNBT(tagCompund); this.setProfession(tagCompund.getInteger("Profession")); this.careerId = tagCompund.getInteger("Career"); this.careerLevel = tagCompund.getInteger("CareerLevel"); NBTTagList nbttaglist = tagCompund.getTagList("Inventory", 10); for (int i = 0; i < nbttaglist.tagCount(); ++i) { ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i)); if (itemstack != null) { this.inventory.func_174894_a(itemstack); } } this.setCanPickUpLoot(true); this.setAdditionalAItasks(); this.isDead = false; this.entityAge = 0; } protected boolean canDespawn() { return false; } protected SoundEvent getAmbientSound() { return SoundEvents.entity_villager_ambient; } protected SoundEvent getHurtSound() { return SoundEvents.entity_villager_hurt; } protected SoundEvent getDeathSound() { return SoundEvents.entity_villager_death; } public void setProfession(int professionId) { this.dataWatcher.set(PROFESSION, Integer.valueOf(professionId)); } public int getProfession() { return Math.max(((Integer)this.dataWatcher.get(PROFESSION)).intValue() % 5, 0); } } Nothing in there really just part of the villager class
  7. tried both egg and world.spawnentity
  8. Walking around in the room after they vanish i realized im bumping in to them and suddenly 1 became visible, it seems this is a server->client sync issue
  9. Following code only spawns a pig. EntityRegistry.registerModEntity(RobotHelper.class, "robotHelper", 0, this, 64, 1, true); EntityRegistry.registerEgg(RobotHelper.class, mainColor, subColor); Following code spawns the entity but everytime i load the world from save the entity loads, stays there for 5 sec, then vanish, saving the map loading it again the entity again show up for 5 sec then vanish. I'm overriding canDespawn and return false, i also tried setting enablePersistence() and forcing age to 0. int i =EntityRegistry.instance().findGlobalUniqueEntityId(); EntityRegistry.registerGlobalEntityID(RobotHelper.class,"robotHelper",i); EntityRegistry.registerModEntity(RobotHelper.class, "robotHelper", i, this, 64, 1, true); EntityRegistry.registerEgg(RobotHelper.class, mainColor, subColor); Im sure im the one doing something wrong here, but im clueless at this point to why it is vanishing.
  10. Opening Inventory grab a stack drop it outside gui, 2 entity items are created, 1 client side only. dropping items pressing Q does not seem to produce this result.
  11. Yes, When using a custom json model it wont allow you to set a parent, will give you an error saying it cant have both a parent and a model. I found the issue with the scaling not working, firstperson_left was suposed to be firstperson_lefthand and same for right. There is one small bug with it though, when using models/item/someitem.json let's say you got a blockstate testblock.json that loads a model tester.json in blocks, when you say parent in the item json and set it to ether block/testblock.json or block/tester.json it will not work, gives no errors but is not acually using the item json. Only way i could get this to work was to name all the files the same name as the block was registered with in the mod. while in 1.8.9 the model could have a different name, and you then specify parent as the model it should affect int the item json. i did specify parent with modid:block/parentmodel
  12. my mistake, seems i need to specify the rotation, scale and transform manually in the item folder in 1.9, any chance it could be added like in 1.8.9 where the standard transform is added automaticly. Also firstperson_left, firstperson_right, thirdperson_left, thirdperson_right do not work at all, scaling, transform does nothing. I also tried the old format without specifying right and left and also does nothing.
  13. I have a couple of json models, they all refuse to render in 3d in the inventory, all you get is the flat front side like you do if you specify isGui3d=false, Json files using built-in models like cube, render fine in 3d. Anything i need to specify that is new to get this to work? { "textures": { "0": "blocks/energyside" }, "elements": [ { "name": "Cube", "from": [ 0.0, 0.0, 0.0 ], "to": [ 16.0, 16.0, 16.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] } } } ] } loading this json will show the block in inventory as a flat item, only 1 side will be visible, like redstone dust, pickaxe or any other flat items
  14. Would now be. Tessellator tessellator = Tessellator.getInstance(); VertexBuffer worldrenderer = tessellator.getBuffer(); VertexBuffer in net.minecraft.client.renderer.VertexBuffer not net.minecraft.client.renderer.vertexbuffer.VertexBuffer
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.