use of com.sk89q.worldedit.world.registry.PassthroughBlockMaterial in project FastAsyncWorldEdit by IntellectualSites.
the class BukkitBlockRegistry method getMaterial.
@Nullable
@Override
public BlockMaterial getMaterial(BlockType blockType) {
// FAWE start - delegate to our internal values
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
if (adapter != null) {
BlockMaterial result = adapter.getMaterial(blockType);
if (result != null) {
return result;
}
}
Material mat = BukkitAdapter.adapt(blockType);
if (mat == null) {
return new PassthroughBlockMaterial(null);
}
if (materialMap == null) {
materialMap = new BukkitBlockMaterial[Material.values().length];
}
BukkitBlockMaterial result = materialMap[mat.ordinal()];
if (result == null) {
result = new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(blockType), mat);
materialMap[mat.ordinal()] = result;
}
return result;
// FAWE end
}
Aggregations