Commits

md_5 authored 71cd505d451
SPIGOT-2405: Better event for combust due to fire
No tags

nms-patches/Entity.patch

Modified
197 197
198 198 boolean flag2 = this.ai();
199 199
200 200 @@ -634,7 +764,16 @@
201 201 this.burn(1);
202 202 if (!flag2) {
203 203 ++this.fireTicks;
204 204 - if (this.fireTicks == 0) {
205 205 + // CraftBukkit start - Not on fire yet
206 206 + if (this.fireTicks <= 0) { // Only throw events on the first combust, otherwise it spams
207 -+ EntityCombustEvent event = new EntityCombustEvent(getBukkitEntity(), 8);
207 ++ EntityCombustEvent event = new org.bukkit.event.entity.EntityCombustByBlockEvent(null, getBukkitEntity(), 8);
208 208 + world.getServer().getPluginManager().callEvent(event);
209 209 +
210 210 + if (!event.isCancelled()) {
211 211 + setOnFire(event.getDuration());
212 212 + }
213 213 + } else {
214 214 + // CraftBukkit end
215 215 this.setOnFire(8);
216 216 }
217 217 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut