Posted October 24, 20177 yr Hey, So I have this armor set class and armor tick method. However, when I test for all pieces equipped the code runs 4 times. Now I fixed it by checking for one armor piece after checking for all. Nevertheless, I have a problem: whenever I take off the chestplate, the absorption amount does not decrease from what it was. When I remove all other armor pieces it does. My Code: [SOLVED] Is there any solution? Thanks! Edited October 26, 20177 yr by Differentiation
October 24, 20177 yr 23 minutes ago, Differentiation said: else if (this.flag == true) // doesn't reduce for chestplate flag is only ever set to true for the chestplate, which when removed, this code is no longer run. Remove this conditional. 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 25, 20177 yr Author 3 hours ago, diesieben07 said: No, you cannot just store instance variables in Item and Block classes like that. Items and blocks are singleton-like. These variables will be shared across every occurrence of your item. The variables act as flags for this specific class, to be used in the armortick method. Hence they are also private. 3 hours ago, diesieben07 said: Or for f***s sake. Particles are not even server side. Don't tell me you are sending a packet to the server only to then send one back to the client. Please no. Oh, then do you have a better solution to send particles for all the players to see? 'Cause this is the one I got, and I only send 1 packet for all the particles...
October 25, 20177 yr 23 minutes ago, Differentiation said: The variables act as flags for this specific class, to be used in the armortick method. Hence they are also private. And common to all players. 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 25, 20177 yr Author 4 minutes ago, Draco18s said: And common to all players. That's very true, but I don't really know what to use as an alternative...
October 25, 20177 yr Ok, so, 1, that flag is literally useless And 2, there's this thing called capabilities... 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 25, 20177 yr Author 1 minute ago, Draco18s said: Ok, so, 1, that flag is literally useless And 2, there's this thing called capabilities... True, true. Thanks.
October 25, 20177 yr Author 3 hours ago, diesieben07 said: vanilla has methods in WorldServer to spawn particles server side. I'm having a hard time getting the WorldServer instance
October 25, 20177 yr Author 1 hour ago, diesieben07 said: What have you tried? Idk WorldServer server = ....... I haven't tried much because I don't really know how to get the instance...
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.