use of net.glowstone.net.message.play.entity.SpawnMobMessage in project Glowstone by GlowstoneMC.
the class GlowBat method createSpawnMessage.
@Override
public List<Message> createSpawnMessage() {
List<Message> result = new LinkedList<>();
// spawn mob
double x = location.getX();
double y = location.getY();
double z = location.getZ();
int yaw = Position.getIntYaw(location);
int pitch = Position.getIntPitch(location);
//TODO 1.9 - Real UUID
result.add(new SpawnMobMessage(id, UUID.randomUUID(), getType().getTypeId(), x, y, z, yaw, pitch, pitch, 0, 0, 0, metadata.getEntryList()));
// head facing
result.add(new EntityHeadRotationMessage(id, yaw));
return result;
}
use of net.glowstone.net.message.play.entity.SpawnMobMessage in project Glowstone by GlowstoneMC.
the class GlowCreature method createSpawnMessage.
@Override
public List<Message> createSpawnMessage() {
List<Message> result = new LinkedList<>();
// spawn mob
double x = location.getX();
double y = location.getY();
double z = location.getZ();
int yaw = Position.getIntYaw(location);
int pitch = Position.getIntPitch(location);
result.add(new SpawnMobMessage(id, getUniqueId(), type.getTypeId(), x, y, z, yaw, pitch, pitch, 0, 0, 0, metadata.getEntryList()));
// head facing
result.add(new EntityHeadRotationMessage(id, yaw));
//result.add(createEquipmentMessage());
return result;
}
use of net.glowstone.net.message.play.entity.SpawnMobMessage in project Glowstone by GlowstoneMC.
the class SpawnMobCodec method decode.
@Override
public SpawnMobMessage decode(ByteBuf buf) throws IOException {
int id = ByteBufUtils.readVarInt(buf);
UUID uuid = GlowBufUtils.readUuid(buf);
int type = ByteBufUtils.readVarInt(buf);
;
double x = buf.readDouble();
double y = buf.readDouble();
double z = buf.readDouble();
int headPitch = buf.readByte();
int pitch = buf.readByte();
int rotation = buf.readByte();
int velX = buf.readShort();
int velY = buf.readShort();
int velZ = buf.readShort();
List<Entry> list = GlowBufUtils.readMetadata(buf);
return new SpawnMobMessage(id, uuid, type, x, y, z, rotation, pitch, headPitch, velX, velY, velZ, list);
}
Aggregations