Search in sources :

Example 1 with TileEntityEnderChest

use of net.minecraft.server.v1_8_R3.TileEntityEnderChest 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);
    }
}
Also used : TileEntityChest(net.minecraft.server.v1_8_R3.TileEntityChest) BlockPosition(net.minecraft.server.v1_8_R3.BlockPosition) TileEntityEnderChest(net.minecraft.server.v1_8_R3.TileEntityEnderChest) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld) World(net.minecraft.server.v1_8_R3.World) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld) Location(org.bukkit.Location)

Aggregations

BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)1 TileEntityChest (net.minecraft.server.v1_8_R3.TileEntityChest)1 TileEntityEnderChest (net.minecraft.server.v1_8_R3.TileEntityEnderChest)1 World (net.minecraft.server.v1_8_R3.World)1 Location (org.bukkit.Location)1 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)1