Search in sources :

Example 1 with ItemCanisterOxygenInfinite

use of micdoodle8.mods.galacticraft.core.items.ItemCanisterOxygenInfinite in project Galacticraft by micdoodle8.

the class GCItems method initItems.

public static void initItems() {
    GCItems.oxTankLight = new ItemOxygenTank(1, "oxygen_tank_light_full");
    GCItems.oxTankMedium = new ItemOxygenTank(2, "oxygen_tank_med_full");
    GCItems.oxTankHeavy = new ItemOxygenTank(3, "oxygen_tank_heavy_full");
    GCItems.oxMask = new ItemOxygenMask("oxygen_mask");
    GCItems.rocketTier1 = new ItemTier1Rocket("rocket_t1");
    GCItems.sensorGlasses = new ItemSensorGlasses("sensor_glasses");
    GCItems.steelPickaxe = new ItemPickaxeGC("steel_pickaxe");
    GCItems.steelAxe = new ItemAxeGC("steel_axe");
    GCItems.steelHoe = new ItemHoeGC("steel_hoe");
    GCItems.steelSpade = new ItemSpadeGC("steel_shovel");
    GCItems.steelSword = new ItemSwordGC("steel_sword");
    GCItems.steelHelmet = new ItemArmorGC(0, "helmet");
    GCItems.steelChestplate = new ItemArmorGC(1, "chestplate");
    GCItems.steelLeggings = new ItemArmorGC(2, "leggings");
    GCItems.steelBoots = new ItemArmorGC(3, "boots");
    GCItems.canister = new ItemCanister("canister");
    GCItems.oxygenVent = new ItemBase("air_vent");
    GCItems.oxygenFan = new ItemBase("air_fan");
    GCItems.oxygenConcentrator = new ItemBase("oxygen_concentrator");
    GCItems.heavyPlatingTier1 = new ItemBase("heavy_plating").setSmeltingXP(1F);
    GCItems.rocketEngine = new ItemRocketEngineGC("engine");
    GCItems.partFins = new ItemBase("rocket_fins");
    GCItems.partNoseCone = new ItemBase("nose_cone");
    GCItems.sensorLens = new ItemBase("sensor_lens");
    GCItems.buggy = new ItemBuggy("buggy");
    GCItems.flag = new ItemFlag("flag");
    GCItems.oxygenGear = new ItemOxygenGear("oxygen_gear");
    GCItems.parachute = new ItemParaChute("parachute");
    GCItems.canvas = new ItemBase("canvas");
    GCItems.oilCanister = new ItemOilCanister("oil_canister_partial");
    GCItems.fuelCanister = new ItemFuelCanister("fuel_canister_partial");
    GCItems.oxygenCanisterInfinite = new ItemCanisterOxygenInfinite("infinite_oxygen");
    GCItems.flagPole = new ItemBase("steel_pole");
    GCItems.schematic = new ItemSchematic("schematic");
    GCItems.key = new ItemKey("key");
    GCItems.partBuggy = new ItemBuggyMaterial("buggymat");
    GCItems.basicItem = new ItemBasic("basic_item");
    GCItems.foodItem = new ItemFood("food");
    GCItems.battery = new ItemBattery("battery");
    GCItems.infiniteBatery = new ItemBatteryInfinite("infinite_battery");
    GCItems.meteorChunk = new ItemMeteorChunk("meteor_chunk");
    GCItems.wrench = new ItemUniversalWrench("standard_wrench");
    GCItems.cheeseCurd = new ItemCheese(1, 0.1F, false);
    // GCItems.cheeseBlock = new ItemBlockCheese(GCBlocks.cheeseBlock, "cheeseBlock");
    GCItems.meteoricIronRaw = new ItemMeteoricIron("meteoric_iron_raw");
    GCItems.itemBasicMoon = new ItemMoon("item_basic_moon");
    GCItems.prelaunchChecklist = new ItemPreLaunchChecklist("prelaunch_checklist");
    GCItems.dungeonFinder = new ItemBase("dungeonfinder");
    GCItems.ic2compat = new ItemIC2Compat("ic2compat");
    GCItems.emergencyKit = new ItemEmergencyKit("emergency_kit");
    GCItems.registerHarvestLevels();
    GCItems.registerItems();
    GCItems.itemChanges.put(new ItemStack(GCItems.basicItem, 1, 15), new ItemStack(GCItems.foodItem, 1, 0));
    GCItems.itemChanges.put(new ItemStack(GCItems.basicItem, 1, 16), new ItemStack(GCItems.foodItem, 1, 1));
    GCItems.itemChanges.put(new ItemStack(GCItems.basicItem, 1, 17), new ItemStack(GCItems.foodItem, 1, 2));
    GCItems.itemChanges.put(new ItemStack(GCItems.basicItem, 1, 18), new ItemStack(GCItems.foodItem, 1, 3));
    for (int i = 0; i < ItemBasic.names.length; i++) {
        if (ItemBasic.names[i].contains("ingot") || ItemBasic.names[i].contains("compressed") || ItemBasic.names[i].contains("wafer")) {
            String name = ItemBasic.names[i];
            while (name.contains("_")) {
                int loc = name.indexOf("_");
                name = name.substring(0, loc) + name.substring(loc + 1, loc + 2).toUpperCase() + name.substring(loc + 2, name.length());
            }
            OreDictionary.registerOre(name, new ItemStack(GCItems.basicItem, 1, i));
        }
    }
    OreDictionary.registerOre("compressedMeteoricIron", new ItemStack(GCItems.itemBasicMoon, 1, 1));
    OreDictionary.registerOre("ingotMeteoricIron", new ItemStack(GCItems.itemBasicMoon, 1, 0));
    if (CompatibilityManager.useAluDust()) {
        OreDictionary.registerOre("dustAluminum", new ItemStack(GCItems.ic2compat, 1, 0));
        OreDictionary.registerOre("dustAluminium", new ItemStack(GCItems.ic2compat, 1, 0));
    }
    if (CompatibilityManager.isIc2Loaded()) {
        OreDictionary.registerOre("crushedAluminum", new ItemStack(GCItems.ic2compat, 1, 2));
        OreDictionary.registerOre("crushedPurifiedAluminum", new ItemStack(GCItems.ic2compat, 1, 1));
    }
    GalacticraftCore.proxy.registerCanister(new PartialCanister(GCItems.oilCanister, Constants.MOD_ID_CORE, "oil_canister_partial", 7));
    GalacticraftCore.proxy.registerCanister(new PartialCanister(GCItems.fuelCanister, Constants.MOD_ID_CORE, "fuel_canister_partial", 7));
    OreDictionary.registerOre(ConfigManagerCore.otherModsSilicon, new ItemStack(GCItems.basicItem, 1, 2));
}
Also used : PartialCanister(micdoodle8.mods.galacticraft.core.wrappers.PartialCanister) ItemStack(net.minecraft.item.ItemStack)

