当前位置: 首页>>代码示例>>Java>>正文


Java C17PacketCustomPayload类代码示例

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


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

示例1: handleJoinGame

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
/**
 * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
public void handleJoinGame(S01PacketJoinGame packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
    this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
    this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.thePlayer.dimension = packetIn.getDimension();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
    this.gameController.thePlayer.setEntityId(packetIn.getEntityId());
    this.currentServerMaxPlayers = packetIn.getMaxPlayers();
    this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
    this.gameController.playerController.setGameType(packetIn.getGameType());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.sendPacket(new C17PacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:21,代码来源:NetHandlerPlayClient.java

示例2: handleJoinGame

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
/**
 * Registers some server properties
 * (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
public void handleJoinGame(S01PacketJoinGame packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
	this.clientWorldController = new WorldClient(this,
			new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(),
					packetIn.getWorldType()),
			packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
	this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
	this.gameController.loadWorld(this.clientWorldController);
	this.gameController.thePlayer.dimension = packetIn.getDimension();
	this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
	this.gameController.thePlayer.setEntityId(packetIn.getEntityId());
	this.currentServerMaxPlayers = packetIn.getMaxPlayers();
	this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
	this.gameController.playerController.setGameType(packetIn.getGameType());
	this.gameController.gameSettings.sendSettingsToServer();
	this.netManager.sendPacket(new C17PacketCustomPayload("MC|Brand",
			(new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:25,代码来源:NetHandlerPlayClient.java

示例3: channelRead0

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
@Override
protected void channelRead0(ChannelHandlerContext ctx, Packet msg) throws Exception
{
    boolean handled = false;
    if (msg instanceof C17PacketCustomPayload)
    {
        handled = handleServerSideCustomPacket((C17PacketCustomPayload) msg, ctx);
    }
    else if (msg instanceof S3FPacketCustomPayload)
    {
        handled = handleClientSideCustomPacket((S3FPacketCustomPayload)msg, ctx);
    }
    else if (state != ConnectionState.CONNECTED && state != ConnectionState.HANDSHAKECOMPLETE)
    {
        handled = handleVanilla(msg);
    }
    if (!handled)
    {
        ctx.fireChannelRead(msg);
    }
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:22,代码来源:NetworkDispatcher.java

示例4: syncGlidingCLIENT

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
public void syncGlidingCLIENT(int type, String name){ /*0 - add, 1 - remove*/
	PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
	try {
		pb.writeInt("gliderdata".getBytes().length);
		pb.writeBytes("gliderdata".getBytes());
		pb.writeInt(type);
		pb.writeInt(name.getBytes().length);
		pb.writeBytes(name.getBytes());
	} catch (Exception ex) {
		ex.printStackTrace();
	}

	C17PacketCustomPayload packet = new C17PacketCustomPayload("AvatarMisc", pb);

	Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(packet);
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:17,代码来源:Data.java

示例5: sendState

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
private static void sendState(int state){
	PacketBuffer pb = new PacketBuffer(Unpooled.buffer());
	try {
		pb.writeInt("keyInput".getBytes().length);
		pb.writeBytes("keyInput".getBytes());
		pb.writeInt(state);
		pb.writeInt(Minecraft.getMinecraft().thePlayer.getDisplayName().getBytes().length);
		pb.writeBytes(Minecraft.getMinecraft().thePlayer.getDisplayName().getBytes());
	} catch (Exception ex) {
		ex.printStackTrace();
	}
	
	C17PacketCustomPayload packet = new C17PacketCustomPayload("AvatarMisc", pb);
	
	Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(packet);
}
 
开发者ID:kieranvs,项目名称:Blockbender,代码行数:17,代码来源:FlightKeyController.java

示例6: sendSlotContents

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
/**
 * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual
 * contents of that slot. Args: Container, slot number, slot contents
 */
@Override
public void sendSlotContents(Container container, int updateID, ItemStack itemStack)
{
    if (updateID == 0)
    {
        this.itemNameField.setText(itemStack == null ? "" : itemStack.getDisplayName());
        this.itemNameField.setEnabled(itemStack != null); //set enabled

        if (itemStack != null)
        {
            this.repairContainer.updateItemName(this.itemNameField.getText());
            mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("MC|ItemName", itemNameField.getText().getBytes(Charsets.UTF_8)));
        }
    }
}
 
开发者ID:vdvman1,项目名称:betterAnvil-forge,代码行数:20,代码来源:GuiRepairBA.java

示例7: renameItem

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
private void renameItem()
{
    String s = this.nameField.getText();
    Slot slot = this.anvil.getSlot(0);

    if (slot != null && slot.getHasStack() && !slot.getStack().hasDisplayName() && s.equals(slot.getStack().getDisplayName()))
    {
        s = "";
    }

    this.anvil.updateItemName(s);
    this.mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("MC|ItemName", (new PacketBuffer(Unpooled.buffer())).writeString(s)));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:GuiRepair.java

