Towny Classic

Towny Classic

3.2k Downloads

[Bug] Nation Town Upkeep Modifier Not Applying (v0.101.1.14)

Closed this issue · 4 comments

commented

What steps will reproduce the problem?

I am experiencing an issue where the nationTownUpkeepModifier in the config.yml does not seem to be applying the intended upkeep discount to towns that have joined a nation.

Steps to Reproduce:

Ensure nationTownUpkeepModifier is set to 0.8 (or any value less than 1.0) in the config.yml.
Start the server or run /towny reload.
Create a town and note its initial daily upkeep cost (e.g., using /t stats).
Create a nation.
Have the town join the nation.
Wait for the next Towny "New Day" cycle (or force it if possible for testing).
Check the town's upkeep cost again (e.g., using /t stats).
Observed Result: The upkeep cost remains identical to the pre-nation joining cost, showing no 20% discount.

Relevant Configuration Snippet:

YAML

levels:
nation_level:

  • kingPostfix: ''
    capitalPostfix: ''
    upkeepModifier: 1.0
    kingPrefix: '지도자 '
    capitalPrefix: ''
    numResidents: 0
    nationBonusOutpostLimit: 1
    namePostfix: ' 의 영토'
    townBlockLimitBonus: 10
    namePrefix: ''
    nationZonesSize: 1
    nationTownUpkeepModifier: 0.8 # This is the setting in question
    peacefulCostMultiplier: '1.0'
    bankCapModifier: '1.0'
    nationCapitalBonusOutpostLimit: '0'

... (other nation_level entries also have nationTownUpkeepModifier: 0.8)

Additional Context:
I've checked the change logs for v0.101.0.0 which mentions a fix for town_plotbased_upkeep_affected_by_town_level_modifier not being respected for nationTownUpkeepModifier. While my version is newer, it seems the issue might still persist or a similar bug is present.

I have already tried:
Completely restarting the server.
Waiting for the next Towny "New Day"
Confirming no other plugins are obviously conflicting with Towny's economic system.
Any guidance or a fix for this issue would be greatly appreciated. Thank you for your time and efforts!

What is the expected output?

Expected Behavior:
Based on the config.yml settings under levels.nation_level, specifically nationTownUpkeepModifier: 0.8, towns that join a nation should receive a 20% discount on their daily upkeep costs.

Actual Behavior:
After a town joins a nation, its daily upkeep cost remains the same as before joining. There is no observed change or discount applied to the upkeep, even after a server restart and waiting for the next Towny "New Day" cycle.

Towny version

Towny Version: 0.101.1.14

Server version

1.20.1 Paper

Please use Pastebin.com to link the following files

config.zip

commented
commented
		// If the town has a nation we will be altering thing with the nation's TownUpkeepModifier, or 1.0 if no nation.
		double nationMultiplier = town.hasNation() ? town.getNationOrNull().getNationLevel().nationTownUpkeepModifier() : 1.0;
		// Nation's multiplier should only affect plot-based-upkeep if the config is set for it.
		if (isUpkeepByPlot() && !isTownLevelModifiersAffectingPlotBasedUpkeep())
			nationMultiplier = 1.0;

I'm guessing you're using plot based upkeep and you have the townlevel modifier not affecting plot based upkeep.

commented

I believe it's a bug that the nation upkeep discount isn't applied when plot based upkeep is enabled.
The normal and expected behavior should be for the nation upkeep discount to apply simultaneously with plot based upkeep.

commented