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

  • Author
1 minute ago, diesieben07 said:

You can do that. But you must also have a no-argument constructor and you must be aware that only the no-argument constructor will be used when reading your TileEntity from disk.

I'm now using zero-argument constructor, but energy again restores to 0.

UPD: I created zero-argument constructor and it deleted! What?

  • Author
2 minutes ago, diesieben07 said:

In the code you posted the energy is never changed.

 

What indeed, please clarify what "deleted".

Sorry, this is problem with GitHub. 

  • Author
16 minutes ago, diesieben07 said:

You can do that. But you must also have a no-argument constructor and you must be aware that only the no-argument constructor will be used when reading your TileEntity from disk.

I recrated zero-argument constructor and uploaded new code to GitHub.

  • Author
18 hours ago, diesieben07 said:

Ok, great. Now, what's your issue?

getEnergy() always returns  10000.

/blockdata <x> <y> <z> {} shows {Energy: 10000}.

  • Author
1 minute ago, diesieben07 said:

 

Once again, not sure what else you expected, given that:

 

I can record video of what changes in my world.

  • Author
Just now, diesieben07 said:

I don't want video. I want code that shows where you change the energy. You have shown no such code, as such I can only assume that the energy value never changes.

Energy don't change, but after world restart it always maximum. I think, that this is storage creating or update() method problem.

  • Author
9 minutes ago, diesieben07 said:

This is broken. If setEnergy is called with 0 as it's argument, it will set the energy to capacity.

I fix it. But now it sets to 0.

  • Author

After i typed /blockdata ... ... ... {Energy:5000}, energy changed to 5000 properly. When I reloaded world, energy saved and readed properly! GUI shows 5034 (this is previous value). But /blockdata shows 5000. I need to send energy level to client?

12 minutes ago, MineDen said:

After i typed /blockdata ... ... ... {Energy:5000}, energy changed to 5000 properly. When I reloaded world, energy saved and readed properly! GUI shows 5034 (this is previous value). But /blockdata shows 5000. I need to send energy level to client?

Any time the TE data changes and you want to update the client, call these methods:
https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/farming/entities/TileEntityTanner.java#L95-L98

And have these methods overridden

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/farming/entities/TileEntityTanner.java#L174-L189

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
2 hours ago, Draco18s said:

In 1.12.1, method this.getState() not exist. What method i need to use?

  • Author

RETEST: NBT don't saves automatically. Only /blockdata changes NBT, and after world reload, NBT entered in /blockdata restored.

nope

 

this is the javadoc for isremote

 

Quote

/**
 * True if the world is a 'slave' client; changes will not be saved or propagated from this world. For example,
 * server worlds have this set to false, client worlds have this set to true.
 */

 

  • Author
1 minute ago, diesieben07 said:

For the hundredth time: WHERE?

 

Here.

 

2 minutes ago, loordgek said:

nope

 

this is the javadoc for isremote

 

 

Lol. Sorry, I'm read only 0.2% of this comments.

  • Author
5 minutes ago, loordgek said:

when you check for world.isremote you check for client

you need !world.isremote

I understand it.

  • Author
3 minutes ago, loordgek said:

what is the problem now

Thanks, Draco18s, diesieben07, Kokkie, loordgek! All works properly!thx.png

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.