Failender
Forge Modder-
Posts
1091 -
Joined
-
Last visited
Everything posted by Failender
-
U are the guy :b
-
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
-
u might find ur solution in ContainerFurnace, look at the call there in addCraftingToCrafters, maybe it can help you
-
Then they changed something there from 1.8 to 1.7 I have no idea then sorry
-
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_);
-
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
-
you can do a save in the CommonProxy or use IExtendedPlayerProperties
-
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); }
-
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.
-
[SOLVED][1.7.10] - Player max health AttributeModifier
Failender replied to Agravaine's topic in Modder Support
CloneEvent is enabled in 1.7? Damn I thought it was 1.8 only good to know -
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
-
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.
-
[SOLVED][1.7.10] - Player max health AttributeModifier
Failender replied to Agravaine's topic in Modder Support
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 -
MyTileEntity te = (MyTileEntity) world.getTileEntity(x,y,z) (for 1.8 use BlockPos instead of x,y,z)
-
http://lmgtfy.com/?q=minecraft+forge+tileentity
-
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
-
You cant change them anywhere. E.g. chests bc u cant get the container of an iotem from the item
-
Correct me if Im wrong, but they dont go up inside chests
-
[1.8 - Forge] - How to check for event then deny it
Failender replied to Muggles's topic in Modder Support
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 -
[1.8 - Forge] - How to check for event then deny it
Failender replied to Muggles's topic in Modder Support
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 -
to make this short: u cant.
-
http://www.minecraftforge.net/forum/index.php/topic,33145.0.html Mainly the same, u just need to exchange destruciton by changing
-
http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-forge-1-6-4-1-8-eventhandler-and