Posted June 11, 201411 yr I have a problem using NBT data. It saves the integer correctly but when i restart the client or when i create a new world it keeps the value and it doesnt reset it. Can some one have a look at my code? Thanks! http://pastebin.com/i2z9Cvw3 Only code when your having fun doing it.
June 12, 201411 yr Author static stuff can only refer to static Only code when your having fun doing it.
June 12, 201411 yr I'm sorry, but... * facepalms * GO ACTUALLY LOOK UP WHAT A STATIC VARIABLE IS IN GOOGLE!!!! >.> We all stuff up sometimes... But I seem to be at the bottom of that pot.
June 12, 201411 yr Static can refer to non-static code by slapping an instance in front of the non-static code. Just saying if that helped. Developer of the WIP Rubies mod.
June 12, 201411 yr I have a problem using NBT data. It saves the integer correctly but when i restart the client or when i create a new world it keeps the value and it doesnt reset it. Can some one have a look at my code? Thanks! http://pastebin.com/i2z9Cvw3 Hi I don't really understand what you are asking. Could you describe it in a bit more detail (be specific)? 1) what you expect to happen 2) what actually happens A bit of background on what you're trying to do (what mod feature this is) would also help. I suspect that static doesn't have anything to do with your problem, but then I'm not actually sure what you are trying to do. -TGG
June 12, 201411 yr I suspect that static doesn't have anything to do with your problemLook at his code. Yes, it does. @dieSieben I agree the static is a potential problem if he or she wants each player to have their own XP, but I don't think it's causing the problem he or she is describing. The problem looks to me like he is mixing up an EventHandler with IExtendedEntityProperties. The implements IExtendedEntityProperties looks like a red herring because if it had been used as a normal IExtendedEntityProperties, the symptoms should be different (i.e. all entities have the same XP level, not that the XP level is persistent after restart). @TwIxToR_TiTaN Anyway because I'm not sure what you are trying to do, I don't know the best way to suggest to fix it. There are several potential problems with how you're implementing this and once you give more info we can help you work them out. -TGG
June 13, 201411 yr IT'S A MESS! 1) Using getEntityData along with Extended properties and mixing them up. 2) creating new properties for each entity, but sharing the variables between them all (class static variables). 3) static method setLevel uses partly argument (level) and then makes invalid access to static variable for currentLevel. 4) The following code is useless and gets nobody's armor: public static int getArmor() { EntityPlayer player = Minecraft.getMinecraft().thePlayer; return armor; <<<--- STATIC VALUE } 5...n) Any number of other problems I didn't check closely enough on. -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
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.