Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by Differentiation

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.

  • 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...

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.

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.

  • 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 :(

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.