Fix usage of 'resale' in 'default.yml' for 'flagProfile' section

- 'resale' was used instead of 'resell' (as defined in GeneralRegion#RegionState) in the 'flagProfile' section, causing the flags not getting applied when the region is in reselling state.
- Added fallback to 'resale' section if 'resell' section is not present (to properly read old config.yml/default.yml files)
- Fixed usage of '%resaleprice%' in the resale greeting, should be '%resellprice%'
- Fixes #303, thanks electro2560 for the great bug report!
This commit is contained in:
Thijs Wiefferink 2017-04-20 15:26:26 +02:00
parent 3b9d6187ca
commit 395cc6de07
3 changed files with 8 additions and 2 deletions

View File

@ -44,6 +44,12 @@ public class WorldGuardRegionFlagsFeature extends RegionFeature {
// Region flags for the current state
ConfigurationSection stateFlags = flagProfileSection.getConfigurationSection(region.getState().getValue());
// If in reselling mode, fallback to 'resale' section if 'resell' is not found (legacy configuration problem: https://github.com/NLthijs48/AreaShop/issues/303)
if(stateFlags == null && region.getState() == GeneralRegion.RegionState.RESELL) {
stateFlags = flagProfileSection.getConfigurationSection("resale");
}
if(stateFlags != null) {
result = result && updateRegionFlags(region, stateFlags);
}

View File

@ -124,7 +124,7 @@ general:
sold:
members: '%uuid%, %friendsuuid%'
greeting: '%lang:prefix%%lang:greeting-bought%'
resale:
resell:
members: '%uuid%, %friendsuuid%'
greeting: '%lang:prefix%%lang:greeting-resale%'

View File

@ -577,6 +577,6 @@ greeting-forrent: "%region% can be rented for %price% per %duration%."
greeting-rented: "%region% is rented by %player% until %until%."
greeting-forsale: "%region% can be bought for %price%."
greeting-bought: "%region% is bought by %player%."
greeting-resale: "%region% can be bought for %resaleprice% from %player%."
greeting-resale: "%region% can be bought for %resellprice% from %player%."
update-playerNotify: "[darkgreen]Update from AreaShop V%0% to %1% available, get the latest version at https://github.com/NLthijs48/AreaShop/releases."