aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRiley Park <[email protected]>2021-05-18 08:57:17 -0700
committerRiley Park <[email protected]>2021-05-18 08:58:07 -0700
commit322886c8693a7db4dc6e2b2d5bd8ce6a9f8c4b0f (patch)
tree0203a109dfc806a150d6fa90e6054f39df961b03
parentd3c9a195cb5778e99ea120ed4fea12fbf57abb97 (diff)
downloadPaper-322886c8693a7db4dc6e2b2d5bd8ce6a9f8c4b0f.tar.gz
Paper-322886c8693a7db4dc6e2b2d5bd8ce6a9f8c4b0f.zip
Avoid NPE due to PlayerBedFailEnterEvent
fixes #5670
-rw-r--r--Spigot-Server-Patches/0715-Added-PlayerBedFailEnterEvent.patch7
1 files changed, 4 insertions, 3 deletions
diff --git a/Spigot-Server-Patches/0715-Added-PlayerBedFailEnterEvent.patch b/Spigot-Server-Patches/0715-Added-PlayerBedFailEnterEvent.patch
index f74fd8eb88..16189aeee4 100644
--- a/Spigot-Server-Patches/0715-Added-PlayerBedFailEnterEvent.patch
+++ b/Spigot-Server-Patches/0715-Added-PlayerBedFailEnterEvent.patch
@@ -17,7 +17,7 @@ index 3a13e7a050db7f5c93d810afe56325495cec7aa4..c39c50e53549e9cb9d3520bc7e8b7e89
public IChatBaseComponent a() {
return this.g;
diff --git a/src/main/java/net/minecraft/world/level/block/BlockBed.java b/src/main/java/net/minecraft/world/level/block/BlockBed.java
-index eca84595342756e3550883551e487aaf79574fde..abe0a1c309d526de37efcac44922fa259e1d112c 100644
+index eca84595342756e3550883551e487aaf79574fde..00a01a157deec004bcf2f8587723a0ecd0bfef85 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockBed.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockBed.java
@@ -43,6 +43,8 @@ import net.minecraft.world.phys.shapes.VoxelShape;
@@ -29,7 +29,7 @@ index eca84595342756e3550883551e487aaf79574fde..abe0a1c309d526de37efcac44922fa25
public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
-@@ -101,14 +103,22 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
+@@ -101,14 +103,23 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
BlockPosition finalblockposition = blockposition;
// CraftBukkit end
entityhuman.sleep(blockposition).ifLeft((entityhuman_enumbedresult) -> {
@@ -48,7 +48,8 @@ index eca84595342756e3550883551e487aaf79574fde..abe0a1c309d526de37efcac44922fa25
// CraftBukkit end
if (entityhuman_enumbedresult != null) {
- entityhuman.a(entityhuman_enumbedresult.a(), true);
-+ entityhuman.a(PaperAdventure.asVanilla(event.getMessage()), true); // Paper
++ final net.kyori.adventure.text.Component message = event.getMessage(); // Paper
++ if(message != null) entityhuman.a(PaperAdventure.asVanilla(message), true); // Paper
}
+ } // Paper