Example 2 with ItemCanisterOxygenInfinite

use of micdoodle8.mods.galacticraft.core.items.ItemCanisterOxygenInfinite in project Galacticraft by micdoodle8.

the class GalacticraftCore method init.

@EventHandler
public void init(FMLInitializationEvent event) {
    GCBlocks.doOtherModsTorches();
    GalacticraftCore.handler.registerItemChanges();
    GalacticraftCore.galacticraftBlocksTab.setItemForTab(Item.getItemFromBlock(GCBlocks.machineBase2));
    GalacticraftCore.galacticraftItemsTab.setItemForTab(GCItems.rocketTier1);
    if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
        GCBlocks.finalizeSort();
        GCItems.finalizeSort();
    }
    GalacticraftCore.proxy.init(event);
    GalacticraftCore.packetPipeline = GalacticraftChannelHandler.init();
    GalacticraftCore.solarSystemSol = new SolarSystem("sol", "milky_way").setMapPosition(new Vector3(0.0F, 0.0F, 0.0F));
    Star starSol = (Star) new Star("sol").setParentSolarSystem(GalacticraftCore.solarSystemSol).setTierRequired(-1);
    starSol.setBodyIcon(new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png"));
    GalacticraftCore.solarSystemSol.setMainStar(starSol);
    GalacticraftCore.planetOverworld = (Planet) new Planet("overworld").setParentSolarSystem(GalacticraftCore.solarSystemSol).setRingColorRGB(0.1F, 0.9F, 0.6F).setPhaseShift(0.0F);
    GalacticraftCore.planetOverworld.setBodyIcon(new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/celestialbodies/earth.png"));
    GalacticraftCore.planetOverworld.setDimensionInfo(ConfigManagerCore.idDimensionOverworld, WorldProvider.class, false).setTierRequired(1);
    GalacticraftCore.planetOverworld.atmosphereComponent(EnumAtmosphericGas.NITROGEN).atmosphereComponent(EnumAtmosphericGas.OXYGEN).atmosphereComponent(EnumAtmosphericGas.ARGON).atmosphereComponent(EnumAtmosphericGas.WATER);
    GalacticraftCore.planetOverworld.addChecklistKeys("equip_parachute");
    GalacticraftCore.moonMoon = (Moon) new Moon("moon").setParentPlanet(GalacticraftCore.planetOverworld).setRelativeSize(0.2667F).setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(13F, 13F)).setRelativeOrbitTime(1 / 0.01F);
    GalacticraftCore.moonMoon.setDimensionInfo(ConfigManagerCore.idDimensionMoon, WorldProviderMoon.class).setTierRequired(1);
    GalacticraftCore.moonMoon.setBodyIcon(new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png"));
    GalacticraftCore.moonMoon.setAtmosphere(new AtmosphereInfo(false, false, false, 0.0F, 0.0F, 0.0F));
    GalacticraftCore.moonMoon.setBiomeInfo(BiomeGenBaseMoon.moonFlat);
    GalacticraftCore.moonMoon.addMobInfo(new SpawnListEntry(EntityEvolvedZombie.class, 8, 2, 3));
    GalacticraftCore.moonMoon.addMobInfo(new SpawnListEntry(EntityEvolvedSpider.class, 8, 2, 3));
    GalacticraftCore.moonMoon.addMobInfo(new SpawnListEntry(EntityEvolvedSkeleton.class, 8, 2, 3));
    GalacticraftCore.moonMoon.addMobInfo(new SpawnListEntry(EntityEvolvedCreeper.class, 8, 2, 3));
    GalacticraftCore.moonMoon.addMobInfo(new SpawnListEntry(EntityEvolvedEnderman.class, 10, 1, 4));
    GalacticraftCore.moonMoon.addChecklistKeys("equip_oxygen_suit");
    // Satellites must always have a WorldProvider implementing IOrbitDimension
    GalacticraftCore.satelliteSpaceStation = (Satellite) new Satellite("spacestation.overworld").setParentBody(GalacticraftCore.planetOverworld).setRelativeSize(0.2667F).setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(9F, 9F)).setRelativeOrbitTime(1 / 0.05F);
    GalacticraftCore.satelliteSpaceStation.setDimensionInfo(ConfigManagerCore.idDimensionOverworldOrbit, ConfigManagerCore.idDimensionOverworldOrbitStatic, WorldProviderOverworldOrbit.class).setTierRequired(1);
    GalacticraftCore.satelliteSpaceStation.setBodyIcon(new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/celestialbodies/space_station.png"));
    GalacticraftCore.satelliteSpaceStation.setAtmosphere(new AtmosphereInfo(false, false, false, 0.0F, 0.1F, 0.02F));
    GalacticraftCore.satelliteSpaceStation.addChecklistKeys("equip_oxygen_suit", "create_grapple");
    ForgeChunkManager.setForcedChunkLoadingCallback(GalacticraftCore.instance, new ChunkLoadingCallback());
    MinecraftForge.EVENT_BUS.register(new ConnectionEvents());
    SchematicRegistry.registerSchematicRecipe(new SchematicRocketT1());
    SchematicRegistry.registerSchematicRecipe(new SchematicMoonBuggy());
    SchematicRegistry.registerSchematicRecipe(new SchematicAdd());
    ChunkPowerHandler.initiate();
    EnergyConfigHandler.initGas();
    CompatibilityManager.registerMicroBlocks();
    this.registerCreatures();
    this.registerOtherEntities();
    this.registerTileEntities();
    GalaxyRegistry.registerSolarSystem(GalacticraftCore.solarSystemSol);
    GalaxyRegistry.registerPlanet(GalacticraftCore.planetOverworld);
    GalaxyRegistry.registerMoon(GalacticraftCore.moonMoon);
    GalaxyRegistry.registerSatellite(GalacticraftCore.satelliteSpaceStation);
    GalacticraftRegistry.registerProvider(ConfigManagerCore.idDimensionOverworldOrbit, WorldProviderOverworldOrbit.class, false, 0);
    GalacticraftRegistry.registerProvider(ConfigManagerCore.idDimensionOverworldOrbitStatic, WorldProviderOverworldOrbit.class, true, 0);
    GalacticraftRegistry.registerTeleportType(WorldProviderSurface.class, new TeleportTypeOverworld());
    GalacticraftRegistry.registerTeleportType(WorldProviderOverworldOrbit.class, new TeleportTypeOrbit());
    GalacticraftRegistry.registerTeleportType(WorldProviderMoon.class, new TeleportTypeMoon());
    GalacticraftRegistry.registerRocketGui(WorldProviderOverworldOrbit.class, new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/overworld_rocket_gui.png"));
    GalacticraftRegistry.registerRocketGui(WorldProviderSurface.class, new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/overworld_rocket_gui.png"));
    GalacticraftRegistry.registerRocketGui(WorldProviderMoon.class, new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/moon_rocket_gui.png"));
    GalacticraftRegistry.addDungeonLoot(1, new ItemStack(GCItems.schematic, 1, 0));
    GalacticraftRegistry.addDungeonLoot(1, new ItemStack(GCItems.schematic, 1, 1));
    if (ConfigManagerCore.enableCopperOreGen) {
        GameRegistry.registerWorldGenerator(new OverworldGenerator(GCBlocks.basicBlock, 5, 24, 0, 75, 7), 4);
    }
    if (ConfigManagerCore.enableTinOreGen) {
        GameRegistry.registerWorldGenerator(new OverworldGenerator(GCBlocks.basicBlock, 6, 22, 0, 60, 7), 4);
    }
    if (ConfigManagerCore.enableAluminumOreGen) {
        GameRegistry.registerWorldGenerator(new OverworldGenerator(GCBlocks.basicBlock, 7, 18, 0, 45, 7), 4);
    }
    if (ConfigManagerCore.enableSiliconOreGen) {
        GameRegistry.registerWorldGenerator(new OverworldGenerator(GCBlocks.basicBlock, 8, 3, 0, 25, 7), 4);
    }
    FMLInterModComms.sendMessage("OpenBlocks", "donateUrl", "http://www.patreon.com/micdoodle8");
    registerCoreGameScreens();
    GCFluids.registerLegacyFluids();
    GCFluids.registerDispenserBehaviours();
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_MASK, EnumExtendedInventorySlot.MASK, GCItems.oxMask);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_GEAR, EnumExtendedInventorySlot.GEAR, GCItems.oxygenGear);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_LIGHT, EnumExtendedInventorySlot.LEFT_TANK, GCItems.oxTankLight);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_LIGHT, EnumExtendedInventorySlot.RIGHT_TANK, GCItems.oxTankLight);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_MEDIUM, EnumExtendedInventorySlot.LEFT_TANK, GCItems.oxTankMedium);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_MEDIUM, EnumExtendedInventorySlot.RIGHT_TANK, GCItems.oxTankMedium);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_HEAVY, EnumExtendedInventorySlot.LEFT_TANK, GCItems.oxTankHeavy);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_HEAVY, EnumExtendedInventorySlot.RIGHT_TANK, GCItems.oxTankHeavy);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_INFINITE, EnumExtendedInventorySlot.LEFT_TANK, GCItems.oxygenCanisterInfinite);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_INFINITE, EnumExtendedInventorySlot.RIGHT_TANK, GCItems.oxygenCanisterInfinite);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_PARACHUTE, EnumExtendedInventorySlot.PARACHUTE, GCItems.parachute);
    GalacticraftRegistry.registerGear(Constants.GEAR_ID_FREQUENCY_MODULE, EnumExtendedInventorySlot.FREQUENCY_MODULE, new ItemStack(GCItems.basicItem, 1, 19));
    GalacticraftCore.proxy.registerFluidTexture(GCFluids.fluidOil, new ResourceLocation(Constants.ASSET_PREFIX, "textures/misc/underoil.png"));
    GalacticraftCore.proxy.registerFluidTexture(GCFluids.fluidFuel, new ResourceLocation(Constants.ASSET_PREFIX, "textures/misc/underfuel.png"));
