Search in sources :

Example 1 with MessagePlayOutEntityMetadata

use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata in project LanternServer by LanternPowered.

the class EntityProtocol method update.

@Override
protected void update(EntityProtocolUpdateContext context) {
    final Vector3d rot = this.entity.getRotation();
    final Vector3d headRot = this.entity instanceof Living ? ((Living) this.entity).getHeadRotation() : null;
    final Vector3d pos = this.entity.getPosition();
    final double x = pos.getX();
    final double y = pos.getY();
    final double z = pos.getZ();
    final long xu = (long) (x * 4096);
    final long yu = (long) (y * 4096);
    final long zu = (long) (z * 4096);
    final byte yaw = wrapAngle(rot.getY());
    // All living entities have a head rotation and changing the pitch
    // would only affect the head pitch.
    final byte pitch = wrapAngle((headRot != null ? headRot : rot).getX());
    boolean dirtyPos = xu != this.lastX || yu != this.lastY || zu != this.lastZ;
    boolean dirtyRot = yaw != this.lastYaw || pitch != this.lastPitch;
    // TODO: On ground state
    final int entityId = getRootEntityId();
    final boolean passenger = this.entity.getVehicle().isPresent();
    if (dirtyRot) {
        this.lastYaw = yaw;
        this.lastPitch = pitch;
    }
    if (dirtyPos) {
        final long dxu = xu - this.lastX;
        final long dyu = yu - this.lastY;
        final long dzu = zu - this.lastZ;
        this.lastX = xu;
        this.lastY = yu;
        this.lastZ = zu;
        // rule the world.
        if (!passenger) {
            if (Math.abs(dxu) <= Short.MAX_VALUE && Math.abs(dyu) <= Short.MAX_VALUE && Math.abs(dzu) <= Short.MAX_VALUE) {
                if (dirtyRot) {
                    context.sendToAllExceptSelf(new MessagePlayOutEntityLookAndRelativeMove(entityId, (int) dxu, (int) dyu, (int) dzu, yaw, pitch, this.entity.isOnGround()));
                    // The rotation is already send
                    dirtyRot = false;
                } else {
                    context.sendToAllExceptSelf(new MessagePlayOutEntityRelativeMove(entityId, (int) dxu, (int) dyu, (int) dzu, this.entity.isOnGround()));
                }
            } else {
                context.sendToAllExceptSelf(new MessagePlayOutEntityTeleport(entityId, x, y, z, yaw, pitch, this.entity.isOnGround()));
                // The rotation is already send
                dirtyRot = false;
            }
        }
    }
    if (dirtyRot) {
        context.sendToAllExceptSelf(() -> new MessagePlayOutEntityLook(entityId, yaw, pitch, this.entity.isOnGround()));
    } else if (!passenger) {
        if (headRot != null) {
            final byte headYaw = wrapAngle(headRot.getY());
            if (headYaw != this.lastHeadYaw) {
                context.sendToAllExceptSelf(() -> new MessagePlayOutEntityHeadLook(entityId, headYaw));
                this.lastHeadYaw = headYaw;
            }
        }
    }
    final Vector3d velocity = this.entity.getVelocity();
    final double vx = velocity.getX();
    final double vy = velocity.getY();
    final double vz = velocity.getZ();
    if (vx != this.lastVelX || vy != this.lastVelY || vz != this.lastVelZ) {
        context.sendToAll(() -> new MessagePlayOutEntityVelocity(entityId, vx, vy, vz));
        this.lastVelX = vx;
        this.lastVelY = vy;
        this.lastVelZ = vz;
    }
    final ParameterList parameterList = context == EntityProtocolUpdateContext.empty() ? fillParameters(false, EmptyParameterList.INSTANCE) : fillParameters(false);
    // There were parameters applied
    if (!parameterList.isEmpty()) {
        context.sendToAll(() -> new MessagePlayOutEntityMetadata(entityId, parameterList));
    }
    if (hasEquipment() && this.entity instanceof Carrier) {
        final Inventory inventory = ((Carrier) this.entity).getInventory();
        for (int i = 0; i < Holder.EQUIPMENT_TYPES.length; i++) {
            final ItemStack itemStack = inventory.query(Holder.EQUIPMENT_QUERIES[i]).first().peek().orElse(null);
            final ItemStack oldItemStack = this.lastEquipment.get(i);
            if (!LanternItemStack.areSimilar(itemStack, oldItemStack)) {
                this.lastEquipment.put(i, itemStack);
                final int slotIndex = i;
                context.sendToAllExceptSelf(() -> new MessagePlayOutEntityEquipment(getRootEntityId(), slotIndex, itemStack));
            }
        }
    }
// TODO: Update attributes
}
Also used : MessagePlayOutEntityLookAndRelativeMove(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityLookAndRelativeMove) Living(org.spongepowered.api.entity.living.Living) LanternLiving(org.lanternpowered.server.entity.LanternLiving) MessagePlayOutEntityEquipment(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityEquipment) MessagePlayOutEntityRelativeMove(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityRelativeMove) Vector3d(com.flowpowered.math.vector.Vector3d) MessagePlayOutEntityLook(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityLook) MessagePlayOutEntityVelocity(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityVelocity) ParameterList(org.lanternpowered.server.network.entity.parameter.ParameterList) EmptyParameterList(org.lanternpowered.server.network.entity.parameter.EmptyParameterList) ByteBufParameterList(org.lanternpowered.server.network.entity.parameter.ByteBufParameterList) MessagePlayOutEntityMetadata(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata) MessagePlayOutEntityTeleport(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityTeleport) Carrier(org.spongepowered.api.item.inventory.Carrier) MessagePlayOutEntityHeadLook(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityHeadLook) ItemStack(org.spongepowered.api.item.inventory.ItemStack) LanternItemStack(org.lanternpowered.server.inventory.LanternItemStack) Inventory(org.spongepowered.api.item.inventory.Inventory)

