use of net.minecraft.world.level.block.entity.TileEntity in project dynmap by webbukkit.
the class BukkitVersionHelperSpigot117 method readTileEntityNBT.
@Override
public Object readTileEntityNBT(Object te) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = new NBTTagCompound();
// readNBT
tileent.save(nbt);
return nbt;
}
use of net.minecraft.world.level.block.entity.TileEntity in project dynmap by webbukkit.
the class BukkitVersionHelperSpigot118 method readTileEntityNBT.
@Override
public Object readTileEntityNBT(Object te) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = tileent.n();
return nbt;
}
use of net.minecraft.world.level.block.entity.TileEntity in project dynmap by webbukkit.
the class BukkitVersionHelperSpigot118_2 method readTileEntityNBT.
@Override
public Object readTileEntityNBT(Object te) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = tileent.n();
return nbt;
}
use of net.minecraft.world.level.block.entity.TileEntity in project WildChests by BG-Software-LLC.
the class NMSInventory_v1_17_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.removeTileEntity(blockPosition);
world.setTileEntity(tileEntityWildChest);
Chunk chunk = world.getChunkAtWorldCoords(blockPosition);
world.a(CREATE_TICKING_BLOCK.invoke(chunk, tileEntityWildChest, tileEntityWildChest));
}
}
use of net.minecraft.world.level.block.entity.TileEntity in project WildChests by BG-Software-LLC.
the class NMSInventory_v1_17_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.removeTileEntity(blockPosition);
}
Aggregations