akdukaan / GPFlags

GriefPreventionFlags is a Minecraft plugin to allow players to customize their GriefPrevention claims with claimflags.
GNU General Public License v3.0
17 stars 20 forks source link

Bought Subclaims Can Still Be Bought #55

Closed deserterghost closed 5 months ago

deserterghost commented 11 months ago

Bought Subclaims Can Still Be Bought Players have bought subclaims on my server but the message still shows up when I enter them (not when the person who bought them enters), and I can still buy the subclaims. This results in multiple managers in the trustlist.

To Reproduce Steps to reproduce the behavior:

  1. Player buys subclaim with /buysubclaim
  2. Enter plot as another player
  3. Buy subclaim with /buysubclam
  4. Check /trustlist and find that there are multiple managers now

Expected behavior The subclaim that a player has bought should not be available for other players to buy, nor should the message appear for them when they enter the plot.

Configs:

GriefPrevention: SeaLevelOverrides: world: -1 world_nether: -1 world_the_end: -1 Claims: Mode: world: Survival world_nether: Disabled world_the_end: Disabled PreventGlobalMonsterEggs: true PreventTheft: true ProtectCreatures: true PreventButtonsSwitches: true LockWoodenDoors: false LockTrapDoors: false LockFenceGates: true EnderPearlsRequireAccessTrust: true RaidTriggersRequireBuildTrust: true ProtectHorses: true ProtectDonkeys: true ProtectLlamas: true InitialBlocks: 500 Claim Blocks Accrued Per Hour: Default: 100 Max Accrued Claim Blocks: Default: 80000 Accrued Idle Threshold: 0 AccruedIdlePercent: 0 AbandonReturnRatio: 1.0 AutomaticNewPlayerClaimsRadius: 4 AutomaticNewPlayerClaimsRadiusMinimum: 0 ExtendIntoGroundDistance: 99999 MinimumWidth: 5 MinimumArea: 20 MaximumDepth: -2147483648 InvestigationTool: STICK ModificationTool: GOLDEN_SHOVEL Expiration: ChestClaimDays: 7 UnusedClaimDays: 30 AllClaims: DaysInactive: 60 ExceptWhenOwnerHasTotalClaimBlocks: 10000 ExceptWhenOwnerHasBonusClaimBlocks: 10000 AutomaticNatureRestoration: SurvivalWorlds: false AllowTrappedInAdminClaims: false MaximumNumberOfClaimsPerPlayer: 0 CreationRequiresWorldGuardBuildPermission: true VillagerTradingRequiresPermission: true CommandsRequiringAccessTrust: /sethome DeliverManuals: true ManualDeliveryDelaySeconds: 30 RavagersBreakBlocks: true FireSpreadsInClaims: false FireDamagesInClaims: false LecternReadingRequiresAccessTrust: true Spam: Enabled: true LoginCooldownSeconds: 60 LoginLogoutNotificationsPerMinute: 5 ChatSlashCommands: /me;/global;/local WhisperSlashCommands: /tell;/pm;/r;/whisper;/msg WarningMessage: Please reduce your noise level. BanOffenders: false BanMessage: Banned for spam. AllowedIpAddresses: 1.2.3.4; 5.6.7.8 DeathMessageCooldownSeconds: 120 Logout Message Delay In Seconds: 0 PvP: RulesEnabledInWorld: world: false world_nether: false world_the_end: false ProtectFreshSpawns: true PunishLogout: true CombatTimeoutSeconds: 15 AllowCombatItemDrop: false BlockedSlashCommands: /home;/vanish;/spawn;/tpa ProtectPlayersInLandClaims: PlayerOwnedClaims: true AdministrativeClaims: false AdministrativeSubdivisions: true AllowLavaDumpingNearOtherPlayers: PvPWorlds: true NonPvPWorlds: false AllowFlintAndSteelNearOtherPlayers: PvPWorlds: true NonPvPWorlds: false ProtectPetsOutsideLandClaims: false Economy: ClaimBlocksMaxBonus: 80000 ClaimBlocksPurchaseCost: 2.0 ClaimBlocksSellValue: 1.0 ProtectItemsDroppedOnDeath: PvPWorlds: false NonPvPWorlds: true BlockLandClaimExplosions: false BlockSurfaceCreeperExplosions: false BlockSurfaceOtherExplosions: false LimitSkyTrees: false LimitTreeGrowth: false PistonMovement: EVERYWHERE PistonExplosionSound: true FireSpreads: true FireDestroys: true AdminsGetWhispers: true AdminsGetSignNotifications: true VisualizationAntiCheatCompatMode: false SmartBan: true Mute New Players Using Banned Words: true MaxPlayersPerIpAddress: 3 SilenceBans: true Siege: Worlds: [] BreakableBlocks:

