diff --git a/patches/server/0978-add-PlayerCreateMapEvent.patch b/patches/server/0978-add-PlayerCreateMapEvent.patch index c159133988..a9d883b13d 100644 --- a/patches/server/0978-add-PlayerCreateMapEvent.patch +++ b/patches/server/0978-add-PlayerCreateMapEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] add PlayerCreateMapEvent diff --git a/src/main/java/net/minecraft/world/item/EmptyMapItem.java b/src/main/java/net/minecraft/world/item/EmptyMapItem.java -index e92bb09dd3218d5a13e6251bddd0812acadda2be..3e4a20de2140615afd7ff271a072b11caef9b214 100644 +index e92bb09dd3218d5a13e6251bddd0812acadda2be..7da8084db2ad53d2d467e3b9868a523f7ce3970a 100644 --- a/src/main/java/net/minecraft/world/item/EmptyMapItem.java +++ b/src/main/java/net/minecraft/world/item/EmptyMapItem.java @@ -18,13 +18,18 @@ public class EmptyMapItem extends ComplexItem { @@ -22,9 +22,9 @@ index e92bb09dd3218d5a13e6251bddd0812acadda2be..3e4a20de2140615afd7ff271a072b11c + // Paper start + io.papermc.paper.event.player.PlayerCreateMapEvent playerCreateMapEvent = new io.papermc.paper.event.player.PlayerCreateMapEvent((org.bukkit.entity.Player) user.getBukkitEntity(), itemStack2.asBukkitCopy()); + world.getCraftServer().getPluginManager().callEvent(playerCreateMapEvent); -+ if(playerCreateMapEvent.isCancelled()){ ++ if (playerCreateMapEvent.isCancelled()) { + return InteractionResultHolder.consume(itemStack); -+ }else if (!user.getAbilities().instabuild) { // Paper - moved down a couple of lines so an item gets removed only if the event wasn't cancelled! ++ } else if (!user.getAbilities().instabuild) { // Paper - moved down a couple of lines so an item gets removed only if the event wasn't cancelled! + itemStack.shrink(1); + } + // Paper end