Skip to content

Commit

Permalink
Merge branch 'GTNewHorizons:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHero233 authored Sep 23, 2024
2 parents df6fbf4 + 2368c35 commit 8aec74a
Show file tree
Hide file tree
Showing 231 changed files with 1,260 additions and 3,098 deletions.
18 changes: 9 additions & 9 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ dependencies {
api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev")
api("com.github.GTNewHorizons:GTNHLib:0.5.11:dev")
api("com.github.GTNewHorizons:ModularUI:1.2.8:dev")
api("com.github.GTNewHorizons:ModularUI2:2.1.9-1.7.10:dev")
api("com.github.GTNewHorizons:ModularUI2:2.1.11-1.7.10:dev")
api("com.github.GTNewHorizons:waila:1.8.1:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-462-GTNH:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-463-GTNH:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.36-gtnh:dev")
api('com.github.GTNewHorizons:Yamcl:0.6.0:dev')
api("com.github.GTNewHorizons:Postea:1.0.11:dev")
api("com.github.GTNewHorizons:Postea:1.0.13:dev")

compileOnlyApi('com.github.GTNewHorizons:ThaumicTinkerer:2.10.1:dev')
compileOnlyApi("com.github.GTNewHorizons:Mobs-Info:0.4.6-GTNH:dev")
Expand All @@ -63,29 +63,29 @@ dependencies {
compileOnlyApi("com.github.GTNewHorizons:BuildCraft:7.1.39:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.8.17:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:ForestryMC:4.9.16:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:ProjectRed:4.10.2-GTNH:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:ProjectRed:4.10.5-GTNH:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:Railcraft:9.15.14:dev") { transitive = false }

compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.27:deobf") {transitive = false}
compileOnly("com.github.GTNewHorizons:ThaumicBases:1.7.5:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:EnderCore:0.4.6:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:VisualProspecting:1.3.17:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:VisualProspecting:1.3.24:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.94-GTNH:dev") { transitive = false }

compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.2.4-GTNH:dev") { transitive = false }
implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.9-GTNH:dev")
compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.2.5-GTNH:dev") { transitive = false }
implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.10-GTNH:dev")

compileOnly("com.github.GTNewHorizons:Chisel:2.15.2-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Translocators:1.2.1:dev") { transitive = false }
compileOnly rfg.deobf("curse.maven:cofh-core-69162:2388751")
compileOnly("com.github.GTNewHorizons:Nuclear-Control:2.6.7:dev") { transitive = false }
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.68:dev") { transitive = false }
implementation("com.github.GTNewHorizons:Hodgepodge:2.5.70:dev")
compileOnly('com.github.GTNewHorizons:Botania:1.11.5-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:HoloInventory:2.4.12-GTNH:dev') { transitive = false }
compileOnly rfg.deobf("curse.maven:extra-utilities-225561:2264384")
compileOnly rfg.deobf('curse.maven:minefactory-reloaded-66672:2366150')
compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.23-GTNH:dev") {transitive = false}
compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.26-GTNH:dev") {transitive = false}
// https://www.curseforge.com/minecraft/mc-mods/advancedsolarpanels
compileOnlyApi rfg.deobf('curse.maven:advsolar-362768:2885953')
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.25-GTNH:dev') {transitive = false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;

import bartworks.ASM.BWCoreStaticReplacementMethodes;
import bartworks.hooks.BWCoreStaticReplacementMethodes;

public class ClearCraftingCache extends CommandBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* DEALINGS IN THE SOFTWARE.
*/

package bartworks.ASM;
package bartworks.hooks;

import java.util.HashSet;
import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import bartworks.API.recipe.BWNBTDependantCraftingRecipe;
import bartworks.API.recipe.BartWorksRecipeMaps;
import bartworks.ASM.BWCoreStaticReplacementMethodes;
import bartworks.hooks.BWCoreStaticReplacementMethodes;
import bartworks.system.material.WerkstoffLoader;
import bartworks.util.BWUtil;
import bartworks.util.Pair;
Expand Down Expand Up @@ -65,14 +65,10 @@ public class CircuitImprintLoader {
public static void run() {
HashSet<GTRecipe> toRem = new HashSet<>();
HashSet<GTRecipe> toAdd = new HashSet<>();

deleteCALRecipesAndTags();
rebuildCircuitAssemblerMap(toRem, toAdd);
exchangeRecipesInList(toRem, toAdd);
makeCircuitImprintRecipes();

toRem = null;
toAdd = null;
}

private static void reAddOriginalRecipes() {
Expand Down Expand Up @@ -282,14 +278,7 @@ private static void removeOldRecipesFromRegistries() {
BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes();
RecipeMaps.slicerRecipes.getBackend()
.removeRecipes(gtrecipeWorldCache);
recipeWorldCache.forEach(r -> {
try {
BWUtil.getGTBufferedRecipeList()
.remove(r);
} catch (Exception e) {
e.printStackTrace();
}
});
GTModHandler.sBufferRecipeList.removeAll(recipeWorldCache);
recipeWorldCache.clear();
gtrecipeWorldCache.clear();
}
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/bartworks/system/material/WerkstoffLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
import bartworks.system.material.werkstoff_loaders.recipe.MetalLoader;
import bartworks.system.material.werkstoff_loaders.recipe.MoltenCellLoader;
import bartworks.system.material.werkstoff_loaders.recipe.MultipleMetalLoader;
import bartworks.system.material.werkstoff_loaders.recipe.OreLoader;
import bartworks.system.material.werkstoff_loaders.recipe.RawOreLoader;
import bartworks.system.material.werkstoff_loaders.recipe.SimpleMetalLoader;
import bartworks.system.material.werkstoff_loaders.recipe.ToolLoader;
Expand Down Expand Up @@ -320,6 +319,8 @@ public static void setUp() {
public static final Werkstoff Ferberite = new Werkstoff(
new short[] { 0xB0, 0xB0, 0xB0, 0 },
"Ferberite",
Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND)
.setElektrolysis(false),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures(),
11,
Expand Down Expand Up @@ -384,6 +385,8 @@ public static void setUp() {
public static final Werkstoff Huebnerit = new Werkstoff(
new short[] { 0x80, 0x60, 0x60, 0 },
"Huebnerite",
Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND)
.setElektrolysis(false),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures(),
17,
Expand Down Expand Up @@ -1657,7 +1660,7 @@ public static void run() {
}

IWerkstoffRunnable[] werkstoffRunnables = { new ToolLoader(), new DustLoader(), new GemLoader(),
new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(), new RawOreLoader(),
new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new RawOreLoader(),
new CrushedLoader(), new CraftingMaterialLoader(), new CellLoader(), new MoltenCellLoader(),
new MultipleMetalLoader(), new MetalLoader(), new BlockLoader() };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,15 @@ public static String displayRecipe(GTRecipe recipe) {

@SuppressWarnings({ "unchecked", "rawtypes" })
public static void replacePureElements() {
// Cache the ItemList.values() call
final ItemList[] values = ItemList.values();
final ArrayList<ItemStack> ITEMLIST_VALUES = new ArrayList<>(values.length);
for (ItemList e : values) {
if (e.hasBeenSet()) {
ITEMLIST_VALUES.add(e.get(1));
}
}

// furnace
for (Object entry : FurnaceRecipes.smelting()
.getSmeltingList()
Expand All @@ -823,7 +832,7 @@ public static void replacePureElements() {

Werkstoff mat = (ass.mMaterial.mMaterial.equals(Materials.Platinum)) ? PTMetallicPowder : PDMetallicPowder;

if (PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) continue;
if (PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey(), ITEMLIST_VALUES)) continue;
realEntry.setValue(mat.get(prefix, stack.stackSize * 2));
}
// vanilla crafting
Expand Down Expand Up @@ -877,7 +886,7 @@ public static void replacePureElements() {
|| BWUtil.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i]))
&& !BWUtil.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) {
for (ItemStack mInput : recipe.mInputs)
if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
if (PlatinumSludgeOverHaul.isInBlackList(mInput, ITEMLIST_VALUES)) continue recipeloop;
int amount = recipe.mOutputs[i].stackSize * 2;
GTLog.err.println("Recipe edited: " + displayRecipe(recipe));
recipe.mOutputs[i] = LeachResidue.get(dust, amount);
Expand All @@ -888,7 +897,7 @@ public static void replacePureElements() {
|| BWUtil.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i]))
&& !BWUtil.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) {
for (ItemStack mInput : recipe.mInputs)
if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
if (PlatinumSludgeOverHaul.isInBlackList(mInput, ITEMLIST_VALUES)) continue recipeloop;
int amount = recipe.mOutputs[i].stackSize * 2;
GTLog.err.println("Recipe edited: " + displayRecipe(recipe));
recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount);
Expand All @@ -899,7 +908,7 @@ public static void replacePureElements() {
if (GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial
.equals(Materials.Platinum)) {
for (ItemStack mInput : recipe.mInputs) {
if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
if (PlatinumSludgeOverHaul.isInBlackList(mInput, ITEMLIST_VALUES)) continue recipeloop;
}
if (dust.equals(GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
|| dustImpure.equals(GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
Expand All @@ -922,7 +931,7 @@ public static void replacePureElements() {
} else if (GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial
.equals(Materials.Palladium)) {
for (ItemStack mInput : recipe.mInputs) {
if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
if (PlatinumSludgeOverHaul.isInBlackList(mInput, ITEMLIST_VALUES)) continue recipeloop;
}
if (dust.equals(GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
|| dustImpure.equals(GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
Expand All @@ -949,7 +958,8 @@ public static void replacePureElements() {
} else if (GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial
.equals(Materials.Osmium)) {
for (ItemStack mInput : recipe.mInputs) {
if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
if (PlatinumSludgeOverHaul.isInBlackList(mInput, ITEMLIST_VALUES))
continue recipeloop;
}
if (dust.equals(GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
|| dustImpure.equals(GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
Expand Down Expand Up @@ -977,7 +987,8 @@ public static void replacePureElements() {
} else if (GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial
.equals(Materials.Iridium)) {
for (ItemStack mInput : recipe.mInputs) {
if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop;
if (PlatinumSludgeOverHaul.isInBlackList(mInput, ITEMLIST_VALUES))
continue recipeloop;
}
if (dust.equals(GTOreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)
|| dustImpure
Expand Down Expand Up @@ -1106,7 +1117,7 @@ public static boolean checkRecipe(Object input, Materials mat) {
return false;
}

private static boolean isInBlackList(ItemStack stack) {
private static boolean isInBlackList(ItemStack stack, List<ItemStack> ITEMLIST_VALUES) {
if (stack == null || stack.getItem() instanceof BWMetaGeneratedItems
|| MainMod.MOD_ID.equals(GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId)
|| BartWorksCrossmod.MOD_ID.equals(GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId))
Expand All @@ -1122,10 +1133,11 @@ private static boolean isInBlackList(ItemStack stack) {
if (Block.getBlockFromItem(stack.getItem()) instanceof GTGenericBlock
&& !(Block.getBlockFromItem(stack.getItem()) instanceof BlockOresAbstract)) return true;

if (Arrays.stream(ItemList.values())
.filter(ItemList::hasBeenSet)
.anyMatch(e -> !BWUtil.checkStackAndPrefix(stack) && GTUtility.areStacksEqual(e.get(1), stack, true)))
return true;
for (ItemStack itemStack : ITEMLIST_VALUES) {
if (!BWUtil.checkStackAndPrefix(stack) && GTUtility.areStacksEqual(itemStack, stack, true)) {
return true;
}
}

if (stack.getItem() instanceof GTGenericItem) {
if (!BWUtil.checkStackAndPrefix(stack)) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import static gregtech.api.recipe.RecipeMaps.hammerRecipes;
import static gregtech.api.recipe.RecipeMaps.laserEngraverRecipes;
import static gregtech.api.recipe.RecipeMaps.latheRecipes;
import static gregtech.api.recipe.RecipeMaps.maceratorRecipes;
import static gregtech.api.recipe.RecipeMaps.sifterRecipes;
import static gregtech.api.util.GTRecipeBuilder.MINUTES;
import static gregtech.api.util.GTRecipeBuilder.SECONDS;
Expand Down Expand Up @@ -66,13 +65,6 @@ public void run(Werkstoff werkstoff) {
.eut(2)
.addTo(compressorRecipes);

GTValues.RA.stdBuilder()
.itemInputs(werkstoff.get(block))
.itemOutputs(werkstoff.get(gem, 9))
.duration(5 * SECONDS)
.eut(24)
.addTo(hammerRecipes);

GTValues.RA.stdBuilder()
.itemInputs(werkstoff.get(crushedPurified))
.itemOutputs(
Expand All @@ -89,41 +81,6 @@ public void run(Werkstoff werkstoff) {

}

GTValues.RA.stdBuilder()
.itemInputs(werkstoff.get(gemExquisite))
.itemOutputs(werkstoff.get(dust, 4))
.duration(20 * SECONDS)
.eut(2)
.addTo(maceratorRecipes);

GTValues.RA.stdBuilder()
.itemInputs(werkstoff.get(gemFlawless))
.itemOutputs(werkstoff.get(dust, 2))
.duration(20 * SECONDS)
.eut(2)
.addTo(maceratorRecipes);

GTValues.RA.stdBuilder()
.itemInputs(werkstoff.get(gem))
.itemOutputs(werkstoff.get(dust))
.duration(20 * SECONDS)
.eut(2)
.addTo(maceratorRecipes);

GTValues.RA.stdBuilder()
.itemInputs(werkstoff.get(gemFlawed))
.itemOutputs(werkstoff.get(dustSmall, 2))
.duration(20 * SECONDS)
.eut(2)
.addTo(maceratorRecipes);

GTValues.RA.stdBuilder()
.itemInputs(werkstoff.get(gemChipped))
.itemOutputs(werkstoff.get(dustSmall))
.duration(20 * SECONDS)
.eut(2)
.addTo(maceratorRecipes);

GTModHandler.addCraftingRecipe(
werkstoff.get(gemFlawless, 2),
0,
Expand Down Expand Up @@ -202,13 +159,6 @@ public void run(Werkstoff werkstoff) {
texture,
new CoverLens(BWColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex, texture));

GTValues.RA.stdBuilder()
.itemInputs(werkstoff.get(lens))
.itemOutputs(werkstoff.get(dustSmall, 3))
.duration(20 * SECONDS)
.eut(2)
.addTo(maceratorRecipes);

for (ItemStack is : OreDictionary
.getOres("craftingLens" + BWColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) {
is.stackSize = 0;
Expand Down
Loading

0 comments on commit 8aec74a

Please sign in to comment.