Paper
Paper copied to clipboard
EntityCombustByBlockEvent not called when ItemEntity burned by lava.
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.
Why limit this to only LivingEntity in the first place? Why can't we just remove that instanceof check in the first place?
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.
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.
Why do we need an instance of check at ALL? I'd think that all entities here should be fine?
I agree with @Owen1212055. We can just remove the check. No such check exists for the fire call.