TownyAdvanced / Towny

Towny Advanced Minecraft plugin for Bukkit/Spigot.
https://townyadvanced.github.io
Other
518 stars 356 forks source link

Suggestion: Add support for loading worlds in a nested folder. #4597

Closed Seeroh closed 2 years ago

Seeroh commented 3 years ago

What steps will reproduce the problem?

  1. Use Towny 0.96.5.5
  2. Set level-name: in server.properties to worlds/test (This only seems to be a problem when this option has a directory included)
  3. Start server, adjust settings so you are able to create a town in worlds/test, and claim some chunks
  4. Either reload Towny, or restart the server
  5. The townblocks you have claimed are not loaded, and even though they exist in the database, they are ignored
  6. This can also be reproduced by having level-name: test in server.properties, and then using Multiverse-Core to create a new world inside a folder, like /worlds/test2. Claims made in /test are saved on plugin reload or server restart, but claims made in /worlds/test2 are removed.
  7. Creating an outpost in /worlds/test2 leads to the claim for the outpost being removed, but still being able to use /t outpost to teleport to where the outpost was.

This was tested using flatfile database

What is the expected output?

  1. Townblocks claimed should persist beyond reload/restart

What is your Towny version?

0.96.5.5

What is your spigot/craftbukkit version?

This server is running Paper version git-Paper-325 (MC: 1.16.4)

Please use Pastebin.com to link the following files:

Skipping these files is not an option. It is the easiest way to diagnose an issue ticket properly. If you do skip this step then your ticket will most likely be deleted and you will be asked to resubmit.

  1. Latest.log: https://pastebin.com/hFY9z4TM (tested using only CMI / Vault / Towny)
  2. config.yml: https://pastebin.com/aAbgrvqS
  3. townyperms.yml: https://pastebin.com/9T1qLrnd
  4. Your log's error : None Available

Other Notes

I found this bug from trying to upgrade from an older version of Towny 0.95.0.0 to a newer version, and also updating from 1.14 to 1.16. I had level-name: worlds/towny set in server.properties before the upgrade, but due to changes in the back end, this now causes some minor issues it seems. Everything on my server was set up this way, and trying to fix it to work another way is... a lot of effort. Plugins like LWC, Towny, CMI, Quickshop, Warp plugins, multiverse, just everything is set to use /worlds/towny, so this is a pretty big bug for us.

No worlds nested in a folder work properly for Towny while using 1.16

LlmDl commented 3 years ago

You cannot use a worldname with \ in it. Nesting worlds does not load.

LlmDl commented 3 years ago

Also I'm not sure if I understood you correctly, but I don't believe Towny has ever been able to load nested worlds.

Seeroh commented 3 years ago

It did work previously in 1.14, as I encountered no problems with it. I realize now that it was not exactly intended behavior, but it did at least work prior to 1.16.

The townblock files are created and available, as well as all the world files and everything, Towny just doesn't load them at all

LlmDl commented 3 years ago

The world files is one of the only things that hasn't changed recently. What does your towny\data\worlds.txt look like?

Seeroh commented 3 years ago

towny\data\worlds.txt

pvp=false
forcepvp=false
friendlyFire=false
# Can players found towns and claim plots in this world?
claimable=true
worldmobs=true
wildernessmobs=true
forcetownmobs=false
firespread=true
forcefirespread=false
explosions=true
forceexplosions=false
endermanprotect=true
disableplayertrample=true
disablecreaturetrample=true

# Unclaimed Zone settings.
unclaimedZoneBuild=false
unclaimedZoneDestroy=false
unclaimedZoneSwitch=false
unclaimedZoneItemUse=false
unclaimedZoneName=Wilderness

# The following are blocks that will bypass the above build, destroy, switch and itemuse settings.
unclaimedZoneIgnoreIds=SAPLING,GOLD_ORE,IRON_ORE,COAL_ORE,LOG,LEAVES,LAPIS_ORE,LONG_GRASS,YELLOW_FLOWER,RED_ROSE,BROWN_MUSHROOM,RED_MUSHROOM,TORCH,DIAMOND_ORE,LADDER,RAILS,REDSTONE_ORE,GLOWING_REDSTONE_ORE,CACTUS,CLAY,SUGAR_CANE_BLOCK,PUMPKIN,GLOWSTONE,LOG_2,VINE,NETHER_WARTS,COCOA

