From 620a4b459776d7b46d46d32242b6f9082e129573 Mon Sep 17 00:00:00 2001 From: StellarWind22 Date: Fri, 1 Dec 2023 00:03:54 -0600 Subject: [PATCH] Fixed item group stuff --- .../basicshields/initializers/BasicShields.java | 13 +++++++++++++ .../basicshields/module/AdabraniumModule.java | 7 ------- .../basicshields/module/AlexandriteModule.java | 5 ----- .../basicshields/module/BronzeModule.java | 5 ----- .../basicshields/module/CarbonadoModule.java | 5 ----- .../basicshields/module/CitrineModule.java | 5 ----- .../basicshields/module/CorundumModule.java | 5 ----- .../basicshields/module/GobberModule.java | 8 -------- .../basicshields/module/KunziteModule.java | 5 ----- .../basicshields/module/MoissaniteModule.java | 5 ----- .../basicshields/module/PeridotModule.java | 5 ----- .../basicshields/module/RubyModule.java | 5 ----- .../basicshields/module/SapphireModule.java | 5 ----- .../basicshields/module/SpinelModule.java | 5 ----- .../basicshields/module/SteelModule.java | 5 ----- .../basicshields/module/TanzaniteModule.java | 5 ----- .../basicshields/module/TopazModule.java | 5 ----- .../basicshields/module/TourmalineModule.java | 5 ----- .../basicshields/module/VanillaModule.java | 8 -------- 19 files changed, 13 insertions(+), 98 deletions(-) diff --git a/src/main/java/com/github/crimsondawn45/basicshields/initializers/BasicShields.java b/src/main/java/com/github/crimsondawn45/basicshields/initializers/BasicShields.java index 51e34ba..7ee3021 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/initializers/BasicShields.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/initializers/BasicShields.java @@ -27,6 +27,8 @@ import com.github.crimsondawn45.basicshields.module.TopazModule; import com.github.crimsondawn45.basicshields.module.TourmalineModule; import com.github.crimsondawn45.basicshields.module.VanillaModule; +import com.github.crimsondawn45.basicshields.util.ContentModule; +import com.github.crimsondawn45.basicshields.util.ModShieldItem; import me.shedaniel.autoconfig.AutoConfig; import me.shedaniel.autoconfig.serializer.GsonConfigSerializer; @@ -117,6 +119,17 @@ public void onInitialize() { topaz = new TopazModule( CONFIG.always_load_topaz, "more_gems", "gemsandcrystals"); tourmaline = new TourmalineModule( CONFIG.always_load_tourmaline, "more_gems"); + //Register items to group + BasicShields.SHIELDS.entries((context, entries) -> { + + for(ContentModule module : ContentModule.loadedModules) { + + for(ModShieldItem shield : module.getShieldItems()) { + entries.add(shield.getItem()); + } + } + }); + //Build item group Registry.register(Registries.ITEM_GROUP, new Identifier(MOD_ID, "shields"), SHIELDS.build()); diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/AdabraniumModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/AdabraniumModule.java index d0e82a5..a44a476 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/AdabraniumModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/AdabraniumModule.java @@ -68,12 +68,5 @@ public void registerContent() { //Recipe this.addRecipe(adamantium_shield, ModRecipe.createShieldRecipe(adamantium_tag.id(), true, adamantium_shield.getIdentifier())); - - //Item Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(nether_shield.getItem()); - entries.add(vibranium_shield.getItem()); - entries.add(adamantium_shield.getItem()); - }); } } \ No newline at end of file diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/AlexandriteModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/AlexandriteModule.java index 6b97c89..da2359f 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/AlexandriteModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/AlexandriteModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(alexandrite_shield, ModRecipe.createShieldRecipe(alexandrite_tag.id(), true, alexandrite_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(alexandrite_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/BronzeModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/BronzeModule.java index 3313f7b..8c1a211 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/BronzeModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/BronzeModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(bronze_shield, ModRecipe.createShieldRecipe(bronze_tag.id(), true, bronze_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(bronze_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/CarbonadoModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/CarbonadoModule.java index c359632..9534ad5 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/CarbonadoModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/CarbonadoModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(carbonado_shield, ModRecipe.createShieldRecipe(carbonado_tag.id(), true, carbonado_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(carbonado_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/CitrineModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/CitrineModule.java index 86ef2cb..20ecec9 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/CitrineModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/CitrineModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(citrine_shield, ModRecipe.createShieldRecipe(citrine_tag.id(), true, citrine_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(citrine_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/CorundumModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/CorundumModule.java index 57f68d6..0ab429c 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/CorundumModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/CorundumModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(corundum_shield, ModRecipe.createShieldRecipe(corundum_tag.id(), true, corundum_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(corundum_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/GobberModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/GobberModule.java index 9fb8752..a8f0738 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/GobberModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/GobberModule.java @@ -120,13 +120,5 @@ public void registerContent() { //Recipe this.addRecipe(gobber_dragon_shield, ModRecipe.createSmithingRecipe(gobber_end_shield.getIdentifier(), false, gobber_dragon_tag.id(), true, gobber_dragon_shield.getIdentifier())); - - //Item Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(gobber_shield.getItem()); - entries.add(gobber_nether_shield.getItem()); - entries.add(gobber_end_shield.getItem()); - entries.add(gobber_dragon_shield.getItem()); - }); } } \ No newline at end of file diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/KunziteModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/KunziteModule.java index 86c0abd..7d5aac5 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/KunziteModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/KunziteModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(kunzite_shield, ModRecipe.createShieldRecipe(kunzite_tag.id(), true, kunzite_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(kunzite_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/MoissaniteModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/MoissaniteModule.java index b93c79f..c11035a 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/MoissaniteModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/MoissaniteModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(moissanite_shield, ModRecipe.createShieldRecipe(moissanite_tag.id(), true, moissanite_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(moissanite_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/PeridotModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/PeridotModule.java index 2a04227..7c86509 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/PeridotModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/PeridotModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(peridot_shield, ModRecipe.createShieldRecipe(peridot_tag.id(), true, peridot_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(peridot_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/RubyModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/RubyModule.java index a3484a8..60a05d0 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/RubyModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/RubyModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(ruby_shield, ModRecipe.createShieldRecipe(ruby_tag.id(), true, ruby_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(ruby_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/SapphireModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/SapphireModule.java index fd5fc54..11b0bba 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/SapphireModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/SapphireModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(sapphire_shield, ModRecipe.createShieldRecipe(sapphire_tag.id(), true, sapphire_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(sapphire_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/SpinelModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/SpinelModule.java index 6696574..f6366b2 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/SpinelModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/SpinelModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(spinel_shield, ModRecipe.createShieldRecipe(spinel_tag.id(), true, spinel_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(spinel_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/SteelModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/SteelModule.java index 6f0159e..78b4e3a 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/SteelModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/SteelModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(steel_shield, ModRecipe.createShieldRecipe(steel_tag.id(), true, steel_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(steel_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/TanzaniteModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/TanzaniteModule.java index d24c6b5..e4ad142 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/TanzaniteModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/TanzaniteModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(tanzanite_shield, ModRecipe.createShieldRecipe(tanzanite_tag.id(), true, tanzanite_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(tanzanite_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/TopazModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/TopazModule.java index 8d48c53..a1a3fea 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/TopazModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/TopazModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(topaz_shield, ModRecipe.createShieldRecipe(topaz_tag.id(), true, topaz_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(topaz_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/TourmalineModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/TourmalineModule.java index 779486c..ddff621 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/TourmalineModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/TourmalineModule.java @@ -41,10 +41,5 @@ public void registerContent() { //Recipe this.addRecipe(tourmaline_shield, ModRecipe.createShieldRecipe(tourmaline_tag.id(), true, tourmaline_shield.getIdentifier())); - - //Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(tourmaline_shield.getItem()); - }); } } diff --git a/src/main/java/com/github/crimsondawn45/basicshields/module/VanillaModule.java b/src/main/java/com/github/crimsondawn45/basicshields/module/VanillaModule.java index fa56645..afa1f51 100644 --- a/src/main/java/com/github/crimsondawn45/basicshields/module/VanillaModule.java +++ b/src/main/java/com/github/crimsondawn45/basicshields/module/VanillaModule.java @@ -78,13 +78,5 @@ public void registerContent() { //Recipe this.addRecipe(netherite_shield, ModRecipe.createSmithingRecipe(diamond_shield.getIdentifier(), false, netherite_tag.id(), true, netherite_shield.getIdentifier())); - - //Item Group - BasicShields.SHIELDS.entries((context, entries) -> { - entries.add(wooden_shield.getItem()); - entries.add(golden_shield.getItem()); - entries.add(diamond_shield.getItem()); - entries.add(netherite_shield.getItem()); - }); } } \ No newline at end of file