Example 2 with MessagePlayOutEntityMetadata

use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata in project LanternServer by LanternPowered.

the class ObjectEntityProtocol method spawn.

@Override
protected void spawn(EntityProtocolUpdateContext context) {
    final int entityId = this.getRootEntityId();
    final Vector3d rot = this.entity.getRotation();
    final Vector3d pos = this.entity.getPosition();
    final Vector3d vel = this.entity.getVelocity();
    double yaw = rot.getY();
    double pitch = rot.getX();
    context.sendToAllExceptSelf(() -> new MessagePlayOutSpawnObject(entityId, this.entity.getUniqueId(), this.getObjectType(), this.getObjectData(), pos, wrapAngle(yaw), wrapAngle(pitch), vel));
    final ParameterList parameterList = this.fillParameters(true);
    if (!parameterList.isEmpty()) {
        context.sendToAll(() -> new MessagePlayOutEntityMetadata(entityId, parameterList));
    }
}
Also used : Vector3d(com.flowpowered.math.vector.Vector3d) ParameterList(org.lanternpowered.server.network.entity.parameter.ParameterList) MessagePlayOutEntityMetadata(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata) MessagePlayOutSpawnObject(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSpawnObject)

Example 3 with MessagePlayOutEntityMetadata

use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata in project LanternServer by LanternPowered.

the class PlayerEntityProtocol method spawn.

