Jump to content

Dustpuppy

Members
  • Posts

    120
  • Joined

  • Last visited

Everything posted by Dustpuppy

  1. Yes, i know. Pickup every item, that is within a box. getEntitiesWithinAABB(EntityItem.class, AABB) makes no sense then. That's why i am using getEntitiesWithinAABBExcludingEntity(null ... I just have to say, that i don't want null picked up, but all other.
  2. I'm getting mad. Changed the position of some variables. Now it's working, but not for potatos.
  3. Wait! The problem is bigger, then expected. It happens with every crop. If the machine plants carrots, it will pick them up only until the seed slot is full. If it plants potatoes, just fills up the seed slot. Same for wheat and custom wheat. If i throw what ever on the field, it will be picked up.
  4. Hi, it sounds silly, if i say that i have problems picking up carrots, but it's real. I have a farming station. Works like i want, but not with carrots. Problem is only at pickup of items. It destroys the block if the crop is in the age to get harvested. Then it picks up all items inside a given box. It works for wheat + seeds, for potatoes, for my custom wheat. If i plant carrots, it will pick them up and place into the seed slot, but in no other slot. All other crops will work right. First i was thinking, it's because carrots have no extra seeds, like wheat, but potatoes are working too and they also have no extra seed. This is the part of the code, where i pickup the items.
  5. Haaaaaaaa!!!!! Found it!!!!! This is wrong. It only works for normal blocks without different meta data. @Override public final ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { int meta = state.getBlock().getMetaFromState(state); ItemStack ret = new ItemStack(this, 1, meta); NBTTagCompound compound = new NBTTagCompound(); TileEntityExtractor tileEntity = (TileEntityExtractor) world.getTileEntity(pos); NBTTagCompound tileEntityTag = new NBTTagCompound(); tileEntity.writeToNBT(tileEntityTag); compound.setTag("BlockEntityTag", tileEntityTag); ret.setTagCompound(compound); return Lists.newArrayList(ret); } Fix was really simple. @Override public final ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { // int meta = state.getBlock().getMetaFromState(state); ItemStack ret = new ItemStack(this, 1, 0); NBTTagCompound compound = new NBTTagCompound(); TileEntityExtractor tileEntity = (TileEntityExtractor) world.getTileEntity(pos); NBTTagCompound tileEntityTag = new NBTTagCompound(); tileEntity.writeToNBT(tileEntityTag); compound.setTag("BlockEntityTag", tileEntityTag); ret.setTagCompound(compound); return Lists.newArrayList(ret); } Took out the line, where the meat data is get and set it for the new itemstack just to 0.
  6. I am using the same code for the portable tank. This will not have the problem. Looks like it has to do with the facing variants. But can' find out, why.
  7. But all this will not explain, why the item of the machine will loose it's textures when it's picked up. Even with simple json files it's doing this.
  8. Same wand just with item/handheld
  9. The differents: Normal holding With my json file
  10. Your right, it is simple. But the wand will then be rendered in first person, like a tool item. That looks bad. With my json display stuff it will be rendered different. A tool item is hold back and my wands are pointing away from player.
  11. Without all the display stuff in the json file for the item, it looks terrible in inventory, because it renders flat.
  12. All code is here -> https://github.com/dustpuppy/wizardmod/tree/master/src/main/java/thewizardmod/extractor
  13. Hi again, it's me...the learner I have a problem with a model, when i pick it up. It's a machine, that uses a block, a tile entity, a container and a special render. No errors or warnings in console. Let me know, what you need to help me. Best to explain is a short video(15sec)
  14. If needed, this is the gui
  15. Hi, i have a custom made kind of furnance. The burning and tank stuff, everyting is working fine. The problems i have are: 1. If there is an item (stone) in the output slot and i shift click a stone in player inventory, he puts the item into this output slot, ignoring isItemValid in the container slot and isItemValidForSlot in the tile entity. 2. If i use hoppers to insert and extract items, he will do it, as long as i don't open the gui. If the gui is open, the extraction will not be updated in the gui. The insert will. If i do any interaction then with the gui, the items will be extracted and the gui slot getting updated. This is the tile entity class And this is the container
  16. This into your common proxy pre init. int id = 1; EntityRegistry.registerModEntity(EntityWeirdZombie.class, "WeirdZombie", id++, TheWizardMod.instance, 64, 3, true, 0x996600, 0xff00ff); // We want our mob to spawn in Plains and ice plains biomes. If you don't add this then it will not spawn automatically // but you can of course still make it spawn manually EntityRegistry.addSpawn(EntityWeirdZombie.class, 100, 3, 5, EnumCreatureType.MONSTER, Biomes.PLAINS, Biomes.ICE_PLAINS); And this into your client pre init RenderingRegistry.registerEntityRenderingHandler(EntityWeirdZombie.class, RenderWeirdZombie.FACTORY); Don't forget, that the zombie will only spawn in plains and icy biomes then, if you don't extend it. And change the instance to yours. I followed the same tutorials like you, i think.
  17. I got it. Taken out the line that reads the tag. There the old position is used and at this position is no tiele entity anymore at this time. Just comment out the line and it works. @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { super.onBlockPlacedBy(worldIn, pos, state, placer, stack); if (stack.hasTagCompound() && stack.getTagCompound().hasKey("BlockEntityTag")) { NBTTagCompound tag = stack.getTagCompound().getCompoundTag("BlockEntityTag"); // worldIn.getTileEntity(pos).readFromNBT(tag); worldIn.getTileEntity(pos).markDirty(); } }
  18. The tank is in package fluids
  19. Finaly i got it to github (i hope). https://github.com/dustpuppy/wizardmod
  20. Ok, here is everything, that has to do with the tank. Block class Tile entity Renderer Two utility classes i've taken from someone else Client proxy Common proxy
  21. Hmmm...i get this error, if i place the tank at another position. If i place it at it's old position, everything is ok.
  22. Ha! Changed in block class this @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { super.onBlockPlacedBy(worldIn, pos, state, placer, stack); if (stack.hasTagCompound() && stack.getTagCompound().hasKey("BlockEntityTag")) { NBTTagCompound tag = stack.getTagCompound().getCompoundTag("BlockEntityTag"); worldIn.getTileEntity(pos).readFromNBT(tag); worldIn.getTileEntity(pos).markDirty(); } } And catched in the renderer class, that he will not render, if tileentity is null. Now i got an error [Client thread/ERROR]: Received invalid update packet for null tile entity at BlockPos{x=428, y=4, z=165} with data: {FluidName:"fluid_magic",Amount:2000,x:428,y:4,z:165,id:"thewizardmodTileEntityTank"} This is strange. The tile entity is null, but he knows the amount of fluid in it.
  23. I right click left of the code line and toggle breakpoint. Then i start in debugger mode.
  24. I open the class and set a breakpoint, like i do normaly in my own code. I think, this is the wrong way to do.
  25. no. Think i am making a misstake in debugging.
×
×
  • Create New...

Important Information

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