Skip to content

Commit

Permalink
✨ Moved crafting grid to seperate tab and added as upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiviacz1337 committed Mar 24, 2024
1 parent 5692da1 commit 73b1aec
Show file tree
Hide file tree
Showing 94 changed files with 2,166 additions and 1,953 deletions.
25 changes: 16 additions & 9 deletions src/main/java/com/tiviacz/travelersbackpack/TravelersBackpack.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class TravelersBackpack implements ModInitializer
@Override
public void onInitialize()
{
TravelersBackpackConfig.setup();
TravelersBackpackConfig.register();
ModItemGroups.registerItemGroup();
ModBlocks.init();
ModItems.init();
Expand Down Expand Up @@ -68,22 +68,29 @@ public void onInitialize()
//Finish

//Slots
TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.toolSlotsAcceptableItems, ToolSlot.TOOL_SLOTS_ACCEPTABLE_ITEMS);
TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.blacklistedItems, BackpackSlot.BLACKLISTED_ITEMS);
TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.getConfig().backpackSettings.toolSlotsAcceptableItems, ToolSlot.TOOL_SLOTS_ACCEPTABLE_ITEMS);
TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.getConfig().backpackSettings.blacklistedItems, BackpackSlot.BLACKLISTED_ITEMS);
//TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.toolSlotsAcceptableItems, ToolSlot.TOOL_SLOTS_ACCEPTABLE_ITEMS);
//TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.blacklistedItems, BackpackSlot.BLACKLISTED_ITEMS);

//Backpack spawn
TravelersBackpackConfig.loadEntityTypesFromConfig(TravelersBackpackConfig.possibleOverworldEntityTypes, Reference.ALLOWED_TYPE_ENTRIES);
TravelersBackpackConfig.loadEntityTypesFromConfig(TravelersBackpackConfig.possibleNetherEntityTypes, Reference.ALLOWED_TYPE_ENTRIES);
TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.overworldBackpacks, ModItems.COMPATIBLE_OVERWORLD_BACKPACK_ENTRIES);
TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.netherBackpacks, ModItems.COMPATIBLE_NETHER_BACKPACK_ENTRIES);
TravelersBackpackConfig.loadEntityTypesFromConfig(TravelersBackpackConfig.getConfig().world.possibleOverworldEntityTypes, Reference.ALLOWED_TYPE_ENTRIES);
TravelersBackpackConfig.loadEntityTypesFromConfig(TravelersBackpackConfig.getConfig().world.possibleNetherEntityTypes, Reference.ALLOWED_TYPE_ENTRIES);
TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.getConfig().world.overworldBackpacks, ModItems.COMPATIBLE_OVERWORLD_BACKPACK_ENTRIES);
TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.getConfig().world.netherBackpacks, ModItems.COMPATIBLE_NETHER_BACKPACK_ENTRIES);
//TravelersBackpackConfig.loadEntityTypesFromConfig(TravelersBackpackConfig.possibleOverworldEntityTypes, Reference.ALLOWED_TYPE_ENTRIES);
//TravelersBackpackConfig.loadEntityTypesFromConfig(TravelersBackpackConfig.possibleNetherEntityTypes, Reference.ALLOWED_TYPE_ENTRIES);
//TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.overworldBackpacks, ModItems.COMPATIBLE_OVERWORLD_BACKPACK_ENTRIES);
//TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.netherBackpacks, ModItems.COMPATIBLE_NETHER_BACKPACK_ENTRIES);

//Abilities
TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.allowedAbilities, BackpackAbilities.ALLOWED_ABILITIES);
TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.getConfig().backpackAbilities.allowedAbilities, BackpackAbilities.ALLOWED_ABILITIES);
//TravelersBackpackConfig.loadItemsFromConfig(TravelersBackpackConfig.allowedAbilities, BackpackAbilities.ALLOWED_ABILITIES);
}

public static boolean enableTrinkets()
{
return trinketsLoaded && TravelersBackpackConfig.trinketsIntegration;
return trinketsLoaded && TravelersBackpackConfig.getConfig().backpackSettings.trinketsIntegration;
}

public static boolean isAnyGraveModInstalled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import net.fabricmc.fabric.api.client.rendering.v1.TooltipComponentCallback;
import net.fabricmc.fabric.api.transfer.v1.client.fluid.FluidVariantRendering;
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariantAttributes;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ingame.HandledScreens;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.client.render.RenderLayer;
Expand Down Expand Up @@ -65,12 +64,12 @@ public void onInitializeClient()
for(Item item : ModItems.BACKPACKS)
{
BuiltinItemRendererRegistry.INSTANCE.register(item, (stack, mode, matrices, vertexConsumers, light, overlay)
-> TravelersBackpackBlockEntityRenderer.renderByItem(new RenderData(MinecraftClient.getInstance().player, stack, stack.hasNbt()), matrices, vertexConsumers, light, overlay));
-> TravelersBackpackBlockEntityRenderer.renderByItem(new RenderData(stack, stack.hasNbt()), matrices, vertexConsumers, light, overlay));
}
registerTooltipComponent();
KeybindHandler.initKeybinds();
KeybindHandler.registerListeners();
ModNetwork.initClient();
//ModNetwork.initClient();
initClientNetworkMessage();
registerModelPredicate();
setupFluidRendering();
Expand Down
Loading

0 comments on commit 73b1aec

Please sign in to comment.