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 have created a liquid and I'm creating a bucket for it, however, the fluid container registry line is throwing a null pointer exception.

 

Troncraft.java: https://gist.github.com/anonymous/c6006d69a773edea63e5

Crash Report: https://gist.github.com/anonymous/fc4f35a84df9bab4d088

 

This line in particular is the one having the issue:

FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("liquidEnergy", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(liquidEnergyBucket), new ItemStack(Items.bucket));

 

When I comment this line out, everything works fine, bucket functions normally. I figured this line was there to reqister how many mB it is and some other properties, so I need it correct? Every parameter appears to me to not be null, but obviously that's not the case, could someone help me figure this out? Again, it's not affecting the buckets functionality, I just figured this line was important since it was in the tutorial.

Try putting a breakpoint at that line, so you can see the null value so that you can search deeper as why that's null, and how to solve it.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

You cannot call getFluidStack() on an unregistered fluid. You must call FluidRegistry#registerFluid(Fluid f) before that, or you will get a null.

  • Author

You cannot call getFluidStack() on an unregistered fluid. You must call FluidRegistry#registerFluid(Fluid f) before that, or you will get a null.

 

But I did register a fluid. This is the second line of my preint:

FluidRegistry.registerFluid(liquidEnergy);

Which I do before I call the getFluidStack. Does the name parameter need to be the localized or unlocalized name of my fluid?

 

EDIT: I did some experimenting and figured it out! I needed to do liquidEnergy.getName() for the string name parameter.

  • Author

I mean, is doing it the way I have right now going to cause problems in the future?

I mean, is doing it the way I have right now going to cause problems in the future?

 

Not knowing when to use the proper case is always a source of problems in programming.

  • Author

Ok, the case issue makes sense, staying consistent and what not with standards. However, is there anything wrong with using fluid.getName() instead of "fluidname"?

Ok, the case issue makes sense, staying consistent and what not with standards. However, is there anything wrong with using fluid.getName() instead of "fluidname"?

Nothing wrong with doing it that way. Whatever works. :)

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.