From 887bc05190637cc5fe5783c0cd353e4eb880a7f5 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 21 Jun 2021 08:46:23 +1000 Subject: [PATCH] SPIGOT-6592: Tile entities in custom ChunkGenerator causes crash --- .../org/bukkit/craftbukkit/generator/CustomChunkGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java index aa5d61f8b..19d25ebea 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -154,7 +154,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { IBlockData block = craftData.getTypeId(tx, ty, tz); if (block.isTileEntity()) { - TileEntity tile = ((ITileEntity) block).createTile(new BlockPosition((x << 4) + tx, ty, (z << 4) + tz), block); + TileEntity tile = ((ITileEntity) block.getBlock()).createTile(new BlockPosition((x << 4) + tx, ty, (z << 4) + tz), block); ichunkaccess.setTileEntity(tile); } }