Jump to content

Custom Fire Producing Particles When It Breaks


Syric

Recommended Posts

I've made some custom fire blocks, borrowing all the code from BaseFireBlock and FireBlock. They don't produce any particles when I punch them to extinguish them, but they do make particles and the 'poof' wool sound when they break as a consequence of a block update - usually, because they've burned the block they're on top of.

They didn't do this when they extended BaseFireBlock, but for some reason they do now that they're extending my custom replacement, even though the code is the same.

How can I prevent this behavior?

Link to comment
Share on other sites

I am not sure what you are describing? There are particle effects produced while the fire is burning. I don't see any when the block is destroyed?

There is a Level.levelEvent() for event 1009 in BaseFireBlock.playerWillDestroy() which ends up in LevelRenderer.levelEvent() that plays the fire extinguish sound(s).

 

A word of warning. You should be careful with this kind of thing. Not everything is OOP. e.g. search the codebase for references to (Base)FireBlock or Material.FIRE and you will find old legacy hardcoding. There is also the more modern BlockTags.FIRE, which I guess you want to add your block to.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

On 7/9/2022 at 6:14 PM, warjort said:

I am not sure what you are describing? There are particle effects produced while the fire is burning. I don't see any when the block is destroyed?

There is a Level.levelEvent() for event 1009 in BaseFireBlock.playerWillDestroy() which ends up in LevelRenderer.levelEvent() that plays the fire extinguish sound(s).

 

A word of warning. You should be careful with this kind of thing. Not everything is OOP. e.g. search the codebase for references to (Base)FireBlock or Material.FIRE and you will find old legacy hardcoding. There is also the more modern BlockTags.FIRE, which I guess you want to add your block to.

I've already put the blocks in BlockTags.FIRE, which didn't help.

The problem is not playerWillDestroy(); I copied that and it works fine. When the player punches fire, it disappears and plays the fire extinguishing noise without making particles. The problem is also not the animation: my fire produces smoke perfectly fine as well.

The problem is that when my custom fire 'breaks' because it destroys the block it's adjacent to, it makes a breaking sound (wool, as it happens) and bursts into a scatter of fire-textured particles, just like any other destroyed block. Vanilla fire doesn't do this. I'd like my fire to also not do this. What should I override?

Link to comment
Share on other sites

Ah, thank you so much.

I suppose the only parts of BaseFireBlock I can't override are methods I can simply choose not to call anyway, so this is doable even if it isn't ideal.

Edit: I can confirm that this works.

Edited by Syric
Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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