use of net.minecraft.server.v1_16_R2.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_16_R2.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_16_R2.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;
}
}
use of net.minecraft.server.v1_16_R2.World in project UltraCosmetics by iSach.
the class MorphElderGuardian method onEquip.
@Override
protected void onEquip() {
super.onEquip();
World world = ((CraftWorld) getPlayer().getWorld()).getHandle();
customGuardian = new CustomGuardian(EntityTypes.ELDER_GUARDIAN, world);
customEntities.add(customGuardian);
customGuardian.check();
Location location = getPlayer().getLocation();
double x = location.getX();
double y = location.getY();
double z = location.getZ();
customGuardian.setLocation(x, y, z, 0, 0);
EntitySpawningManager.setBypass(true);
world.addEntity(customGuardian);
EntitySpawningManager.setBypass(false);
getPlayer().setPassenger(customGuardian.getBukkitEntity());
customGuardian.setInvisible(true);
}
use of net.minecraft.server.v1_16_R2.World in project UltraCosmetics by iSach.
the class MorphElderGuardian method onEquip.
@Override
protected void onEquip() {
super.onEquip();
World world = ((CraftWorld) getPlayer().getWorld()).getHandle();
customGuardian = new CustomGuardian(world);
customEntities.add(customGuardian);
customGuardian.check();
Location location = getPlayer().getLocation();
double x = location.getX();
double y = location.getY();
double z = location.getZ();
customGuardian.setLocation(x, y, z, 0, 0);
EntitySpawningManager.setBypass(true);
world.addEntity(customGuardian);
EntitySpawningManager.setBypass(false);
getPlayer().setPassenger(customGuardian.getBukkitEntity());
customGuardian.setInvisible(true);
}
Aggregations