// switch (this.getSlotIndex())
// {
// case 0:
// return itemstack.getItem() instanceof ItemOxygenMask;
// case 1:
// return itemstack.getItem() == GCItems.oxygenGear;
// case 2:
// case 3:
// return itemstack.getItem() instanceof ItemOxygenTank || itemstack.getItem() instanceof ItemCanisterOxygenInfinite;
// case 4:
// return itemstack.getItem() instanceof ItemParaChute;
// case 5:
// return itemstack.getItem() == GCItems.basicItem && itemstack.getItemDamage() == 19;
// case 6:
// return this.thermalArmorSlotValid(itemstack, 0);
// case 7:
// return this.thermalArmorSlotValid(itemstack, 1);
// case 8:
// return this.thermalArmorSlotValid(itemstack, 2);
// case 9:
// return this.thermalArmorSlotValid(itemstack, 3);
// case 10:
// return this.shieldControllerSlotValid(itemstack);
// }
}
Also used : BiomeGenBaseMoon(micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon) SchematicMoonBuggy(micdoodle8.mods.galacticraft.core.schematic.SchematicMoonBuggy) ChunkLoadingCallback(micdoodle8.mods.galacticraft.core.world.ChunkLoadingCallback) ResourceLocation(net.minecraft.util.ResourceLocation) SchematicAdd(micdoodle8.mods.galacticraft.core.schematic.SchematicAdd) WorldProvider(net.minecraft.world.WorldProvider) SchematicRocketT1(micdoodle8.mods.galacticraft.core.schematic.SchematicRocketT1) OverworldGenerator(micdoodle8.mods.galacticraft.core.world.gen.OverworldGenerator) AtmosphereInfo(micdoodle8.mods.galacticraft.api.world.AtmosphereInfo) Vector3(micdoodle8.mods.galacticraft.api.vector.Vector3) SpawnListEntry(net.minecraft.world.biome.BiomeGenBase.SpawnListEntry) ConnectionEvents(micdoodle8.mods.galacticraft.core.network.ConnectionEvents) ItemStack(net.minecraft.item.ItemStack) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 3 with ItemCanisterOxygenInfinite

