• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CPacketClientStatus类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.network.play.client.CPacketClientStatus的典型用法代码示例。如果您正苦于以下问题:Java CPacketClientStatus类的具体用法?Java CPacketClientStatus怎么用?Java CPacketClientStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CPacketClientStatus类属于net.minecraft.network.play.client包,在下文中一共展示了CPacketClientStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initGui

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.screenTitle = I18n.format("gui.stats", new Object[0]);
    this.doesGuiPauseGame = true;
    this.mc.getConnection().sendPacket(new CPacketClientStatus(CPacketClientStatus.State.REQUEST_STATS));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:GuiStats.java


示例2: initGui

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.mc.getConnection().sendPacket(new CPacketClientStatus(CPacketClientStatus.State.REQUEST_STATS));
    this.buttonList.clear();
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0])));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:GuiAchievements.java


示例3: initGui

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
@Override
public void initGui() {
	this.mc.getConnection().sendPacket(new CPacketClientStatus(CPacketClientStatus.State.REQUEST_STATS));
	this.mc.player.getCapability(TF2weapons.PLAYER_CAP, null).newContracts=false;
	this.mc.player.getCapability(TF2weapons.PLAYER_CAP, null).newRewards=false;
	
	super.initGui();
	this.guiLeft=this.width/2-128;
	this.guiTop=this.height/2-108;
	this.buttonList.add(new GuiButton(0,this.guiLeft+7,this.guiTop+189,100,20,I18n.format("gui.contracts.accept")));
	this.buttonList.add(new GuiButton(1,this.guiLeft+107,this.guiTop+189,71,20,I18n.format("gui.contracts.reject")));
	this.buttonList.add(new GuiButton(2,this.guiLeft+178,this.guiTop+189,71,20,I18n.format("gui.done")));
	if(this.selectedContract != null) {
		this.buttonList.get(1).enabled=true;
		this.buttonList.get(0).enabled=!this.selectedContract.active || this.selectedContract.rewards>0;
		this.buttonList.get(0).displayString=I18n.format(this.selectedContract.active?"gui.contracts.claim":"gui.contracts.accept");
	}
	else {
		this.buttonList.get(1).enabled=false;
		this.buttonList.get(0).enabled=false;
		this.buttonList.get(0).displayString=I18n.format("gui.contracts.select");
	}
	for(int i=0;i<this.mc.player.getCapability(TF2weapons.PLAYER_CAP,null).contracts.size();i++) {
		Contract contract=this.mc.player.getCapability(TF2weapons.PLAYER_CAP,null).contracts.get(i);
		this.buttonList.add(new GuiButton(i+3,this.guiLeft+7,this.guiTop+16+i*20,74,20,I18n.format("gui.contracts."+contract.className, new Object[0])+": "+contract.progress+" CP"));
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:28,代码来源:GuiContracts.java


示例4: processClientStatus

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
/**
 * Processes the client status updates: respawn attempt from player, opening statistics or achievements, or
 * acquiring 'open inventory' achievement
 */
public void processClientStatus(CPacketClientStatus packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld());
    this.playerEntity.markPlayerActive();
    CPacketClientStatus.State cpacketclientstatus$state = packetIn.getStatus();

    switch (cpacketclientstatus$state)
    {
        case PERFORM_RESPAWN:

            if (this.playerEntity.playerConqueredTheEnd)
            {
                this.playerEntity.playerConqueredTheEnd = false;
                this.playerEntity = this.serverController.getPlayerList().recreatePlayerEntity(this.playerEntity, 0, true);
            }
            else
            {
                if (this.playerEntity.getHealth() > 0.0F)
                {
                    return;
                }

                this.playerEntity = this.serverController.getPlayerList().recreatePlayerEntity(this.playerEntity, playerEntity.dimension, false);

                if (this.serverController.isHardcore())
                {
                    this.playerEntity.setGameType(GameType.SPECTATOR);
                    this.playerEntity.getServerWorld().getGameRules().setOrCreateGameRule("spectatorsGenerateChunks", "false");
                }
            }

            break;
        case REQUEST_STATS:
            this.playerEntity.getStatFile().sendStats(this.playerEntity);
            break;
        case OPEN_INVENTORY_ACHIEVEMENT:
            this.playerEntity.addStat(AchievementList.OPEN_INVENTORY);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:44,代码来源:NetHandlerPlayServer.java


示例5: initGui

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.mc.getConnection().sendPacket(new CPacketClientStatus(CPacketClientStatus.State.REQUEST_STATS));
    this.buttonList.clear();
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0])));
    this.buttonList.add(button = new GuiButton(2, (width - imageWidth) / 2 + 24, height / 2 + 74, 125, 20, net.minecraftforge.common.AchievementPage.getTitle(currentPage)));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:GuiAchievements.java