@Override
protected void spawn(EntityProtocolUpdateContext context) {
    super.spawn(context);
    context.sendToSelf(() -> new MessagePlayOutEntityMetadata(getRootEntityId(), fillParameters(true)));
    final GameMode gameMode = getEntity().get(Keys.GAME_MODE).get();
    context.sendToSelf(() -> new MessagePlayOutSetGameMode((LanternGameMode) gameMode));
    context.sendToSelf(() -> new MessagePlayOutPlayerAbilities(this.entity.get(Keys.IS_FLYING).orElse(false), canFly(), false, gameMode == GameModes.CREATIVE, getFlySpeed(), getFovModifier()));
    final TopHat topHat = getTopHat();
    if (topHat != null && !getEntity().get(Keys.INVISIBLE).get()) {
        sendPassengerStack(context);
        sendHat(context, topHat);
    }
}
Also used : MessagePlayOutSetGameMode(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSetGameMode) LanternGameMode(org.lanternpowered.server.entity.living.player.gamemode.LanternGameMode) GameMode(org.spongepowered.api.entity.living.player.gamemode.GameMode) TopHat(org.lanternpowered.server.extra.accessory.TopHat) MessagePlayOutSetGameMode(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSetGameMode) LanternGameMode(org.lanternpowered.server.entity.living.player.gamemode.LanternGameMode) MessagePlayOutEntityMetadata(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata) MessagePlayOutPlayerAbilities(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutPlayerAbilities)

Example 4 with MessagePlayOutEntityMetadata

use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata in project LanternServer by LanternPowered.

the class ProcessorPlayOutParticleEffect method preProcess.

private ICachedMessage preProcess(ParticleEffect effect0) {
    final LanternParticleEffect effect = (LanternParticleEffect) effect0;
    final LanternParticleType type = effect.getType();
    final OptionalInt internalType = type.getInternalType();
    // Special cases
    if (!internalType.isPresent()) {
        if (type == ParticleTypes.FIREWORKS) {
            // Create the fireworks data item
            final LanternItemStack itemStack = new LanternItemStack(ItemTypes.FIREWORKS);
            itemStack.tryOffer(Keys.FIREWORK_EFFECTS, effect.getOptionOrDefault(ParticleOptions.FIREWORK_EFFECTS).get());
            // Write the item to a parameter list
            final ByteBufParameterList parameterList = new ByteBufParameterList(ByteBufferAllocator.unpooled());
            parameterList.add(EntityParameters.Fireworks.ITEM, itemStack);
            return new CachedFireworksMessage(new MessagePlayOutEntityMetadata(CachedFireworksMessage.ENTITY_ID, parameterList));
        } else if (type == ParticleTypes.FERTILIZER) {
            final int quantity = effect.getOptionOrDefault(ParticleOptions.QUANTITY).get();
            return new CachedEffectMessage(2005, quantity, false);
        } else if (type == ParticleTypes.SPLASH_POTION) {
            final int potionId = this.potionEffectTypeToId.getInt(effect.getOptionOrDefault(ParticleOptions.POTION_EFFECT_TYPE).get());
            return new CachedEffectMessage(2002, potionId, false);
        } else if (type == ParticleTypes.BREAK_BLOCK) {
            final int state = getBlockState(effect, type.getDefaultOption(ParticleOptions.BLOCK_STATE));
            if (state == 0) {
                return EmptyCachedMessage.INSTANCE;
            }
            return new CachedEffectMessage(2001, state, false);
        } else if (type == ParticleTypes.MOBSPAWNER_FLAMES) {
            return new CachedEffectMessage(2004, 0, false);
        } else if (type == ParticleTypes.ENDER_TELEPORT) {
            return new CachedEffectMessage(2003, 0, false);
        } else if (type == ParticleTypes.DRAGON_BREATH_ATTACK) {
            return new CachedEffectMessage(2006, 0, false);
        } else if (type == ParticleTypes.FIRE_SMOKE) {
            final Direction direction = effect.getOptionOrDefault(ParticleOptions.DIRECTION).get();
            return new CachedEffectMessage(2000, getDirectionData(direction), false);
        }
        return EmptyCachedMessage.INSTANCE;
    }
    final int internalId = internalType.getAsInt();
    final Vector3f offset = effect.getOption(ParticleOptions.OFFSET).map(Vector3d::toFloat).orElse(Vector3f.ZERO);
    final int quantity = effect.getOption(ParticleOptions.QUANTITY).orElse(1);
    int[] extra = null;
    // The extra values, normal behavior offsetX, offsetY, offsetZ
    double f0 = 0f;
    double f1 = 0f;
    double f2 = 0f;
    // Depends on behavior
    // Note: If the count > 0 -> speed = 0f else if count = 0 -> speed = 1f
    final Optional<BlockState> defaultBlockState;
    if (type != ParticleTypes.ITEM_CRACK && (defaultBlockState = type.getDefaultOption(ParticleOptions.BLOCK_STATE)).isPresent()) {
        final int state = getBlockState(effect, defaultBlockState);
        if (state == 0) {
            return EmptyCachedMessage.INSTANCE;
        }
        extra = new int[] { state };
    }
    final Optional<ItemStackSnapshot> defaultItemStackSnapshot;
    if (extra == null && (defaultItemStackSnapshot = type.getDefaultOption(ParticleOptions.ITEM_STACK_SNAPSHOT)).isPresent()) {
        final Optional<ItemStackSnapshot> optItemStackSnapshot = effect.getOption(ParticleOptions.ITEM_STACK_SNAPSHOT);
        if (optItemStackSnapshot.isPresent()) {
            extra = toExtraItemData(optItemStackSnapshot.get().createStack());
        } else {
            final Optional<BlockState> optBlockState = effect.getOption(ParticleOptions.BLOCK_STATE);
            if (optBlockState.isPresent()) {
                final BlockState blockState = optBlockState.get();
                final Optional<ItemType> optItemType = blockState.getType().getItem();
                if (optItemType.isPresent()) {
                    // TODO: Item damage value
                    extra = new int[] { ItemRegistryModule.get().getInternalId(optItemType.get()), 0 };
                } else {
                    return EmptyCachedMessage.INSTANCE;
                }
            } else {
                extra = toExtraItemData(defaultItemStackSnapshot.get().createStack());
            }
        }
    }
    if (extra == null) {
        extra = new int[0];
    }
    final Optional<Double> defaultScale = type.getDefaultOption(ParticleOptions.SCALE);
    final Optional<Color> defaultColor;
    final Optional<NotePitch> defaultNote;
    final Optional<Vector3d> defaultVelocity;
    if (defaultScale.isPresent()) {
        double scale = effect.getOption(ParticleOptions.SCALE).orElse(defaultScale.get());
        // Server formula: sizeServer = (-sizeClient * 2) + 2
        if (type == ParticleTypes.LARGE_EXPLOSION || type == ParticleTypes.SWEEP_ATTACK) {
            scale = (-scale * 2f) + 2f;
        }
        if (scale == 0f) {
            return new CachedParticleMessage(internalId, offset, quantity, extra);
        }
        f0 = scale;
    } else if ((defaultColor = type.getDefaultOption(ParticleOptions.COLOR)).isPresent()) {
        final boolean isSpell = type == ParticleTypes.MOB_SPELL || type == ParticleTypes.AMBIENT_MOB_SPELL;
        Color color = effect.getOption(ParticleOptions.COLOR).orElse(null);
        if (!isSpell && (color == null || color.equals(defaultColor.get()))) {
            return new CachedParticleMessage(internalId, offset, quantity, extra);
        } else if (isSpell && color == null) {
            color = defaultColor.get();
        }
        f0 = color.getRed() / 255f;
        f1 = color.getGreen() / 255f;
        f2 = color.getBlue() / 255f;
        // but we already chose for the color, can't have both
        if (isSpell) {
            f0 = Math.max(f0, 0.001f);
            f2 = Math.max(f0, 0.001f);
        }
        // If the f0 value 0 is, the redstone will set it automatically to red 255
        if (f0 == 0f && type == ParticleTypes.REDSTONE_DUST) {
            f0 = 0.00001f;
        }
    } else if ((defaultNote = type.getDefaultOption(ParticleOptions.NOTE)).isPresent()) {
        final NotePitch notePitch = effect.getOption(ParticleOptions.NOTE).orElse(defaultNote.get());
        final float note = ((LanternNotePitch) notePitch).getInternalId();
        if (note == 0f) {
            return new CachedParticleMessage(internalId, offset, quantity, extra);
        }
        f0 = note / 24f;
    } else if ((defaultVelocity = type.getDefaultOption(ParticleOptions.VELOCITY)).isPresent()) {
        final Vector3d velocity = effect.getOption(ParticleOptions.VELOCITY).orElse(defaultVelocity.get());
        f0 = velocity.getX();
        f1 = velocity.getY();
        f2 = velocity.getZ();
        final Optional<Boolean> slowHorizontalVelocity = type.getDefaultOption(ParticleOptions.SLOW_HORIZONTAL_VELOCITY);
        if (slowHorizontalVelocity.isPresent() && effect.getOption(ParticleOptions.SLOW_HORIZONTAL_VELOCITY).orElse(slowHorizontalVelocity.get())) {
            f0 = 0f;
            f2 = 0f;
        }
        // The y value won't work for this effect, if the value isn't 0 the velocity won't work
        if (type == ParticleTypes.WATER_SPLASH) {
            f1 = 0f;
        }
        if (f0 == 0f && f1 == 0f && f2 == 0f) {
            return new CachedParticleMessage(internalId, offset, quantity, extra);
        }
    }
    // Is this check necessary?
    if (f0 == 0f && f1 == 0f && f2 == 0f) {
        return new CachedParticleMessage(internalId, offset, quantity, extra);
    }
    return new CachedOffsetParticleMessage(internalId, new Vector3f(f0, f1, f2), offset, quantity, extra);
}
Also used : ItemType(org.spongepowered.api.item.ItemType) LanternParticleEffect(org.lanternpowered.server.effect.particle.LanternParticleEffect) Direction(org.spongepowered.api.util.Direction) NotePitch(org.spongepowered.api.data.type.NotePitch) LanternNotePitch(org.lanternpowered.server.data.type.LanternNotePitch) ByteBufParameterList(org.lanternpowered.server.network.entity.parameter.ByteBufParameterList) Optional(java.util.Optional) Color(org.spongepowered.api.util.Color) OptionalInt(java.util.OptionalInt) LanternItemStack(org.lanternpowered.server.inventory.LanternItemStack) LanternNotePitch(org.lanternpowered.server.data.type.LanternNotePitch) BlockState(org.spongepowered.api.block.BlockState) Vector3d(com.flowpowered.math.vector.Vector3d) Vector3f(com.flowpowered.math.vector.Vector3f) MessagePlayOutEntityMetadata(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata) ItemStackSnapshot(org.spongepowered.api.item.inventory.ItemStackSnapshot) LanternParticleType(org.lanternpowered.server.effect.particle.LanternParticleType)