示例8: actionPerformed

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    boolean flag = false;

    if (button == this.nextButton)
    {
        ++this.selectedMerchantRecipe;
        MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

        if (merchantrecipelist != null && this.selectedMerchantRecipe >= merchantrecipelist.size())
        {
            this.selectedMerchantRecipe = merchantrecipelist.size() - 1;
        }

        flag = true;
    }
    else if (button == this.previousButton)
    {
        --this.selectedMerchantRecipe;

        if (this.selectedMerchantRecipe < 0)
        {
            this.selectedMerchantRecipe = 0;
        }

        flag = true;
    }

    if (flag)
    {
        ((ContainerMerchant)this.inventorySlots).setCurrentRecipeIndex(this.selectedMerchantRecipe);
        PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
        packetbuffer.writeInt(this.selectedMerchantRecipe);
        this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload("MC|TrSel", packetbuffer));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:GuiMerchant.java

示例9: actionPerformed

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.enabled)
    {
        if (button.id == 1)
        {
            this.localCommandBlock.setTrackOutput(this.field_175389_t);
            this.mc.displayGuiScreen((GuiScreen)null);
        }
        else if (button.id == 0)
        {
            PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
            packetbuffer.writeByte(this.localCommandBlock.func_145751_f());
            this.localCommandBlock.func_145757_a(packetbuffer);
            packetbuffer.writeString(this.commandTextField.getText());
            packetbuffer.writeBoolean(this.localCommandBlock.shouldTrackOutput());
            this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload("MC|AdvCdm", packetbuffer));

            if (!this.localCommandBlock.shouldTrackOutput())
            {
                this.localCommandBlock.setLastOutput((IChatComponent)null);
            }

            this.mc.displayGuiScreen((GuiScreen)null);
        }
        else if (button.id == 4)
        {
            this.localCommandBlock.setTrackOutput(!this.localCommandBlock.shouldTrackOutput());
            this.func_175388_a();
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:36,代码来源:GuiCommandBlock.java

示例10: sendToServer

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
public static void sendToServer(RewiModPacket packet) {
	ByteArrayDataOutput output = ByteStreams.newDataOutput();
	output.write(packetRegistry.getIdByPacket(packet.getClass()));
	packet.write(output);
	ByteBuf byteBuf = Unpooled.buffer();
	byteBuf.writeBytes(output.toByteArray());
	C17PacketCustomPayload p = new C17PacketCustomPayload("RewiMod", new PacketBuffer(byteBuf));
	Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(p);
}
 
开发者ID:CreepPlaysDE,项目名称:RewiMod,代码行数:10,代码来源:RewiMod.java

示例11: renameItem

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
public void renameItem() {
	String s = this.nameField.getText();
	Slot slot = this.anvil.getSlot(0);

	if (slot != null && slot.getHasStack() && !slot.getStack().hasDisplayName() && s.equals(slot.getStack().getDisplayName())) {
		s = "";
	}

	this.anvil.updateItemName(s);
	this.mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("MC|ItemName", (new PacketBuffer(Unpooled.buffer())).writeString(s)));
}
 
开发者ID:HyCraftHD,项目名称:TeambattleMod,代码行数:12,代码来源:GuiTeambattleAnvil.java

示例12: make

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
private static Packet make(Side side, String channel) {
    if (FMLCommonHandler.instance().getSide() == Side.SERVER && side == Side.CLIENT) {
        return null;
    }
    if (side == Side.CLIENT) {
        return new C17PacketCustomPayload(channel, new PacketBuffer(Unpooled.buffer(0)));
    } else {
        return new S3FPacketCustomPayload(channel, new PacketBuffer(Unpooled.buffer(0)));
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:11,代码来源:PacketJunction.java

示例13: getChannel

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
public String getChannel(Packet packet) {
    if (packet instanceof C17PacketCustomPayload) {
        C17PacketCustomPayload p = (C17PacketCustomPayload) packet;
        return p.getChannelName();
    }
    return null;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:8,代码来源:HammerProxy.java

示例14: keyTyped

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
@Override
protected void keyTyped(char c, int i)
{
	if(itemNameField.textboxKeyTyped(c, i))
	{
		repairContainer.updateItemName(itemNameField.getText());
		mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("MC|ItemName", itemNameField.getText().getBytes()));
	}
	else {
		super.keyTyped(c, i);
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:13,代码来源:GuiRobitRepair.java

示例15: sendSlotContents

import net.minecraft.network.play.client.C17PacketCustomPayload; //导入依赖的package包/类
@Override
public void sendSlotContents(Container container, int slotID, ItemStack itemstack)
{
	if(slotID == 0)
	{
		itemNameField.setText(itemstack == null ? "" : itemstack.getDisplayName());
		itemNameField.setEnabled(itemstack != null);

		if(itemstack != null)
		{
			repairContainer.updateItemName(itemNameField.getText());
			mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("MC|ItemName", itemNameField.getText().getBytes(Charsets.UTF_8)));
		}
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:16,代码来源:GuiRobitRepair.java


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