示例6: processClientStatus

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
/**
 * Processes the client status updates: respawn attempt from player, opening statistics or achievements, or
 * acquiring 'open inventory' achievement
 */
public void processClientStatus(CPacketClientStatus packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld());
    this.playerEntity.markPlayerActive();
    CPacketClientStatus.State cpacketclientstatus$state = packetIn.getStatus();

    switch (cpacketclientstatus$state)
    {
        case PERFORM_RESPAWN:
            if (this.playerEntity.playerConqueredTheEnd)
            {
                this.playerEntity.playerConqueredTheEnd = false;
                this.playerEntity = this.serverController.getPlayerList().recreatePlayerEntity(this.playerEntity, 0, true);
            }
            else
            {
                if (this.playerEntity.getHealth() > 0.0F)
                {
                    return;
                }

                this.playerEntity = this.serverController.getPlayerList().recreatePlayerEntity(this.playerEntity, 0, false);

                if (this.serverController.isHardcore())
                {
                    this.playerEntity.setGameType(GameType.SPECTATOR);
                    this.playerEntity.getServerWorld().getGameRules().setOrCreateGameRule("spectatorsGenerateChunks", "false");
                }
            }

            break;

        case REQUEST_STATS:
            this.playerEntity.getStatFile().sendStats(this.playerEntity);
            break;

        case OPEN_INVENTORY_ACHIEVEMENT:
            this.playerEntity.addStat(AchievementList.OPEN_INVENTORY);
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:45,代码来源:NetHandlerPlayServer.java


示例7: respawnPlayer

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
public void respawnPlayer()
{
    this.connection.sendPacket(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:5,代码来源:EntityPlayerSP.java


示例8: handleChangeGameState

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
public void handleChangeGameState(SPacketChangeGameState packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.player;
    int i = packetIn.getGameState();
    float f = packetIn.getValue();
    int j = MathHelper.floor(f + 0.5F);

    if (i >= 0 && i < SPacketChangeGameState.MESSAGE_NAMES.length && SPacketChangeGameState.MESSAGE_NAMES[i] != null)
    {
        entityplayer.addChatComponentMessage(new TextComponentTranslation(SPacketChangeGameState.MESSAGE_NAMES[i], new Object[0]), false);
    }

    if (i == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.gameController.playerController.setGameType(GameType.getByID(j));
    }
    else if (i == 4)
    {
        if (j == 0)
        {
            this.gameController.player.connection.sendPacket(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
            this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
        }
        else if (j == 1)
        {
            this.gameController.displayGuiScreen(new GuiWinGame());
        }
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (f == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.movement", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}));
        }
        else if (f == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}));
        }
        else if (f == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}));
        }
    }
    else if (i == 6)
    {
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY + (double)entityplayer.getEyeHeight(), entityplayer.posZ, SoundEvents.ENTITY_ARROW_HIT_PLAYER, SoundCategory.PLAYERS, 0.18F, 0.45F);
    }
    else if (i == 7)
    {
        this.clientWorldController.setRainStrength(f);
    }
    else if (i == 8)
    {
        this.clientWorldController.setThunderStrength(f);
    }
    else if (i == 10)
    {
        this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY, entityplayer.posZ, SoundEvents.ENTITY_ELDER_GUARDIAN_CURSE, SoundCategory.HOSTILE, 1.0F, 1.0F);
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:79,代码来源:NetHandlerPlayClient.java


