Jump to content

Recommended Posts

Posted

I have tried to add a custom fluid, but it is not visible.

 

My Main class:

  Reveal hidden contents

 

My RegistryHandler class:

  Reveal hidden contents

 

My BlockInit class:

  Reveal hidden contents

 

My FluidInit class:

  Reveal hidden contents

 

My Fluid class:

  Reveal hidden contents

 

My FluidBlock class:

  Reveal hidden contents

.json file:

  Reveal hidden contents

 Can anybody help?

Posted

What do you mean by "not visible"? Do you mean there isn't even a place for it on your creative tab? Do you mean you can hold it in your hand but when you try to place it in the world it isn't visible? Do you mean it is truly not visible or do you mean it shows the purple and black checkerboard placeholder texture?

 

In any case, to debug these things you just need to trace the execution. This is an important skill. You should never just run code and then ask the forum unless you've traced the full execution. To do this I personally use a lot of console statements (System.out.println()) throughout my code to confirm the execution while playing. For example, I would have a print statement in my fluid constructor, in the registry events and some of my fluid handling events. You can put key information in the statement, for example in your registry method you are converting a list of instances to an array so if that screws up somehow you will know if you print out the list at that time.

 

Depending on what happens with your console statements you can find out all sorts of things:

- if the registry statement doesn't even print, then you know your event handling isn't set up properly.

- if your list you're registering is empty, then that is obviously a problem.

- if your block never gets constructed, then that is obviously a problem.

- if your fluid level is always 0, then that is a problem.

etc.

 

Now looking at your code, it seems that you are registering an empty list. When do you put the block instances into your BLOCKS list? Also, even though I used to do it that way most modders including myself have moved to using the @ObjectHolder injection method to populate the singleton instances.

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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