Skip to content

Commit

Permalink
Fixed item group stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
StellarWind22 committed Dec 1, 2023
1 parent 92bc6c9 commit 620a4b4
Show file tree
Hide file tree
Showing 19 changed files with 13 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
}
}

0 comments on commit 620a4b4

Please sign in to comment.