Search in sources :

Example 1 with CraftBlockState

use of org.bukkit.craftbukkit.v1_11_R1.block.CraftBlockState 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();
}
Also used : TileEntity(net.minecraft.server.v1_8_R3.TileEntity) CraftBlockState(org.bukkit.craftbukkit.v1_8_R3.block.CraftBlockState)

Example 2 with CraftBlockState

use of org.bukkit.craftbukkit.v1_11_R1.block.CraftBlockState 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();
}
Also used : TileEntity(net.minecraft.server.v1_9_R2.TileEntity) CraftBlockState(org.bukkit.craftbukkit.v1_9_R2.block.CraftBlockState)

Example 3 with CraftBlockState

use of org.bukkit.craftbukkit.v1_11_R1.block.CraftBlockState in project Denizen-For-Bukkit by DenizenScript.

the class BlockHelper_v1_10_R1 method setNbtData.

@Override
public void setNbtData(Block block, CompoundTag compoundTag) {
    TileEntity tileEntity = ((CraftBlockState) block.getState()).getTileEntity();
    if (tileEntity == null) {
        return;
    }
    tileEntity.a(((CompoundTag_v1_10_R1) compoundTag).toNMSTag());
    tileEntity.update();
}
Also used : TileEntity(net.minecraft.server.v1_10_R1.TileEntity) CraftBlockState(org.bukkit.craftbukkit.v1_10_R1.block.CraftBlockState)

Example 4 with CraftBlockState

use of org.bukkit.craftbukkit.v1_11_R1.block.CraftBlockState 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);
}
Also used : TileEntity(net.minecraft.server.v1_8_R3.TileEntity) CraftBlockState(org.bukkit.craftbukkit.v1_8_R3.block.CraftBlockState) NBTTagCompound(net.minecraft.server.v1_8_R3.NBTTagCompound)

Example 5 with CraftBlockState

use of org.bukkit.craftbukkit.v1_11_R1.block.CraftBlockState in project Denizen-For-Bukkit by DenizenScript.

the class BlockHelper_v1_11_R1 method setNbtData.

@Override
public void setNbtData(Block block, CompoundTag compoundTag) {
    TileEntity tileEntity = ((CraftBlockState) block.getState()).getTileEntity();
    if (tileEntity == null) {
        return;
    }
    tileEntity.a(((CompoundTag_v1_11_R1) compoundTag).toNMSTag());
    tileEntity.update();
}
Also used : TileEntity(net.minecraft.server.v1_11_R1.TileEntity) CraftBlockState(org.bukkit.craftbukkit.v1_11_R1.block.CraftBlockState)

Aggregations

TileEntity (net.minecraft.server.v1_8_R3.TileEntity)2 CraftBlockState (org.bukkit.craftbukkit.v1_8_R3.block.CraftBlockState)2 TileEntity (net.minecraft.server.v1_10_R1.TileEntity)1 TileEntity (net.minecraft.server.v1_11_R1.TileEntity)1 NBTTagCompound (net.minecraft.server.v1_8_R3.NBTTagCompound)1 TileEntity (net.minecraft.server.v1_9_R2.TileEntity)1 CraftBlockState (org.bukkit.craftbukkit.v1_10_R1.block.CraftBlockState)1 CraftBlockState (org.bukkit.craftbukkit.v1_11_R1.block.CraftBlockState)1 CraftBlockState (org.bukkit.craftbukkit.v1_9_R2.block.CraftBlockState)1