Port InvView to NeoForge 1.21.1 with complete refactoring and new features
- Fully ported InvView from Forge to NeoForge 1.21.1, ensuring compatibility with the latest API.
- Refactored codebase for modularity and extensibility:
- Introduced
InventoryProvider
API for dynamic inventory handling (PlayerInventoryProvider, EnderChestProvider). - Replaced hardcoded commands with
InventoryProviderRegistry
for provider-based command registration. - Created
AbstractInventoryScreenHandler
to centralize common inventory container logic.
- Introduced
- Added
InventoryLockManager
withInventoryType
enum (PLAYER_INVENTORY, ENDER_CHEST, CURIOS, CURIOS_COSMETIC) to prevent concurrent modifications. - Implemented Curios API integration:
- Added
CuriosInventoryProvider
andCuriosCosmeticInventoryProvider
for functional and cosmetic Curios slots. - Updated
PlayerCuriosInventoryScreenHandler
andPlayerCuriosCosmeticInventoryScreenHandler
to handle inventory changes with proper synchronization. - Registered Curios providers conditionally using
ModList.get().isLoaded("curios")
.
- Added
- Integrated LuckPerms support for fine-grained permissions:
- Created
PermissionHandler
for conditional permission checks (inv_view.inv
,inv_view.echest
,inv_view.curios
,inv_view.curios_cosmetic
). - Fallback to Minecraft operator level 2) when LuckPerms is not installed.
- Created
- Enhanced offline player support:
- Improved
InvViewCommands
to load offline player data usingMinecraftServer.getPlayerList().getPlayerForLogin()
. - Ensured data persistence with
InvViewNeoforge.savePlayerData()
for all inventory modifications.
- Improved
- Added translation support for UI and error messages (e.g.,
inv_view_neoforge.inventory_in_use.error
,inv_view_neoforge.curios.inventory
). - Optimized code for performance and maintainability, removing deprecated Forge methods.
The mod has been completely rewritten improving the system of blocking access to inventories that were already being edited, the detection and management of inventories of disconnected players and the screens of each container have been rewritten for better optimization and maintainability in the future.
If you find any problem do not hesitate to report it, I will try to fix it as soon as possible, before releasing this update for the other versions of the game.
Changelog:
- Added support to the inspection and modification of the cosmetics inventory of curios cosmetics.
- Added support for Backpacked mod backpacks.
Bugfixes:
- Fixed the problem that sometimes caused the quark and travelers' backpacks not to open when the player was disconnected.
Changelog:
- The curios screen has been made rescalable with a minimum of 9 slots and a maximum of 54 slots.
Bugfixes:
Known bugs:
- If the target player is offline and either quark or travelersbackpack commands are used, several bugs occur due to the limitations of these mods when manipulating the items stored in their backpacks for offline players.
Changelog:
- Refactor Curios Code
Bugfixes:
- Fixed an issue where sometimes it would not let open a player's inventory notifying that it was already being used by another player.
- Fixed bug with the Inventorio inventory where the inventory items of the player executing the command were not correctly placed.
- Added the command /travelersbackpack <username> which allows to open the equipped backpack of the specified player in case he has one. (TravelersBackpacks Mod Backpack Support)
- Added the command /quark-backpack <username> which allows to open the equipped backpack of the specified player in case he has one. (Quark Mod Backpack Support)
Known bugs:
- If the target player is offline and either quark or travelersbackpack commands are used, several bugs occur due to the limitations of these mods when manipulating the items stored in their backpacks for offline players.