Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove forbidden getModItem calls #952

Merged
merged 33 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6696a10
import tests from GT5U
boubou19 Aug 28, 2024
0ffa2f3
add NHCore in the forbidden list
boubou19 Aug 28, 2024
3e79507
purge litterals from GMI
boubou19 Aug 28, 2024
884aa14
remove bw gmi (1/2)
boubou19 Aug 28, 2024
c9f74e4
remove GG.isModLoaded
boubou19 Aug 28, 2024
74b4d99
remove BW.isModLoaded
boubou19 Aug 28, 2024
78e3649
remove GT++.isModLoaded
boubou19 Aug 28, 2024
0383b38
remove NEIOrePlugin.isModLoaded
boubou19 Aug 28, 2024
d3a3643
remove TT.isModLoaded
boubou19 Aug 28, 2024
e80b4e7
remove KekzTech.isModLoaded
boubou19 Aug 28, 2024
f19013f
prevent useless isModLoaded checks
boubou19 Aug 28, 2024
d8f788d
remove bw gmi (2/2)
boubou19 Aug 28, 2024
e60095e
remove NEIOrePlugin gmi
boubou19 Aug 28, 2024
8063aa9
remove tectech gmi
boubou19 Aug 28, 2024
a1c7974
remove nhcore gmi (1/3)
boubou19 Aug 29, 2024
532bdaf
remove nhcore gmi (2/3)
boubou19 Aug 29, 2024
b932d85
remove gregtech gmi (1/2)
boubou19 Aug 30, 2024
46943b3
Merge branch 'master' into fix/forbidden_gmi
boubou19 Aug 31, 2024
4e7d02d
temp
boubou19 Aug 31, 2024
6ed6513
Merge branch 'fix/forbidden_gmi' of github.com:GTNewHorizons/NewHoriz…
boubou19 Aug 31, 2024
cc1eb3d
fix other merge conflicts
boubou19 Aug 31, 2024
7157bf8
remove gregtech gmi (2/2)
boubou19 Aug 31, 2024
724af81
remove nhcore gmi (3/3)
boubou19 Aug 31, 2024
e8eac91
remove gg gmi (3/3)
boubou19 Aug 31, 2024
4ead067
remove kekztech gmi (3/3)
boubou19 Aug 31, 2024
978596a
strenghten gmi checks
boubou19 Aug 31, 2024
7269660
fix GT++ gmi
boubou19 Sep 1, 2024
270a561
spotless apply
boubou19 Sep 1, 2024
1667608
Merge branch 'master' into fix/forbidden_gmi
boubou19 Sep 1, 2024
c840ded
fix bad copy paste
boubou19 Sep 1, 2024
2f3f1b6
fix missing import
boubou19 Sep 1, 2024
c906344
Merge branch 'fix/forbidden_gmi' of github.com:GTNewHorizons/NewHoriz…
boubou19 Sep 1, 2024
6b5a997
fix bad copy/paste again
boubou19 Sep 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/test-forbidden-getmoditems.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Forbidden getModItems

on:
pull_request:
branches: [ master, main ]
push:
branches: [ master, main ]

jobs:
test-forbidden-getmoditems:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect forbidden getModItem calls
shell: bash
run: |
! grep -E -r 'getModItem\(("(bartworks|galacticgreg|ggfab|GoodGenerator|gregtech|gtnhlanth|miscutils|kekztech|kubatech|tectech|gtneioreplugin|dreamcraft)"|.*(BartWorks|GalactiGreg|GGFab|GoodGenerator|GregTech|GTNHLanthanides|GTPlusPlus|KekzTech|KubaTech|TecTech|NEIOrePlugin|NewHorizonsCoreMod)\.ID)' src/main/java
18 changes: 18 additions & 0 deletions .github/workflows/test-forbidden-ismodloaded.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Forbidden isModLoaded

on:
pull_request:
branches: [ master, main ]
push:
branches: [ master, main ]

jobs:
test-forbidden-isModLoaded:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect forbidden isModLoaded calls
shell: bash
run: |
! grep -E -r '(BartWorks|GalactiGreg|GGFab|GoodGenerator|GTNHLanthanides|GregTech|GTPlusPlus|KekzTech|KubaTech|TecTech|NEIOrePlugin|NewHorizonsCoreMod)\.isModLoaded' src/main/java
19 changes: 19 additions & 0 deletions .github/workflows/test-scala-presence.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test Scala Presence

on:
pull_request:
branches: [ master, main ]
push:
branches: [ master, main ]

jobs:
test-scala-presence:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect scala presence
shell: bash
run: |
! grep -E -r 'import scala\.' src/main/java

