diff options
author | md_5 <git@md-5.net> | 2017-12-07 10:25:16 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-12-07 10:25:16 +1100 |
commit | cfd69330028afefa92f624382881bccf5619a104 (patch) | |
tree | 7289f39a30ba00e40990607ad6e507e60c91e144 /src/main/java | |
parent | 558c5a348ca73d6ba8c13d2b68a7df85ed02fafa (diff) | |
download | craftbukkit-cfd69330028afefa92f624382881bccf5619a104.tar craftbukkit-cfd69330028afefa92f624382881bccf5619a104.tar.gz craftbukkit-cfd69330028afefa92f624382881bccf5619a104.tar.lz craftbukkit-cfd69330028afefa92f624382881bccf5619a104.tar.xz craftbukkit-cfd69330028afefa92f624382881bccf5619a104.zip |
SPIGOT-3664: Add Material getter to ChunkSnapshot
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java index edf701be..c0fb34b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit; import org.bukkit.ChunkSnapshot; +import org.bukkit.Material; import org.bukkit.block.Biome; import org.bukkit.craftbukkit.block.CraftBlock; @@ -52,6 +53,11 @@ public class CraftChunkSnapshot implements ChunkSnapshot { return worldname; } + @Override + public Material getBlockType(int x, int y, int z) { + return Material.getMaterial(getBlockTypeId(x, y, z)); + } + public final int getBlockTypeId(int x, int y, int z) { return blockids[y >> 4][((y & 0xF) << 8) | (z << 4) | x]; } |