Skip to content

Commit

Permalink
this should deduplicate some F3+H tooltips, like Iron inside a Dust F…
Browse files Browse the repository at this point in the history
…unnel
  • Loading branch information
GregoriusT committed Apr 14, 2024
1 parent 2216a5d commit 42f9c76
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/main/java/gregapi/data/ANY.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023 GregTech-6 Team
* Copyright (c) 2024 GregTech-6 Team
*
* This file is part of GregTech.
*
Expand Down Expand Up @@ -145,5 +145,12 @@ protected static void init() {
_Steel .stealLooks(MT.Steel ).put(DONT_SHOW_THIS_COMPONENT);
_Bronze .stealLooks(MT.Bronze ).put(DONT_SHOW_THIS_COMPONENT);
_Metal .stealLooks(MT.Fe ).put(DONT_SHOW_THIS_COMPONENT);

MT.W.mTargetReversing = ANY.W;
MT.Cu.mTargetReversing = ANY.Cu;
MT.Fe.mTargetReversing = ANY.Fe.mTargetReversing = ANY.Iron;
MT.Steel.mTargetReversing = ANY.Steel;
MT.Stone.mTargetReversing = ANY.Stone;
MT.Wood.mTargetReversing = ANY.Wood;
}
}
2 changes: 1 addition & 1 deletion src/main/java/gregapi/lang/LanguageHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public static String getLocalName(OreDictPrefix aPrefix, OreDictMaterial aMateri
if (aPrefix == OP.crateGtPlate || aPrefix == OP.crateGt64Plate || aPrefix == OP.blockPlate ) return aPrefix.mMaterialPre + getLocalName(OP.plate , aMaterial);
if (aPrefix == OP.crateGtPlateGem || aPrefix == OP.crateGt64PlateGem || aPrefix == OP.blockPlateGem) return aPrefix.mMaterialPre + getLocalName(OP.plateGem, aMaterial);

if (aMaterial.mID >= 0 && aMaterial.mID < 10 && aPrefix.contains(TD.Prefix.ORE)) return "Unidentified Ore";
if (aMaterial.mID >= 0 && aMaterial.mID < 10 && aPrefix.contains(TD.Prefix.ORE)) return APRIL_FOOLS ? "Schrödingers Ore" : "Unidentified Ore";

if (APRIL_FOOLS) {
if (aMaterial == MT.Empty) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/gregapi/oredict/OreDictItemData.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023 GregTech-6 Team
* Copyright (c) 2024 GregTech-6 Team
*
* This file is part of GregTech.
*
Expand Down Expand Up @@ -106,8 +106,8 @@ public OreDictItemData(OreDictItemData... aData) {
ArrayList<OreDictMaterialStack> aList = new ArrayListNoNulls<>(), rList = new ArrayListNoNulls<>();

for (OreDictItemData tData : aData) if (tData != null) {
if (tData.validMaterial() && tData.mMaterial.mAmount > 0) aList.add(tData.mMaterial.clone());
for (OreDictMaterialStack tMaterial : tData.mByProducts) if (tMaterial.mAmount > 0) aList.add(tMaterial.clone());
if (tData.validMaterial() && tData.mMaterial.mAmount > 0) aList.add(OM.stack(tData.mMaterial.mMaterial.mTargetReversing, tData.mMaterial.mAmount));
for (OreDictMaterialStack tMaterial : tData.mByProducts) if (tMaterial.mAmount > 0) aList.add(OM.stack(tMaterial.mMaterial.mTargetReversing, tMaterial.mAmount));
}

for (OreDictMaterialStack aMaterial : aList) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/gregapi/oredict/OreDictMaterial.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ public static OreDictMaterial get(OreDictMaterial aMaterial) {
public int mPriorityPrefixIndex = 0;
/** Contains the most useful Prefix made of 1 Unit for this Material. */
public OreDictPrefix mPriorityPrefix = null;
/** The Material which is the target for Recycling a Crafting Recipe. Mainly to prevent things like Iron from showing up twice in the Ingredients List */
public OreDictMaterial mTargetReversing = this;
/** The Material which is the target for Re-Registration. */
public OreDictMaterial mTargetRegistration = this;
/** The Material which is the target for selecting the preferred Tool Handle. */
Expand Down

0 comments on commit 42f9c76

Please sign in to comment.