Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.7.2]what to use instead of onInventoryChanged() method

Recommended Posts


I used method onInventoryChanged() from IInventory in 1.6.4. Unfortunatelly, this method was removed in 1.7.2. Any idea what to use instead?


I used the method to send packet about update, so the tileEntity updates on clients without activating the block.

Sorry for mistakes, English is not my mother tongue

Link to post
Share on other sites

It's probably not removed.  Just not deobfuscated.


In any case, I don't know the answer.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.


Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.


DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to post
Share on other sites

There are methods in IInventory in Forge


int getSizeInventory();
ItemStack getStackInSlot(int var1);
ItemStack decrStackSize(int var1, int var2);
ItemStack getStackInSlotOnClosing(int var1);
void setInventorySlotContents(int var1, ItemStack var2);
String getInventoryName();
boolean hasCustomInventoryName();
int getInventoryStackLimit();
void markDirty();
boolean isUseableByPlayer(EntityPlayer var1);
void openInventory();
void closeInventory();
boolean isItemValidForSlot(int var1, ItemStack var2);


And from what I have understand, markDirty does something different. Maybe it got back in newest (1025) update? I haven't had time to update yet.

Sorry for mistakes, English is not my mother tongue

Link to post
Share on other sites

I too wonder what to use.

I was following a tutorial ( curse:MrrGingerNinja TE inv) and onInventoryChange() was called to commit the stuff done in 2 of the required TE IInv methods.

ex derived from tut:

public void setInventorySlotContents(int pSlot, ItemStack pStack) {
	inventory[pSlot] = pStack;
	if(pStack != null && pStack.stackSize > getInventoryStackLimit()) {
		pStack.stackSize = getInventoryStackLimit();

it seems like it is just committing the change,

and the choices of remaining talk about chunkloading and refreshing from read etc

(I want to commit, not read)

MarkDirty sounded like it will do stuff at some later point beyond this control

... no, Commit Now!


whats the way other folks are committing  setInventorySlotContents() TE IInv changes now,

if not onInventoryChanged()?

Link to post
Share on other sites

Tip: if you have problems that you cant solve, and inolves inventory stuff, just look iron chest source on cpw´s github, if the problem is new names, just look at commits and see what cpw has changed.

(i wouldn´t recommend minecraft because you did this thread as you couldn´t look at minecraft source correctly, so using the iron chest one is more easier because of the commits)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.