October 30, 20177 yr 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?
October 30, 20177 yr 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.
October 30, 20177 yr 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.
October 31, 20177 yr Author 18 hours ago, diesieben07 said: Ok, great. Now, what's your issue? getEnergy() always returns 10000. /blockdata <x> <y> <z> {} shows {Energy: 10000}.
October 31, 20177 yr 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.
October 31, 20177 yr 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.
October 31, 20177 yr 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.
October 31, 20177 yr 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?
October 31, 20177 yr 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.
October 31, 20177 yr Author 2 hours ago, Draco18s said: 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 In 1.12.1, method this.getState() not exist. What method i need to use?
October 31, 20177 yr 47 minutes ago, MineDen said: In 1.12.1, method this.getState() not exist. What method i need to use? https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/farming/entities/TileEntityTanner.java#L105-L107 Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
October 31, 20177 yr Author RETEST: NBT don't saves automatically. Only /blockdata changes NBT, and after world reload, NBT entered in /blockdata restored.
October 31, 20177 yr https://github.com/MineDen/m1/blob/master/src/main/java/com/mineden/mtest/tileentity/AutoTEEnergy.java#L56-L57 On 30-10-2017 at 3:38 PM, diesieben07 said: Why are you adding energy every tick on the client? nbt is only saved on the server Edited October 31, 20177 yr by loordgek
October 31, 20177 yr Author 37 minutes ago, loordgek said: https://github.com/MineDen/m1/blob/master/src/main/java/com/mineden/mtest/tileentity/AutoTEEnergy.java#L56-L57 nbt is only saved on the server I'm adding energy on server side.
October 31, 20177 yr 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. */
October 31, 20177 yr 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.
October 31, 20177 yr Author 5 minutes ago, loordgek said: when you check for world.isremote you check for client you need !world.isremote I understand it.
October 31, 20177 yr Author 3 minutes ago, loordgek said: what is the problem now Thanks, Draco18s, diesieben07, Kokkie, loordgek! All works properly!
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.