Draylar / inmis

I need more inventory space! A Fabric backpack mod.
https://www.curseforge.com/minecraft/mc-mods/inmis
MIT License
33 stars 31 forks source link

Add support for Trinkets (if present) and add keybinding to open backpack #57

Closed OmegaJak closed 3 years ago

OmegaJak commented 3 years ago
  1. Allows placement of any backpack into the backpack trinket slot if the Trinkets mod is present
    • I added a compileOnly dependency on Trinkets
    • I used a plugin mixin to conditionally make BackpackItem implement Trinket when Trinkets is present
    • This adresses the second request in #51

image

  1. Adds a keybinding to open the first backpack in the player's inventory
    • I had to refactor BackpackScreenHandler to not be tied to hands for this
    • This addresses the basics for #48, though I didn't go so far as enabling opening of different backpacks by hotkey
    • The search for the 'first' backpack happens in this order:
      1. The backpack slot of the trinket inventory, if present
      2. The player's offhand
      3. Player's hotbar, left to right
      4. Player's main inventory, top left to bottom right

I did my best to match code style & organization to what was already there and your other mods, but change anything as you see fit.

Note: I didn't bother with any rendering stuff while wearing the backpack.

Draylar commented 3 years ago

Looks awesome, thanks for the fantastic PR! I'll add you to the contributors' list in the fabric.mod.json file before release.

Draylar commented 3 years ago

I'm changing the default keybinding to B because Identity, my morph mod, uses ` for the main menu (and I would prefer for both of them to work together out of the box). Released in 2.1.0 in a second! Thanks again.

OmegaJak commented 3 years ago

Sounds good! I had fun doing it