Example 5 with MessagePlayOutEntityMetadata

use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata in project LanternServer by LanternPowered.

the class PlayerEntityProtocol method update.

@Override
protected void update(EntityProtocolUpdateContext context) {
    final GameMode gameMode = this.entity.get(Keys.GAME_MODE).get();
    final boolean canFly = canFly();
    final float flySpeed = getFlySpeed();
    final float fieldOfView = getFovModifier();
    if (gameMode != this.lastGameMode) {
        context.sendToSelf(() -> new MessagePlayOutSetGameMode((LanternGameMode) gameMode));
        context.sendToSelf(() -> new MessagePlayOutPlayerAbilities(this.entity.get(Keys.IS_FLYING).orElse(false), canFly, false, gameMode == GameModes.CREATIVE, flySpeed, fieldOfView));
        this.lastGameMode = gameMode;
        this.lastCanFly = canFly;
        this.lastFlySpeed = flySpeed;
        this.lastFieldOfView = fieldOfView;
    } else if (canFly != this.lastCanFly || flySpeed != this.lastFlySpeed || fieldOfView != this.lastFieldOfView) {
        context.sendToSelf(() -> new MessagePlayOutPlayerAbilities(this.entity.get(Keys.IS_FLYING).orElse(false), canFly, false, gameMode == GameModes.CREATIVE, flySpeed, fieldOfView));
        this.lastCanFly = canFly;
        this.lastFlySpeed = flySpeed;
        this.lastFieldOfView = fieldOfView;
    }
    final float health = this.entity.get(Keys.HEALTH).get().floatValue();
    final int foodLevel = this.entity.get(Keys.FOOD_LEVEL).get();
    final float saturation = this.entity.get(Keys.SATURATION).get().floatValue();
    if (health != this.lastHealth || foodLevel != this.lastFoodLevel || saturation == 0.0f != this.lastHungry) {
        context.sendToSelf(() -> new MessagePlayOutPlayerHealthUpdate(health, foodLevel, saturation));
        this.lastHealth = health;
        this.lastFoodLevel = foodLevel;
        this.lastHungry = saturation == 0.0f;
    }
    super.update(context);
    final TopHat topHat = getTopHat();
    if (topHat != this.lastTopHat) {
        if (this.lastTopHat == null) {
            sendPassengerStack(context);
            sendHat(context, topHat);
        } else if (topHat == null) {
            removePassengerStack(context);
        } else {
            sendHat(context, topHat);
        }
        this.lastTopHat = topHat;
    }
    if (this.lastYaw0 != this.lastYaw || this.lastPitch0 != this.lastPitch || this.lastFlags0 != this.lastFlags) {
        for (final int id : this.passengerStack) {
            context.sendToSelf(() -> new MessagePlayOutEntityLook(id, this.lastYaw, this.lastPitch, this.entity.isOnGround()));
        }
        if (this.lastTopHat != null) {
            context.sendToSelf(() -> new MessagePlayOutEntityHeadLook(this.passengerStack[10], this.lastYaw));
            context.sendToSelf(() -> new MessagePlayOutEntityHeadLook(this.passengerStack[11], this.lastYaw));
            context.sendToSelf(() -> new MessagePlayOutEntityHeadLook(this.passengerStack[12], this.lastYaw));
            // context.sendToSelf(() -> new MessagePlayOutEntityHeadLook(this.passengerStack[14], this.lastYaw));
            if (this.lastFlags0 != this.lastFlags) {
                final boolean glow = (this.lastFlags & 0x40) != 0;
                final ParameterList parameterList = new ByteBufParameterList(ByteBufferAllocator.unpooled());
                parameterList.add(EntityParameters.Base.FLAGS, (byte) (0x20 | (glow ? 0x40 : 0x00)));
                context.sendToAll(() -> new MessagePlayOutEntityMetadata(this.passengerStack[10], parameterList));
                context.sendToAll(() -> new MessagePlayOutEntityMetadata(this.passengerStack[11], parameterList));
            }
        }
        this.lastYaw0 = this.lastYaw;
        this.lastPitch0 = this.lastPitch;
        this.lastFlags0 = this.lastFlags;
    }
    // Some 1.11.2 magic, ultra secret stuff...
    final boolean elytraFlying = this.entity.get(LanternKeys.IS_ELYTRA_FLYING).orElse(false);
    final boolean elytraSpeedBoost = this.entity.get(LanternKeys.ELYTRA_SPEED_BOOST).orElse(false);
    if (this.lastElytraFlying != elytraFlying || this.lastElytraSpeedBoost != elytraSpeedBoost) {
        if (this.lastElytraFlying && this.lastElytraSpeedBoost) {
            context.sendToAll(() -> new MessagePlayOutDestroyEntities(this.elytraRocketId));
        } else if (elytraFlying && elytraSpeedBoost) {
            // Create the fireworks data item
            final LanternItemStack itemStack = new LanternItemStack(ItemTypes.FIREWORKS);
            // Write the item to a parameter list
            final ByteBufParameterList parameterList = new ByteBufParameterList(ByteBufferAllocator.unpooled());
            parameterList.add(EntityParameters.Fireworks.ITEM, itemStack);
            parameterList.add(EntityParameters.Fireworks.ELYTRA_BOOST_PLAYER, getRootEntityId());
            context.sendToAll(() -> new MessagePlayOutSpawnObject(this.elytraRocketId, UUID.randomUUID(), 76, 0, this.entity.getPosition(), 0, 0, Vector3d.ZERO));
            context.sendToAll(() -> new MessagePlayOutEntityMetadata(this.elytraRocketId, parameterList));
        }
        this.lastElytraSpeedBoost = elytraSpeedBoost;
        this.lastElytraFlying = elytraFlying;
    }
}
Also used : TopHat(org.lanternpowered.server.extra.accessory.TopHat) ByteBufParameterList(org.lanternpowered.server.network.entity.parameter.ByteBufParameterList) LanternGameMode(org.lanternpowered.server.entity.living.player.gamemode.LanternGameMode) MessagePlayOutSpawnObject(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSpawnObject) LanternItemStack(org.lanternpowered.server.inventory.LanternItemStack) MessagePlayOutSetGameMode(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSetGameMode) LanternGameMode(org.lanternpowered.server.entity.living.player.gamemode.LanternGameMode) GameMode(org.spongepowered.api.entity.living.player.gamemode.GameMode) MessagePlayOutPlayerHealthUpdate(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutPlayerHealthUpdate) MessagePlayOutEntityLook(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityLook) MessagePlayOutSetGameMode(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSetGameMode) MessagePlayOutDestroyEntities(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutDestroyEntities) ParameterList(org.lanternpowered.server.network.entity.parameter.ParameterList) ByteBufParameterList(org.lanternpowered.server.network.entity.parameter.ByteBufParameterList) MessagePlayOutEntityMetadata(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata) MessagePlayOutPlayerAbilities(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutPlayerAbilities) MessagePlayOutEntityHeadLook(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityHeadLook)

