diff --git a/nms-patches/EntityPlayer.patch b/nms-patches/EntityPlayer.patch index f94155c88f..3c68aa747e 100644 --- a/nms-patches/EntityPlayer.patch +++ b/nms-patches/EntityPlayer.patch @@ -499,7 +499,7 @@ private void a(WorldServer worldserver, BlockPosition blockposition) { BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.i(); -@@ -631,14 +886,14 @@ +@@ -631,17 +886,17 @@ } @Override @@ -517,7 +517,11 @@ + Optional 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"); ++ // EntityPlayer.LOGGER.error("Unable to create a portal, likely target out of worldborder"); // CraftBukkit + } + + return optional1; @@ -685,10 +940,8 @@ this.activeContainer.c(); } diff --git a/nms-patches/PortalTravelAgent.patch b/nms-patches/PortalTravelAgent.patch index 9cda542f63..9031f59324 100644 --- a/nms-patches/PortalTravelAgent.patch +++ b/nms-patches/PortalTravelAgent.patch @@ -70,7 +70,7 @@ } } } -@@ -136,10 +149,19 @@ +@@ -136,10 +149,20 @@ for (j1 = 0; j1 < 2; ++j1) { for (j = 0; j < 3; ++j) { blockposition_mutableblockposition.a((BaseBlockPosition) blockposition1, j1 * enumdirection.getAdjacentX(), j, j1 * enumdirection.getAdjacentZ()); @@ -84,9 +84,10 @@ + org.bukkit.event.world.PortalCreateEvent event = new org.bukkit.event.world.PortalCreateEvent((java.util.List) (java.util.List) blockList.getList(), bworld, (entity == null) ? null : entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.NETHER_PAIR); + + this.world.getServer().getPluginManager().callEvent(event); -+ if (!event.isCancelled()) { -+ blockList.updateList(); ++ if (event.isCancelled()) { ++ return Optional.empty(); + } ++ blockList.updateList(); + // CraftBukkit end return Optional.of(new BlockUtil.Rectangle(blockposition1.immutableCopy(), 2, 3)); }