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

So I noticed that in the forge Fluid class that it has a getColor() method but no setColor() method. I'm not entirely certain what that color does but it seems to affect how a bucket is displayed? But it is weird that there is no setColor() method because it means you have to extend Fluid for your custom fluid when otherwise you could just call all the setters to make a custom fluid. Is that color important? Does that mean we need to extend Fluid rather than just instantiate it with setters if we want custom color? Where does the color for the overlay when you're submersed in the liquid get set (like when you're under water everything looks blue)? I know I can handle the overlay event but is it supposed to be set somewhere?

 

Also, it seems that the BlockFluid and the Fluid classes are a bit circular. The BlockFluid takes a Fluid as a constructor parameter but Fluid class also needs a setBlock() to be set. Am I missing something? So when you're instantiating your block and fluid I'm guessing you first instantiate the fluid, then you instantiate the block while passing the fluid instance, and then you set the resulting block instance back to the fluid? I guess you can also just create an instance of the fluid with new Fluid() for the block constructor, but seems a bit wasteful and also seems like potential for a bug if you have both classes pointing at each other...

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

Okay, I just figured out the answer to my second question, but it is indeed a bit circular. The Fluid#setBlock() method is called by the BlockFluidBase constructor. So basically you create the fluid instance, pass it into the block constructor and it passes itself back to the fluid. It is a bit dangerous in my opinon to have a bunch of setters on Fluid that you expect people to invoke directly and have one that you shouldn't. Would have been better to have some sort of map, or the registry itself do the association...

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.