Search in sources :

Example 16 with PacketCustom

use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.

the class NEICPH method sendMobSpawnerID.

public static void sendMobSpawnerID(int x, int y, int z, String mobtype) {
    PacketCustom packet = new PacketCustom(channel, 15);
    packet.writeCoord(x, y, z);
    packet.writeString(mobtype);
    packet.sendToServer();
}
Also used : PacketCustom(codechicken.lib.packet.PacketCustom)

Example 17 with PacketCustom

use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.

the class NEICPH method sendGiveItem.

public static void sendGiveItem(ItemStack spawnstack, boolean infinite, boolean doSpawn) {
    PacketCustom packet = new PacketCustom(channel, 1);
    packet.writeItemStack(spawnstack);
    packet.writeBoolean(infinite);
    packet.writeBoolean(doSpawn);
    packet.sendToServer();
}
Also used : PacketCustom(codechicken.lib.packet.PacketCustom)

Example 18 with PacketCustom

use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.

the class NEICPH method sendStateLoad.

public static void sendStateLoad(ItemStack[] state) {
    sendDeleteAllItems();
    for (int slot = 0; slot < state.length; slot++) {
        ItemStack item = state[slot];
        if (item == null) {
            continue;
        }
        sendSetSlot(slot, item, false);
    }
    PacketCustom packet = new PacketCustom(channel, 11);
    packet.sendToServer();
}
Also used : PacketCustom(codechicken.lib.packet.PacketCustom) ItemStack(net.minecraft.item.ItemStack)

Example 19 with PacketCustom

use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.

the class NEICPH method sendModifyEnchantment.

public static void sendModifyEnchantment(int enchID, int level, boolean add) {
    PacketCustom packet = new PacketCustom(channel, 22);
    packet.writeByte(enchID);
    packet.writeByte(level);
    packet.writeBoolean(add);
    packet.sendToServer();
}
Also used : PacketCustom(codechicken.lib.packet.PacketCustom)

Example 20 with PacketCustom

use of codechicken.lib.packet.PacketCustom in project Galacticraft by micdoodle8.

the class NEICPH method sendCreativeScroll.

public static void sendCreativeScroll(int steps) {
    PacketCustom packet = new PacketCustom(channel, 14);
    packet.writeInt(steps);
    packet.sendToServer();
}
Also used : PacketCustom(codechicken.lib.packet.PacketCustom)

Aggregations

PacketCustom (codechicken.lib.packet.PacketCustom)27 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)3 ItemStack (net.minecraft.item.ItemStack)3 IGuiPacketSender (codechicken.core.IGuiPacketSender)2 LinkedList (java.util.LinkedList)1 Set (java.util.Set)1 InventoryBasic (net.minecraft.inventory.InventoryBasic)1 ChatComponentTranslation (net.minecraft.util.ChatComponentTranslation)1