# The following settings control what blocks are deleted upon a townblock being unclaimed
usingPlotManagementDelete=false
plotManagementDeleteIds=WHITE_BED,ORANGE_BED,MAGENTA_BED,LIGHT_BLUE_BED,YELLOW_BED,LIME_BED,PINK_BED,GRAY_BED,LIGHT_GRAY_BED,CYAN_BED,PURPLE_BED,BLUE_BED,BROWN_BED,GREEN_BED,RED_BED,BLACK_BED,TORCH,REDSTONE_WIRE,ACACIA_SIGN,BIRCH_SIGN,DARK_OAK_SIGN,JUNGLE_SIGN,OAK_SIGN,SPRUCE_SIGN,WOODEN_DOOR,ACACIA_WALL_SIGN,BIRCH_WALL_SIGN,DARK_OAK_WALL_SIGN,JUNGLE_WALL_SIGN,OAK_WALL_SIGN,SPRUCE_WALL_SIGN,STONE_PLATE,IRON_DOOR_BLOCK,WOOD_PLATE,REDSTONE_TORCH_OFF,REDSTONE_TORCH_ON,DIODE_BLOCK_OFF,DIODE_BLOCK_ON,CRIMSON_SIGN,WARPED_SIGN,CRIMSON_WALL_SIGN,WARPED_WALL_SIGN,CRIMSON_DOOR,WARPED_DOOR,SOUL_TORCH,SOUL_WALL_TORCH,CRIMSON_PRESSURE_PLATE,WARPED_PRESSURE_PLATE,POLISHED_BLACKSTONE_PRESSURE_PLATE,CRIMSON_SIGN,WARPED_SIGN,CRIMSON_WALL_SIGN,WARPED_WALL_SIGN,CRIMSON_DOOR,WARPED_DOOR,SOUL_TORCH,SOUL_WALL_TORCH,CRIMSON_PRESSURE_PLATE,WARPED_PRESSURE_PLATE,POLISHED_BLACKSTONE_PRESSURE_PLATE

# The following settings control what blocks are deleted upon a mayor issuing a '/plot clear' command
usingPlotManagementMayorDelete=false
plotManagementMayorDelete=ACACIA_WALL_SIGN,BIRCH_WALL_SIGN,DARK_OAK_WALL_SIGN,JUNGLE_WALL_SIGN,OAK_WALL_SIGN,SPRUCE_WALL_SIGN,ACACIA_SIGN,BIRCH_SIGN,DARK_OAK_SIGN,JUNGLE_SIGN,OAK_SIGN,SPRUCE_SIGN,CRIMSON_WALL_SIGN,CRIMSON_SIGN,WARPED_WALL_SIGN,WARPED_SIGN,CRIMSON_WALL_SIGN,CRIMSON_SIGN,WARPED_WALL_SIGN,WARPED_SIGN

