Package codechicken.lib.packet

Examples of codechicken.lib.packet.PacketCustom


            }
        }
        else
        {
            player.swingItem();
            new PacketCustom(McMultipartSPH.channel, 1).sendToServer();
        }
        return true;
    }
View Full Code Here


                break;
        }
    }

    public static void spawnBurnoutSmoke(World world, int x, int y, int z) {
        new PacketCustom(channel, 1).writeCoord(x, y, z).sendToChunk(world, x >> 4, z >> 4);
    }
View Full Code Here

        //change it on the server
        player.theItemInWorldManager.setGameType(getGameType(mode));

        //tell the client to change it
        new PacketCustom(NEISPH.channel, 14).writeByte(mode).sendToPlayer(player);
        player.addChatMessage(new ChatComponentTranslation("nei.chat.gamemode." + mode));
    }
View Full Code Here

        if (open) {
            ServerUtils.openSMPContainer(sender, new ContainerCreativeInv(sender, new ExtendedCreativeInv(NEIServerConfig.forPlayer(sender.getCommandSenderName()), Side.SERVER)), new IGuiPacketSender()
            {
                @Override
                public void sendPacket(EntityPlayerMP player, int windowId) {
                    PacketCustom packet = new PacketCustom(channel, 23);
                    packet.writeBoolean(true);
                    packet.writeByte(windowId);
                    packet.sendToPlayer(player);
                }
            });
        } else {
            sender.closeContainer();
            PacketCustom packet = new PacketCustom(channel, 23);
            packet.writeBoolean(false);
            packet.sendToPlayer(sender);
        }
    }
View Full Code Here

    private void openEnchantmentGui(EntityPlayerMP player) {
        ServerUtils.openSMPContainer(player, new ContainerEnchantmentModifier(player.inventory, player.worldObj, 0, 0, 0), new IGuiPacketSender()
        {
            @Override
            public void sendPacket(EntityPlayerMP player, int windowId) {
                PacketCustom packet = new PacketCustom(channel, 21);
                packet.writeByte(windowId);
                packet.sendToPlayer(player);
            }
        });
    }
View Full Code Here

            b.setInventorySlotContents(i, packet.readItemStack());
        ServerUtils.openSMPContainer(player, new ContainerPotionCreator(player.inventory, b), new IGuiPacketSender()
        {
            @Override
            public void sendPacket(EntityPlayerMP player, int windowId) {
                PacketCustom packet = new PacketCustom(channel, 24);
                packet.writeByte(windowId);
                packet.sendToPlayer(player);
            }
        });
    }
View Full Code Here

            }
        });
    }

    public static void sendActionDisabled(int dim, String name, boolean disable) {
        new PacketCustom(channel, 11)
                .writeString(name)
                .writeBoolean(disable)
                .sendToDimension(dim);
    }
View Full Code Here

                .writeBoolean(disable)
                .sendToDimension(dim);
    }

    public static void sendActionEnabled(EntityPlayerMP player, String name, boolean enable) {
        new PacketCustom(channel, 12)
                .writeString(name)
                .writeBoolean(enable)
                .sendToPlayer(player);
    }
View Full Code Here

        }
        for (ItemStackMap.Entry<Set<String>> entry : NEIServerConfig.bannedItems.entries())
            if (!NEIServerConfig.isPlayerInList(player.getCommandSenderName(), entry.value, true))
                bannedItems.add(entry.key);

        PacketCustom packet = new PacketCustom(channel, 10);

        packet.writeByte(actions.size());
        for (String s : actions)
            packet.writeString(s);

        packet.writeByte(disabled.size());
        for (String s : disabled)
            packet.writeString(s);

        packet.writeByte(enabled.size());
        for (String s : enabled)
            packet.writeString(s);

        packet.writeInt(bannedItems.size());
        for (ItemStack stack : bannedItems)
            packet.writeItemStack(stack);

        packet.sendToPlayer(player);
    }
View Full Code Here

        packet.sendToPlayer(player);
    }

    public static void sendHasServerSideTo(EntityPlayerMP player) {
        NEIServerConfig.logger.debug("Sending serverside check to: " + player.getCommandSenderName());
        PacketCustom packet = new PacketCustom(channel, 1);
        packet.writeByte(NEIActions.protocol);
        packet.writeString(CommonUtils.getWorldName(player.worldObj));

        packet.sendToPlayer(player);
    }
View Full Code Here

TOP

Related Classes of codechicken.lib.packet.PacketCustom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.