use of net.minecraft.world.level.block.entity.EnderChestBlockEntity in project UltraCosmetics by iSach.
the class EntityUtil method playChestAnimation.
@Override
public void playChestAnimation(Block b, boolean open, TreasureChestDesign design) {
Location location = b.getLocation();
Level world = ((CraftWorld) location.getWorld()).getHandle();
BlockPos position = new BlockPos(location.getX(), location.getY(), location.getZ());
if (design.getChestType() == ChestType.ENDER) {
EnderChestBlockEntity tileChest = (EnderChestBlockEntity) world.getBlockEntity(position);
world.blockEvent(position, tileChest.getBlockState().getBlock(), 1, open ? 1 : 0);
} else {
ChestBlockEntity tileChest = (ChestBlockEntity) world.getBlockEntity(position);
world.blockEvent(position, tileChest.getBlockState().getBlock(), 1, open ? 1 : 0);
}
}
use of net.minecraft.world.level.block.entity.EnderChestBlockEntity in project UltraCosmetics by iSach.
the class EntityUtil method playChestAnimation.
@Override
public void playChestAnimation(Block b, boolean open, TreasureChestDesign design) {
Location location = b.getLocation();
Level world = ((CraftWorld) location.getWorld()).getHandle();
BlockPos position = new BlockPos(location.getX(), location.getY(), location.getZ());
if (design.getChestType() == ChestType.ENDER) {
EnderChestBlockEntity tileChest = (EnderChestBlockEntity) world.getBlockEntity(position);
world.blockEvent(position, tileChest.getBlockState().getBlock(), 1, open ? 1 : 0);
} else {
ChestBlockEntity tileChest = (ChestBlockEntity) world.getBlockEntity(position);
world.blockEvent(position, tileChest.getBlockState().getBlock(), 1, open ? 1 : 0);
}
}
Aggregations