use of org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData in project Movecraft by APDevTeam.
the class IWorldHandler method setBlockFast.
@Override
public void setBlockFast(@NotNull Location location, @NotNull MovecraftRotation rotation, @NotNull BlockData data) {
BlockState blockData;
if (data instanceof CraftBlockData) {
blockData = ((CraftBlockData) data).getState();
} else {
blockData = (BlockState) data;
}
blockData = blockData.rotate(ROTATION[rotation.ordinal()]);
Level world = ((CraftWorld) (location.getWorld())).getHandle();
BlockPos BlockPos = locationToPosition(MathUtils.bukkit2MovecraftLoc(location));
setBlockFast(world, BlockPos, blockData);
}
use of org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData in project Movecraft by APDevTeam.
the class IWorldHandler method setBlockFast.
@Override
public void setBlockFast(@NotNull Location location, @NotNull MovecraftRotation rotation, @NotNull BlockData data) {
IBlockData blockData;
if (data instanceof CraftBlockData) {
blockData = ((CraftBlockData) data).getState();
} else {
blockData = (IBlockData) data;
}
blockData = blockData.a(ROTATION[rotation.ordinal()]);
World world = ((CraftWorld) (location.getWorld())).getHandle();
BlockPosition blockPosition = locationToPosition(bukkit2MovecraftLoc(location));
setBlockFast(world, blockPosition, blockData);
}
use of org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData in project Movecraft by APDevTeam.
the class IWorldHandler method setBlockFast.
@Override
public void setBlockFast(@NotNull Location location, @NotNull MovecraftRotation rotation, @NotNull BlockData data) {
BlockState blockData;
if (data instanceof CraftBlockData) {
blockData = ((CraftBlockData) data).getState();
} else {
blockData = (BlockState) data;
}
blockData = blockData.rotate(ROTATION[rotation.ordinal()]);
Level world = ((CraftWorld) (location.getWorld())).getHandle();
BlockPos BlockPos = locationToPosition(MathUtils.bukkit2MovecraftLoc(location));
setBlockFast(world, BlockPos, blockData);
}
use of org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData in project Movecraft by APDevTeam.
the class IWorldHandler method setBlockFast.
@Override
public void setBlockFast(@NotNull Location location, @NotNull MovecraftRotation rotation, @NotNull BlockData data) {
IBlockData blockData;
if (data instanceof CraftBlockData) {
blockData = ((CraftBlockData) data).getState();
} else {
blockData = (IBlockData) data;
}
blockData = blockData.a(ROTATION[rotation.ordinal()]);
World world = ((CraftWorld) (location.getWorld())).getHandle();
BlockPosition blockPosition = locationToPosition(bukkit2MovecraftLoc(location));
setBlockFast(world, blockPosition, blockData);
}
use of org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData in project BentoBox by BentoBoxWorld.
the class NMSHandler method setBlockInNativeChunk.
@Override
public void setBlockInNativeChunk(org.bukkit.Chunk chunk, int x, int y, int z, BlockData blockData, boolean applyPhysics) {
CraftBlockData craft = (CraftBlockData) blockData;
World nmsWorld = ((CraftWorld) chunk.getWorld()).getHandle();
Chunk nmsChunk = nmsWorld.d(chunk.getX(), chunk.getZ());
BlockPosition bp = new BlockPosition((chunk.getX() << 4) + x, y, (chunk.getZ() << 4) + z);
// Setting the block to air before setting to another state prevents some console errors
nmsChunk.a(bp, AIR, applyPhysics);
nmsChunk.a(bp, craft.getState(), applyPhysics);
}
Aggregations