From 49aa3c4e2df8b86e54c085b75f86619a273383bb Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 13 Aug 2018 22:39:50 -0400 Subject: [PATCH] Fix NPE in AnvilDamageEvent - Closes #1331 --- Spigot-Server-Patches/0323-AnvilDamageEvent.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Spigot-Server-Patches/0323-AnvilDamageEvent.patch b/Spigot-Server-Patches/0323-AnvilDamageEvent.patch index f4bf652f5e..c3258d7523 100644 --- a/Spigot-Server-Patches/0323-AnvilDamageEvent.patch +++ b/Spigot-Server-Patches/0323-AnvilDamageEvent.patch @@ -1,11 +1,11 @@ -From 259073abd3c6dd5d4a3434c920db539e73f956cc Mon Sep 17 00:00:00 2001 +From aba330fc2adbe136ffb43bd42ba13a203279a0ea Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 20 Jul 2018 23:37:03 -0500 Subject: [PATCH] AnvilDamageEvent diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java -index fb3413d81e..9f20348d0c 100644 +index fb3413d81e..3b23ef9863 100644 --- a/src/main/java/net/minecraft/server/ContainerAnvil.java +++ b/src/main/java/net/minecraft/server/ContainerAnvil.java @@ -73,6 +73,16 @@ public class ContainerAnvil extends Container { @@ -13,7 +13,7 @@ index fb3413d81e..9f20348d0c 100644 if (!entityhuman.abilities.canInstantlyBuild && iblockdata.a(TagsBlock.y) && entityhuman.getRandom().nextFloat() < 0.12F) { IBlockData iblockdata1 = BlockAnvil.a_(iblockdata); + // Paper start -+ com.destroystokyo.paper.event.block.AnvilDamagedEvent event = new com.destroystokyo.paper.event.block.AnvilDamagedEvent(getBukkitView(), org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(iblockdata1)); ++ com.destroystokyo.paper.event.block.AnvilDamagedEvent event = new com.destroystokyo.paper.event.block.AnvilDamagedEvent(getBukkitView(), iblockdata1 != null ? org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(iblockdata1) : null); + if (!event.callEvent()) { + return itemstack; + } else if (event.getDamageState() == com.destroystokyo.paper.event.block.AnvilDamagedEvent.DamageState.BROKEN) {