Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello,

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

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.

  • Author

No, it is removed. There is no deobfuscated method in IInventory and no other method that could replace it.

Sorry for mistakes, English is not my mother tongue

  • Author

There are methods in IInventory in Forge 10.12.0.1024

 

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

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:

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

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()?

markDirty has the exact same call usages as in 1.6.4. The only thing that has changed besides the name, is the comment; which isn't anything to go by.

 

 

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)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.