Search in sources :

Example 1 with ContainerSlimeling

use of micdoodle8.mods.galacticraft.planets.mars.inventory.ContainerSlimeling in project Galacticraft by micdoodle8.

the class MarsUtil method openSlimelingInventory.

public static void openSlimelingInventory(EntityPlayerMP player, EntitySlimeling slimeling) {
    player.getNextWindowId();
    player.closeContainer();
    int windowId = player.currentWindowId;
    GalacticraftCore.packetPipeline.sendTo(new PacketSimpleMars(EnumSimplePacketMars.C_OPEN_CUSTOM_GUI, GCCoreUtil.getDimensionID(player.worldObj), new Object[] { windowId, 0, slimeling.getEntityId() }), player);
    player.openContainer = new ContainerSlimeling(player.inventory, slimeling, player);
    player.openContainer.windowId = windowId;
    player.openContainer.onCraftGuiOpened(player);
}
Also used : ContainerSlimeling(micdoodle8.mods.galacticraft.planets.mars.inventory.ContainerSlimeling) PacketSimpleMars(micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars)

Example 2 with ContainerSlimeling

use of micdoodle8.mods.galacticraft.planets.mars.inventory.ContainerSlimeling in project Galacticraft by micdoodle8.

the class ContainerSlimeling method addSlots.

public static void addSlots(ContainerSlimeling container, InventoryPlayer playerInventory, EntitySlimeling slimeling) {
    Slot slot = new SlotSpecific(slimeling.slimelingInventory, 1, 9, 30, new ItemStack(MarsItems.marsItemBasic, 1, 4));
    container.addSlotToContainer(slot);
    int var3;
    for (var3 = 0; var3 < 3; ++var3) {
        for (int var4 = 0; var4 < 9; ++var4) {
            slot = new Slot(playerInventory, var4 + var3 * 9 + 9, 8 + var4 * 18, 129 + var3 * 18);
            container.addSlotToContainer(slot);
        }
    }
    for (var3 = 0; var3 < 9; ++var3) {
        slot = new Slot(playerInventory, var3, 8 + var3 * 18, 187);
        container.addSlotToContainer(slot);
    }
}
Also used : SlotSpecific(micdoodle8.mods.galacticraft.core.inventory.SlotSpecific) Slot(net.minecraft.inventory.Slot) ItemStack(net.minecraft.item.ItemStack)

Aggregations

SlotSpecific (micdoodle8.mods.galacticraft.core.inventory.SlotSpecific)1 ContainerSlimeling (micdoodle8.mods.galacticraft.planets.mars.inventory.ContainerSlimeling)1 PacketSimpleMars (micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars)1 Slot (net.minecraft.inventory.Slot)1 ItemStack (net.minecraft.item.ItemStack)1