# If enabled when a town claims a townblock a snapshot will be taken at the time it is claimed.
# When the townblock is unclaimed its blocks will begin to revert to the original snapshot.
usingPlotManagementRevert=false
# Any block Id's listed here will not be respawned. Instead it will revert to air. This list also world on the WildRegen settings below.
plotManagementIgnoreIds=GOLD_ORE,LAPIS_ORE,LAPIS_BLOCK,GOLD_BLOCK,IRON_ORE,IRON_BLOCK,MOSSY_COBBLESTONE,TORCH,SPAWNER,DIAMOND_ORE,DIAMOND_BLOCK,ACACIA_SIGN,BIRCH_SIGN,DARK_OAK_SIGN,JUNGLE_SIGN,OAK_SIGN,SPRUCE_SIGN,ACACIA_WALL_SIGN,BIRCH_WALL_SIGN,DARK_OAK_WALL_SIGN,JUNGLE_WALL_SIGN,OAK_WALL_SIGN,SPRUCE_WALL_SIGN,GLOWSTONE,EMERALD_ORE,EMERALD_BLOCK,WITHER_SKELETON_SKULL,WITHER_SKELETON_WALL_SKULL,SHULKER_BOX,WHITE_SHULKER_BOX,ORANGE_SHULKER_BOX,MAGENTA_SHULKER_BOX,LIGHT_BLUE_SHULKER_BOX,LIGHT_GRAY_SHULKER_BOX,YELLOW_SHULKER_BOX,LIME_SHULKER_BOX,PINK_SHULKER_BOX,GRAY_SHULKER_BOX,CYAN_SHULKER_BOX,PURPLE_SHULKER_BOX,BLUE_SHULKER_BOX,BROWN_SHULKER_BOX,GREEN_SHULKER_BOX,RED_SHULKER_BOX,BLACK_SHULKER_BOX,BEACON,NETHER_GOLD_ORE,ANCIENT_DEBRIS,SOUL_TORCH,SOUL_WALL_TORCH,CRIMSON_SIGN,CRIMSON_WALL_SIGN,WARPED_SIGN,WARPED_WALL_SIGN,LODESTONE,RESPAWN_ANCHOR,NETHER_PORTAL,FURNACE,BLAST_FURNACE,SMOKER,BREWING_STAND,TNT,AIR,FIRE,NETHER_QUARTZ_ORE,NETHER_GOLD_ORE,ANCIENT_DEBRIS,SOUL_TORCH,SOUL_WALL_TORCH,CRIMSON_SIGN,CRIMSON_WALL_SIGN,WARPED_SIGN,WARPED_WALL_SIGN,LODESTONE,RESPAWN_ANCHOR,NETHER_PORTALFURNACE,BLAST_FURNACE,SMOKER,BREWING_STAND,TNT,AIR,FIRE,NETHER_QUARTZ_ORE

# The following settings control which entities/blocks' explosions are reverted in the wilderness.
# If enabled any damage caused by entity explosions will repair itself.
usingPlotManagementWildRegen=false
# The list of entities whose explosions would be reverted.
PlotManagementWildRegenEntities=creeper,endercrystal,enderdragon,fireball,smallfireball,largefireball,tntprimed,explosiveminecart,wither,witherskull,wither,witherskull
# If enabled any damage caused by block explosions will repair itself.
usingPlotManagementWildRegenBlocks=false
# The list of entities whose explosions would be reverted.
PlotManagementWildRegenBlocks=WHITE_BED,ORANGE_BED,MAGENTA_BED,LIGHT_BLUE_BED,YELLOW_BED,LIME_BED,PINK_BED,GRAY_BED,LIGHT_GRAY_BED,CYAN_BED,PURPLE_BED,BLUE_BED,BROWN_BED,GREEN_BED,RED_BED,BLACK_BED
# The delay after which the explosion reverts will begin.
usingPlotManagementWildRegenDelay=20

# This setting is used to enable or disable Towny in this world.
usingTowny=false

# This setting is used to enable or disable Event war in this world.
warAllowed=false

metadata=
LlmDl commented 3 years ago

That's one of the worldname.txt files. I'd like to see the towny\data\worlds.txt file.

Seeroh commented 3 years ago

Oh whoops, you're right, my bad!

Here's towny\data\worlds.txt if server.properties has level-name: test and worlds/test2 is created with MultiverseCore

test_the_end
worlds/test2
worlds
test
test_nether

And here's towny\data\worlds.txt if server.properties has level-name: worlds/test and worlds/test2 is created with MultiverseCore

worlds/test_nether
worlds/test_the_end
worlds/test
worlds/test2
LlmDl commented 3 years ago

And can you show me a screenshot of your towny\data\worlds\ folder? (Or a file list.)

Seeroh commented 3 years ago

level-name: test

\towny\data\worlds\deleted\
\towny\data\worlds\worlds\
\towny\data\worlds\worlds\test2.txt
\towny\data\worlds\test.txt
\towny\data\worlds\test_nether.txt
\towny\data\worlds\test_the_end.txt

level-name: worlds/test

\towny\data\worlds\deleted\
\towny\data\worlds\worlds\
\towny\data\worlds\worlds\test.txt
\towny\data\worlds\worlds\test_nether.txt
\towny\data\worlds\worlds\test_the_end.txt
\towny\data\worlds\worlds\test2.txt

Both are with worlds/test2 being created using in multiverse using mv create worlds/test2 normal

LlmDl commented 2 years ago

Changed this to a suggestion as I'm quite certain Towny never had nested world support.