This repository has been archived by the owner on Mar 8, 2024. It is now read-only.
forked from bartimaeusnek/bartworks
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Convert manual LCR recipe addition to RA2 * Remove outdated recipe addition for replicator * Remove DynamicGTRecipe constructor that is identical to super * Remove duplicated replicator recipe generation * Migrate BW recipemaps * Migrate recipe loaders * Remove enforceNobleGas No material succeeds in this method in the modpack * Apply recipe categories * Fix recipe removal code * Adjust recipe catalysts * update bs+deps+gradle * fix * fix * change back to gtnh tag --------- Co-authored-by: Martin Robertz <[email protected]> Former-commit-id: 3c91fe83d0620dc1d3933f569101645351005add
- Loading branch information
1 parent
95b4384
commit 9cf3651
Showing
76 changed files
with
1,041 additions
and
1,720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// Add your dependencies here | ||
|
||
dependencies { | ||
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.91:dev') | ||
api("com.github.GTNewHorizons:TecTech:5.3.15:dev") | ||
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.96:dev') | ||
api("com.github.GTNewHorizons:TecTech:5.3.18:dev") | ||
api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { | ||
exclude group:"com.github.GTNewHorizons", module:"bartworks" | ||
} | ||
api("com.github.GTNewHorizons:Avaritia:1.46:dev") | ||
implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.12-GTNH:dev") | ||
|
||
compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} | ||
compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.25-pre:dev") {transitive = false} | ||
compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:api") {transitive = false} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...main/java/com/github/bartimaeusnek/bartworks/API/recipe/BWNBTDependantCraftingRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package com.github.bartimaeusnek.bartworks.API.recipe; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
import net.minecraft.inventory.InventoryCrafting; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.crafting.IRecipe; | ||
import net.minecraft.world.World; | ||
|
||
import com.github.bartimaeusnek.bartworks.util.BW_Util; | ||
|
||
public class BWNBTDependantCraftingRecipe implements IRecipe { | ||
|
||
ItemStack result; | ||
Map<Character, ItemStack> charToStackMap = new HashMap<>(9, 1); | ||
String[] shape; | ||
|
||
@SuppressWarnings({ "SuspiciousSystemArraycopy" }) | ||
public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) { | ||
this.result = result; | ||
this.shape = new String[3]; | ||
System.arraycopy(recipe, 0, this.shape, 0, 3); | ||
this.charToStackMap.put(' ', null); | ||
for (int i = 3; i < recipe.length; i += 2) { | ||
this.charToStackMap.put((char) recipe[i], ((ItemStack) recipe[i + 1]).copy()); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof BWNBTDependantCraftingRecipe that)) return false; | ||
|
||
if (!Objects.equals(this.result, that.result) || !Objects.equals(this.charToStackMap, that.charToStackMap)) | ||
return false; | ||
// Probably incorrect - comparing Object[] arrays with Arrays.equals | ||
return Arrays.equals(this.shape, that.shape); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result1 = this.result != null ? this.result.hashCode() : 0; | ||
result1 = 31 * result1 + (this.charToStackMap != null ? this.charToStackMap.hashCode() : 0); | ||
return 31 * result1 + Arrays.hashCode(this.shape); | ||
} | ||
|
||
@Override | ||
public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { | ||
for (int x = 0; x < 3; x++) { | ||
for (int y = 0; y < 3; y++) { | ||
ItemStack toCheck = p_77569_1_.getStackInRowAndColumn(y, x); | ||
ItemStack ref = this.charToStackMap.get(this.shape[x].toCharArray()[y]); | ||
if (!BW_Util.areStacksEqualOrNull(toCheck, ref)) return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
@Override | ||
public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { | ||
return this.result.copy(); | ||
} | ||
|
||
@Override | ||
public int getRecipeSize() { | ||
return 10; | ||
} | ||
|
||
@Override | ||
public ItemStack getRecipeOutput() { | ||
return this.result; | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BacterialVatFrontend.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package com.github.bartimaeusnek.bartworks.API.recipe; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; | ||
|
||
import net.minecraft.util.EnumChatFormatting; | ||
import net.minecraft.util.StatCollector; | ||
|
||
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; | ||
import com.gtnewhorizons.modularui.api.math.Alignment; | ||
|
||
import gregtech.api.recipe.BasicUIPropertiesBuilder; | ||
import gregtech.api.recipe.NEIRecipePropertiesBuilder; | ||
import gregtech.api.recipe.RecipeMapFrontend; | ||
import gregtech.api.util.MethodsReturnNonnullByDefault; | ||
import gregtech.nei.GT_NEI_DefaultHandler; | ||
import gregtech.nei.RecipeDisplayInfo; | ||
import gregtech.nei.formatter.INEISpecialInfoFormatter; | ||
|
||
@ParametersAreNonnullByDefault | ||
@MethodsReturnNonnullByDefault | ||
public class BacterialVatFrontend extends RecipeMapFrontend { | ||
|
||
public BacterialVatFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, | ||
NEIRecipePropertiesBuilder neiPropertiesBuilder) { | ||
super( | ||
uiPropertiesBuilder, | ||
neiPropertiesBuilder.neiSpecialInfoFormatter(new BacterialVatSpecialValueFormatter())); | ||
} | ||
|
||
@Override | ||
protected List<String> handleNEIItemInputTooltip(List<String> currentTip, | ||
GT_NEI_DefaultHandler.FixedPositionedStack pStack) { | ||
if (pStack.isFluid()) { | ||
currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.input.tooltip")); | ||
return currentTip; | ||
} | ||
return super.handleNEIItemInputTooltip(currentTip, pStack); | ||
} | ||
|
||
@Override | ||
protected List<String> handleNEIItemOutputTooltip(List<String> currentTip, | ||
GT_NEI_DefaultHandler.FixedPositionedStack pStack) { | ||
if (pStack.isFluid()) { | ||
currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.output.tooltip")); | ||
return currentTip; | ||
} | ||
return super.handleNEIItemOutputTooltip(currentTip, pStack); | ||
} | ||
|
||
@Override | ||
protected void drawNEIOverlayForInput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { | ||
drawFluidOverlay(stack); | ||
} | ||
|
||
@Override | ||
protected void drawNEIOverlayForOutput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { | ||
drawFluidOverlay(stack); | ||
} | ||
|
||
private void drawFluidOverlay(GT_NEI_DefaultHandler.FixedPositionedStack stack) { | ||
if (stack.isFluid()) { | ||
drawNEIOverlayText( | ||
"+", | ||
stack, | ||
colorOverride.getTextColorOrDefault("nei_overlay_yellow", 0xFDD835), | ||
0.5f, | ||
true, | ||
Alignment.TopRight); | ||
return; | ||
} | ||
super.drawNEIOverlayForOutput(stack); | ||
} | ||
|
||
private static class BacterialVatSpecialValueFormatter implements INEISpecialInfoFormatter { | ||
|
||
@Override | ||
public List<String> format(RecipeDisplayInfo recipeInfo) { | ||
int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(recipeInfo.recipe.mSpecialValue); | ||
String glassTier = StatCollector.translateToLocalFormatted("nei.biovat.0.name", tSpecialA[0]); | ||
String sievert; | ||
if (tSpecialA[2] == 1) { | ||
sievert = StatCollector.translateToLocalFormatted("nei.biovat.1.name", tSpecialA[3]); | ||
} else { | ||
sievert = StatCollector.translateToLocalFormatted("nei.biovat.2.name", tSpecialA[3]); | ||
} | ||
return Arrays.asList(glassTier, sievert); | ||
} | ||
} | ||
} |
Oops, something went wrong.