Skip to content

Conversation

Absolutionism
Copy link
Contributor

Problem

Paper has methods of opening certain InventoryTypes to players making them more reliable. Such as #openAnvil which allows actually being able to get the anvil text input of a custom anvil inventory.

Solution

Updates EffOpenInventory utilizing Papers methods (Skript 2.13 will be Paper)
Simplifies code

Testing Completed

manual

loop all inventory types:
  open loop-value to player

!broadcast anvil text input of (top inventory of player("SirSmurfy2"))

Supporting Information

Todo in the future: Support Paper's MenuTypes


Completes: #6954
Related: none

@Absolutionism Absolutionism requested a review from a team as a code owner July 23, 2025 20:28
@Absolutionism Absolutionism requested review from erenkarakal and Burbulinis and removed request for a team July 23, 2025 20:28
@Absolutionism Absolutionism added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Jul 23, 2025
@Absolutionism Absolutionism moved this to In Review in 2.13 Releases Jul 23, 2025
@TheLimeGlass
Copy link
Contributor

I'm working on #7508 that got closed after 3 weeks...
Which will support the new menu builder and keep the fixes and sections

@Absolutionism Absolutionism requested a review from Efnilite August 22, 2025 20:01
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Sep 1, 2025
@Description("""
Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that they opened.
Please note that currently 'show' and 'open' have the same effect,\
but 'show' will eventually show an unmodifiable view of the inventory in the future.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may want to implement this in this pr

Comment on lines +43 to +53
ANVIL("[an] anvil", "anvil", InventoryType.ANVIL),
CARTOGRAPHY("[a] cartography [table]", "cartography table", InventoryType.CARTOGRAPHY),
CRAFTING("[a] (crafting [table]|workbench)", "crafting table", InventoryType.CRAFTING),
DISPENSER("dispenser", InventoryType.DISPENSER),
DROPPER("dropper", InventoryType.DROPPER),
ENCHANTING("[an] enchant(ing|ment) [table]", "enchantment table", InventoryType.ENCHANTING),
GRINDSTONE("grindstone", InventoryType.GRINDSTONE),
HOPPER("hopper", InventoryType.HOPPER),
LOOM("loom", InventoryType.LOOM),
SMITHING("[a] smithing [table]", "smithing table", InventoryType.SMITHING),
STONECUTTER("stonecutter", InventoryType.STONECUTTER)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this what the inventorytype type handles already? Can't we just improve it instead of duplicating it like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section was done to minimize breaking changes, since prior, the pattern had names of inventory types manually inserted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but can't we do that through the inventory type type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I could add all these "variations" to the patterns of the enum node inventory types
But then that would just be breaking changes since it would lead to MultiLiteral of ItemType and InventoryType.
anvil, furnace, beacon, hopper etc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant more like have a second entry for the types in the lang file that details their 'short names', but if that won't play nice with the enum class info thing, this way is alright.

inventory types:
  hopper: hopper @a

Then internally we add the "inventory" for the type parser, but can use the short version here.

Or

inventory types:
  hopper:
    full: hopper inventory @a
    short: hopper @a

Let me know what you think

@sovdeeth sovdeeth removed this from 2.13 Releases Sep 30, 2025
@sovdeeth sovdeeth moved this to In Review in 2.14 Releases Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. needs reviews A PR that needs additional reviews
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

5 participants