Skip to content

Commit 682a195

Browse files
committed
Add some better integration for Shadows of Greg addon
Move a few enums into GTNE from SoG so they don't have to be shimmed in with EnumHelper - With EnumHelper you had to use oredict Strings or valueOf() lookups rather than symbols, so this will make the code cleaner and reduce likelihood of mistakes - None of these items are actually registered by GTNE so there will be no effect on anyone not using SoG Adjust visibility of MetaTileEntityLoader::resolveComponents() for reuse elsewhere
1 parent e89aeca commit 682a195

4 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/main/java/gregtech/api/unification/Element.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ public enum Element {
139139
//stargate
140140
Tr(119, 178, -1, null, "Tritanium", false),
141141
Dr(120, 180, -1, null, "Duranium", false),
142-
Nq(121, 172, 140, null, "Naquadah", true);
142+
Nq(121, 172, 140, null, "Naquadah", true),
143+
//Shadows of Greg
144+
Nt(0, 5000L, -1L, null, "NEUTRONIUM", false);
143145

144146
public final String name;
145147
public final long protons;

src/main/java/gregtech/api/unification/material/MaterialIconType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public enum MaterialIconType {
3333
ingotQuadruple,
3434
ingotQuintuple,
3535
plate,
36+
plateCurved, // SoG
3637
plateDouble,
3738
plateTriple,
3839
plateQuadruple,

src/main/java/gregtech/api/unification/ore/OrePrefix.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package gregtech.api.unification.ore;
22

33
import com.google.common.base.Preconditions;
4+
import gregtech.api.GTValues;
45
import gregtech.api.unification.material.MarkerMaterials;
56
import gregtech.api.unification.material.MaterialIconType;
67
import gregtech.api.unification.material.Materials;
@@ -159,7 +160,16 @@ public enum OrePrefix {
159160
batterySingleUse("Single Use Batteries", -1, null, null, DISALLOW_RECYCLING, null),
160161
battery("Reusable Batteries", -1, null, null, DISALLOW_RECYCLING, null), // Introduced by Calclavia
161162
circuit("Circuits", -1, null, null, ENABLE_UNIFICATION | DISALLOW_RECYCLING, null), // Introduced by Calclavia
162-
chipset("Chipsets", -1, null, null, ENABLE_UNIFICATION | DISALLOW_RECYCLING, null); // Introduced by Buildcraft
163+
chipset("Chipsets", -1, null, null, ENABLE_UNIFICATION | DISALLOW_RECYCLING, null), // Introduced by Buildcraft
164+
165+
// Shadows of Greg
166+
plateCurved("Curved Plate", GTValues.M, null, MaterialIconType.plateCurved,
167+
OrePrefix.Flags.ENABLE_UNIFICATION, mat -> mat instanceof IngotMaterial && mat.hasFlag(DustMaterial.MatFlags.GENERATE_PLATE)),
168+
ingotDouble("Double Ingot", GTValues.M, null, MaterialIconType.ingotDouble,
169+
OrePrefix.Flags.ENABLE_UNIFICATION, mat -> mat instanceof IngotMaterial && mat.hasFlag(DustMaterial.MatFlags.GENERATE_PLATE)),
170+
round("Round", GTValues.M, null, MaterialIconType.round,
171+
OrePrefix.Flags.ENABLE_UNIFICATION, mat -> mat instanceof IngotMaterial && mat.hasFlag(IngotMaterial.MatFlags.GENERATE_SMALL_GEAR));
172+
163173

164174
public static final String DUST_REGULAR = "dustRegular";
165175

@@ -171,7 +181,7 @@ public static class Flags {
171181
}
172182

173183
public static class Conditions {
174-
public static Predicate<Material> isToolMaterial = mat -> mat instanceof SolidMaterial && ((SolidMaterial) mat).toolDurability > 0;
184+
public static Predicate<Material> isToolMaterial = mat -> mat instanceof SolidMaterial s && s.toolDurability > 0;
175185
}
176186

177187
static {

src/main/java/gregtech/loaders/recipe/MetaTileEntityLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,8 +1076,8 @@ void registerTieredShapedRecipes(String prefix,
10761076
* @param subs substitution mappings
10771077
* @return a new array containing tier-resolved substitution mappings
10781078
*/
1079-
private static Substitution<?>[] resolveComponents(int tier,
1080-
Substitution<?>... subs) {
1079+
public static Substitution<?>[] resolveComponents(int tier,
1080+
Substitution<?>... subs) {
10811081
Substitution<?>[] result = new ModHandler.Substitution[subs.length];
10821082
for(int i = 0; i < subs.length; i++) {
10831083
var current = subs[i];

0 commit comments

Comments
 (0)