Settings: Log Enter/Exit Messages To Console: true World Flags: world: Default Gamemode: survival PvP Only In PvP-Flagged Claims: false Message To Send When PvP Is Denied: Player vs. player combat is restricted to designated areas. Send Message On Enter PvP Enabled Claim: false Message: PvP is enabled in this claim, be careful Send Message On Exit PvP Enabled Claim: false ExitMessage: PvP is disabled in this area, you are now safe NoMonsterSpawn Flag Ignores Spawners and Eggs: true NoMobSpawn Flag Ignores Spawners and Eggs: true world_nether: Default Gamemode: survival PvP Only In PvP-Flagged Claims: false Message To Send When PvP Is Denied: Player vs. player combat is restricted to designated areas. Send Message On Enter PvP Enabled Claim: false Message: PvP is enabled in this claim, be careful Send Message On Exit PvP Enabled Claim: false ExitMessage: PvP is disabled in this area, you are now safe NoMonsterSpawn Flag Ignores Spawners and Eggs: true NoMobSpawn Flag Ignores Spawners and Eggs: true world_the_end: Default Gamemode: survival PvP Only In PvP-Flagged Claims: false Message To Send When PvP Is Denied: Player vs. player combat is restricted to designated areas. Send Message On Enter PvP Enabled Claim: false Message: PvP is enabled in this claim, be careful Send Message On Exit PvP Enabled Claim: false ExitMessage: PvP is disabled in this area, you are now safe NoMonsterSpawn Flag Ignores Spawners and Eggs: true NoMobSpawn Flag Ignores Spawners and Eggs: true


 - Example for a flag with the issue (same for all other flags)

'13': buysubclaim: params: '20000' value: true



**Versions:**
 - GriefPrevention version: 16.18.1
 - GPFlags version: 5.12.9
 - Server version: 1.20.1 (Paper)

**Additional context**
One of the players has bought a plot and the money was taken from them but manager trust was not given to them, as if they hadn't bought the plot. This has only happened once so far but I thought I'd mention.
deserterghost commented 11 months ago

I've been testing this issue further and realised that the source of the problem is that data gets lost on server restart. I checked if GriefPrevention acts in a similar way, but manually giving /permissiontrust and /buildtrust seems to be saved properly, as they remain after server restart. When players use /buysubclaim, however, they only own the subclaim as long as the server is running. As soon as I restart, they lose their subclaim.

akdukaan commented 11 months ago

I haven’t had time to test on my own just yet but here are my initial thoughts. Sounds like there’s 2 issues happening here.

  1. It’s supposed to turn off the flag in the subclaim after it’s been bought. You’d be able to check with /listflags. If other players still get the prompt, that would mean that the flag still enabled somehow.
  2. You’re saying there’s an issue where it only gives them the permission until the next restart. Are you sure? Did your server crash? I’m pretty sure buysubclaim assigns permissions through GP the same way that /trust does. So if there’s an issue with one it should also have the issue with the other.
akdukaan commented 5 months ago

Fixed in builds 176 and above! https://jenkins.luminescent.dev/job/GPFlags/