3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-16 19:40:07 +01:00
Paper/Spigot-Server-Patches/0578-Fix-block-data-exception-when-cancelling-PortalCreat.patch
Aikar 64ed429884
(FIRST 1.16.3): Update Paper to 1.16.3
This is a pretty tiny update with very little changed. Recommended to update
from 1.16.2 ASAP as 1.16.2 is now no longer supported.

Plugins should mostly remain working as the NMS revision did not change.
2020-09-10 19:47:58 -04:00

41 Zeilen
2.2 KiB
Diff

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 04f14691ba9b0552b2c195c4a3b47f45cd72c5a2..11fa231caa5be12a43e646eb2c0300e597d25dd2 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1028,7 +1028,7 @@ 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 205f3f697e9c31674a4ac8db38467bb2e61cfe6b..9273fc22df2c9618efb09a8f95fd7e7f08652f88 100644
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
@@ -120,6 +120,7 @@ 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();
}
@@ -160,7 +161,7 @@ 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));
}