use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSpawnMob in project LanternServer by LanternPowered.
the class CreatureEntityProtocol method spawn.
@Override
protected void spawn(EntityProtocolUpdateContext context) {
final Vector3d rot = this.entity.getRotation();
final Vector3d headRot = this.entity instanceof LanternLiving ? ((LanternLiving) this.entity).getHeadRotation() : null;
final Vector3d pos = this.entity.getPosition();
final Vector3d vel = this.entity.getVelocity();
final double yaw = rot.getY();
final double pitch = headRot != null ? headRot.getX() : rot.getX();
final double headYaw = headRot != null ? headRot.getY() : 0;
context.sendToAllExceptSelf(() -> new MessagePlayOutSpawnMob(getRootEntityId(), this.entity.getUniqueId(), getMobType(), pos, wrapAngle(yaw), wrapAngle(pitch), wrapAngle(headYaw), vel, fillParameters(true)));
spawnWithEquipment(context);
}
use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSpawnMob in project LanternServer by LanternPowered.
the class PlayerEntityProtocol method sendStackEntry.
private void sendStackEntry(EntityProtocolUpdateContext context, int index, int type) {
final ParameterList parameterList = new ByteBufParameterList(ByteBufferAllocator.unpooled());
parameterList.add(EntityParameters.Base.FLAGS, (byte) 0x20);
if (type == 55) {
parameterList.add(EntityParameters.AbstractSlime.SIZE, -1);
} else if (type == 101) {
parameterList.add(EntityParameters.Ageable.IS_BABY, true);
}
context.sendToAll(() -> new MessagePlayOutSpawnMob(this.passengerStack[index], UUID.randomUUID(), type, getEntity().getPosition(), (byte) 0, (byte) 0, (byte) 0, Vector3d.ZERO, parameterList));
}
Aggregations