Search in sources :

Example 1 with CompoundTagBuilder

use of net.aufdemrand.denizen.nms.util.jnbt.CompoundTagBuilder in project Denizen-For-Bukkit by DenizenScript.

the class BlockData_v1_11_R1 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_11_R1) 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());
    }
}
Also used : TileEntity(net.minecraft.server.v1_11_R1.TileEntity) BlockPosition(net.minecraft.server.v1_11_R1.BlockPosition) CompoundTagBuilder(net.aufdemrand.denizen.nms.util.jnbt.CompoundTagBuilder)

Example 2 with CompoundTagBuilder

use of net.aufdemrand.denizen.nms.util.jnbt.CompoundTagBuilder 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());
    }
}
Also used : TileEntity(net.minecraft.server.v1_8_R3.TileEntity) BlockPosition(net.minecraft.server.v1_8_R3.BlockPosition) CompoundTagBuilder(net.aufdemrand.denizen.nms.util.jnbt.CompoundTagBuilder)

Example 3 with CompoundTagBuilder

use of net.aufdemrand.denizen.nms.util.jnbt.CompoundTagBuilder in project Denizen-For-Bukkit by DenizenScript.

the class BlockData_v1_10_R1 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_10_R1) 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());
    }
}
Also used : TileEntity(net.minecraft.server.v1_10_R1.TileEntity) BlockPosition(net.minecraft.server.v1_10_R1.BlockPosition) CompoundTagBuilder(net.aufdemrand.denizen.nms.util.jnbt.CompoundTagBuilder)

Example 4 with CompoundTagBuilder

use of net.aufdemrand.denizen.nms.util.jnbt.CompoundTagBuilder in project Denizen-For-Bukkit by DenizenScript.

the class BlockData_v1_9_R2 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_9_R2) 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());
    }
}
Also used : TileEntity(net.minecraft.server.v1_9_R2.TileEntity) BlockPosition(net.minecraft.server.v1_9_R2.BlockPosition) CompoundTagBuilder(net.aufdemrand.denizen.nms.util.jnbt.CompoundTagBuilder)

Aggregations

CompoundTagBuilder (net.aufdemrand.denizen.nms.util.jnbt.CompoundTagBuilder)4 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)1 TileEntity (net.minecraft.server.v1_10_R1.TileEntity)1 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)1 TileEntity (net.minecraft.server.v1_11_R1.TileEntity)1 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)1 TileEntity (net.minecraft.server.v1_8_R3.TileEntity)1 BlockPosition (net.minecraft.server.v1_9_R2.BlockPosition)1 TileEntity (net.minecraft.server.v1_9_R2.TileEntity)1