use of micdoodle8.mods.galacticraft.core.items.ItemCanisterOxygenInfinite in project Galacticraft by micdoodle8.

the class TileEntityOxygenDecompressor method update.

@Override
public void update() {
    super.update();
    if (!this.worldObj.isRemote) {
        this.usingEnergy = false;
        ItemStack tank1 = this.containingItems[0];
        if (tank1 != null && this.hasEnoughEnergyToRun && this.getOxygenStored() < this.getMaxOxygenStored()) {
            if (tank1.getItem() instanceof ItemOxygenTank && tank1.getItemDamage() < tank1.getMaxDamage()) {
                tank1.setItemDamage(tank1.getItemDamage() + 1);
                this.receiveOxygen(1, true);
                this.usingEnergy = true;
            } else if (tank1.getItem() instanceof ItemCanisterOxygenInfinite) {
                this.receiveOxygen(1, true);
                this.usingEnergy = true;
            }
        }
        this.produceOxygen();
    }
}
Also used : ItemStack(net.minecraft.item.ItemStack) ItemOxygenTank(micdoodle8.mods.galacticraft.core.items.ItemOxygenTank) ItemCanisterOxygenInfinite(micdoodle8.mods.galacticraft.core.items.ItemCanisterOxygenInfinite)

Example 4 with ItemCanisterOxygenInfinite

