Skip to content
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

Adds the ability to have per item transaction permissions & applies enchantment permissions to signs #5976

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from

Conversation

NicholasJBond
Copy link

@NicholasJBond NicholasJBond commented Nov 25, 2024

Information

This PR fixes #2212.
Follow up of PR #5585.

Details

Proposed fix:

The command /sell hand and /sell blocks and a sell sign will require you to have the permission corresponding to the item in the format essentials.item.<buy|sell|free>.<itemName>. Players still need the permissions essentials.sell.<hand|inventory> and essentials.signs.<free|buy|sell>.use depending on which method they sell their items.

The same is required to use buy and free signs. Players will require the permission essentials.item.<buy|sell|free>.<itemName> and essentials.signs.<free|buy|sell>.use. However there is no command for buy and free.

To use an enchant sign, players will need the permission essentials.enchantments.<enchantmentName> along with essentials.signs.enchant.use.

These features are disabled by default and are configurable in the config.yml file as per-item-transaction-permissions and enchant-sign-restrictions.

The enchant sign has also been updated to capitalise the first letter of the enchantment name and puts the currency symbol if not added by the player on creation of the sign.

Environments tested:

OS:
Windows

Java version:
21.0.

  • Most recent Paper version (1.XX.Y, git-Paper-BUILD)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

Added per-item-transaction-permissions and enchant-sign-restrictions to config file. When true, it requires users to have specific commands to enchant or to buy and sell. Enchant sign tweaked a bit to make it auto adjust.
@mdcfe mdcfe self-requested a review November 25, 2024 11:22
@NicholasJBond NicholasJBond changed the title Fix @2212 Adds the ability to have per item transaction permissions & applies enchantment permissions to signs Nov 25, 2024
@@ -97,6 +97,7 @@ burnCommandDescription=Set a player on fire.
burnCommandUsage=/<command> <player> <seconds>
burnCommandUsage1Description=Sets the specified player on fire for the specified amount of seconds
burnMsg=<primary>You set<secondary> {0} <primary>on fire for<secondary> {1} seconds<primary>.
buySpecificItemPermission=<primary>You do not have permission to buy <Secondary>{0}
Copy link

Choose a reason for hiding this comment

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

Suggested change
buySpecificItemPermission=<primary>You do not have permission to buy <Secondary>{0}
buySpecificItemPermission=<primary>You do not have permission to buy <secondary>{0}

@@ -375,6 +376,7 @@ flyCommandUsage1Description=Toggles fly for yourself or another player if specif
flying=flying
flyMode=<primary>Set fly mode<secondary> {0} <primary>for {1}<primary>.
foreverAlone=<dark_red>You have nobody to whom you can reply.
freeSpecificItemPermission=<primary>You do not have permission to accept the free offer of <Secondary>{0}
Copy link

Choose a reason for hiding this comment

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

Suggested change
freeSpecificItemPermission=<primary>You do not have permission to accept the free offer of <Secondary>{0}
freeSpecificItemPermission=<primary>You do not have permission to accept the free offer of <secondary>{0}

@@ -980,6 +982,7 @@ sellCommandUsage3Description=Sells all possible items in your inventory
sellCommandUsage4=/<command> blocks [amount]
sellCommandUsage4Description=Sells all (or the given amount, if specified) of blocks in your inventory
sellHandPermission=<primary>You do not have permission to hand sell.
sellSpecificItemPermission=<primary>You do not have permission to sell <Secondary>{0}
Copy link

Choose a reason for hiding this comment

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

Suggested change
sellSpecificItemPermission=<primary>You do not have permission to sell <Secondary>{0}
sellSpecificItemPermission=<primary>You do not have permission to sell <secondary>{0}

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.

[Feature Request] Detailed permissions for signs and /sell.
2 participants