diff --git a/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/tiles/TileTest.java b/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/tiles/TileTest.java index 19333d70d..021503c31 100644 --- a/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/tiles/TileTest.java +++ b/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/tiles/TileTest.java @@ -22,7 +22,7 @@ public void test() throws Exception { try { Block block = world.getBlockAt(world.getSpawnLocation().getBlockX(), 254, world.getSpawnLocation().getBlockZ()); - if (block.getChunk().isLoaded() && block.getType() == Material.AIR) { + if (world.isChunkLoaded(block.getX() >> 4, block.getZ() >> 4) && block.getType() == Material.AIR) { block.setType(Material.CHEST); NBTTileEntity tile = new NBTTileEntity(block.getState()); if (!MinecraftVersion.isNewerThan(MinecraftVersion.MC1_17_R1)) { diff --git a/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/tiles/TilesCustomNBTPersistentTest.java b/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/tiles/TilesCustomNBTPersistentTest.java index 6002a5d57..ff821a90b 100644 --- a/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/tiles/TilesCustomNBTPersistentTest.java +++ b/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/tiles/TilesCustomNBTPersistentTest.java @@ -25,7 +25,7 @@ public void test() throws Exception { try { Block block = world.getBlockAt(world.getSpawnLocation().getBlockX(), 250, world.getSpawnLocation().getBlockZ()); - if (block.getType() == Material.AIR) { + if (world.isChunkLoaded(block.getX() >> 4, block.getZ() >> 4) && block.getType() == Material.AIR) { block.setType(Material.CHEST); NBTTileEntity comp = new NBTTileEntity(block.getState()); NBTCompound persistentData = comp.getPersistentDataContainer();