use of cn.nukkit.network.protocol.BlockEntityDataPacket in project Nukkit by Nukkit.
the class BlockEntitySpawnable method spawnTo.
public void spawnTo(Player player) {
if (this.closed) {
return;
}
CompoundTag tag = this.getSpawnCompound();
BlockEntityDataPacket pk = new BlockEntityDataPacket();
pk.x = (int) this.x;
pk.y = (int) this.y;
pk.z = (int) this.z;
try {
pk.namedTag = NBTIO.write(tag, ByteOrder.LITTLE_ENDIAN, true);
} catch (IOException e) {
throw new RuntimeException(e);
}
player.dataPacket(pk);
}
Aggregations