Job update
This commit is contained in:
parent
ad38f2c99b
commit
f5cfb8a1a7
18 changed files with 193 additions and 9 deletions
|
|
@ -2,10 +2,13 @@ package org.gsdistance.grimmsServer.Events;
|
|||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.gsdistance.grimmsServer.Commands.CommandRegistry;
|
||||
import org.gsdistance.grimmsServer.Data.JobTitlesBaseValues;
|
||||
import org.gsdistance.grimmsServer.Data.PlayerTitleManager;
|
||||
import org.gsdistance.grimmsServer.GrimmsServer;
|
||||
import org.gsdistance.grimmsServer.Stats.PlayerStatLeaderBoard;
|
||||
import org.gsdistance.grimmsServer.Stats.PlayerStats;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class ServerStartupEvent {
|
||||
|
|
@ -24,6 +27,17 @@ public class ServerStartupEvent {
|
|||
PlayerTitleManager.checkForTotalKills(player);
|
||||
}
|
||||
}
|
||||
if(ticks % 24000 == 0){
|
||||
for (Player player : GrimmsServer.instance.getServer().getOnlinePlayers()) {
|
||||
PlayerStats playerStats = PlayerStats.getPlayerStats(player);
|
||||
String jobTitleId = (String) playerStats.getStat("jobTitle");
|
||||
double payCheck = JobTitlesBaseValues.jobTitleBaseValues.getOrDefault(jobTitleId, null).paycheckSize;
|
||||
if(!Objects.equals(jobTitleId, "") && jobTitleId != null){
|
||||
playerStats.setStat("money", (Double)playerStats.getStat("money") + payCheck);
|
||||
}
|
||||
player.sendMessage("You have received your paycheck: " + payCheck);
|
||||
}
|
||||
}
|
||||
}, 100L, 1L);
|
||||
GrimmsServer.logger.log(Level.INFO, "GrimmsServer has started successfully.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue