use of net.minecraft.server.v1_14_R1.TileEntity in project Denizen-For-Bukkit by DenizenScript.
the class BlockHelper_v1_8_R3 method setNbtData.
@Override
public void setNbtData(Block block, CompoundTag compoundTag) {
TileEntity tileEntity = ((CraftBlockState) block.getState()).getTileEntity();
if (tileEntity == null) {
return;
}
tileEntity.a(((CompoundTag_v1_8_R3) compoundTag).toNMSTag());
tileEntity.update();
}
use of net.minecraft.server.v1_14_R1.TileEntity in project Denizen-For-Bukkit by DenizenScript.
the class BlockHelper_v1_9_R2 method setNbtData.
@Override
public void setNbtData(Block block, CompoundTag compoundTag) {
TileEntity tileEntity = ((CraftBlockState) block.getState()).getTileEntity();
if (tileEntity == null) {
return;
}
tileEntity.a(((CompoundTag_v1_9_R2) compoundTag).toNMSTag());
tileEntity.update();
}
use of net.minecraft.server.v1_14_R1.TileEntity in project Denizen-For-Bukkit by DenizenScript.
the class BlockData_v1_8_R3 method setBlock.
public void setBlock(Block block) {
block.setTypeIdAndData(material.getId(), (byte) data, false);
if (ctag != null) {
CompoundTagBuilder builder = ctag.createBuilder();
builder.putInt("x", block.getX());
builder.putInt("y", block.getY());
builder.putInt("z", block.getZ());
ctag = (CompoundTag_v1_8_R3) builder.build();
// TODO: make this work!
BlockPosition blockPos = new BlockPosition(block.getX(), block.getY(), block.getZ());
TileEntity te = ((CraftWorld) block.getWorld()).getHandle().getTileEntity(blockPos);
te.a(ctag.toNMSTag());
}
}
use of net.minecraft.server.v1_14_R1.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;
}
use of net.minecraft.server.v1_14_R1.TileEntity in project Denizen-For-Bukkit by DenizenScript.
the class BlockHelper_v1_8_R3 method getNbtData.
@Override
public CompoundTag getNbtData(Block block) {
TileEntity tileEntity = ((CraftBlockState) block.getState()).getTileEntity();
if (tileEntity == null) {
return null;
}
NBTTagCompound nbtTagCompound = new NBTTagCompound();
tileEntity.b(new NBTTagCompound());
return CompoundTag_v1_8_R3.fromNMSTag(nbtTagCompound);
}
Aggregations