ChestShop-authors / ChestShop-3

ChestShop - the chest & sign shop plugin for Minecraft Servers running Bukkit/Spigot/Paper
https://dev.bukkit.org/projects/chestshop
GNU Lesser General Public License v2.1
275 stars 176 forks source link

[#504] Implement SignName compatability with price restrictions #594

Closed casptyche closed 2 months ago

casptyche commented 3 months ago

This is a proposed implementation for #504 Allow price limits for different item IDs.

The solution changes the PriceRestrictionModule to try to find a configured price restriction for the Item's ItemUtil#getSignName result. If none is found, it falls back to the item material as per the original implementation.

I've tested this briefly locally and it seems to work a treat with Slimefun4 items whilst maintaining compatibility with Vanilla items.


IssueHunt Summary ### Referenced issues This pull request has been submitted to: - [#504: Allow price limits for different item ids such as Player Head#1 from Slimefun](https://oss.issuehunt.io/repos/1751509/issues/504) - [#504: Allow price limits for different item ids such as Player Head#1 from Slimefun](https://oss.issuehunt.io/repos/1751509/issues/504) ---
casptyche commented 3 months ago

Updated MR to reflect it's ready for review and briefly tested locally

casptyche commented 3 months ago

My fault! I had removed the auto-format changes but it clearly auto-formatted again without me realizing right before I staged :')

Reverted import, version change & formatting changes.

Tested locally briefly to confirm still works (i.e. Player Head#2 in priceLimits.yml is enforced in game, and oak_sign in priceLimits.yml is enforced in game, confirming that 'other items' and 'materials' both still work)

casptyche commented 3 months ago

Is there any further action required on my end?

Phoenix616 commented 3 months ago

Sorry, I simply didn't have time to look at this again yet.