use of org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData in project FastAsyncWorldEdit by IntellectualSites.
the class PaperweightAdapter method getBlock.
@Override
public BlockState getBlock(Location location) {
checkNotNull(location);
CraftWorld craftWorld = ((CraftWorld) location.getWorld());
int x = location.getBlockX();
int y = location.getBlockY();
int z = location.getBlockZ();
final ServerLevel handle = craftWorld.getHandle();
LevelChunk chunk = handle.getChunk(x >> 4, z >> 4);
final BlockPos blockPos = new BlockPos(x, y, z);
final CraftBlockData blockData = chunk.getBlockState(blockPos).createCraftBlockData();
BlockState state = BukkitAdapter.adapt(blockData);
if (state == null) {
org.bukkit.block.Block bukkitBlock = location.getBlock();
state = BukkitAdapter.adapt(bukkitBlock.getBlockData());
}
return state;
}
use of org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData in project Denizen by DenizenScript.
the class EntityHelperImpl method setFallingBlockType.
@Override
public void setFallingBlockType(FallingBlock entity, BlockData block) {
BlockState state = ((CraftBlockData) block).getState();
FallingBlockEntity nmsEntity = ((CraftFallingBlock) entity).getHandle();
try {
FALLINGBLOCK_TYPE_SETTER.invoke(nmsEntity, state);
} catch (Throwable ex) {
Debug.echoError(ex);
}
}
use of org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData in project Denizen by DenizenScript.
the class EntityHelperImpl method setFallingBlockType.
@Override
public void setFallingBlockType(FallingBlock entity, BlockData block) {
BlockState state = ((CraftBlockData) block).getState();
FallingBlockEntity nmsEntity = ((CraftFallingBlock) entity).getHandle();
try {
FALLINGBLOCK_TYPE_SETTER.invoke(nmsEntity, state);
} catch (Throwable ex) {
Debug.echoError(ex);
}
}
use of org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData in project Denizen by DenizenScript.
the class EntityHelperImpl method setFallingBlockType.
@Override
public void setFallingBlockType(FallingBlock entity, BlockData block) {
BlockState state = ((CraftBlockData) block).getState();
FallingBlockEntity nmsEntity = ((CraftFallingBlock) entity).getHandle();
try {
FALLINGBLOCK_TYPE_SETTER.invoke(nmsEntity, state);
} catch (Throwable ex) {
Debug.echoError(ex);
}
}
use of org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData in project Magma-1.16.x by magmafoundation.
the class CraftMinecart method setDisplayBlockData.
@Override
public void setDisplayBlockData(BlockData blockData) {
if (blockData != null) {
BlockState block = ((CraftBlockData) blockData).getState();
this.getHandle().setDisplayBlockState(block);
} else {
// Set block to air (default) and set the flag to not have a display block.
this.getHandle().setDisplayBlockState(Blocks.AIR.defaultBlockState());
this.getHandle().setCustomDisplay(false);
}
}
Aggregations