Skip to content

Commit

Permalink
fix: 🐛 Fixed Chipped upgrades to be included as optional entries in s…
Browse files Browse the repository at this point in the history
…ophisticatedbackpacks:upgrade tag list (and thus not break loading this list when Chipped isn't present)
  • Loading branch information
P3pp3rF1y committed Jan 23, 2025
1 parent 2eb6206 commit a37d4c5
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 45 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loader_version_range=[4,)
mod_id=sophisticatedbackpacks
mod_name=Sophisticated Backpacks
mod_license=GNU General Public License v3.0
mod_version=3.22.6
mod_version=3.22.7
mod_group_id=sophisticatedbackpacks
mod_authors=P3pp3rF1y, Ridanisaurus
mod_description=Fancy and functional backpacks.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,55 +1,76 @@
{
"values": [
"sophisticatedbackpacks:jukebox_upgrade",
"sophisticatedbackpacks:chipped/loom_table_upgrade",
"sophisticatedbackpacks:filter_upgrade",
"sophisticatedbackpacks:void_upgrade",
"sophisticatedbackpacks:advanced_void_upgrade",
"sophisticatedbackpacks:feeding_upgrade",
"sophisticatedbackpacks:pump_upgrade",
"sophisticatedbackpacks:advanced_deposit_upgrade",
"sophisticatedbackpacks:stack_upgrade_tier_2",
"sophisticatedbackpacks:xp_pump_upgrade",
"sophisticatedbackpacks:stonecutter_upgrade",
"sophisticatedbackpacks:chipped/carpenters_table_upgrade",
"sophisticatedbackpacks:inception_upgrade",
"sophisticatedbackpacks:smelting_upgrade",
"sophisticatedbackpacks:smithing_upgrade",
"sophisticatedbackpacks:advanced_jukebox_upgrade",
{
"id": "sophisticatedbackpacks:chipped/tinkering_table_upgrade",
"required": false
},
"sophisticatedbackpacks:advanced_pickup_upgrade",
"sophisticatedbackpacks:battery_upgrade",
{
"id": "sophisticatedbackpacks:chipped/loom_table_upgrade",
"required": false
},
"sophisticatedbackpacks:auto_smelting_upgrade",
"sophisticatedbackpacks:anvil_upgrade",
"sophisticatedbackpacks:stack_upgrade_tier_1",
"sophisticatedbackpacks:stack_upgrade_tier_2",
"sophisticatedbackpacks:advanced_feeding_upgrade",
"sophisticatedbackpacks:filter_upgrade",
"sophisticatedbackpacks:advanced_refill_upgrade",
"sophisticatedbackpacks:stack_upgrade_tier_4",
"sophisticatedbackpacks:stack_upgrade_starter_tier",
"sophisticatedbackpacks:tool_swapper_upgrade",
"sophisticatedbackpacks:magnet_upgrade",
"sophisticatedbackpacks:pickup_upgrade",
"sophisticatedbackpacks:advanced_tool_swapper_upgrade",
"sophisticatedbackpacks:stack_upgrade_tier_3",
"sophisticatedbackpacks:everlasting_upgrade",
"sophisticatedbackpacks:deposit_upgrade",
"sophisticatedbackpacks:feeding_upgrade",
"sophisticatedbackpacks:advanced_magnet_upgrade",
"sophisticatedbackpacks:advanced_void_upgrade",
{
"id": "sophisticatedbackpacks:chipped/carpenters_table_upgrade",
"required": false
},
"sophisticatedbackpacks:blasting_upgrade",
"sophisticatedbackpacks:crafting_upgrade",
"sophisticatedbackpacks:tank_upgrade",
"sophisticatedbackpacks:advanced_compacting_upgrade",
"sophisticatedbackpacks:restock_upgrade",
"sophisticatedbackpacks:inception_upgrade",
{
"id": "sophisticatedbackpacks:chipped/mason_table_upgrade",
"required": false
},
"sophisticatedbackpacks:everlasting_upgrade",
"sophisticatedbackpacks:stonecutter_upgrade",
"sophisticatedbackpacks:advanced_filter_upgrade",
"sophisticatedbackpacks:advanced_tool_swapper_upgrade",
"sophisticatedbackpacks:auto_smoking_upgrade",
"sophisticatedbackpacks:blasting_upgrade",
"sophisticatedbackpacks:auto_blasting_upgrade",
"sophisticatedbackpacks:compacting_upgrade",
"sophisticatedbackpacks:advanced_pickup_upgrade",
"sophisticatedbackpacks:magnet_upgrade",
"sophisticatedbackpacks:chipped/botanist_workbench_upgrade",
"sophisticatedbackpacks:refill_upgrade",
"sophisticatedbackpacks:deposit_upgrade",
"sophisticatedbackpacks:chipped/tinkering_table_upgrade",
"sophisticatedbackpacks:xp_pump_upgrade",
"sophisticatedbackpacks:tank_upgrade",
{
"id": "sophisticatedbackpacks:chipped/botanist_workbench_upgrade",
"required": false
},
"sophisticatedbackpacks:advanced_pump_upgrade",
"sophisticatedbackpacks:advanced_feeding_upgrade",
"sophisticatedbackpacks:battery_upgrade",
"sophisticatedbackpacks:advanced_refill_upgrade",
"sophisticatedbackpacks:chipped/mason_table_upgrade",
"sophisticatedbackpacks:restock_upgrade",
"sophisticatedbackpacks:void_upgrade",
"sophisticatedbackpacks:smelting_upgrade",
"sophisticatedbackpacks:pump_upgrade",
{
"id": "sophisticatedbackpacks:chipped/glassblower_upgrade",
"required": false
},
"sophisticatedbackpacks:refill_upgrade",
"sophisticatedbackpacks:jukebox_upgrade",
{
"id": "sophisticatedbackpacks:chipped/alchemy_bench_upgrade",
"required": false
},
"sophisticatedbackpacks:advanced_deposit_upgrade",
"sophisticatedbackpacks:advanced_jukebox_upgrade",
"sophisticatedbackpacks:advanced_restock_upgrade",
"sophisticatedbackpacks:stack_upgrade_tier_4",
"sophisticatedbackpacks:tool_swapper_upgrade",
"sophisticatedbackpacks:stack_upgrade_starter_tier",
"sophisticatedbackpacks:chipped/glassblower_upgrade",
"sophisticatedbackpacks:smoking_upgrade",
"sophisticatedbackpacks:chipped/alchemy_bench_upgrade",
"sophisticatedbackpacks:advanced_magnet_upgrade",
"sophisticatedbackpacks:advanced_filter_upgrade"
"sophisticatedbackpacks:advanced_compacting_upgrade",
"sophisticatedbackpacks:anvil_upgrade",
"sophisticatedbackpacks:stack_upgrade_tier_3",
"sophisticatedbackpacks:smithing_upgrade",
"sophisticatedbackpacks:compacting_upgrade",
"sophisticatedbackpacks:smoking_upgrade"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.ItemTagsProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
Expand All @@ -25,6 +26,13 @@ protected void addTags(HolderLookup.Provider pProvider) {
IntrinsicTagAppender<Item> upgradeTag = tag(ModItems.BACKPACK_UPGRADE_TAG);
BuiltInRegistries.ITEM.entrySet().stream()
.filter(entry -> entry.getKey().location().getNamespace().equals(SophisticatedBackpacks.MOD_ID) && entry.getValue() instanceof UpgradeItemBase)
.map(Map.Entry::getValue).forEach(upgradeTag::add);
.map(Map.Entry::getValue).forEach(item -> {
ResourceLocation location = BuiltInRegistries.ITEM.getKey(item);
if (location.getPath().contains("/")) {
upgradeTag.addOptional(location);
} else {
upgradeTag.add(item);
}
});
}
}

0 comments on commit a37d4c5

Please sign in to comment.