3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-24 15:20:11 +01:00
Paper/nms-patches/EntityMonster.patch

27 Zeilen
1.2 KiB
Diff

2015-02-26 23:41:06 +01:00
--- /home/matt/mc-dev-private//net/minecraft/server/EntityMonster.java 2015-02-26 22:40:22.635608139 +0000
+++ src/main/java/net/minecraft/server/EntityMonster.java 2015-02-26 22:40:22.635608139 +0000
@@ -1,5 +1,7 @@
package net.minecraft.server;
+import org.bukkit.event.entity.EntityCombustByEntityEvent; // CraftBukkit
+
public abstract class EntityMonster extends EntityCreature implements IMonster {
2015-02-26 23:41:06 +01:00
public EntityMonster(World world) {
@@ -79,7 +81,14 @@
int j = EnchantmentManager.getFireAspectEnchantmentLevel(this);
if (j > 0) {
- entity.setOnFire(j * 4);
+ // CraftBukkit start - Call a combust event when somebody hits with a fire enchanted item
+ EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), j * 4);
+ org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
+
+ if (!combustEvent.isCancelled()) {
+ entity.setOnFire(combustEvent.getDuration());
+ }
+ // CraftBukkit end
}
this.a((EntityLiving) this, entity);