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

I have a machine patterned after a minecraft furnace in which I display the remaining burnTime in the Gui. I have changed all related 'short' in my code to 'int' (even in Nbt code).

 

When I run it on Single Player the Gui works as desired, displaying the progression of values 20000, 40000, and 60000.

 

When I make a Server and run Multiplayer, my machine's Gui displays 20000, -25536, -5536.

 

Why would the server make it behave differently?

 

int myBurnTime = 60000;

 

I was using Integer.toString(myBurnTime) when I display the value (worked fine on client, not on server). I tried String.valueOf((long)myBurnTime)--it had the same problem.

 

Does anyone know if there is some reason the server-side values would act like 'short' while the client-side values continue to act 'int'?

  • Author

If it is a packet problem, where would that code be? (I have not written any "packet" code.)

 

What do you need to see? My TileEntity, my GuiContainer, my Container, my Machine class? Does it have anything to do with Nbt-related code?

 

by packet problem i mean the server and client are out of sync but yes the things you listed we need to see its maybe just a thing where MC casts it down to a short to send the data over the TE update packet.

I have no idea what the problem is note right now I am on moible device not on pc I will get back here later.

  • Author

Thank you. I was poking around there and hadn't yet looked at the contract. I am not at my terminal right now, but i don't remember getting a warning about possible loss of precision going from 'int' to 'short'.

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.