Towny Classic

Towny Classic

3.2k Downloads

"/t set perm" does not change permissions in plots with custom TownBlockTypes

galacticwarrior9 opened this issue ยท 4 comments

commented

What steps will reproduce the problem?

  1. Define a custom TownBlockType in the config.yml, e.g.
  - name: cargo
    cost: 0.0
    tax: 0.0
    mapKey: C
    itemUseIds: ''
    switchIds: ''
    allowedBlocks: ''
  1. Set a plot in your town to the custom type. /plot set cargo.

  2. Type /t set perm ally on.

  3. Turn on /plot perm hud.

  4. Fly around the town and observe how ally perms are enabled in every plot except the cargo plot.

What is the expected output?

/t set perm changes permissions in plots with custom TownBlockTypes.

Towny version

0.99.6.3

Server version

Purpur Build 2062, 1.20.1

Please use Pastebin.com to link the following files

  1. Your full server startup from the logs\latest.log: Link
  2. Your Towny config.yml: Link
  3. Your log's error: No error.
commented

the problem is that the cargo plot has changed=true, at some point it had a custom perm line set on it (likely via commands in game, it doesn't set changed to true on creation of a custom plot.)

When a plot is changed=true it is not affected by the /t set perm command (except for /t set perm reset)

commented

Can you find one of those townblocks in the database and get me its file from towny\data\townblocks\WORLDNAME\ ?

Use /towny map while stood in it to get the coord it uses for saving.

commented

The file for the cargo townblock (0, 2) is:

name=
price=-1.0
taxed=true
town=Celle
type=cargo
outpost=false
permissions=denyAll
changed=true
claimedAt=1697888345577
metadata=
groupID=
trustedResidents=
customPermissionData={}

And here's an adjacent plot (0, 1) which is normal and works as intended:

name=
price=-1.0
taxed=true
town=Celle
type=Default
outpost=false
changed=false
claimedAt=1697888345576
metadata=
groupID=
trustedResidents=
customPermissionData={}

The problem could be caused by the cargo townblock having permissions=denyAll set for whatever reason.

commented

Upon investigating this, I am seeing exactly what you're seeing.

When I set a plot to a special perm line (which grants changed=true,) and then set it to a cargo plot, that plot loses its changed=true (which is what should happen when a plot has its plot type changed.)