2017-09-18 22:39:40 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Riley Park <rileysebastianpark@gmail.com>
|
|
|
|
Date: Mon, 18 Sep 2017 13:38:40 -0700
|
|
|
|
Subject: [PATCH] Avoid NPE during CraftBlockEntityState load
|
|
|
|
|
|
|
|
|
2017-09-19 03:03:45 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
|
2018-01-16 04:13:17 +01:00
|
|
|
index 54b719d91..3f2c5b2d5 100644
|
2017-09-19 03:03:45 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
|
|
|
|
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity {
|
|
|
|
}
|
|
|
|
|
|
|
|
public MinecraftServer C_() {
|
|
|
|
- return TileEntitySign.this.world.getMinecraftServer();
|
|
|
|
+ return MinecraftServer.getServer(); // Paper - world may be null
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-09-18 22:39:40 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
2018-01-16 04:13:17 +01:00
|
|
|
index 266f87d7f..22dcaea72 100644
|
2017-09-18 22:39:40 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
|
|
|
@@ -0,0 +0,0 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
|
|
|
|
|
|
|
|
// copy tile entity data:
|
|
|
|
this.snapshot = this.createSnapshot(tileEntity);
|
|
|
|
+ if(this.snapshot != null) // Paper - avoid NPE during load
|
|
|
|
this.load(snapshot);
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -0,0 +0,0 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
|
|
|
|
|
|
|
|
// copy tile entity data:
|
|
|
|
this.snapshot = this.createSnapshot(tileEntity);
|
|
|
|
+ if(this.snapshot != null) // Paper - avoid NPE during load
|
|
|
|
this.load(snapshot);
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|