use of micdoodle8.mods.galacticraft.core.items.ItemCanisterOxygenInfinite in project Galacticraft by micdoodle8.

the class ContainerOxygenDecompressor method transferStackInSlot.

@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par1) {
    ItemStack var2 = null;
    final Slot slot = (Slot) this.inventorySlots.get(par1);
    final int b = this.inventorySlots.size();
    if (slot != null && slot.getHasStack()) {
        final ItemStack stack = slot.getStack();
        var2 = stack.copy();
        boolean movedToMachineSlot = false;
        if (par1 < 2) {
            if (!this.mergeItemStack(stack, b - 36, b, true)) {
                return null;
            }
        } else {
            if (EnergyUtil.isElectricItem(stack.getItem())) {
                if (!this.mergeItemStack(stack, 1, 2, false)) {
                    return null;
                }
                movedToMachineSlot = true;
            } else if (stack.getItem() instanceof ItemCanisterOxygenInfinite || (stack.getItem() instanceof ItemOxygenTank && stack.getItemDamage() < stack.getMaxDamage())) {
                if (!this.mergeItemStack(stack, 0, 1, false)) {
                    return null;
                }
                movedToMachineSlot = true;
            } else {
                if (par1 < b - 9) {
                    if (!this.mergeItemStack(stack, b - 9, b, false)) {
                        return null;
                    }
                } else if (!this.mergeItemStack(stack, b - 36, b - 9, false)) {
                    return null;
                }
            }
        }
        if (stack.stackSize == 0) {
            // Needed where tile has inventoryStackLimit of 1
            if (movedToMachineSlot && var2.stackSize > 1) {
                ItemStack remainder = var2.copy();
                --remainder.stackSize;
                slot.putStack(remainder);
            } else {
                slot.putStack((ItemStack) null);
            }
        } else {
            slot.onSlotChanged();
        }
        if (stack.stackSize == var2.stackSize) {
            return null;
        }
        slot.onPickupFromSlot(par1EntityPlayer, stack);
    }
    return var2;
}
Also used : Slot(net.minecraft.inventory.Slot) ItemStack(net.minecraft.item.ItemStack) ItemOxygenTank(micdoodle8.mods.galacticraft.core.items.ItemOxygenTank) ItemCanisterOxygenInfinite(micdoodle8.mods.galacticraft.core.items.ItemCanisterOxygenInfinite)