2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Add your dependencies here

dependencies {
api("com.github.GTNewHorizons:GT5-Unofficial:5.09.49.40:dev")
api("com.github.GTNewHorizons:GT5-Unofficial:5.09.49.42:dev")
api("com.github.GTNewHorizons:Yamcl:0.6.0:dev")
api("com.github.GTNewHorizons:Baubles:1.0.4:dev")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.dreammaster.auxiliary;

import static com.dreammaster.scripts.IScriptLoader.missing;
import static com.dreammaster.scripts.IScriptLoader.wildcard;
import static gregtech.api.enums.Mods.*;

import net.minecraft.init.Blocks;
Expand Down Expand Up @@ -113,22 +114,6 @@ public void loadConfig() {
API.hideItem(GT_ModHandler.getModItem(AppliedEnergistics2.ID, "tile.BlockPaint", 1));
}

if (BartWorks.isModLoaded()) {
API.hideItem(GT_ModHandler.getModItem(BartWorks.ID, "gt.bwMetaGeneratedGTEnhancementcapsule", 1, 477));
API.hideItem(
GT_ModHandler
.getModItem(BartWorks.ID, "gt.bwMetaGeneratedGTEnhancementcapsule", 1, 32767, missing));
API.hideItem(
GT_ModHandler.getModItem(
BartWorks.ID,
"gt.bwMetaGeneratedGTEnhancementcapsuleMolten",
1,
32767,
missing));
API.hideItem(GT_ModHandler.getModItem(BartWorks.ID, "gt.bwMetaGeneratedcapsuleMolten", 1, 32767, missing));
API.hideItem(GT_ModHandler.getModItem(BartWorks.ID, "gt.bwMetaGeneratedcapsule", 1, 32767, missing));
}

if (Chisel.isModLoaded()) {
API.hideItem(GT_ModHandler.getModItem(Chisel.ID, "amber", 1));
API.hideItem(GT_ModHandler.getModItem(Chisel.ID, "bloodBrick", 1));
Expand Down Expand Up @@ -157,8 +142,8 @@ public void loadConfig() {
API.hideItem(GT_ModHandler.getModItem(BiomesOPlenty.ID, "misc", 1, 6, missing));
}
if (MagicBees.isModLoaded()) {
API.hideItem(GT_ModHandler.getModItem(MagicBees.ID, "capsule.magic", 1, 32767, missing));
API.hideItem(GT_ModHandler.getModItem(MagicBees.ID, "capsule.void", 1, 32767, missing));
API.hideItem(GT_ModHandler.getModItem(MagicBees.ID, "capsule.magic", 1, wildcard, missing));
API.hideItem(GT_ModHandler.getModItem(MagicBees.ID, "capsule.void", 1, wildcard, missing));
}

if (ForbiddenMagic.isModLoaded()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps.radioHatchRecipes;
import static com.github.bartimaeusnek.bartworks.util.BWRecipes.calcDecayTicks;
import static gregtech.api.enums.Mods.GTPlusPlus;
import static gregtech.api.util.GT_RecipeConstants.DECAY_TICKS;

import net.minecraft.item.ItemStack;
Expand All @@ -14,10 +13,6 @@
public class BW_RadHatchMaterial {

public static void runRadHatchAdder() {
if (!GTPlusPlus.isModLoaded()) {
return;
}

ItemStack err = ItemUtils.getErrorStack(1);

for (Material material : Material.mMaterialMap) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

public class BartWorksMaterials {

@Deprecated
public static Materials getBartWorksMaterialByVarName(String name) {
Materials materials = Materials._NULL;
try {
Expand All @@ -21,16 +22,19 @@ public static Materials getBartWorksMaterialByVarName(String name) {
return materials;
}

@Deprecated
public static Materials getBartWorksMaterialByODName(String name) {
return Werkstoff.werkstoffHashSet.stream().filter(e -> e.getVarName().equals(name)).findFirst()
.map(Werkstoff::getBridgeMaterial).orElse(Materials._NULL);
}

@Deprecated
public static Materials getBartWorksMaterialByIGNName(String name) {
return Optional.ofNullable(Werkstoff.werkstoffNameHashMap.get(name)).map(Werkstoff::getBridgeMaterial)
.orElse(Materials._NULL);
}

@Deprecated
public static Materials getBartWorksMaterialByID(int id) {
return Optional.ofNullable(Werkstoff.werkstoffHashMap.get((short) id)).map(Werkstoff::getBridgeMaterial)
.orElse(Materials._NULL);
Expand Down
Loading