Buy enchantment + Misc Update

This commit is contained in:
tyuXX 2025-04-03 18:37:43 +03:00
parent 53dbcb6800
commit a24db4dbcd
41 changed files with 488 additions and 122 deletions

View file

@ -10,32 +10,43 @@ import java.util.Map;
public class PlayerTitles {
private final String[] playerTitles;
public static final Map<String, String> titles = Map.ofEntries(
Map.entry("Dictator","The title of a dictator, not to be messed with."),
Map.entry("Executioner","The title and power of execution."),
Map.entry("Murderer","Someone whose crimes follow him till death."),
Map.entry("Victim","Got murdered, unfortunate."),
Map.entry("DragonSlayer","The fabled warrior to defeat the fabled dragon or something like that."),
Map.entry("Newbie","Wowie! Joining the game gives a title!"),
Map.entry("Millionaire","Wow, that's quite a lot ya' know!"),
Map.entry("Billionaire","Capitalism at it's finest."),
Map.entry("Trillionaire","Literally insane, no comment."),
Map.entry("Dictator", "The title of a dictator, not to be messed with."),
Map.entry("Executioner", "The title and power of execution."),
Map.entry("Murderer", "Someone whose crimes follow him till death."),
Map.entry("Victim", "Got murdered, unfortunate."),
Map.entry("DragonSlayer", "The fabled warrior to defeat the fabled dragon or something like that."),
Map.entry("Newbie", "Wowie! Joining the game gives a title!"),
Map.entry("Richie", "Money talks, well at least that's what I've been told!"),
Map.entry("Millionaire", "Wow, that's quite a lot ya' know!"),
Map.entry("Billionaire", "Capitalism at it's finest."),
Map.entry("Trillionaire", "Literally insane, no comment."),
Map.entry("Miner", "Minin' to the earths core."),
Map.entry("Anti-block", "DEMOLISH 10000 blocks"),
Map.entry("UltimateMiner", "Mine 100000 blocks"),
Map.entry("Titlemaxxer", "Get more than 5 titles"),
Map.entry("Leader","You got on the leaderboard."),
Map.entry("Null","Not a title bro.")
Map.entry("KillingMachine", "Kill 100 things(?)."),
Map.entry("ProGamer", "Kill 1000 things(?)."),
Map.entry("Hitman", "Professional killerguy."),
Map.entry("Leader", "You got on the leaderboard."),
Map.entry("Null", "Not a title bro.")
);
private final Player player;
public PlayerTitles(Player player) {
this.player = player;
this.playerTitles = new Gson().fromJson((String) PlayerStats.getPlayerStats(player).getStat("titles"),String[].class);
this.playerTitles = new Gson().fromJson((String) PlayerStats.getPlayerStats(player).getStat("titles"), String[].class);
}
public static PlayerTitles getPlayerTitles(Player player) {
return new PlayerTitles(player);
}
public String[] getTitles() {
return playerTitles;
}
public void addTitle(String title) {
if(!hasTitle(title)) {
if (!hasTitle(title)) {
String[] newTitles = new String[playerTitles.length + 1];
System.arraycopy(playerTitles, 0, newTitles, 0, playerTitles.length);
newTitles[playerTitles.length] = title;
@ -44,6 +55,7 @@ public class PlayerTitles {
PlayerTitleManager.checkTitles(player);
}
}
public boolean hasTitle(String title) {
for (String playerTitle : playerTitles) {
if (playerTitle.equals(title)) {