use of net.minecraft.server.v1_12_R1.TileEntityChest in project WildChests by BG-Software-LLC.
the class NMSAdapter_v1_12_R1 method playChestAction.
@Override
public void playChestAction(Location location, boolean open) {
World world = ((CraftWorld) location.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(location.getX(), location.getY(), location.getZ());
TileEntityChest tileChest = (TileEntityChest) world.getTileEntity(blockPosition);
if (tileChest != null)
world.playBlockAction(blockPosition, tileChest.getBlock(), 1, open ? 1 : 0);
}
use of net.minecraft.server.v1_12_R1.TileEntityChest in project SSB-OneBlock by BG-Software-LLC.
the class NMSAdapter_v1_15_R1 method setChestName.
@Override
public void setChestName(Location chest, String name) {
assert chest.getWorld() != null;
World world = ((CraftWorld) chest.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(chest.getBlockX(), chest.getBlockY(), chest.getBlockZ());
TileEntityChest tileEntityChest = (TileEntityChest) world.getTileEntity(blockPosition);
assert tileEntityChest != null;
tileEntityChest.setCustomName(CraftChatMessage.fromString(name)[0]);
}
use of net.minecraft.server.v1_12_R1.TileEntityChest in project SSB-OneBlock by BG-Software-LLC.
the class NMSAdapter_v1_8_R3 method setChestName.
@Override
public void setChestName(Location chest, String name) {
World world = ((CraftWorld) chest.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(chest.getBlockX(), chest.getBlockY(), chest.getBlockZ());
TileEntityChest tileEntityChest = (TileEntityChest) world.getTileEntity(blockPosition);
tileEntityChest.a(name);
}
use of net.minecraft.server.v1_12_R1.TileEntityChest in project solinia3-core by mixxit.
the class PatchUtils method listToInventory.
public Inventory listToInventory(NBTTagList nbttaglist) {
TileEntityChest tileentitychest = new TileEntityChest();
for (int i = 0; i < nbttaglist.size(); i++) {
NBTTagCompound nbttagcompound = (NBTTagCompound) nbttaglist.get(i);
int j = nbttagcompound.getByte("Slot") & 0xFF;
if (j >= 0 && j < 27) {
tileentitychest.setItem(j, net.minecraft.server.v1_15_R1.ItemStack.a(nbttagcompound));
}
}
return new CraftInventory(tileentitychest);
}
use of net.minecraft.server.v1_12_R1.TileEntityChest in project SSB-OneBlock by BG-Software-LLC.
the class NMSAdapter_v1_12_R1 method setChestName.
@Override
public void setChestName(Location chest, String name) {
World world = ((CraftWorld) chest.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(chest.getBlockX(), chest.getBlockY(), chest.getBlockZ());
TileEntityChest tileEntityChest = (TileEntityChest) world.getTileEntity(blockPosition);
assert tileEntityChest != null;
tileEntityChest.setCustomName(name);
}
Aggregations