MineDen Posted October 30, 2017 Author Posted October 30, 2017 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? Quote
MineDen Posted October 30, 2017 Author Posted October 30, 2017 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. Quote
MineDen Posted October 30, 2017 Author Posted October 30, 2017 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. Quote
MineDen Posted October 31, 2017 Author Posted October 31, 2017 18 hours ago, diesieben07 said: Ok, great. Now, what's your issue? getEnergy() always returns 10000. /blockdata <x> <y> <z> {} shows {Energy: 10000}. Quote
MineDen Posted October 31, 2017 Author Posted October 31, 2017 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. Quote
MineDen Posted October 31, 2017 Author Posted October 31, 2017 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. Quote
MineDen Posted October 31, 2017 Author Posted October 31, 2017 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. Quote
MineDen Posted October 31, 2017 Author Posted October 31, 2017 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? Quote
Draco18s Posted October 31, 2017 Posted October 31, 2017 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 Quote 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.
MineDen Posted October 31, 2017 Author Posted October 31, 2017 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? Quote
Kokkie Posted October 31, 2017 Posted October 31, 2017 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 Quote Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
MineDen Posted October 31, 2017 Author Posted October 31, 2017 RETEST: NBT don't saves automatically. Only /blockdata changes NBT, and after world reload, NBT entered in /blockdata restored. Quote
loordgek Posted October 31, 2017 Posted October 31, 2017 (edited) 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, 2017 by loordgek Quote
MineDen Posted October 31, 2017 Author Posted October 31, 2017 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. Quote
loordgek Posted October 31, 2017 Posted October 31, 2017 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. */ Quote
MineDen Posted October 31, 2017 Author Posted October 31, 2017 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. Quote
loordgek Posted October 31, 2017 Posted October 31, 2017 when you check for world.isremote you check for client you need !world.isremote Quote
MineDen Posted October 31, 2017 Author Posted October 31, 2017 5 minutes ago, loordgek said: when you check for world.isremote you check for client you need !world.isremote I understand it. Quote
MineDen Posted October 31, 2017 Author Posted October 31, 2017 3 minutes ago, loordgek said: what is the problem now Thanks, Draco18s, diesieben07, Kokkie, loordgek! All works properly! Quote
Recommended Posts
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.