From d45b5f349999f1f44eb72d02db9158232b5f05de Mon Sep 17 00:00:00 2001 From: Shane Freeder <theboyetronic@gmail.com> Date: Thu, 10 Sep 2020 09:02:22 +0100 Subject: [PATCH] Fix block data exception when cancelling PortalCreateEvent (#4199) --- ...xception-when-cancelling-PortalCreat.patch | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Spigot-Server-Patches/Fix-block-data-exception-when-cancelling-PortalCreat.patch diff --git a/Spigot-Server-Patches/Fix-block-data-exception-when-cancelling-PortalCreat.patch b/Spigot-Server-Patches/Fix-block-data-exception-when-cancelling-PortalCreat.patch new file mode 100644 index 0000000000..d03a218bb4 --- /dev/null +++ b/Spigot-Server-Patches/Fix-block-data-exception-when-cancelling-PortalCreat.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder <theboyetronic@gmail.com> +Date: Thu, 10 Sep 2020 09:00:02 +0100 +Subject: [PATCH] Fix block data exception when cancelling PortalCreateEvent + + +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + Optional<BlockUtil.Rectangle> optional1 = worldserver.getTravelAgent().createPortal(blockposition, enumdirection_enumaxis, this, createRadius); // CraftBukkit + + if (!optional1.isPresent()) { +- EntityPlayer.LOGGER.error("Unable to create a portal, likely target out of worldborder"); ++ //EntityPlayer.LOGGER.error("Unable to create a portal, likely target out of worldborder"); // Paper + } + + return optional1; +diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java ++++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java +@@ -0,0 +0,0 @@ public class PortalTravelAgent { + EnumDirection enumdirection1 = enumdirection.g(); + + if (!worldborder.a(blockposition1)) { ++ MinecraftServer.LOGGER.error("Unable to create a portal, likely target out of worldborder"); // Paper - restore this message + return Optional.empty(); + } + +@@ -0,0 +0,0 @@ public class PortalTravelAgent { + this.world.getServer().getPluginManager().callEvent(event); + if (!event.isCancelled()) { + blockList.updateList(); +- } ++ } else return Optional.empty(); // Paper + // CraftBukkit end + return Optional.of(new BlockUtil.Rectangle(blockposition1.immutableCopy(), 2, 3)); + }