Java 类net.minecraft.network.play.server.SPacketEffect 实例源码

项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
public void handleEffect(SPacketEffect packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (packetIn.isSoundServerwide())
    {
        this.gameController.world.playBroadcastSound(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
    }
    else
    {
        this.gameController.world.playEvent(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
    }
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
public void handleEffect(SPacketEffect packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (packetIn.isSoundServerwide())
    {
        this.gameController.world.playBroadcastSound(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
    }
    else
    {
        this.gameController.world.playEvent(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
    }
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
public void handleEffect(SPacketEffect packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (packetIn.isSoundServerwide())
    {
        this.gameController.theWorld.playBroadcastSound(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
    }
    else
    {
        this.gameController.theWorld.playEvent(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
    }
}
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
public void handleEffect(SPacketEffect packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (packetIn.isSoundServerwide())
    {
        this.gameController.theWorld.playBroadcastSound(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
    }
    else
    {
        this.gameController.theWorld.playEvent(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
    }
}
项目:Zombe-Modpack    文件:EntityPlayerMP.java   
@Nullable
public Entity changeDimension(int dimensionIn)
{
    this.invulnerableDimensionChange = true;

    if (this.dimension == 1 && dimensionIn == 1)
    {
        this.world.removeEntity(this);

        if (!this.playerConqueredTheEnd)
        {
            this.playerConqueredTheEnd = true;

            if (this.hasAchievement(AchievementList.THE_END2))
            {
                this.connection.sendPacket(new SPacketChangeGameState(4, 0.0F));
            }
            else
            {
                this.addStat(AchievementList.THE_END2);
                this.connection.sendPacket(new SPacketChangeGameState(4, 1.0F));
            }
        }

        return this;
    }
    else
    {
        if (this.dimension == 0 && dimensionIn == 1)
        {
            this.addStat(AchievementList.THE_END);
            dimensionIn = 1;
        }
        else
        {
            this.addStat(AchievementList.PORTAL);
        }

        this.mcServer.getPlayerList().changePlayerDimension(this, dimensionIn);
        this.connection.sendPacket(new SPacketEffect(1032, BlockPos.ORIGIN, 0, false));
        this.lastExperience = -1;
        this.lastHealth = -1.0F;
        this.lastFoodLevel = -1;
        return this;
    }
}
项目:Backmemed    文件:ServerWorldEventHandler.java   
public void playEvent(EntityPlayer player, int type, BlockPos blockPosIn, int data)
{
    this.mcServer.getPlayerList().sendToAllNearExcept(player, (double)blockPosIn.getX(), (double)blockPosIn.getY(), (double)blockPosIn.getZ(), 64.0D, this.theWorldServer.provider.getDimensionType().getId(), new SPacketEffect(type, blockPosIn, data, false));
}
项目:Backmemed    文件:ServerWorldEventHandler.java   
public void broadcastSound(int soundID, BlockPos pos, int data)
{
    this.mcServer.getPlayerList().sendPacketToAllPlayers(new SPacketEffect(soundID, pos, data, true));
}
项目:Backmemed    文件:EntityPlayerMP.java   
@Nullable
public Entity changeDimension(int dimensionIn)
{
    this.invulnerableDimensionChange = true;

    if (this.dimension == 1 && dimensionIn == 1)
    {
        this.world.removeEntity(this);

        if (!this.playerConqueredTheEnd)
        {
            this.playerConqueredTheEnd = true;

            if (this.hasAchievement(AchievementList.THE_END2))
            {
                this.connection.sendPacket(new SPacketChangeGameState(4, 0.0F));
            }
            else
            {
                this.addStat(AchievementList.THE_END2);
                this.connection.sendPacket(new SPacketChangeGameState(4, 1.0F));
            }
        }

        return this;
    }
    else
    {
        if (this.dimension == 0 && dimensionIn == 1)
        {
            this.addStat(AchievementList.THE_END);
            dimensionIn = 1;
        }
        else
        {
            this.addStat(AchievementList.PORTAL);
        }

        this.mcServer.getPlayerList().changePlayerDimension(this, dimensionIn);
        this.connection.sendPacket(new SPacketEffect(1032, BlockPos.ORIGIN, 0, false));
        this.lastExperience = -1;
        this.lastHealth = -1.0F;
        this.lastFoodLevel = -1;
        return this;
    }
}
项目:CustomWorldGen    文件:ServerWorldEventHandler.java   
public void playEvent(EntityPlayer player, int type, BlockPos blockPosIn, int data)
{
    this.mcServer.getPlayerList().sendToAllNearExcept(player, (double)blockPosIn.getX(), (double)blockPosIn.getY(), (double)blockPosIn.getZ(), 64.0D, this.theWorldServer.provider.getDimension(), new SPacketEffect(type, blockPosIn, data, false));
}
项目:CustomWorldGen    文件:ServerWorldEventHandler.java   
public void broadcastSound(int soundID, BlockPos pos, int data)
{
    this.mcServer.getPlayerList().sendPacketToAllPlayers(new SPacketEffect(soundID, pos, data, true));
}
项目:CustomWorldGen    文件:EntityPlayerMP.java   
@Nullable
public Entity changeDimension(int dimensionIn)
{
    if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, dimensionIn)) return this;
    this.invulnerableDimensionChange = true;

    if (this.dimension == 1 && dimensionIn == 1)
    {
        this.worldObj.removeEntity(this);

        if (!this.playerConqueredTheEnd)
        {
            this.playerConqueredTheEnd = true;

            if (this.hasAchievement(AchievementList.THE_END2))
            {
                this.connection.sendPacket(new SPacketChangeGameState(4, 0.0F));
            }
            else
            {
                this.addStat(AchievementList.THE_END2);
                this.connection.sendPacket(new SPacketChangeGameState(4, 1.0F));
            }
        }

        return this;
    }
    else
    {
        if (this.dimension == 0 && dimensionIn == 1)
        {
            this.addStat(AchievementList.THE_END);
            dimensionIn = 1;
        }
        else
        {
            this.addStat(AchievementList.PORTAL);
        }

        this.mcServer.getPlayerList().changePlayerDimension(this, dimensionIn);
        this.connection.sendPacket(new SPacketEffect(1032, BlockPos.ORIGIN, 0, false));
        this.lastExperience = -1;
        this.lastHealth = -1.0F;
        this.lastFoodLevel = -1;
        return this;
    }
}
项目:ExpandedRailsMod    文件:EntityPlayerMP.java   
@Nullable
public Entity changeDimension(int dimensionIn)
{
    if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, dimensionIn)) return this;
    this.invulnerableDimensionChange = true;

    if (this.dimension == 1 && dimensionIn == 1)
    {
        this.worldObj.removeEntity(this);

        if (!this.playerConqueredTheEnd)
        {
            this.playerConqueredTheEnd = true;

            if (this.hasAchievement(AchievementList.THE_END2))
            {
                this.connection.sendPacket(new SPacketChangeGameState(4, 0.0F));
            }
            else
            {
                this.addStat(AchievementList.THE_END2);
                this.connection.sendPacket(new SPacketChangeGameState(4, 1.0F));
            }
        }

        return this;
    }
    else
    {
        if (this.dimension == 0 && dimensionIn == 1)
        {
            this.addStat(AchievementList.THE_END);
            dimensionIn = 1;
        }
        else
        {
            this.addStat(AchievementList.PORTAL);
        }

        this.mcServer.getPlayerList().changePlayerDimension(this, dimensionIn);
        this.connection.sendPacket(new SPacketEffect(1032, BlockPos.ORIGIN, 0, false));
        this.lastExperience = -1;
        this.lastHealth = -1.0F;
        this.lastFoodLevel = -1;
        return this;
    }
}
项目:Backmemed    文件:INetHandlerPlayClient.java   
void handleEffect(SPacketEffect packetIn);
项目:CustomWorldGen    文件:INetHandlerPlayClient.java   
void handleEffect(SPacketEffect packetIn);