Example 5 with ItemCanisterOxygenInfinite

use of micdoodle8.mods.galacticraft.core.items.ItemCanisterOxygenInfinite in project Galacticraft by micdoodle8.

the class ContainerExtendedInventory method transferStackInSlot.

@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par1) {
    ItemStack var2 = null;
    final Slot slot = (Slot) this.inventorySlots.get(par1);
    if (slot != null && slot.getHasStack()) {
        final ItemStack stack = slot.getStack();
        var2 = stack.copy();
        if (par1 >= 36) {
            if (!this.mergeItemStack(stack, 0, 36, true)) {
                return null;
            }
        } else {
            boolean flag = false;
            for (int j = 36; j < 40; j++) {
                if (((SlotArmorGC) this.inventorySlots.get(j)).isItemValid(stack)) {
                    if (!this.mergeOneItem(stack, j, j + 1, false)) {
                        return null;
                    }
                    flag = true;
                    break;
                }
            }
            if (!flag) {
                if (stack.getItem() instanceof ItemOxygenTank || stack.getItem() instanceof ItemCanisterOxygenInfinite) {
                    if (!this.mergeOneItem(stack, 42, 44, false)) {
                        return null;
                    }
                    flag = true;
                } else {
                    for (int j = 40; j < 51; j++) {
                        if (((SlotExtendedInventory) this.inventorySlots.get(j)).isItemValid(stack)) {
                            if (!this.mergeOneItem(stack, j, j + 1, false)) {
                                return null;
                            }
                            flag = true;
                            break;
                        }
                    }
                }
            }
            if (!flag) {
                if (par1 < 27) {
                    if (!this.mergeItemStack(stack, 27, 36, false)) {
                        return null;
                    }
                } else if (!this.mergeItemStack(stack, 0, 27, false)) {
                    return null;
                }
            }
        }
        if (stack.stackSize == 0) {
            slot.putStack((ItemStack) null);
        } else {
            slot.onSlotChanged();
        }
        if (stack.stackSize == var2.stackSize) {
            return null;
        }
        slot.onPickupFromSlot(par1EntityPlayer, stack);
    }
    return var2;
}
Also used : Slot(net.minecraft.inventory.Slot) ItemStack(net.minecraft.item.ItemStack) ItemOxygenTank(micdoodle8.mods.galacticraft.core.items.ItemOxygenTank) ItemCanisterOxygenInfinite(micdoodle8.mods.galacticraft.core.items.ItemCanisterOxygenInfinite)

Aggregations

ItemStack (net.minecraft.item.ItemStack)5 ItemCanisterOxygenInfinite (micdoodle8.mods.galacticraft.core.items.ItemCanisterOxygenInfinite)3 ItemOxygenTank (micdoodle8.mods.galacticraft.core.items.ItemOxygenTank)3 Slot (net.minecraft.inventory.Slot)2 Vector3 (micdoodle8.mods.galacticraft.api.vector.Vector3)1 AtmosphereInfo (micdoodle8.mods.galacticraft.api.world.AtmosphereInfo)1 ConnectionEvents (micdoodle8.mods.galacticraft.core.network.ConnectionEvents)1 SchematicAdd (micdoodle8.mods.galacticraft.core.schematic.SchematicAdd)1 SchematicMoonBuggy (micdoodle8.mods.galacticraft.core.schematic.SchematicMoonBuggy)1 SchematicRocketT1 (micdoodle8.mods.galacticraft.core.schematic.SchematicRocketT1)1 ChunkLoadingCallback (micdoodle8.mods.galacticraft.core.world.ChunkLoadingCallback)1 BiomeGenBaseMoon (micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon)1 OverworldGenerator (micdoodle8.mods.galacticraft.core.world.gen.OverworldGenerator)1 PartialCanister (micdoodle8.mods.galacticraft.core.wrappers.PartialCanister)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 WorldProvider (net.minecraft.world.WorldProvider)1 SpawnListEntry (net.minecraft.world.biome.BiomeGenBase.SpawnListEntry)1 EventHandler (net.minecraftforge.fml.common.Mod.EventHandler)1