use of net.minecraft.server.v1_8_R3.TileEntityChest in project SSB-OneBlock by BG-Software-LLC.
the class NMSAdapter_v1_12_R1 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);
assert tileEntityChest != null;
tileEntityChest.setCustomName(name);
}
use of net.minecraft.server.v1_8_R3.TileEntityChest in project SSB-OneBlock by BG-Software-LLC.
the class NMSAdapter_v1_16_R3 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_8_R3.TileEntityChest in project UltraCosmetics by iSach.
the class EntityUtil method playChestAnimation.
@Override
public void playChestAnimation(Block b, boolean open, TreasureChestDesign design) {
Location location = b.getLocation();
World world = ((CraftWorld) location.getWorld()).getHandle();
BlockPosition position = new BlockPosition(location.getX(), location.getY(), location.getZ());
if (design.getChestType() == ChestType.ENDER) {
TileEntityEnderChest tileChest = (TileEntityEnderChest) world.getTileEntity(position);
world.playBlockAction(position, tileChest.w(), 1, open ? 1 : 0);
} else {
TileEntityChest tileChest = (TileEntityChest) world.getTileEntity(position);
world.playBlockAction(position, tileChest.w(), 1, open ? 1 : 0);
}
}
use of net.minecraft.server.v1_8_R3.TileEntityChest in project WildChests by BG-Software-LLC.
the class NMSAdapter_v1_16_R3 method playChestAction.
@Override
public void playChestAction(Location location, boolean open) {
World world = ((CraftWorld) location.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(location.getX(), location.getY(), location.getZ());
TileEntityChest tileChest = (TileEntityChest) world.getTileEntity(blockPosition);
if (tileChest != null)
world.playBlockAction(blockPosition, tileChest.getBlock().getBlock(), 1, open ? 1 : 0);
}
use of net.minecraft.server.v1_8_R3.TileEntityChest in project WildChests by BG-Software-LLC.
the class NMSAdapter_v1_8_R3 method playChestAction.
@Override
public void playChestAction(Location location, boolean open) {
World world = ((CraftWorld) location.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(location.getX(), location.getY(), location.getZ());
TileEntityChest tileChest = (TileEntityChest) world.getTileEntity(blockPosition);
if (tileChest != null)
world.playBlockAction(blockPosition, world.getType(blockPosition).getBlock(), 1, open ? 1 : 0);
}
Aggregations