use of com.sk89q.worldedit.world.registry.BlockMaterial 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
}
use of com.sk89q.worldedit.world.registry.BlockMaterial in project FastAsyncWorldEdit by IntellectualSites.
the class CharFilterBlock method hasNbtData.
@Override
public boolean hasNbtData() {
final BlockState state = getBlock();
final BlockMaterial material = state.getMaterial();
return material.hasContainer();
}
use of com.sk89q.worldedit.world.registry.BlockMaterial in project FastAsyncWorldEdit by IntellectualSites.
the class CharFilterBlock method getFullBlock.
@Override
public final BaseBlock getFullBlock() {
final BlockState state = getBlock();
final BlockMaterial material = state.getMaterial();
if (material.hasContainer()) {
final CompoundTag tag = get.getTile(x, y + yy, z);
return state.toBaseBlock(tag);
}
return state.toBaseBlock();
}
Aggregations