use of net.minecraft.server.v1_13_R1.World in project RoseStacker by Rosewood-Development.
the class StackedSpawnerTileImpl method updateTile.
private void updateTile() {
World level = this.a();
if (level != null) {
level.b(this.blockPos, this.blockEntity);
IBlockData var1 = this.a().getType(this.b());
this.a().notify(this.blockPos, var1, var1, 3);
}
}
use of net.minecraft.server.v1_13_R1.World in project SSB-OneBlock by BG-Software-LLC.
the class NMSAdapter_v1_15_R1 method setChestName.
@Override
public void setChestName(Location chest, String name) {
assert chest.getWorld() != null;
World world = ((CraftWorld) chest.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(chest.getBlockX(), chest.getBlockY(), chest.getBlockZ());
TileEntityChest tileEntityChest = (TileEntityChest) world.getTileEntity(blockPosition);
assert tileEntityChest != null;
tileEntityChest.setCustomName(CraftChatMessage.fromString(name)[0]);
}
use of net.minecraft.server.v1_13_R1.World in project SSB-OneBlock by BG-Software-LLC.
the class NMSAdapter_v1_8_R3 method setChestName.
@Override
public void setChestName(Location chest, String name) {
World world = ((CraftWorld) chest.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(chest.getBlockX(), chest.getBlockY(), chest.getBlockZ());
TileEntityChest tileEntityChest = (TileEntityChest) world.getTileEntity(blockPosition);
tileEntityChest.a(name);
}
use of net.minecraft.server.v1_13_R1.World in project Atlas by funkemunky.
the class BlockBox1_15_R1 method getCollisionBox.
@Override
public CollisionBox getCollisionBox(org.bukkit.block.Block block) {
final net.minecraft.server.v1_15_R1.World world = ((org.bukkit.craftbukkit.v1_15_R1.CraftWorld) block.getWorld()).getHandle();
final int x = block.getX(), y = block.getY(), z = block.getZ();
net.minecraft.server.v1_15_R1.IBlockData iblockData = ((CraftBlock) block).getNMS();
net.minecraft.server.v1_15_R1.Block vblock = iblockData.getBlock();
BlockPosition blockPos = new BlockPosition(x, y, z);
VoxelShape shape = vblock.a(iblockData, world, blockPos, VoxelShapeCollision.a());
List<AxisAlignedBB> boxes = shape.d();
if (boxes.size() == 0) {
return BlockData.getData(block.getType()).getBox(block, ProtocolVersion.getGameVersion());
} else if (boxes.size() == 1) {
AxisAlignedBB box = boxes.get(0);
return new SimpleCollisionBox(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ);
} else {
ComplexCollisionBox complexBox = new ComplexCollisionBox();
for (AxisAlignedBB box : boxes) {
complexBox.add(new SimpleCollisionBox(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ));
}
return complexBox;
}
}
use of net.minecraft.server.v1_13_R1.World in project Atlas by funkemunky.
the class BlockBox1_16_R2 method getCollisionBox.
@Override
public CollisionBox getCollisionBox(org.bukkit.block.Block block) {
final net.minecraft.server.v1_16_R2.World world = ((org.bukkit.craftbukkit.v1_16_R2.CraftWorld) block.getWorld()).getHandle();
final int x = block.getX(), y = block.getY(), z = block.getZ();
net.minecraft.server.v1_16_R2.IBlockData iblockData = ((CraftBlock) block).getNMS();
net.minecraft.server.v1_16_R2.Block vblock = iblockData.getBlock();
BlockPosition blockPos = new BlockPosition(x, y, z);
VoxelShape shape = vblock.a(iblockData, world, blockPos, VoxelShapeCollision.a());
List<AxisAlignedBB> boxes = shape.d();
if (boxes.size() == 0) {
return BlockData.getData(block.getType()).getBox(block, ProtocolVersion.getGameVersion());
} else if (boxes.size() == 1) {
AxisAlignedBB box = boxes.get(0);
return new SimpleCollisionBox(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ);
} else {
ComplexCollisionBox complexBox = new ComplexCollisionBox();
for (AxisAlignedBB box : boxes) {
complexBox.add(new SimpleCollisionBox(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ));
}
return complexBox;
}
}
Aggregations