Jump to content

Failender

Forge Modder
  • Posts

    1091
  • Joined

  • Last visited

Everything posted by Failender

  1. U are the guy :b
  2. normally detectAndSendChanges does that for you. This is from the vanilla Container code. /** * Looks for changes made in the container, sends them to every listener. */ public void detectAndSendChanges() { for (int i = 0; i < this.inventorySlots.size(); ++i) { ItemStack itemstack = ((Slot)this.inventorySlots.get(i)).getStack(); ItemStack itemstack1 = (ItemStack)this.inventoryItemStacks.get(i); if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) { itemstack1 = itemstack == null ? null : itemstack.copy(); this.inventoryItemStacks.set(i, itemstack1); for (int j = 0; j < this.crafters.size(); ++j) { ((ICrafting)this.crafters.get(j)).sendSlotContents(this, i, itemstack1); } } } } The super.addCraftingToCrafters should normally add the Crafter to the list so they gut updated
  3. u might find ur solution in ContainerFurnace, look at the call there in addCraftingToCrafters, maybe it can help you
  4. Then they changed something there from 1.8 to 1.7 I have no idea then sorry
  5. wrong function then that explains it. u want a function with the args Container and IInventory . this is the obfuscated one in 1.8 void func_175173_a(Container p_175173_1_, IInventory p_175173_2_);
  6. Not the kind of thing where I am pro at but.. I think u dont need to call this.getInventory, u need to add machine there, which means the call could be p_75132_1_.sendContainerAndContentsToPlayer(this, machine); If this doesnt helps im clueless, sorry
  7. you can do a save in the CommonProxy or use IExtendedPlayerProperties
  8. Okay I am not 100% sure about this. I took this code from a custom smelter of mine. I think (think im not sure) that the addCraftingToCrafters is a way to tell Minecraft "look on this inventory, if something changes please inform the client" , so I guess u are not adding ur inventory to a listener, which means no1 is syncing client and server. @Override public void addCraftingToCrafters(ICrafting listener) { // TODO Auto-generated method stub super.addCraftingToCrafters(listener); listener.func_175173_a(this, smelter.inventory); }
  9. thats a terrible idea to be honest. ClientProxy is for Client Stuff, checking which TE's are to get connected should be a decision made on server side, so u cant hack.
  10. CloneEvent is enabled in 1.7? Damn I thought it was 1.8 only good to know
  11. u could save the x,y,z position of the te in the nbt and then get the te if u need it via world.getTileEntity
  12. dont save the lastclicked inside the item. u need to use nbt for that, bc everything inside the item class is shared for all items.
  13. One solution is to save the amount of hp the player should have and reasign it in EntityConstruct event, since there is a new EntityPlayer created every time the player dies
  14. MyTileEntity te = (MyTileEntity) world.getTileEntity(x,y,z) (for 1.8 use BlockPos instead of x,y,z)
  15. http://lmgtfy.com/?q=minecraft+forge+tileentity
  16. this code is a total mess. you should better delete it and hope noone will ever find it again. The method u are seeking is onBlockPlaced, it gives you an EntityLivingBase where u can get the players name from. If u call setBlockUnbreakable u will set ALL of your blocks unbreakable, because the Block class is for EVERY SINGE BLOCK of that block placed. if you want them to be different you need to use a TileEntity
  17. You cant change them anywhere. E.g. chests bc u cant get the container of an iotem from the item
  18. Correct me if Im wrong, but they dont go up inside chests
  19. To see which event types there are use ur ide. it is easy to find it. then check which one ios the one u desire
  20. I dont know if the event is cancelable, but if it is u can do event.setCancelled(true) EDIT: Plot Twist: Its not cancelable https://dl.dropboxusercontent.com/s/h777x7ugherqs0w/forgeevents.html
  21. to make this short: u cant.
  22. http://www.minecraftforge.net/forum/index.php/topic,33145.0.html Mainly the same, u just need to exchange destruciton by changing
  23. use HarvestDrops event, if the harvesting player has no tool equipped clear the drops list
  24. http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-forge-1-6-4-1-8-eventhandler-and
×
×
  • Create New...

Important Information

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