Starting-balance is always zero for new players
BoomEaro opened this issue · 1 comments
Type of bug
Data loss, Other unexpected behaviour
/ess version
output
Server версия: 1.12.2-R0.1-SNAPSHOT git-Paper-1615 (MC: 1.12.2)
Brand версия: Paper
EssentialsX версия: 2.19.0-dev+161-3fe279e
LuckPerms версия: 5.3.45
Vault версия: 1.5.6-b49
EssentialsXChat версия: 2.19.0-dev+161-3fe279e
EssentialsXSpawn версия: 2.19.0-dev+161-3fe279e
Citizens версия: 2.0.27-SNAPSHOT
Server startup log
none
EssentialsX config files
The starting-balance section is exactly specified with the desired value in the config.
Error log (if applicable)
none
Bug description
It looks like starting-balance is not working as expected after a recent update of the configuration logic.
The starting-balance value is returned correct, but it does not apply to new players.
It looks like the problem is with these lines:
Essentials/Essentials/src/main/java/com/earth2me/essentials/UserData.java
Lines 110 to 112 in 3fe279e
The money() method never returns null. As a result, it is considered that this player already has a balance from his personal config.
Although, the variable money is declared null by default:
But for some reason, the money() method will never return null.
It is not clear why this is happening and how to fix it.
Steps to reproduce
Very easy to repeat.
- Set the starting-balance to 100000
- Log in to the server as a player who has never been in the game
- Enter the command /money
- The command returns zero balance.
Expected behaviour
Balance must be set according to configuration.
Actual behaviour
The balance is always set to zero.