IntellectualSites / IntellectualSites/PlotSquared

Plot Grants are broken

Open
#3,858 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Requires Testing
Dominant language
Java
Stars
653
Forks
975
Avg merge
2m
Merged PRs (30d)
6

Description

Server Implementation

Paper

Server Version

1.17.1

Describe the bug

Hey, why do plot grants do delete when players dont use them or delete their plot?

First Example: A Player has maxplots of 1 and gets an item which grants him to claim another plot on right-click, so he right-clicks and the console runs p grant add %player%. The player now claims a second plot and owns 2 plots. One day he decides to delete his plot to claim the plot that just got free next to his first plot. So he deletes the plot and tries to claim the plot next to him, just to find out that he has already reached the maximum amounts of plots he can claim.

Second Example: A Player has maxplots of 1 and gets to collect a lot of plot grant add items. One day he uses all his X collected grant items. He now has X amount of grants left but as he falls asleep he forgets to claim the X amount of plots and the server restarts as scheduled. Now he wakes up, connects to the server and tries to to claim his X amount of plots but some how he can't claim them as he reached his max amount of plots he can claim. Also the placeholder when he opens the player info gui shows, that he can have maxplots of 1.

This is what I've tried to do with DeluxeMenus:

https://justpaste.it/6j1uy

This is what I tried with DeluxeMenu. Only thing I'm able to do is to create it one by one. So a user HAS to HAVE a specific amount of max plots to buy the next upper max plot. But if a user with 3 max plots uses 2 plot grants and claims the plots right away he owns 5 plots with 3 max plots. When he now decides to upgrade to the 6th plot as he already has 5, he can't upgrade because his permission node still stays max plots of 3. Because of this, it's really giving me trouble to set up and use this plugin with its cool features in a smart way, since max plots are obviously separate from plot grants and I'm seriously wondering why.

If I wanted to do it without the plot grants (so plot grants get more useless) this it not possible to do for exact every single plot a user may has max of. If a user has X max plots then add him Y max plots is too general to create with a DeluxeMenu for example. If there would be a command like /plot maxplots add %player% this would make it easier for players to unlock new plots for free just by playing. So the plugin could hook into LuckPerms and change the maxplots permission. Or if a player uses 5 plot grants and claims 5 plots but only has a max of 3, why doesn't it update the max plots of that user since he was able to claim more than his max?

I really need a working solution about this. I would appreciate your help in this case. Thank you really really much in advance!

(Also I've seen other servers, for example Purple Prison, where when you use a plot grant item your max plots are being changed and even if you unclaim a new unlocked plot you still have the grant or the permission left to reclaim it somewhere else.

Best regards,
Wastinqs

To Reproduce
  1. Give your acc 3 max plots
  2. Type p grant add in console to add your acc a plot grant
  3. Claim a plot
  4. Unclaim a plot
  5. Try to claim a plot again (this won't work)
Expected behaviour

I was expecting that /p grant adds a certain user a certain amount of max plots since the grant would be totally useless if its not saved anywhere that the user now can claim more plots than his usual max plots permission allows him. So I expected, that a plot grant will be saved and a user with 3 max plots who used 2 grants can claim 5 plots in his life-time being on the server, no matter if he unclaims or not uses the grants right away.

Screenshots / Videos

No response

Error log (if applicable)

No response

Plot Debugpaste

https://athion.net/ISPaster/paste/view/76e501ec178e45ad80260cfcfb8f4676

PlotSquared Version

6.10.2 Premium

Checklist
Anything else?

What are plot grants supposed to be used for if the grants are not saved but temporary?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with the listed steps on PlotSquared 6.10.2, then trace the /p grant add and max-plots handling. Determine how grants are represented across claiming, unclaiming, and server restarts; done means granted capacity remains available as described and the player can reclaim plots within it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.