mirror of
https://github.com/turbodiesel4598/NuclearCraft
synced 2026-04-26 16:24:50 +02:00
Compare commits
3 Commits
b03ac28246
...
e747545f0e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e747545f0e | ||
|
|
713e9ee1db | ||
|
|
c6e8954367 |
@ -1,3 +1,7 @@
|
||||
v2.18zzz
|
||||
|
||||
* Fixed crash when GTCEu is installed [thanks to DStrand1!]
|
||||
|
||||
v2.18zz
|
||||
|
||||
* Fixed ore processing config not correctly disabling ore melting recipes and unnecessarily disabling ingot crushing and melting recipes
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
mc_version=1.12.2
|
||||
forge_version=14.23.5.2847
|
||||
mapping_version=stable_39
|
||||
mod_version=2.18zz
|
||||
mod_version=2.18zzz
|
||||
|
||||
ic2_version=2.8.221-ex112
|
||||
jei_version=4.16.1.301
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import gregtech.api.items.metaitem.MetaItem.MetaValueItem;
|
||||
@ -33,6 +34,14 @@ import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
public class GTCERecipeHelper {
|
||||
|
||||
private static RecipeMap<?> EXTRACTOR_MAP;
|
||||
|
||||
@Optional.Method(modid = "gregtech")
|
||||
public static void checkGtVersion() {
|
||||
String version = Loader.instance().getIndexedModList().get("gregtech").getVersion();
|
||||
EXTRACTOR_MAP = getExtractorMap(Integer.parseInt(version.split("\\.")[0]));
|
||||
}
|
||||
|
||||
// Thanks so much to Firew0lf for the original method!
|
||||
@Optional.Method(modid = "gregtech")
|
||||
public static void addGTCERecipe(String recipeName, ProcessorRecipe recipe) {
|
||||
@ -63,7 +72,8 @@ public class GTCERecipeHelper {
|
||||
builder = addStats(recipeMap.recipeBuilder(), recipe, 16, 12);
|
||||
break;
|
||||
case "melter":
|
||||
recipeMap = RecipeMaps.FLUID_EXTRACTION_RECIPES;
|
||||
recipeMap = EXTRACTOR_MAP;
|
||||
if (recipeMap != null)
|
||||
builder = addStats(recipeMap.recipeBuilder(), recipe, 32, 16);
|
||||
break;
|
||||
case "supercooler":
|
||||
@ -107,7 +117,8 @@ public class GTCERecipeHelper {
|
||||
builder = addStats(recipeMap.recipeBuilder(), recipe, 20, 20).notConsumable(new IntCircuitIngredient(1));
|
||||
break;
|
||||
case "extractor":
|
||||
recipeMap = RecipeMaps.FLUID_EXTRACTION_RECIPES;
|
||||
recipeMap = EXTRACTOR_MAP;
|
||||
if (recipeMap != null)
|
||||
builder = addStats(recipeMap.recipeBuilder(), recipe, 16, 12);
|
||||
break;
|
||||
case "centrifuge":
|
||||
@ -324,4 +335,16 @@ public class GTCERecipeHelper {
|
||||
}
|
||||
return MetaItems.SHAPE_MOLD_BALL;
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "gregtech")
|
||||
private static RecipeMap<?> getExtractorMap(int gtVersion) {
|
||||
if (gtVersion == 2) {
|
||||
return RecipeMaps.EXTRACTOR_RECIPES;
|
||||
} else {
|
||||
try {
|
||||
return (RecipeMap<?>) RecipeMaps.class.getField("FLUID_EXTRACTION_RECIPES").get(null);
|
||||
} catch (NoSuchFieldException | IllegalAccessException ignored) {}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,6 +59,7 @@ public abstract class ProcessorRecipeHandler extends AbstractRecipeHandler<Proce
|
||||
|
||||
public void addGTCERecipes() {
|
||||
if (ModCheck.gregtechLoaded() && GTCE_INTEGRATION.getBoolean(recipeName)) {
|
||||
GTCERecipeHelper.checkGtVersion();
|
||||
for (ProcessorRecipe recipe : recipeList) {
|
||||
GTCERecipeHelper.addGTCERecipe(recipeName, recipe);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user