當前位置: 首頁>>代碼示例>>Java>>正文


Java NetHandlerPlayClient.addToSendQueue方法代碼示例

本文整理匯總了Java中net.minecraft.client.network.NetHandlerPlayClient.addToSendQueue方法的典型用法代碼示例。如果您正苦於以下問題:Java NetHandlerPlayClient.addToSendQueue方法的具體用法?Java NetHandlerPlayClient.addToSendQueue怎麽用?Java NetHandlerPlayClient.addToSendQueue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.network.NetHandlerPlayClient的用法示例。


在下文中一共展示了NetHandlerPlayClient.addToSendQueue方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onGuiClosed

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
/**
 * Called when the screen is unloaded. Used to disable keyboard repeat events
 */
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
    NetHandlerPlayClient nethandlerplayclient = this.mc.getNetHandler();

    if (nethandlerplayclient != null)
    {
        nethandlerplayclient.addToSendQueue(new C12PacketUpdateSign(this.tileSign.getPos(), this.tileSign.signText));
    }

    this.tileSign.setEditable(true);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:16,代碼來源:GuiEditSign.java

示例2: sendSign

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
public static void sendSign(final @Nonnull EntryId entryId, final @Nonnull TileEntitySign sourceentity) {
	entryId.toEntity(sourceentity);
	sourceentity.markDirty();
	final NetHandlerPlayClient nethandlerplayclient = Client.mc.getNetHandler();
	if (nethandlerplayclient!=null)
		nethandlerplayclient.addToSendQueue(new C12PacketUpdateSign(sourceentity.xCoord, sourceentity.yCoord, sourceentity.zCoord, sourceentity.signText));
	sourceentity.setEditable(true);
}
 
開發者ID:Team-Fruit,項目名稱:SignPicture,代碼行數:9,代碼來源:Sign.java

示例3: onUpdate

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
@Override
public void onUpdate() {
    if (WurstClient.INSTANCE.mods.getModByClass(YesCheatMod.class).isActive()) {
        NetHandlerPlayClient sendQueue = Minecraft.getMinecraft().thePlayer.sendQueue;
        sendQueue.addToSendQueue(
                new C0BPacketEntityAction(Minecraft.getMinecraft().thePlayer, Action.START_SNEAKING));
        sendQueue.addToSendQueue(
                new C0BPacketEntityAction(Minecraft.getMinecraft().thePlayer, Action.STOP_SNEAKING));
    } else {
        Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(
                new C0BPacketEntityAction(Minecraft.getMinecraft().thePlayer, Action.START_SNEAKING));
    }
}
 
開發者ID:null-dev,項目名稱:EvenWurse,代碼行數:14,代碼來源:SneakMod.java

示例4: onGuiClosed

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
/**
 * "Called when the screen is unloaded. Used to disable keyboard repeat events."
 */
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
    NetHandlerPlayClient var1 = this.mc.getNetHandler();

    if (var1 != null)
    {
        var1.addToSendQueue(new C12PacketUpdateSign(this.field_146848_f.field_145851_c, this.field_146848_f.field_145848_d, this.field_146848_f.field_145849_e, this.field_146848_f.field_145915_a));
    }

    this.field_146848_f.func_145913_a(true);
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:16,代碼來源:GuiEditSign.java

示例5: mineBlock

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
public void mineBlock(World world, int x, int y, int z, int meta, EntityPlayer player, Block block)
{
    // Workaround for dropping experience
    boolean silktouch = EnchantmentHelper.getSilkTouchModifier(player);
    int fortune = EnchantmentHelper.getFortuneModifier(player);
    int exp = block.getExpDrop(world, meta, fortune);

    block.onBlockHarvested(world, x, y, z, meta, player);
    if (block.removedByPlayer(world, player, x, y, z, true))
    {
        block.onBlockDestroyedByPlayer(world, x, y, z, meta);
        block.harvestBlock(world, player, x, y, z, meta);
        // Workaround for dropping experience
        if (!silktouch)
            block.dropXpOnBlockBreak(world, x, y, z, exp);

        if (world.isRemote)
        {
            INetHandler handler = FMLClientHandler.instance().getClientPlayHandler();
            if (handler != null && handler instanceof NetHandlerPlayClient)
            {
                NetHandlerPlayClient handlerClient = (NetHandlerPlayClient) handler;
                handlerClient.addToSendQueue(new C07PacketPlayerDigging(0, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit));
                handlerClient.addToSendQueue(new C07PacketPlayerDigging(2, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit));
            }
        }
    }
}
 
開發者ID:Wolfofthenyght,項目名稱:M4Armory,代碼行數:29,代碼來源:AOEHandler.java

示例6: mineBlock

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
public void mineBlock(World world, int x, int y, int z, int meta, EntityPlayer player, Block block)
{
    // Workaround for dropping experience
    boolean silktouch = EnchantmentHelper.getSilkTouchModifier(player);
    int fortune = EnchantmentHelper.getFortuneModifier(player);
    int exp = block.getExpDrop(world, meta, fortune);

    block.onBlockHarvested(world, x, y, z, meta, player);
    if (block.removedByPlayer(world, player, x, y, z, true))
    {
        block.onBlockDestroyedByPlayer(world, x, y, z, meta);
        block.harvestBlock(world, player, x, y, z, meta);
        // Workaround for dropping experience
        if (!silktouch)
            block.dropXpOnBlockBreak(world, x, y, z, exp);

        if (world.isRemote)
        {
            INetHandler handler = FMLClientHandler.instance().getClientPlayHandler();
            if (handler != null && handler instanceof NetHandlerPlayClient)
            {
                NetHandlerPlayClient handlerClient = (NetHandlerPlayClient) handler;
                handlerClient.addToSendQueue(new C07PacketPlayerDigging(0, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit));
                handlerClient.addToSendQueue(new C07PacketPlayerDigging(2, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit));
            }
        }
        else if (Config.noisyBlocks)
        {
            world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
        }
    }
}
 
開發者ID:wyldmods,項目名稱:ToolUtilities,代碼行數:33,代碼來源:AOEHandler.java

示例7: onGuiClosed

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
    NetHandlerPlayClient nethandlerplayclient = this.mc.getNetHandler();

    if (nethandlerplayclient != null)
    {
        nethandlerplayclient.addToSendQueue(new C12PacketUpdateSign(this.tileSign.xCoord, this.tileSign.yCoord, this.tileSign.zCoord, this.tileSign.signText));
    }

    this.tileSign.setEditable(true);
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:13,代碼來源:GuiEditSign.java

示例8: wakeFromSleep

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
private void wakeFromSleep()
{
    NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue;
    nethandlerplayclient.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SLEEPING));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:6,代碼來源:GuiSleepMP.java

示例9: switchJunction

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
public static void switchJunction(NetHandlerPlayClient net, boolean state) {
    ensurePlay(net.getNetworkManager().channel());
    net.addToSendQueue(state ? WRAP_ON_C : WRAP_OFF_C);
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:5,代碼來源:PacketJunction.java

示例10: func_146418_g

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
private void func_146418_g()
{
    NetHandlerPlayClient var1 = this.mc.thePlayer.sendQueue;
    var1.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, 3));
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:6,代碼來源:GuiSleepMP.java

示例11: func_146418_g

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的package包/類
private void func_146418_g()
{
    NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue;
    nethandlerplayclient.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, 3));
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:6,代碼來源:GuiSleepMP.java


注:本文中的net.minecraft.client.network.NetHandlerPlayClient.addToSendQueue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。