Differentiation Posted October 24, 2017 Posted October 24, 2017 (edited) 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, 2017 by Differentiation Quote
Draco18s Posted October 24, 2017 Posted October 24, 2017 On 10/24/2017 at 10:14 PM, Differentiation said: else if (this.flag == true) // doesn't reduce for chestplate Expand flag is only ever set to true for the chestplate, which when removed, this code is no longer run. Remove this conditional. 1 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.
Differentiation Posted October 25, 2017 Author Posted October 25, 2017 On 10/24/2017 at 10:47 PM, 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. Expand The variables act as flags for this specific class, to be used in the armortick method. Hence they are also private. On 10/24/2017 at 10:47 PM, 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. Expand 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... Quote
Draco18s Posted October 25, 2017 Posted October 25, 2017 On 10/25/2017 at 2:14 AM, Differentiation said: The variables act as flags for this specific class, to be used in the armortick method. Hence they are also private. Expand And common to all players. 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.
Differentiation Posted October 25, 2017 Author Posted October 25, 2017 On 10/25/2017 at 2:37 AM, Draco18s said: And common to all players. Expand That's very true, but I don't really know what to use as an alternative... Quote
Draco18s Posted October 25, 2017 Posted October 25, 2017 Ok, so, 1, that flag is literally useless And 2, there's this thing called capabilities... 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.
Differentiation Posted October 25, 2017 Author Posted October 25, 2017 On 10/25/2017 at 2:52 AM, Draco18s said: Ok, so, 1, that flag is literally useless And 2, there's this thing called capabilities... Expand True, true. Thanks. Quote
Differentiation Posted October 25, 2017 Author Posted October 25, 2017 On 10/25/2017 at 8:19 AM, diesieben07 said: vanilla has methods in WorldServer to spawn particles server side. Expand I'm having a hard time getting the WorldServer instance Quote
Differentiation Posted October 25, 2017 Author Posted October 25, 2017 On 10/25/2017 at 12:07 PM, diesieben07 said: What have you tried? Expand Idk WorldServer server = ....... I haven't tried much because I don't really know how to get the instance... 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.