Search in sources :

Example 1 with ClientboundGameEventPacket

use of net.minecraft.network.protocol.game.ClientboundGameEventPacket in project SpongeCommon by SpongePowered.

the class ServerPlayerMixin method impl$performGameWinLogic.

@SuppressWarnings("ConstantConditions")
@Override
protected final Entity impl$performGameWinLogic() {
    this.shadow$unRide();
    this.shadow$getLevel().removePlayerImmediately((net.minecraft.server.level.ServerPlayer) (Object) this);
    if (!this.wonGame) {
        this.wonGame = true;
        this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, this.seenCredits ? 0.0F : 1.0F));
        this.seenCredits = true;
    }
    return (Entity) (Object) this;
}
Also used : HumanEntity(org.spongepowered.common.entity.living.human.HumanEntity) LivingEntity(net.minecraft.world.entity.LivingEntity) Entity(net.minecraft.world.entity.Entity) ClientboundGameEventPacket(net.minecraft.network.protocol.game.ClientboundGameEventPacket)

Aggregations

ClientboundGameEventPacket (net.minecraft.network.protocol.game.ClientboundGameEventPacket)1 Entity (net.minecraft.world.entity.Entity)1 LivingEntity (net.minecraft.world.entity.LivingEntity)1 HumanEntity (org.spongepowered.common.entity.living.human.HumanEntity)1