Board Thread:Bug Reports/@comment-27200931-20170213123546/@comment-25101089-20170219000958

Dragonovith wrote:

LOTRMod wrote: Alright, I have copied and pasted the code from the base fire class and modified it to check for banner protection before trying to spread to a block. This comes at the expense of stability and compatibility. Khamul's Fire might break in updates, in different Forge versions, and if there are other mods installed which mess with fire. There is no other way to alter the fire's behaviour, because the methods in the base fire class are private, and thus cannot be overriden and altered for Khamul's Fire.

Personally I would say this is worse than having the fire able to spread one block into banner protection, but there you go. " at the expense of stability and compatibility."

We all deeply appreciate your efforts, but if stability is compromised, maybe it should be reverted? By the way, isn't there any other way to fix or circumvent this? I will try to explain why not. In terms of code, the Khamul's Fire class extends from the Fire class. It inherits the base behaviour of the Fire block. To make it burn stone, I did a little trick where I override the block update code and do the following: set all stone-type blocks to be flammable, then run the Fire class's base update behaviour, then reset stone blocks to their original properties. This is a nice little workaround which lets me avoid copying and pasting the entire Fire class and breaking dependency on the base Fire behaviour.

Unfortunately, the functions in the Fire class which actually do the burning, things like 'tryCatchFire' and 'canNeighborBurn' are 'private methods' meaning they cannot be overriden by an extended class. The above 'block update' method is public, so I can override it.

If those other methods were protected or public then I could override them and simply do a banner check before invoking the base behaviour. But since they're not override-able, my only choice is to copy the entirety of the Fire update code, change some parts of it, and write new private methods. All this behaviour is no longer inherited from the base Fire behaviour, meaning that if the base Fire behaviour is changed, Khamul's Fire will not change.

The only other option would be to do something with a coremod, but that would have worse compatibility issues, and I'm not actually trying to alter the base Fire behaviour.