13
0
geforkt von Mirrors/Paper

SPIGOT-4825: Clearly error on asynchronous tile access

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2019-05-01 17:05:21 +10:00
Ursprung cef8c2f357
Commit 39114e773e

Datei anzeigen

@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import com.google.common.base.Preconditions;
import net.minecraft.server.BlockPosition; import net.minecraft.server.BlockPosition;
import net.minecraft.server.NBTTagCompound; import net.minecraft.server.NBTTagCompound;
import net.minecraft.server.TileEntity; import net.minecraft.server.TileEntity;
@ -24,6 +25,7 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
// get tile entity from block: // get tile entity from block:
CraftWorld world = (CraftWorld) this.getWorld(); CraftWorld world = (CraftWorld) this.getWorld();
this.tileEntity = tileEntityClass.cast(world.getHandle().getTileEntity(this.getPosition())); this.tileEntity = tileEntityClass.cast(world.getHandle().getTileEntity(this.getPosition()));
Preconditions.checkState(this.tileEntity != null, "Tile is null, asynchronous access? " + block);
// copy tile entity data: // copy tile entity data:
this.snapshot = this.createSnapshot(tileEntity, world.getHandle()); this.snapshot = this.createSnapshot(tileEntity, world.getHandle());