use of net.glowstone.net.message.play.game.ExplosionMessage in project Glowstone by GlowstoneMC.
the class Explosion method playOutExplosion.
private void playOutExplosion(GlowPlayer player, Iterable<BlockVector> blocks) {
Collection<Record> records = new ArrayList<>();
for (BlockVector block : blocks) {
byte x = (byte) (block.getBlockX() - location.getBlockX());
byte y = (byte) (block.getBlockY() - location.getBlockY());
byte z = (byte) (block.getBlockZ() - location.getBlockZ());
records.add(new Record(x, y, z));
}
Vector velocity = player.getVelocity();
ExplosionMessage message = new ExplosionMessage((float) location.getX(), (float) location.getY(), (float) location.getZ(), power, (float) velocity.getX(), (float) velocity.getY(), (float) velocity.getZ(), records);
player.getSession().send(message);
}
Aggregations