use of net.minecraft.server.v1_16_R3.TileEntity in project WildChests by BG-Software-LLC.
the class NMSInventory_v1_8_R3 method removeTileEntity.
@Override
public void removeTileEntity(Chest chest) {
Location loc = chest.getLocation();
World world = ((CraftWorld) loc.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
TileEntity currentTileEntity = world.getTileEntity(blockPosition);
if (currentTileEntity instanceof TileEntityWildChest)
world.t(blockPosition);
}
use of net.minecraft.server.v1_16_R3.TileEntity in project WildChests by BG-Software-LLC.
the class NMSInventory_v1_12_R1 method removeTileEntity.
@Override
public void removeTileEntity(Chest chest) {
Location loc = chest.getLocation();
World world = ((CraftWorld) loc.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
TileEntity currentTileEntity = world.getTileEntity(blockPosition);
if (currentTileEntity instanceof TileEntityWildChest)
world.s(blockPosition);
}
use of net.minecraft.server.v1_16_R3.TileEntity in project WildChests by BG-Software-LLC.
the class NMSInventory_v1_12_R1 method updateTileEntity.
@Override
public void updateTileEntity(Chest chest) {
Location loc = chest.getLocation();
World world = ((CraftWorld) loc.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
TileEntity tileEntity = world.getTileEntity(blockPosition);
TileEntityWildChest tileEntityWildChest;
if (tileEntity instanceof TileEntityWildChest) {
tileEntityWildChest = (TileEntityWildChest) tileEntity;
((WChest) chest).setTileEntityContainer(tileEntityWildChest);
} else {
tileEntityWildChest = new TileEntityWildChest(chest, world, blockPosition);
}
world.setTileEntity(blockPosition, tileEntityWildChest);
}
use of net.minecraft.server.v1_16_R3.TileEntity in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_16_R3 method openWorkbench.
@Override
public void openWorkbench(Player player, Location loc, InventoryType type) {
TileInventory tileEntity = new TileInventory(new CustomTileEntityContainerWorkbench(this, loc), new ChatMessage("container.crafting", new Object[0]));
((CraftPlayer) player).getHandle().openContainer(tileEntity);
}
use of net.minecraft.server.v1_16_R3.TileEntity in project RoseStacker by Rosewood-Development.
the class NMSHandlerImpl method injectStackedSpawnerTile.
@Override
public StackedSpawnerTile injectStackedSpawnerTile(Object stackedSpawnerObj) {
StackedSpawner stackedSpawner = (StackedSpawner) stackedSpawnerObj;
Block block = stackedSpawner.getBlock();
WorldServer level = ((CraftWorld) block.getWorld()).getHandle();
TileEntity blockEntity = level.getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
if (blockEntity instanceof TileEntityMobSpawner) {
TileEntityMobSpawner spawnerBlockEntity = (TileEntityMobSpawner) blockEntity;
if (!(spawnerBlockEntity.getSpawner() instanceof StackedSpawnerTileImpl)) {
StackedSpawnerTile stackedSpawnerTile = new StackedSpawnerTileImpl(spawnerBlockEntity.getSpawner(), spawnerBlockEntity, stackedSpawner);
unsafe.putObject(spawnerBlockEntity, field_SpawnerBlockEntity_spawner_offset, stackedSpawnerTile);
return stackedSpawnerTile;
} else {
StackedSpawnerTileImpl spawnerTile = (StackedSpawnerTileImpl) spawnerBlockEntity.getSpawner();
spawnerTile.updateStackedSpawner(stackedSpawner);
return spawnerTile;
}
}
return null;
}
Aggregations