Aggregations

MessagePlayOutEntityMetadata (org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityMetadata)6 LanternItemStack (org.lanternpowered.server.inventory.LanternItemStack)4 ByteBufParameterList (org.lanternpowered.server.network.entity.parameter.ByteBufParameterList)4 ParameterList (org.lanternpowered.server.network.entity.parameter.ParameterList)4 Vector3d (com.flowpowered.math.vector.Vector3d)3 MessagePlayOutSpawnObject (org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSpawnObject)3 LanternGameMode (org.lanternpowered.server.entity.living.player.gamemode.LanternGameMode)2 TopHat (org.lanternpowered.server.extra.accessory.TopHat)2 MessagePlayOutEntityEquipment (org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityEquipment)2 MessagePlayOutEntityHeadLook (org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityHeadLook)2 MessagePlayOutEntityLook (org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutEntityLook)2 MessagePlayOutPlayerAbilities (org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutPlayerAbilities)2 MessagePlayOutSetGameMode (org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSetGameMode)2 GameMode (org.spongepowered.api.entity.living.player.gamemode.GameMode)2 Vector3f (com.flowpowered.math.vector.Vector3f)1 Optional (java.util.Optional)1 OptionalInt (java.util.OptionalInt)1 LanternNotePitch (org.lanternpowered.server.data.type.LanternNotePitch)1 LanternParticleEffect (org.lanternpowered.server.effect.particle.LanternParticleEffect)1 LanternParticleType (org.lanternpowered.server.effect.particle.LanternParticleType)1