Search in sources :

Example 1 with BlockEntityBeacon

use of cn.nukkit.blockentity.BlockEntityBeacon in project Nukkit by Nukkit.

the class BlockBeacon method place.

@Override
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {
    boolean blockSuccess = super.place(item, block, target, face, fx, fy, fz, player);
    if (blockSuccess) {
        CompoundTag nbt = new CompoundTag("").putString("id", BlockEntity.BEACON).putInt("x", (int) this.x).putInt("y", (int) this.y).putInt("z", (int) this.z);
        new BlockEntityBeacon(this.level.getChunk((int) this.x >> 4, (int) this.z >> 4), nbt);
    }
    return blockSuccess;
}
Also used : BlockEntityBeacon(cn.nukkit.blockentity.BlockEntityBeacon) CompoundTag(cn.nukkit.nbt.tag.CompoundTag)

Aggregations

BlockEntityBeacon (cn.nukkit.blockentity.BlockEntityBeacon)1 CompoundTag (cn.nukkit.nbt.tag.CompoundTag)1