From 39114e773eb98dcb7b1a6622904a597a90bc7fc5 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 1 May 2019 17:05:21 +1000 Subject: [PATCH] SPIGOT-4825: Clearly error on asynchronous tile access By: md_5 --- .../org/bukkit/craftbukkit/block/CraftBlockEntityState.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java index 0a28e3c081..57443ca6f0 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.block; +import com.google.common.base.Preconditions; import net.minecraft.server.BlockPosition; import net.minecraft.server.NBTTagCompound; import net.minecraft.server.TileEntity; @@ -24,6 +25,7 @@ public class CraftBlockEntityState extends CraftBlockState // get tile entity from block: CraftWorld world = (CraftWorld) this.getWorld(); this.tileEntity = tileEntityClass.cast(world.getHandle().getTileEntity(this.getPosition())); + Preconditions.checkState(this.tileEntity != null, "Tile is null, asynchronous access? " + block); // copy tile entity data: this.snapshot = this.createSnapshot(tileEntity, world.getHandle());