Skip to content

Commit

Permalink
Merge branch 'master' into config/tectech
Browse files Browse the repository at this point in the history
  • Loading branch information
boubou19 authored Sep 17, 2024
2 parents 0f7a7b7 + d869dae commit d8dceca
Show file tree
Hide file tree
Showing 87 changed files with 671 additions and 2,550 deletions.
10 changes: 5 additions & 5 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
dependencies {
api("com.github.GTNewHorizons:StructureLib:1.3.4:dev")
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.6.36-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.6.38-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughIds:2.1.2:dev")
api("com.github.GTNewHorizons:GTNHLib:0.5.11:dev")
api("com.github.GTNewHorizons:ModularUI:1.2.5:dev")
Expand Down Expand Up @@ -69,8 +69,8 @@ dependencies {
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.16:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.93-GTNH:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:VisualProspecting:1.3.17: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")
Expand All @@ -95,7 +95,7 @@ dependencies {
compileOnly rfg.deobf("curse.maven:biomes-o-plenty-220318:2499612")

compileOnly('com.github.GTNewHorizons:SC2:2.2.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:Binnie:2.4.1:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Binnie:2.4.2:dev') {transitive = false}
compileOnly('curse.maven:PlayerAPI-228969:2248928') {transitive=false}
compileOnly('com.github.GTNewHorizons:BlockRenderer6343:1.2.14:dev'){transitive=false}

Expand All @@ -108,7 +108,7 @@ dependencies {
// runtimeOnlyNonPublishable("com.github.GTNewHorizons:ForestryMC:4.9.16:dev")
// runtimeOnlyNonPublishable('com.github.GTNewHorizons:neiaddons:1.16.0:dev')
// runtimeOnlyNonPublishable('com.github.GTNewHorizons:MagicBees:2.8.5-GTNH:dev')
// runtimeOnlyNonPublishable('com.github.GTNewHorizons:Binnie:2.4.1:dev')
// runtimeOnlyNonPublishable('com.github.GTNewHorizons:Binnie:2.4.2:dev')

testImplementation(platform('org.junit:junit-bom:5.9.2'))
testImplementation('org.junit.jupiter:junit-jupiter')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,58 +98,62 @@ public static void addEBFGasRecipes() {

public static void unificationRecipeEnforcer() {
List<GTRecipe> toRemove = new ArrayList<>();
final OrePrefixes[] OREPREFIX_VALUES = OrePrefixes.values();
for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
StaticRecipeChangeLoaders.runMaterialLinker(werkstoff);
if (werkstoff.getGenerationFeatures().enforceUnification) {
HashSet<String> oreDictNames = new HashSet<>(werkstoff.getADDITIONAL_OREDICT());
oreDictNames.add(werkstoff.getVarName());
StaticRecipeChangeLoaders.runMoltenUnificationEnfocement(werkstoff);
StaticRecipeChangeLoaders.runUnficationDeleter(werkstoff);
for (String s : oreDictNames) for (OrePrefixes prefixes : OrePrefixes.values()) {
if (!werkstoff.hasItemType(prefixes)) continue;
String fullOreName = prefixes + s;
List<ItemStack> ores = OreDictionary.getOres(fullOreName, false);
if (ores.size() <= 1) // empty or one entry, i.e. no unification needed
continue;
for (ItemStack toReplace : ores) {
ItemStack replacement = werkstoff.get(prefixes);
if (toReplace == null || GTUtility.areStacksEqual(toReplace, replacement)
|| replacement == null
|| replacement.getItem() == null) continue;
for (RecipeMap<?> map : RecipeMap.ALL_RECIPE_MAPS.values()) {
toRemove.clear();
nextRecipe: for (GTRecipe recipe : map.getAllRecipes()) {
boolean removal = map.equals(RecipeMaps.fluidExtractionRecipes)
|| map.equals(RecipeMaps.fluidSolidifierRecipes);
for (int i = 0; i < recipe.mInputs.length; i++) {
if (!GTUtility.areStacksEqual(recipe.mInputs[i], toReplace)) continue;
if (removal) {
toRemove.add(recipe);
continue nextRecipe;
for (String s : oreDictNames) {
for (OrePrefixes prefixes : OREPREFIX_VALUES) {
if (!werkstoff.hasItemType(prefixes)) continue;
String fullOreName = prefixes + s;
List<ItemStack> ores = OreDictionary.getOres(fullOreName, false);
if (ores.size() <= 1) // empty or one entry, i.e. no unification needed
continue;
for (ItemStack toReplace : ores) {
ItemStack replacement = werkstoff.get(prefixes);
if (toReplace == null || GTUtility.areStacksEqual(toReplace, replacement)
|| replacement == null
|| replacement.getItem() == null) continue;
for (RecipeMap<?> map : RecipeMap.ALL_RECIPE_MAPS.values()) {
toRemove.clear();
nextRecipe: for (GTRecipe recipe : map.getAllRecipes()) {
boolean removal = map.equals(RecipeMaps.fluidExtractionRecipes)
|| map.equals(RecipeMaps.fluidSolidifierRecipes);
for (int i = 0; i < recipe.mInputs.length; i++) {
if (!GTUtility.areStacksEqual(recipe.mInputs[i], toReplace)) continue;
if (removal) {
toRemove.add(recipe);
continue nextRecipe;
}
recipe.mInputs[i] = GTUtility
.copyAmount(recipe.mInputs[i].stackSize, replacement);
}
recipe.mInputs[i] = GTUtility.copyAmount(recipe.mInputs[i].stackSize, replacement);
}
for (int i = 0; i < recipe.mOutputs.length; i++) {
if (!GTUtility.areStacksEqual(recipe.mOutputs[i], toReplace)) continue;
if (removal) {
toRemove.add(recipe);
continue nextRecipe;
for (int i = 0; i < recipe.mOutputs.length; i++) {
if (!GTUtility.areStacksEqual(recipe.mOutputs[i], toReplace)) continue;
if (removal) {
toRemove.add(recipe);
continue nextRecipe;
}
recipe.mOutputs[i] = GTUtility
.copyAmount(recipe.mOutputs[i].stackSize, replacement);
}
recipe.mOutputs[i] = GTUtility
.copyAmount(recipe.mOutputs[i].stackSize, replacement);
}
if (recipe.mSpecialItems instanceof ItemStack specialItemStack) {
if (!GTUtility.areStacksEqual(specialItemStack, toReplace)) continue;
if (removal) {
toRemove.add(recipe);
continue nextRecipe;
if (recipe.mSpecialItems instanceof ItemStack specialItemStack) {
if (!GTUtility.areStacksEqual(specialItemStack, toReplace)) continue;
if (removal) {
toRemove.add(recipe);
continue nextRecipe;
}
recipe.mSpecialItems = GTUtility
.copyAmount(specialItemStack.stackSize, replacement);
}
recipe.mSpecialItems = GTUtility
.copyAmount(specialItemStack.stackSize, replacement);
}
map.getBackend()
.removeRecipes(toRemove);
}
map.getBackend()
.removeRecipes(toRemove);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,7 @@ protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zD
int yHead, int oldYHead) {
if (this.mMode != 3) {
this.isPickingPipes = false;
try {
Field workState = this.getClass()
.getField("workState");
workState.setInt(this, 0);
} catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) {}
this.workState = 0;
return true;
}
return super.workingUpward(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead);
Expand All @@ -215,12 +211,7 @@ protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int
int yHead, int oldYHead) {
if (this.mMode == 3) {
this.isPickingPipes = true;
try {
Field workState = this.getClass()
.getSuperclass()
.getDeclaredField("workState");
workState.setInt(this, 2);
} catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) {}
this.workState = 2;
return true;
}

Expand Down
35 changes: 13 additions & 22 deletions src/main/java/bartworks/system/material/WerkstoffLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,9 @@ public static void run() {
DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre));
Integer[] clsArr = {};
int size = 0;
if (BetterLoadingScreen.isModLoaded()) clsArr = CLSCompat.initCls();
if (BetterLoadingScreen.isModLoaded()) {
clsArr = CLSCompat.initCls();
}

IWerkstoffRunnable[] werkstoffRunnables = { new ToolLoader(), new DustLoader(), new GemLoader(),
new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(), new RawOreLoader(),
Expand All @@ -1670,7 +1672,9 @@ public static void run() {
progressBar.step("");
continue;
}
if (BetterLoadingScreen.isModLoaded()) size = CLSCompat.invokeStepSize(werkstoff, clsArr, size);
if (BetterLoadingScreen.isModLoaded()) {
size = CLSCompat.invokeStepSize(werkstoff, clsArr, size);
}
DebugLog.log("Werkstoff: " + werkstoff.getDefaultName() + " " + (System.nanoTime() - timepreone));
for (IWerkstoffRunnable runnable : werkstoffRunnables) {
String loaderName = runnable.getClass()
Expand Down Expand Up @@ -2002,38 +2006,25 @@ public static void addVanillaCasingsToGTOreDictUnificator() {
}

/**
* very hacky way to make my ores/blocks/smallores detectable by gt assosication in world, well at least the prefix.
* very hacky way to make my ores/blocks/small ores detectable by gt association in world, well at least the prefix.
* used for the miners mostly removing this hacky material from the materials map instantly. we only need the item
* data.
*/
@SuppressWarnings("unchecked")
private static void addFakeItemDataToInWorldBlocksAndCleanUpFakeData() {

Map<String, Materials> MATERIALS_MAP = null;

try {
Field f = Materials.class.getDeclaredField("MATERIALS_MAP");
f.setAccessible(true);
MATERIALS_MAP = (Map<String, Materials>) f.get(null);
} catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) {
e.printStackTrace();
}

if (MATERIALS_MAP == null) throw new NullPointerException("MATERIALS_MAP null!");

Materials oreMat = new Materials(-1, null, 0, 0, 0, false, "bwores", "bwores", null, true, null);
Materials smallOreMat = new Materials(-1, null, 0, 0, 0, false, "bwsmallores", "bwsmallores", null, true, null);
Materials blockMat = new Materials(-1, null, 0, 0, 0, false, "bwblocks", "bwblocks", null, true, null);

for (int i = 0; i < 16; i++) {
GTOreDictUnificator.addAssociation(ore, oreMat, new ItemStack(BWOres, 1, i), true);
GTOreDictUnificator.addAssociation(oreSmall, smallOreMat, new ItemStack(BWSmallOres, 1, i), true);
GTOreDictUnificator.addAssociation(block, blockMat, new ItemStack(BWBlocks, 1, i), true);
}

MATERIALS_MAP.remove("bwores");
MATERIALS_MAP.remove("bwsmallores");
MATERIALS_MAP.remove("bwblocks");
Materials.getMaterialsMap()
.remove("bwores");
Materials.getMaterialsMap()
.remove("bwsmallores");
Materials.getMaterialsMap()
.remove("bwblocks");
}

public static void removeIC2Recipes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ public void run(Werkstoff werkstoff) {
1,
1,
null);
final Element[] ELEMENT_VALUES = Element.values();
for (OrePrefixes prefixes : values()) {
if (prefixes != cell || !Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) {
if (prefixes == dust && Werkstoff.Types.ELEMENT.equals(werkstoff.getType())
&& Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) {
boolean ElementSet = false;
for (Element e : Element.values()) {
for (Element e : ELEMENT_VALUES) {
if (e.toString()
.equals(werkstoff.getToolTip())) {
if (!e.mLinkedMaterials.isEmpty()) break;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/bartworks/system/worldgen/MapGenRuins.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ private void checkTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int
if (BTE.getMetaTileID() != meta || worldObj.getTileEntity(x, y, z) != BTE || BTE.isInvalid()) {
this.redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing);
this.checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, depth);
depth++;
}
} else {
worldObj.removeTileEntity(x, y, z);
Expand Down
Loading

0 comments on commit d8dceca

Please sign in to comment.