From f3f2fe5795ecaf5a93d7355a66a6fb6030d527f0 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 29 Oct 2018 07:17:59 +1100 Subject: SPIGOT-4455: ChunkData.getType returns legacy material --- src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java | 2 +- src/test/java/org/bukkit/craftbukkit/generator/ChunkDataTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java index c26f0ed1..550416be 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java @@ -67,7 +67,7 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData { @Override public Material getType(int x, int y, int z) { - return getTypeAndData(x, y, z).getItemType(); + return CraftMagicNumbers.getMaterial(getTypeId(x, y, z).getBlock()); } @Override diff --git a/src/test/java/org/bukkit/craftbukkit/generator/ChunkDataTest.java b/src/test/java/org/bukkit/craftbukkit/generator/ChunkDataTest.java index 792e1fc6..c5194e38 100644 --- a/src/test/java/org/bukkit/craftbukkit/generator/ChunkDataTest.java +++ b/src/test/java/org/bukkit/craftbukkit/generator/ChunkDataTest.java @@ -13,7 +13,7 @@ public class ChunkDataTest extends AbstractTestingBase { private boolean testSetBlock(CraftChunkData data, int x, int y, int z, BlockData type, BlockData expected) { data.setBlock(x, y, z, type); - return expected.equals(data.getBlockData(x, y, z)); + return expected.equals(data.getBlockData(x, y, z)) && expected.getMaterial().equals(data.getType(x, y, z)); } private void testSetRegion(CraftChunkData data, int minx, int miny, int minz, int maxx, int maxy, int maxz, BlockData type) { -- cgit v1.2.3