mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-09 08:32:07 -07:00
SPIGOT-3664: Add Material getter to ChunkSnapshot
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package org.bukkit.craftbukkit;
|
package org.bukkit.craftbukkit;
|
||||||
|
|
||||||
import org.bukkit.ChunkSnapshot;
|
import org.bukkit.ChunkSnapshot;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.craftbukkit.block.CraftBlock;
|
import org.bukkit.craftbukkit.block.CraftBlock;
|
||||||
|
|
||||||
@@ -52,6 +53,11 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
|
|||||||
return worldname;
|
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) {
|
public final int getBlockTypeId(int x, int y, int z) {
|
||||||
return blockids[y >> 4][((y & 0xF) << 8) | (z << 4) | x];
|
return blockids[y >> 4][((y & 0xF) << 8) | (z << 4) | x];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user