EntityCombustByBlockEvent should be called when ItemEntity is burned by lava, this is currently not what happens, probably because ItemEntity is not a subclass of LivingEntity

This commit is contained in:
Alex 2022-08-11 23:15:53 +02:00
parent 3f0415b453
commit e6a7b1a2dc

View File

@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Alex <alexzatstone@gmail.com>
Date: Thu, 11 Aug 2022 23:13:30 +0200
Subject: [PATCH] EntityCombustByBlockEvent should be called when ItemEntity is
burned by lava, this is currently not what happens, probably because
ItemEntity is not a subclass of LivingEntity
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f925a8d550ecbf2044a37bfe58b30d6578c5f6af..2283cdb3f90215e741e9fd4a408c363366cf4763 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -888,7 +888,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void lavaHurt() {
if (!this.fireImmune()) {
// CraftBukkit start - Fallen in lava TODO: this event spams!
- if (this instanceof net.minecraft.world.entity.LivingEntity && this.remainingFireTicks <= 0) {
+ if ((this instanceof net.minecraft.world.entity.LivingEntity || this instanceof net.minecraft.world.entity.item.ItemEntity) && this.remainingFireTicks <= 0) { // Paper - EntityCombustByBlockEvent should be called when ItemEntity is burned by lava
// not on fire yet
org.bukkit.block.Block damager = (this.lastLavaContact == null) ? null : org.bukkit.craftbukkit.block.CraftBlock.at(level, lastLavaContact);
org.bukkit.entity.Entity damagee = this.getBukkitEntity();