From 42760138335574ae20c549a6ecb13b29d20b6d20 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Fri, 15 Oct 2021 12:43:19 +0100 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 9590b610 SPIGOT-6749: Library Loader does not correctly isolate dependencies CraftBukkit Changes: 11c9299f #940: Fixed a NPE during CraftBlockEntityState#update. 960f3109 #937: Fixes related to unplaced BlockStates and the recent world generation changes. 4faf479e SPIGOT-6754: We ignore any still present TileEntity now when we create a BlockState for a block of type AIR. a72d5404 SPIGOT-6754: Temporarily restore previous behaviour for tile entities with removed blocks Spigot Changes: dc75aca8 Remove redundant 'Log null TileEntity Owner' patch --- ...or-plugins-modifying-the-parent-of-t.patch | 4 +- ...rioritise-own-classes-where-possible.patch | 6 +-- ...-a-useful-PluginClassLoader-toString.patch | 4 +- ...-get-a-BlockState-without-a-snapshot.patch | 12 ++---- .../server/0534-Optimise-getType-calls.patch | 4 +- .../server/0689-More-Lidded-Block-API.patch | 4 +- ...-Fix-upstreams-block-state-factories.patch | 22 +++++----- ...block-states-after-new-chunk-gen-API.patch | 40 +++---------------- ...licable-for-CraftBlockEntityState-up.patch | 21 ---------- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 12 files changed, 34 insertions(+), 89 deletions(-) delete mode 100644 patches/server/0826-Null-check-isApplicable-for-CraftBlockEntityState-up.patch diff --git a/patches/api/0071-Add-workaround-for-plugins-modifying-the-parent-of-t.patch b/patches/api/0071-Add-workaround-for-plugins-modifying-the-parent-of-t.patch index 3d26c42d43..958596ad70 100644 --- a/patches/api/0071-Add-workaround-for-plugins-modifying-the-parent-of-t.patch +++ b/patches/api/0071-Add-workaround-for-plugins-modifying-the-parent-of-t.patch @@ -87,7 +87,7 @@ index f99d60ae4003f953b5680a997e9e43e63c035b0c..c943bd801b54519ba6cf5d45aec593d7 /** diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index e77c616977a3dcaa72bb22c35f6092c1f00b2b85..550225f168160298f4b1bf6c361207a59cf23122 100644 +index 657243776c8a2abb5a57e5c407212a8387d649eb..4fa5f7140ea97e1b6a63808b59115bfb1a85cb32 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -44,6 +44,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot @@ -107,7 +107,7 @@ index e77c616977a3dcaa72bb22c35f6092c1f00b2b85..550225f168160298f4b1bf6c361207a5 try { Class jarClass; try { -@@ -224,6 +227,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot +@@ -229,6 +232,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot pluginState = new IllegalStateException("Initial initialization"); this.pluginInit = javaPlugin; diff --git a/patches/api/0207-Prioritise-own-classes-where-possible.patch b/patches/api/0207-Prioritise-own-classes-where-possible.patch index 275d1ff4b8..8b251555d5 100644 --- a/patches/api/0207-Prioritise-own-classes-where-possible.patch +++ b/patches/api/0207-Prioritise-own-classes-where-possible.patch @@ -25,7 +25,7 @@ The patch in general terms just loads the class in the plugin's jar before it starts looking elsewhere for it. diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index ce751577623eaad0f31e2eb7bf0842d1ab73e845..31793f46e5623729dfb4048e901f274082f57826 100644 +index dfa44d9a0f0e270fddc4f30b845c2b0e23008033..80236a0934861902db7f15571d0d9b4902e70045 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -51,6 +51,7 @@ import org.yaml.snakeyaml.error.YAMLException; @@ -63,7 +63,7 @@ index ce751577623eaad0f31e2eb7bf0842d1ab73e845..31793f46e5623729dfb4048e901f2740 for (PluginClassLoader loader : loaders) { try { diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 550225f168160298f4b1bf6c361207a59cf23122..9c2bde2820b92d17bc2241957390f3fb3cc50d98 100644 +index 4fa5f7140ea97e1b6a63808b59115bfb1a85cb32..cd1907e8895ece9b780617635b71937596c0f982 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -33,7 +33,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot @@ -75,7 +75,7 @@ index 550225f168160298f4b1bf6c361207a59cf23122..9c2bde2820b92d17bc2241957390f3fb private final File dataFolder; private final File file; private final JarFile jar; -@@ -118,7 +118,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot +@@ -123,7 +123,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot if (checkGlobal) { // This ignores the libraries of other plugins, unless they are transitive dependencies. diff --git a/patches/api/0208-Provide-a-useful-PluginClassLoader-toString.patch b/patches/api/0208-Provide-a-useful-PluginClassLoader-toString.patch index b81a6dacb4..698d53a3af 100644 --- a/patches/api/0208-Provide-a-useful-PluginClassLoader-toString.patch +++ b/patches/api/0208-Provide-a-useful-PluginClassLoader-toString.patch @@ -8,10 +8,10 @@ however, this provides no indication of the owner of the classloader, making these messages effectively useless, this patch rectifies this diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 9c2bde2820b92d17bc2241957390f3fb3cc50d98..6b5d7c350c216b7a234d96ecacae1d39a1acd814 100644 +index cd1907e8895ece9b780617635b71937596c0f982..9e14c95deaca0044a3e9284ceefbb2b5c54ede07 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -@@ -230,4 +230,16 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot +@@ -235,4 +235,16 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot javaPlugin.logger = this.logger; // Paper - set logger javaPlugin.init(loader, loader.server, description, dataFolder, file, this); } diff --git a/patches/server/0168-API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/0168-API-to-get-a-BlockState-without-a-snapshot.patch index 43c56745f2..74b7560eb7 100644 --- a/patches/server/0168-API-to-get-a-BlockState-without-a-snapshot.patch +++ b/patches/server/0168-API-to-get-a-BlockState-without-a-snapshot.patch @@ -13,7 +13,7 @@ also Avoid NPE during CraftBlockEntityState load if could not get TE If Tile Entity was null, correct Sign to return empty lines instead of null diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index 77645019c88d61dde28b7598d8a29b7d0c23c209..560ee4eaa286197a0f8fc0a119ff5e06baca792a 100644 +index 27895fbe1cd7ee6ee025ed3e320671e3e971764d..1d1764766d2b4a0b7bf4078ce428bb1474f709df 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java @@ -42,6 +42,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { @@ -33,7 +33,7 @@ index 77645019c88d61dde28b7598d8a29b7d0c23c209..560ee4eaa286197a0f8fc0a119ff5e06 net.minecraft.nbt.Tag persistentDataTag = nbt.get("PublicBukkitValues"); if (persistentDataTag instanceof CompoundTag) { -@@ -222,6 +223,11 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { +@@ -222,10 +223,15 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { // CraftBukkit start - add method public InventoryHolder getOwner() { @@ -43,12 +43,8 @@ index 77645019c88d61dde28b7598d8a29b7d0c23c209..560ee4eaa286197a0f8fc0a119ff5e06 + public InventoryHolder getOwner(boolean useSnapshot) { + // Paper end if (this.level == null) return null; - // Spigot start org.bukkit.block.Block block = this.level.getWorld().getBlockAt(this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ()); -@@ -230,7 +236,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { - return null; - } - // Spigot end + if (block.getType() == org.bukkit.Material.AIR) return null; - org.bukkit.block.BlockState state = block.getState(); + org.bukkit.block.BlockState state = block.getState(useSnapshot); // Paper if (state instanceof InventoryHolder) return (InventoryHolder) state; @@ -80,7 +76,7 @@ index e6b8dd52cd503f45ca9bb868891ae4c8b29b3fcb..f1c4c3a3392c2d4d836fa10d7a38558d @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -index fbd52387299c90b85afd79897139cdb879fce74a..aaddbaecc25af87c863fe51098eb322fd5702104 100644 +index 2fb445e6edc43eb8e3e169cca3fc3b46ced94202..059a122ef7038f7c4e269b476eb6e013b3eb4531 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -10,15 +10,26 @@ public abstract class CraftBlockEntityState extends Craft diff --git a/patches/server/0534-Optimise-getType-calls.patch b/patches/server/0534-Optimise-getType-calls.patch index 4de5d7d25a..99be2ad7e8 100644 --- a/patches/server/0534-Optimise-getType-calls.patch +++ b/patches/server/0534-Optimise-getType-calls.patch @@ -54,10 +54,10 @@ index 4febad176d8dc7c56e9cb09c8e5ce55f4c9f3288..fd4a0bbd1438bfc94580f29382d0c5f5 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -index 3d8d8e797a08067725924de1d1f07ada75cdb683..b2b41b5c3a6cab44d49a43b6b0db2fea3271c225 100644 +index 8f7da903c75feaaf31e368ac8d798af8ed845ebf..db7a6af045364e7b1e9c0449faaf5f49394f6204 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -@@ -153,7 +153,7 @@ public class CraftBlockState implements BlockState { +@@ -166,7 +166,7 @@ public class CraftBlockState implements BlockState { @Override public Material getType() { diff --git a/patches/server/0689-More-Lidded-Block-API.patch b/patches/server/0689-More-Lidded-Block-API.patch index c0c11a1f15..167cf3d5d8 100644 --- a/patches/server/0689-More-Lidded-Block-API.patch +++ b/patches/server/0689-More-Lidded-Block-API.patch @@ -21,10 +21,10 @@ index 9d0c272b1d89a96b0b63603fa8e4649f11fb6c51..d5fdf4504a0ca76fb0483f4ae5861c93 + // Paper end - More Lidded Block API } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -index 189674ce35f2da75a70e4a05c77dd022cef469db..2a723bd0850ee1201bb87760647bd4b3a93279fe 100644 +index 1290a29e90349222b33c32429347250ce6101817..9806697cb7566c5af1df74b7eaa8088d19ee4fdc 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -@@ -78,4 +78,11 @@ public class CraftChest extends CraftLootable implements Chest +@@ -76,4 +76,11 @@ public class CraftChest extends CraftLootable implements Chest } getTileEntity().openersCounter.opened = false; } diff --git a/patches/server/0819-Fix-upstreams-block-state-factories.patch b/patches/server/0819-Fix-upstreams-block-state-factories.patch index ea75832c71..452d73f78e 100644 --- a/patches/server/0819-Fix-upstreams-block-state-factories.patch +++ b/patches/server/0819-Fix-upstreams-block-state-factories.patch @@ -10,7 +10,7 @@ tile entity type to determine the block state factory and falls back on the material type of the block at that location. diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77385902a8 100644 +index b794e04036df00dd9633b9bd808591f499238387..a20505b6badaf2d709bd95fa01d0617b86b35fe2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java @@ -19,6 +19,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity; @@ -21,7 +21,7 @@ index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77 import net.minecraft.world.level.block.entity.BrewingStandBlockEntity; import net.minecraft.world.level.block.entity.CampfireBlockEntity; import net.minecraft.world.level.block.entity.ChestBlockEntity; -@@ -109,6 +110,12 @@ public final class CraftBlockStates { +@@ -110,6 +111,12 @@ public final class CraftBlockStates { return new CraftBlockState(world, blockPosition, blockData); } }; @@ -34,7 +34,7 @@ index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77 static { register( -@@ -129,7 +136,7 @@ public final class CraftBlockStates { +@@ -130,7 +137,7 @@ public final class CraftBlockStates { Material.SPRUCE_WALL_SIGN, Material.WARPED_SIGN, Material.WARPED_WALL_SIGN @@ -43,7 +43,7 @@ index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77 ); register( -@@ -146,7 +153,7 @@ public final class CraftBlockStates { +@@ -147,7 +154,7 @@ public final class CraftBlockStates { Material.WITHER_SKELETON_WALL_SKULL, Material.ZOMBIE_HEAD, Material.ZOMBIE_WALL_HEAD @@ -52,7 +52,7 @@ index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77 ); register( -@@ -154,7 +161,7 @@ public final class CraftBlockStates { +@@ -155,7 +162,7 @@ public final class CraftBlockStates { Material.COMMAND_BLOCK, Material.REPEATING_COMMAND_BLOCK, Material.CHAIN_COMMAND_BLOCK @@ -61,7 +61,7 @@ index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77 ); register( -@@ -191,7 +198,7 @@ public final class CraftBlockStates { +@@ -192,7 +199,7 @@ public final class CraftBlockStates { Material.WHITE_WALL_BANNER, Material.YELLOW_BANNER, Material.YELLOW_WALL_BANNER @@ -70,7 +70,7 @@ index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77 ); register( -@@ -213,7 +220,7 @@ public final class CraftBlockStates { +@@ -214,7 +221,7 @@ public final class CraftBlockStates { Material.GREEN_SHULKER_BOX, Material.RED_SHULKER_BOX, Material.BLACK_SHULKER_BOX @@ -79,7 +79,7 @@ index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77 ); register( -@@ -234,54 +241,51 @@ public final class CraftBlockStates { +@@ -235,54 +242,51 @@ public final class CraftBlockStates { Material.RED_BED, Material.WHITE_BED, Material.YELLOW_BED @@ -165,7 +165,7 @@ index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77 } private static void register(Material blockType, BlockStateFactory factory) { -@@ -290,15 +294,17 @@ public final class CraftBlockStates { +@@ -291,15 +295,17 @@ public final class CraftBlockStates { private static > void register( Material blockType, @@ -184,7 +184,7 @@ index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77 Class blockStateType, BiFunction blockStateConstructor, BiFunction tileEntityConstructor -@@ -307,17 +313,35 @@ public final class CraftBlockStates { +@@ -308,17 +314,35 @@ public final class CraftBlockStates { for (Material blockType : blockTypes) { CraftBlockStates.register(blockType, factory); } @@ -220,7 +220,7 @@ index a5c0fe5ba6ca4bed8914edcdcd21275145d11aee..5f497e0b9d2c7b23672f6480aa86aa77 public static BlockState getBlockState(Block block) { Preconditions.checkNotNull(block, "block is null"); CraftBlock craftBlock = (CraftBlock) block; -@@ -360,7 +384,7 @@ public final class CraftBlockStates { +@@ -361,7 +385,7 @@ public final class CraftBlockStates { if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(material)) { factory = CraftBlockStates.DEFAULT_FACTORY; } else { diff --git a/patches/server/0822-Fix-unplaced-block-states-after-new-chunk-gen-API.patch b/patches/server/0822-Fix-unplaced-block-states-after-new-chunk-gen-API.patch index 1b92828dea..f2f48eb8b3 100644 --- a/patches/server/0822-Fix-unplaced-block-states-after-new-chunk-gen-API.patch +++ b/patches/server/0822-Fix-unplaced-block-states-after-new-chunk-gen-API.patch @@ -5,15 +5,10 @@ Subject: [PATCH] Fix unplaced block states after new chunk gen API diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java -index 489d259d105476092d401f788c88c17c3bed86ff..250afe0acb37e6ea2288a6079160566965b3b2bf 100644 +index e00210950cbf005b0e65aed68dfbb7c281aefd87..b4a10c1ef095faaefbedc2a1fd84aea721a4ba98 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java -@@ -60,11 +60,11 @@ public class CraftBeehive extends CraftBlockEntityState impl - - @Override - public List releaseEntities() { -- Preconditions.checkState(getWorldHandle() instanceof net.minecraft.world.level.Level, "Can't release entities during world generation"); - +@@ -65,6 +65,7 @@ public class CraftBeehive extends CraftBlockEntityState impl List bees = new ArrayList<>(); if (isPlaced()) { @@ -21,37 +16,12 @@ index 489d259d105476092d401f788c88c17c3bed86ff..250afe0acb37e6ea2288a60791605669 BeehiveBlockEntity beehive = ((BeehiveBlockEntity) this.getTileEntityFromWorld()); for (Entity bee : beehive.releaseBees(this.getHandle(), BeeReleaseStatus.BEE_RELEASED, true)) { bees.add((Bee) bee.getBukkitEntity()); -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -index b2b41b5c3a6cab44d49a43b6b0db2fea3271c225..b17a448a4bb78b0527031815de5adee82d7d7f01 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -@@ -58,12 +58,14 @@ public class CraftBlockState implements BlockState { - - public LevelAccessor getWorldHandle() { - if (this.weakWorld == null) { -+ requirePlaced(); // Paper - return this.world.getHandle(); - } - - LevelAccessor access = this.weakWorld.get(); - if (access == null) { - this.weakWorld = null; -+ requirePlaced(); // Paper - return this.world.getHandle(); - } - diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -index 2a723bd0850ee1201bb87760647bd4b3a93279fe..6bcd71928fee7c4f4e1fd11e52293f641d11b12b 100644 +index 9806697cb7566c5af1df74b7eaa8088d19ee4fdc..ad833481414d3b60bdbcf87727b494ecff84f2c3 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -@@ -38,12 +38,12 @@ public class CraftChest extends CraftLootable implements Chest - - @Override - public Inventory getInventory() { -- Preconditions.checkState(getWorldHandle() instanceof net.minecraft.world.level.Level, "Can't get inventory during world generation, use getBlockInventory() instead"); - - CraftInventory inventory = (CraftInventory) this.getBlockInventory(); - if (!isPlaced()) { +@@ -42,6 +42,7 @@ public class CraftChest extends CraftLootable implements Chest + if (!isPlaced() || isWorldGeneration()) { return inventory; } + Preconditions.checkState(getWorldHandle() instanceof net.minecraft.world.level.Level, "Can't get inventory during world generation, use getBlockInventory() instead"); // Paper - move after placed check diff --git a/patches/server/0826-Null-check-isApplicable-for-CraftBlockEntityState-up.patch b/patches/server/0826-Null-check-isApplicable-for-CraftBlockEntityState-up.patch deleted file mode 100644 index 9c6cad66cb..0000000000 --- a/patches/server/0826-Null-check-isApplicable-for-CraftBlockEntityState-up.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Spottedleaf -Date: Tue, 12 Oct 2021 13:32:52 -0700 -Subject: [PATCH] Null check isApplicable for CraftBlockEntityState#update - -If the update call removed the TE, then isApplicable would -have NPE'd. - -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -index d2ff7e373476aaab0d4d08977c9d9f274fff67bf..a31162bbb37b79cb7f84956c91f2ef9efc4ededc 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -@@ -102,7 +102,7 @@ public abstract class CraftBlockEntityState extends Craft - } - - protected boolean isApplicable(BlockEntity tileEntity) { -- return this.tileEntity.getClass() == tileEntity.getClass(); -+ return tileEntity != null && this.tileEntity.getClass() == tileEntity.getClass(); // Paper - fix NPE if the TE was removed - } - - @Override diff --git a/work/Bukkit b/work/Bukkit index 6be36d3638..9590b610cf 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 6be36d3638f97e6e0dc053f3e0fd0e68e8ec93f0 +Subproject commit 9590b610cfa705b082c0593b595a7d563a89dc85 diff --git a/work/CraftBukkit b/work/CraftBukkit index 1df303e707..11c9299fbb 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 1df303e70742418fd30760a750a9545f3dea5b9b +Subproject commit 11c9299fbb8f559c1ba38e8f0e1695c4d33109ba diff --git a/work/Spigot b/work/Spigot index 8e907441bd..dc75aca853 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 8e907441bde900ddc564d3a5fac831287a1a8b75 +Subproject commit dc75aca85361e65679880f2abd5c92f6db448ae2