Skip to content

Commit

Permalink
GCcore item and recipe cleanup for GTNH (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
chochem authored Jan 4, 2025
1 parent 7d1f46a commit 8405381
Show file tree
Hide file tree
Showing 4 changed files with 472 additions and 470 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;

import cpw.mods.fml.common.Loader;
import micdoodle8.mods.galacticraft.api.entity.IEntityBreathable;
import micdoodle8.mods.galacticraft.core.Constants;
import micdoodle8.mods.galacticraft.core.items.GCItems;
import micdoodle8.mods.galacticraft.core.util.ConfigManagerCore;
import micdoodle8.mods.galacticraft.core.util.WorldUtil;
Expand Down Expand Up @@ -154,7 +156,9 @@ protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
// Drop copper ingot as semi-rare drop if player hit and if dropping rotten
// flesh (50% chance)
if (p_70628_1_ && ConfigManagerCore.challengeMobDropsAndSpawning && j > 0 && this.rand.nextInt(6) == 0) {
this.entityDropItem(new ItemStack(GCItems.basicItem, 1, 3), 0.0F);
if (!Loader.isModLoaded(Constants.MOD_ID_NEW_HORIZONS_CORE_MOD)) {
this.entityDropItem(new ItemStack(GCItems.basicItem, 1, 3), 0.0F);
}
}
}
}
16 changes: 12 additions & 4 deletions src/main/java/micdoodle8/mods/galacticraft/core/items/GCItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.oredict.OreDictionary;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import micdoodle8.mods.galacticraft.core.Constants;
import micdoodle8.mods.galacticraft.core.util.ConfigManagerCore;
Expand Down Expand Up @@ -227,9 +228,11 @@ public static void initItems() {
GCCoreUtil.registerGalacticraftItem("infiniteBattery", GCItems.infiniteBatery);
GCCoreUtil.registerGalacticraftItem("infiniteOxygen", GCItems.oxygenCanisterInfinite);
GCCoreUtil.registerGalacticraftItem("rawSilicon", GCItems.basicItem, 2);
GCCoreUtil.registerGalacticraftItem("ingotCopper", GCItems.basicItem, 3);
GCCoreUtil.registerGalacticraftItem("ingotTin", GCItems.basicItem, 4);
GCCoreUtil.registerGalacticraftItem("ingotAluminum", GCItems.basicItem, 5);
if (!Loader.isModLoaded(Constants.MOD_ID_NEW_HORIZONS_CORE_MOD)) {
GCCoreUtil.registerGalacticraftItem("ingotCopper", GCItems.basicItem, 3);
GCCoreUtil.registerGalacticraftItem("ingotTin", GCItems.basicItem, 4);
GCCoreUtil.registerGalacticraftItem("ingotAluminum", GCItems.basicItem, 5);
}
GCCoreUtil.registerGalacticraftItem("compressedCopper", GCItems.basicItem, 6);
GCCoreUtil.registerGalacticraftItem("compressedTin", GCItems.basicItem, 7);
GCCoreUtil.registerGalacticraftItem("compressedAluminum", GCItems.basicItem, 8);
Expand All @@ -253,12 +256,17 @@ public static void initItems() {
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")) {
if (Loader.isModLoaded(Constants.MOD_ID_NEW_HORIZONS_CORE_MOD) && (2 < i) && (i < 6)) {
continue;
}
OreDictionary.registerOre(ItemBasic.names[i], new ItemStack(GCItems.basicItem, 1, i));
}
}

OreDictionary.registerOre("compressedMeteoricIron", new ItemStack(GCItems.meteoricIronIngot, 1, 1));
OreDictionary.registerOre("ingotMeteoricIron", new ItemStack(GCItems.meteoricIronIngot, 1, 0));
if (!Loader.isModLoaded(Constants.MOD_ID_NEW_HORIZONS_CORE_MOD)) {
OreDictionary.registerOre("ingotMeteoricIron", new ItemStack(GCItems.meteoricIronIngot, 1, 0));
}
OreDictionary.registerOre(ConfigManagerCore.otherModsSilicon, new ItemStack(GCItems.basicItem, 1, 2));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import codechicken.nei.PositionedStack;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import cpw.mods.fml.common.Loader;
import micdoodle8.mods.galacticraft.api.recipe.CompressorRecipes;
import micdoodle8.mods.galacticraft.core.Constants;
import micdoodle8.mods.galacticraft.core.blocks.GCBlocks;
Expand Down Expand Up @@ -48,6 +49,13 @@ public void loadConfig() {
}
}

if (Loader.isModLoaded(Constants.MOD_ID_NEW_HORIZONS_CORE_MOD)) {
API.hideItem(new ItemStack(GCItems.basicItem, 1, 3));
API.hideItem(new ItemStack(GCItems.basicItem, 1, 4));
API.hideItem(new ItemStack(GCItems.basicItem, 1, 5));
API.hideItem(new ItemStack(GCItems.meteoricIronIngot, 1, 0));
}

// Handled by GalaxySpace
/*
* API.registerRecipeHandler(new RocketT1RecipeHandler()); API.registerUsageHandler(new
Expand Down
Loading

0 comments on commit 8405381

Please sign in to comment.