Paper icon indicating copy to clipboard operation
Paper copied to clipboard

EntityCombustByBlockEvent not called when ItemEntity burned by lava.

Open orang3-juic3 opened this issue 3 years ago • 5 comments

Javadoc states that EntityCombustByBlockEvent's combuster can be lava, implying that it is called when an entity is combusted by lava. This functions fine for all LivingEntities, however when the Entity is an ItemEntity this is overlooked, even though it can be set on fire (and this event is called when an Item enters a fire block). This pr changes the server's behaviour to also fire the event when an ItemEntity is combusted by lava.

orang3-juic3 avatar Aug 11 '22 21:08 orang3-juic3

Why limit this to only LivingEntity in the first place? Why can't we just remove that instanceof check in the first place?

Machine-Maker avatar Aug 11 '22 21:08 Machine-Maker

Why limit this to only LivingEntity in the first place? Why can't we just remove that instanceof check in the first place?

I agree with you, the reason the new code still has that original instanceof check was because I was scared that I overlooked something that removing it would break.

orang3-juic3 avatar Aug 11 '22 22:08 orang3-juic3

I did a bit of investigating, and it seems that the EntityCombustByBlockEvent in BaseFireBlock (which is working correctly) is fired by the entityInside method in the same class. I looked at what classes call this method to determine which classes should fire the event for the lava case, and now their behaviour should be virtually the same, apart from the fact that the event, in the fire case, is only fired when the entity enters the block, whereas in the lava case the event seems to be called for every tick the entity is in lava.

orang3-juic3 avatar Aug 13 '22 00:08 orang3-juic3

Why do we need an instance of check at ALL? I'd think that all entities here should be fine?

Owen1212055 avatar Nov 26 '22 00:11 Owen1212055

I agree with @Owen1212055. We can just remove the check. No such check exists for the fire call.

Machine-Maker avatar Nov 30 '23 23:11 Machine-Maker