use of net.glowstone.block.data.states.StatefulBlockData in project Glowstone by GlowstoneMC.
the class GlowBlock method setData.
public void setData(byte data, boolean applyPhysics) {
byte oldData = getData();
((GlowChunk) world.getChunkAt(this)).setMetaData(x & 0xf, z & 0xf, y, data);
if (applyPhysics) {
applyPhysics(getType(), getType(), oldData, data);
}
GlowChunk.Key key = GlowChunk.Key.of(x >> 4, z >> 4);
BlockDataManager blockDataManager = ((GlowServer) Bukkit.getServer()).getBlockDataManager();
StatefulBlockData blockData = blockDataManager.createBlockData(getType());
BlockChangeMessage bcmsg = new BlockChangeMessage(x, y, z, blockDataManager.convertToBlockId(blockData), data);
world.broadcastBlockChangeInRange(key, bcmsg);
}
Aggregations