示例9: sendRespawnPacket

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
private void sendRespawnPacket()
{
    this.mc.player.connection.sendPacket(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
    this.mc.displayGuiScreen((GuiScreen)null);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:GuiWinGame.java


示例10: handleChangeGameState

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
public void handleChangeGameState(SPacketChangeGameState packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;
    int i = packetIn.getGameState();
    float f = packetIn.getValue();
    int j = MathHelper.floor_float(f + 0.5F);

    if (i >= 0 && i < SPacketChangeGameState.MESSAGE_NAMES.length && SPacketChangeGameState.MESSAGE_NAMES[i] != null)
    {
        entityplayer.addChatComponentMessage(new TextComponentTranslation(SPacketChangeGameState.MESSAGE_NAMES[i], new Object[0]));
    }

    if (i == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.gameController.playerController.setGameType(GameType.getByID(j));
    }
    else if (i == 4)
    {
        if (j == 0)
        {
            this.gameController.thePlayer.connection.sendPacket(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
            this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
        }
        else if (j == 1)
        {
            this.gameController.displayGuiScreen(new GuiWinGame());
        }
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (f == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.movement", new Object[] {gamesettings.keyBindForward.getDisplayName(), gamesettings.keyBindLeft.getDisplayName(), gamesettings.keyBindBack.getDisplayName(), gamesettings.keyBindRight.getDisplayName()}));
        }
        else if (f == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.jump", new Object[] {gamesettings.keyBindJump.getDisplayName()}));
        }
        else if (f == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.inventory", new Object[] {gamesettings.keyBindInventory.getDisplayName()}));
        }
    }
    else if (i == 6)
    {
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY + (double)entityplayer.getEyeHeight(), entityplayer.posZ, SoundEvents.ENTITY_ARROW_HIT_PLAYER, SoundCategory.PLAYERS, 0.18F, 0.45F);
    }
    else if (i == 7)
    {
        this.clientWorldController.setRainStrength(f);
    }
    else if (i == 8)
    {
        this.clientWorldController.setThunderStrength(f);
    }
    else if (i == 10)
    {
        this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY, entityplayer.posZ, SoundEvents.ENTITY_ELDER_GUARDIAN_CURSE, SoundCategory.HOSTILE, 1.0F, 1.0F);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:79,代码来源:NetHandlerPlayClient.java


示例11: sendRespawnPacket

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
private void sendRespawnPacket()
{
    this.mc.thePlayer.connection.sendPacket(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
    this.mc.displayGuiScreen((GuiScreen)null);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:GuiWinGame.java


示例12: processClientStatus

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
@Override
public void processClientStatus(CPacketClientStatus p_147342_1_) {
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:4,代码来源:FakeNetHandlerPlayServer.java


示例13: processClientStatus

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
@Override
public void processClientStatus(@Nonnull CPacketClientStatus p_147342_1_) {
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:4,代码来源:FakeNetHandlerPlayServer.java


示例14: processClientStatus

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
@Override
public void processClientStatus(CPacketClientStatus packetIn) {

}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:5,代码来源:NetServerHandlerFake.java


示例15: processClientStatus

import net.minecraft.network.play.client.CPacketClientStatus; //导入依赖的package包/类
/**
 * Processes the client status updates: respawn attempt from player, opening statistics or achievements, or
 * acquiring 'open inventory' achievement
 */
void processClientStatus(CPacketClientStatus packetIn);
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:INetHandlerPlayServer.java



注:本文中的net.minecraft.network.play.client.CPacketClientStatus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WebSocketFrameAggregator类代码示例发布时间:2022-05-23
下一篇:
Java StickyFeature类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap