Skip to content

Refactor Container customiztion and phantom slots & crafting grids #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 15, 2025

Conversation

brachy84
Copy link
Member

  • removes ContainerCustomizer
  • ability to easily use a custom Container by overriding UIFactory#createContainer or using UISettings#customContainer (the later takes priority)
  • canInteractWith function can now be customized by overriding UIFactory#canInteractWith or by using UISettings#canInteractWith (the later takes priority)
  • IGuiHolder#buildUI has now a third UISettings parameter
  • UISettings allows customizing the above two features and now holds the JEI settings. An instance is stored in ModularContainer and on client in ModularGuiContext
  • phantom slots have now their own widget and sync handler class
  • phantom slots still have an associated ModularSlots for convenience, but they are no longer added to Container#inventorySlots
  • use static vars for sync ids in ItemSlotSH and FluidSlotSyncHandler
  • change SlotGroupWidget#playerInventory() params to allow creating a player inventory without preset position
  • move ItemSlot and FluidSlot to com.cleanroommc.modularui.widgets.slot
  • create classes (CraftingModularContainer, InventoryCraftingWrapper and ModularCraftingSlot) to easly create crafting grids

@miozune
Copy link
Collaborator

miozune commented Mar 14, 2025

SlotGroup (and thus PanelSyncManager#registerSlotGroup) requires rowSize argument, which isn't really used. Are you going to keep it? Could it be at least optional?

@brachy84
Copy link
Member Author

Its used for bogosorter

@miozune
Copy link
Collaborator

miozune commented Mar 14, 2025

Oh I see

# Conflicts:
#	src/main/java/com/cleanroommc/modularui/test/TestTile.java
@brachy84 brachy84 merged commit d4ba9a9 into master Mar 15, 2025
@brachy84 brachy84 deleted the workbench branch March 15, 2025 14:36
brachy84 added a commit to brachy84/ModularUI2-GTNH that referenced this pull request May 15, 2025
…leanroomMC#118)

* separate phantom slots from vanilla slots

* UISettings, extendable ModularContainer, remove ContainerCustomizer and more

* reimplement shift transfer to phantom slots

* use final static vars for sync ids

* easy crafting grids & player inv improvements

* fix

* fix

(cherry picked from commit d4ba9a9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants