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

Basically if I call

sendUpdates()

(see below) every so often, I can be reasonably assured that the renderer will update, just not instantly.

 

e.g. I can create a timing variable and call the method every 100 ticks and that results in the model changing within 5 seconds of when it should.

 

	private void sendUpdates() {
	markDirty();
	worldObj.markBlockRangeForRenderUpdate(pos, pos);
	worldObj.notifyBlockUpdate(pos, getState(), getState(), 3);
}

 

If I call this method both after any time the TE changes its own contents (i.e. "smelting" an item into another item or consuming "fuel") and not every few seconds, then it also seems to work and pretty much instantly.

 

However, when inserting items via a hopper the update is not always applied.  That is, for inserts from the sides into the input slot, the update is instant.  When inserting from the top (for fuel) the update never occurs (unless the fuel is consumed, which also sends an update, and that one works).

 

If I try to delay all updates by 1 tick (so that all methods that would send a synchronization packet merely flip a boolean and then at the end of onUpdate if that boolean is true, call sendUpdates() and set the bool to false), then I still get the same behavior: inserting from the sides updates instantly (1 tick delay) inserting from the top never updates (and in fact, fuel consumption doesn't update this time either).

 

I don't get it.

 

http://pastebin.com/PKMvsdJu

rack.png

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.

You may want to store a reference to the

TileEntity

in

ItemLeatherHandler

and override

ItemStackHandler#onContentsChanged

to trigger the update packet.

 

I'm not entirely sure why your current code isn't working properly.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

You may want to store a reference to the

TileEntity

in

ItemLeatherHandler

and override

ItemStackHandler#onContentsChanged

to trigger the update packet.

 

Its the salt that's not working correctly, but I'll give that a shot.

 

Faux Edit:

Nope, that doesn't help either. :\

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.

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.