Fix merge conflicts

This commit is contained in:
AlexTheCoder 2017-11-09 00:46:53 -05:00 committed by Alexander Meech
parent b80c010e67
commit 58b48f2a5d
28 changed files with 1017 additions and 343 deletions

View File

@ -1377,97 +1377,97 @@ public enum Achievement
AchievementCategory.MOBA), AchievementCategory.MOBA),
CAKE_WARS_WIN("Cake Dinners", 15000, CAKE_WARS_WIN("Cake Dinners", 15000,
new String[]{"Cake Wars Rumble.Wins", "Cake Wars Duos.Wins"}, new String[]{"Cake Wars 4v4v4v4.Wins", "Cake Wars Duos.Wins"},
new String[]{"Win 100 games of Cake Wars"}, new String[]{"Win 100 games of Cake Wars"},
new int[]{100}, new int[]{100},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_KILLS("Cake Slayer", 15000, CAKE_WARS_KILLS("Cake Slayer", 15000,
new String[]{"Cake Wars Rumble.Kills", "Cake Wars Duos.Kills"}, new String[]{"Cake Wars 4v4v4v4.Kills", "Cake Wars Duos.Kills"},
new String[]{"Kill 1000 players in Cake Wars"}, new String[]{"Kill 1000 players in Cake Wars"},
new int[]{1000}, new int[]{1000},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_BITES("Big Appetite", 15000, CAKE_WARS_BITES("Big Appetite", 15000,
new String[]{"Cake Wars Rumble.Bites", "Cake Wars Duos.Bites"}, new String[]{"Cake Wars 4v4v4v4.Bites", "Cake Wars Duos.Bites"},
new String[]{"Take 500 bites of cake in Cake Wars"}, new String[]{"Take 500 bites of cake in Cake Wars"},
new int[]{500}, new int[]{500},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_EAT_WHOLE_CAKE("Greedy", 2000, CAKE_WARS_EAT_WHOLE_CAKE("Greedy", 2000,
new String[]{"Cake Wars Rumble.EatWholeCake", "Cake Wars Duos.EatWholeCake"}, new String[]{"Cake Wars 4v4v4v4.EatWholeCake", "Cake Wars Duos.EatWholeCake"},
new String[]{"Eat a whole cake"}, new String[]{"Eat a whole cake"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_SURVIVE_10("This game has cakes?", 4000, CAKE_WARS_SURVIVE_10("This game has cakes?", 4000,
new String[]{"Cake Wars Rumble.Survive10", "Cake Wars Duos.Survive10"}, new String[]{"Cake Wars 4v4v4v4.Survive10", "Cake Wars Duos.Survive10"},
new String[]{"Survive 10 minutes without", "a cake"}, new String[]{"Survive 10 minutes without", "a cake"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_FIRST_BLOOD("Cold Baked Killer", 2000, CAKE_WARS_FIRST_BLOOD("Cold Baked Killer", 2000,
new String[]{"Cake Wars Rumble.FirstBlood", "Cake Wars Duos.FirstBlood"}, new String[]{"Cake Wars 4v4v4v4.FirstBlood", "Cake Wars Duos.FirstBlood"},
new String[]{"Get 10 First Bloods"}, new String[]{"Get 10 First Bloods"},
new int[]{10}, new int[]{10},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_EAT_1("Starving", 2000, CAKE_WARS_EAT_1("Starving", 2000,
new String[]{"Cake Wars Rumble.Eat1", "Cake Wars Duos.Eat1"}, new String[]{"Cake Wars 4v4v4v4.Eat1", "Cake Wars Duos.Eat1"},
new String[]{"Eat a cake within the first", "minute of the game"}, new String[]{"Eat a cake within the first", "minute of the game"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_NO_DEATHS("You call that a challenge", 4000, CAKE_WARS_NO_DEATHS("You call that a challenge", 4000,
new String[]{"Cake Wars Rumble.NoDeaths", "Cake Wars Duos.NoDeaths"}, new String[]{"Cake Wars 4v4v4v4.NoDeaths", "Cake Wars Duos.NoDeaths"},
new String[]{"Win a game without dying"}, new String[]{"Win a game without dying"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_BUY_ALL("Team Player", 2000, CAKE_WARS_BUY_ALL("Team Player", 2000,
new String[]{"Cake Wars Rumble.BuyAll", "Cake Wars Duos.BuyAll"}, new String[]{"Cake Wars 4v4v4v4.BuyAll", "Cake Wars Duos.BuyAll"},
new String[]{"Purchase all Team Upgrades", "within one game"}, new String[]{"Purchase all Team Upgrades", "within one game"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_WIN_WITHOUT_KILL("Love not War", 4000, CAKE_WARS_WIN_WITHOUT_KILL("Love not War", 4000,
new String[]{"Cake Wars Rumble.NoKills", "Cake Wars Duos.NoKills"}, new String[]{"Cake Wars 4v4v4v4.NoKills", "Cake Wars Duos.NoKills"},
new String[]{"Win a game without killing", "a player"}, new String[]{"Win a game without killing", "a player"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_WIN_WITH_1("Last Crumb", 2000, CAKE_WARS_WIN_WITH_1("Last Crumb", 2000,
new String[]{"Cake Wars Rumble.WinWithOneBite", "Cake Wars Duos.WinWithOneBite"}, new String[]{"Cake Wars 4v4v4v4.WinWithOneBite", "Cake Wars Duos.WinWithOneBite"},
new String[]{"Win a game with only one", "bite of your cake left"}, new String[]{"Win a game with only one", "bite of your cake left"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_WIN_IN_10("Gotta go fast", 2000, CAKE_WARS_WIN_IN_10("Gotta go fast", 2000,
new String[]{"Cake Wars Rumble.WinIn10", "Cake Wars Duos.WinIn10"}, new String[]{"Cake Wars 4v4v4v4.WinIn10", "Cake Wars Duos.WinIn10"},
new String[]{"Win a game within 10", "minutes"}, new String[]{"Win a game within 10", "minutes"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_FINAL_BITE("Last Laugh", 2000, CAKE_WARS_FINAL_BITE("Last Laugh", 2000,
new String[]{"Cake Wars Rumble.FinalBite", "Cake Wars Duos.FinalBite"}, new String[]{"Cake Wars 4v4v4v4.FinalBite", "Cake Wars Duos.FinalBite"},
new String[]{"Get the final bite on every", "cake within a game"}, new String[]{"Get the final bite on every", "cake within a game"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_OWN_ALL_BEACONS("I <3 Capture Points", 4000, CAKE_WARS_OWN_ALL_BEACONS("I <3 Capture Points", 4000,
new String[]{"Cake Wars Rumble.OwnAllBeacons", "Cake Wars Duos.OwnAllBeacons"}, new String[]{"Cake Wars 4v4v4v4.OwnAllBeacons", "Cake Wars Duos.OwnAllBeacons"},
new String[]{"Own all beacons for your team", "in one game"}, new String[]{"Own all beacons for your team", "in one game"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_GET_GOOD("Get Good", 15000, CAKE_WARS_GET_GOOD("Get Good", 15000,
new String[]{"Cake Wars Rumble.GetGood", "Cake Wars Duos.GetGood"}, new String[]{"Cake Wars 4v4v4v4.GetGood", "Cake Wars Duos.GetGood"},
new String[]{"Kill a player while falling", "from a great height.", "Then save yourself from dying"}, new String[]{"Kill a player while falling", "from a great height.", "Then save yourself from dying"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),
CAKE_WARS_FLOOR_IS_LAVA("The Floor Is Lava", 15000, CAKE_WARS_FLOOR_IS_LAVA("The Floor Is Lava", 15000,
new String[]{"Cake Wars Rumble.FloorIsLava", "Cake Wars Duos.FloorIsLava"}, new String[]{"Cake Wars 4v4v4v4.FloorIsLava", "Cake Wars Duos.FloorIsLava"},
new String[]{"Win a game of Cake Wars while", "after the first 30 seconds of the game,", "only stand on player placed blocks", "", "Includes Deploy Platforms and", "near Shops"}, new String[]{"Win a game of Cake Wars while", "after the first 30 seconds of the game,", "only stand on player placed blocks", "", "Includes Deploy Platforms and", "near Shops"},
new int[]{1}, new int[]{1},
AchievementCategory.CAKE_WARS), AchievementCategory.CAKE_WARS),

View File

@ -247,7 +247,7 @@ public enum AchievementCategory
CAKE_WARS("Cake Wars", null, CAKE_WARS("Cake Wars", null,
new StatDisplay[] new StatDisplay[]
{ {
new StatDisplay(C.Bold + "Rumble", true), new StatDisplay(C.Bold + "4v4v4v4", true),
StatDisplay.fromGame("Wins", GameDisplay.CakeWars4, "Wins"), StatDisplay.fromGame("Wins", GameDisplay.CakeWars4, "Wins"),
StatDisplay.fromGame("Games Play", GameDisplay.CakeWars4, "Wins", "Losses"), StatDisplay.fromGame("Games Play", GameDisplay.CakeWars4, "Wins", "Losses"),
StatDisplay.fromGame("Best Win Streak", GameDisplay.CakeWars4, "BestWinStreak"), StatDisplay.fromGame("Best Win Streak", GameDisplay.CakeWars4, "BestWinStreak"),

View File

@ -109,7 +109,7 @@ public enum GameDisplay
BattleRoyale("Battle Royale", Material.DIAMOND_SWORD, (byte)0, GameCategory.EVENT, 72, false), BattleRoyale("Battle Royale", Material.DIAMOND_SWORD, (byte)0, GameCategory.EVENT, 72, false),
CakeWars4("Cake Wars Rumble", Material.CAKE, (byte)0, GameCategory.CLASSICS, 73, true), CakeWars4("Cake Wars 4v4v4v4", Material.CAKE, (byte)0, GameCategory.CLASSICS, 73, true),
CakeWarsDuos("Cake Wars Duos", Material.CAKE, (byte)0, GameCategory.CLASSICS, 74, false), CakeWarsDuos("Cake Wars Duos", Material.CAKE, (byte)0, GameCategory.CLASSICS, 74, false),
GemHunters("Gem Hunters", Material.EMERALD, (byte) 0, GameCategory.SURVIVAL, 71, false), GemHunters("Gem Hunters", Material.EMERALD, (byte) 0, GameCategory.SURVIVAL, 71, false),

View File

@ -656,7 +656,7 @@ public class Hologram {
newText[i] = newLines[newText.length - (i + 1)]; newText[i] = newLines[newText.length - (i + 1)];
} }
if (newText.equals(_hologramText)) if (Arrays.equals(newText, _hologramText))
{ {
return this; return this;
} }

View File

@ -3,7 +3,8 @@ package mineplex.core.hologram;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType; import org.bukkit.event.inventory.ClickType;
@FunctionalInterface
public interface HologramInteraction public interface HologramInteraction
{ {
public void onClick(Player player, ClickType clickType); void onClick(Player player, ClickType clickType);
} }

View File

@ -15,6 +15,7 @@ import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
import mineplex.core.ReflectivelyCreateMiniPlugin;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.IPacketHandler;
@ -25,14 +26,17 @@ import mineplex.core.updater.event.UpdateEvent;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity; import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.EnumEntityUseAction; import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.EnumEntityUseAction;
@ReflectivelyCreateMiniPlugin
public class HologramManager extends MiniPlugin implements IPacketHandler public class HologramManager extends MiniPlugin implements IPacketHandler
{ {
private ArrayList<Hologram> _activeHolograms = new ArrayList<Hologram>();
public HologramManager(JavaPlugin plugin, PacketHandler packetHandler) private final List<Hologram> _activeHolograms = new ArrayList<>();
private HologramManager()
{ {
super("Hologram Manager", plugin); super("Hologram Manager");
packetHandler.addPacketHandler(this, true, PacketPlayInUseEntity.class);
require(PacketHandler.class).addPacketHandler(this, true, PacketPlayInUseEntity.class);
} }
void addHologram(Hologram hologram) void addHologram(Hologram hologram)

View File

@ -0,0 +1,149 @@
package mineplex.core.leaderboard;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.hologram.Hologram.HologramTarget;
import mineplex.core.recharge.Recharge;
public class DynamicLeaderboard extends LeaderboardDisplay implements PlayerActionHook
{
private final List<StaticLeaderboard> _leaderboards;
private final Map<Player, Integer> _viewingTime;
public DynamicLeaderboard(LeaderboardManager manager, List<StaticLeaderboard> leaderboards)
{
super(manager);
_leaderboards = leaderboards;
_viewingTime = new HashMap<>();
_leaderboards.forEach(leaderboard ->
{
leaderboard.getHologram().setHologramTarget(HologramTarget.WHITELIST);
leaderboard.getHologram().setInteraction((player, clickType) -> rotateTime(player));
});
}
private void rotateTime(Player player)
{
if (_leaderboards.size() == 1 || !Recharge.Instance.use(player, "Leaderboard Interact", 500, false, false))
{
return;
}
int newIndex = _viewingTime.get(player) + 1;
if (newIndex == _leaderboards.size())
{
newIndex = 0;
}
setViewingTime(player, newIndex, true);
}
@Override
public void onPlayerJoin(Player player)
{
setViewingTime(player, 0);
}
@Override
public void onPlayerQuit(Player player)
{
_viewingTime.remove(player);
}
public void setViewingTime(Player player)
{
setViewingTime(player, 0);
}
public void setViewingTime(Player player, int newIndex)
{
setViewingTime(player, newIndex, false);
}
public void setViewingTime(Player player, int newIndex, boolean inform)
{
Integer oldIndex = _viewingTime.get(player);
if (oldIndex != null)
{
_leaderboards.get(oldIndex).getHologram().removePlayer(player);
}
if (newIndex == -1)
{
return;
}
StaticLeaderboard newLeaderboard = _leaderboards.get(newIndex);
if (inform)
{
player.playSound(player.getLocation(), Sound.WOOD_CLICK, 1, 1);
player.sendMessage(F.main(_manager.getName(), "You are now viewing " + F.name(newLeaderboard.getName()) + "."));
}
newLeaderboard.getHologram().addPlayer(player);
_viewingTime.put(player, newIndex);
}
@Override
public void register()
{
}
@Override
public void unregister()
{
_leaderboards.forEach(LeaderboardDisplay::unregister);
_viewingTime.clear();
}
@Override
public void update()
{
_leaderboards.forEach(leaderboard ->
{
leaderboard.update();
if (_leaderboards.size() > 1)
{
String[] text = leaderboard.getHologram().getText();
String[] newText = new String[text.length + 3];
System.arraycopy(text, 0, newText, 0, text.length);
newText[text.length] = C.blankLine;
newText[text.length + 1] = C.cYellowB + "Click to view the";
newText[text.length + 2] = C.cYellowB + "next category";
leaderboard.getHologram().setText(newText);
}
});
}
@Override
public List<Leaderboard> getDisplayedLeaderboards()
{
List<Leaderboard> leaderboards = new ArrayList<>();
_leaderboards.forEach(display -> leaderboards.addAll(display.getDisplayedLeaderboards()));
return leaderboards;
}
public List<StaticLeaderboard> getLeaderboards()
{
return _leaderboards;
}
}

View File

@ -1,73 +1,60 @@
package mineplex.core.leaderboard; package mineplex.core.leaderboard;
import java.util.Collections; import java.util.ArrayList;
import java.util.LinkedList; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import org.bukkit.Location;
import mineplex.core.Managers;
import mineplex.core.common.Pair;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.hologram.Hologram;
import mineplex.core.hologram.HologramManager;
import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType; import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType;
public class Leaderboard public class Leaderboard
{ {
private static final HologramManager HOLOGRAM_MANAGER = Managers.get(HologramManager.class); private static final String NULL_ENTRY = C.cGray + " - ";
private final String _display;
private final Pair<String, String> _statDisplay;
private final String[] _statNames;
private final int[] _statIds;
private final int _size, _start;
private final LeaderboardSQLType _type; private final LeaderboardSQLType _type;
private final Location _loc; private final int _start, _size;
private Hologram _holo; private final int[] _statIds;
private final String[] _statNames;
private final Map<String, Integer> _entries;
private final List<String> _formattedEntries;
public Leaderboard(String display, Pair<String, String> statDisplayNames, String[] statNames, LeaderboardSQLType type, Location displayLoc, int size) public Leaderboard(LeaderboardSQLType type, String... statNames)
{ {
this(display, statDisplayNames, statNames, type, displayLoc, size, 0); this(type, 10, statNames);
} }
@SuppressWarnings("unchecked") public Leaderboard(LeaderboardSQLType type, int size, String... statNames)
public Leaderboard(String display, Pair<String, String> statDisplayNames, String[] statNames, LeaderboardSQLType type, Location displayLoc, int size, int start) {
this(type, 0, size, statNames);
}
public Leaderboard(LeaderboardSQLType type, int start, int size, String... statNames)
{ {
_display = display;
_statDisplay = statDisplayNames;
_statNames = statNames;
_statIds = new int[_statNames.length];
_type = type; _type = type;
_size = size;
_start = start; _start = start;
_loc = displayLoc; _size = size;
_statIds = new int[statNames.length];
update(Collections.EMPTY_MAP); _statNames = statNames;
_entries = new HashMap<>(size);
_formattedEntries = new ArrayList<>(size);
} }
public int getSize() public void update(Map<String, Integer> entries)
{ {
return _size; _entries.clear();
} _entries.putAll(entries);
_formattedEntries.clear();
public int getStart() AtomicInteger place = new AtomicInteger(_start);
{
return _start;
}
/** entries.forEach((name, value) -> _formattedEntries.add(C.cAqua + "#" + place.incrementAndGet() + C.cGray + " - " + C.cYellow + name + C.cGray + " - " + C.cYellow + value));
* The returned array is not safe for mutation
*/
public String[] getStatNames()
{
return _statNames;
}
public synchronized int[] getStatIds() while (place.getAndIncrement() < _size)
{ {
return _statIds; _formattedEntries.add(NULL_ENTRY);
}
} }
public LeaderboardSQLType getType() public LeaderboardSQLType getType()
@ -75,25 +62,17 @@ public class Leaderboard
return _type; return _type;
} }
public void update(Map<String, Long> names) public int getStart()
{ {
deconstruct(); return _start;
LinkedList<String> display = new LinkedList<>();
display.add(C.cAqua + _display);
display.add(C.blankLine);
AtomicInteger place = new AtomicInteger(_start + 1);
names.forEach((name, value) ->
{
display.add(C.cGreen + "#" + place + " " + name + C.cRed + " " + value + " " + (value == 1 ? _statDisplay.getLeft() : _statDisplay.getRight()));
place.getAndIncrement();
});
_holo = new Hologram(HOLOGRAM_MANAGER, _loc, display.toArray(new String[0]))
.start();
} }
public synchronized void setStatId(int index, int id) public int getSize()
{
return _size;
}
synchronized void setStatId(int index, int id)
{ {
if (_statIds.length > index && index >= 0) if (_statIds.length > index && index >= 0)
{ {
@ -101,12 +80,23 @@ public class Leaderboard
} }
} }
public void deconstruct() synchronized int[] getStatIds()
{ {
if (_holo != null) return _statIds;
{
_holo.stop();
_holo = null;
} }
String[] getStatNames()
{
return _statNames;
}
public Map<String, Integer> getEntries()
{
return _entries;
}
public List<String> getFormattedEntries()
{
return _formattedEntries;
} }
} }

View File

@ -0,0 +1,22 @@
package mineplex.core.leaderboard;
import java.util.List;
public abstract class LeaderboardDisplay
{
protected final LeaderboardManager _manager;
LeaderboardDisplay(LeaderboardManager manager)
{
_manager = manager;
}
public abstract void register();
public abstract void unregister();
public abstract void update();
public abstract List<Leaderboard> getDisplayedLeaderboards();
}

View File

@ -8,34 +8,45 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.Managers;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
import mineplex.core.account.permissions.Permission; import mineplex.core.account.permissions.Permission;
import mineplex.core.account.permissions.PermissionGroup; import mineplex.core.account.permissions.PermissionGroup;
import mineplex.core.command.CommandBase; import mineplex.core.command.CommandBase;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer;
import mineplex.core.hologram.HologramManager; import mineplex.core.hologram.HologramManager;
import mineplex.core.stats.StatsManager; import mineplex.core.stats.StatsManager;
public class LeaderboardManager extends MiniPlugin public class LeaderboardManager extends MiniPlugin
{ {
public enum Perm implements Permission public enum Perm implements Permission
{ {
CYCLE_LEADERBOARD_COMMAND, CYCLE_LEADERBOARD_COMMAND,
} }
private final Map<String, Leaderboard> _leaderboards = new HashMap<>(); private final StatsManager _statsManager;
private final HologramManager _hologramManager;
private final LeaderboardRepository _repo; private final LeaderboardRepository _repo;
private final Map<Leaderboard, Runnable> _loading = new HashMap<>();
public LeaderboardManager(JavaPlugin plugin) private final Map<String, LeaderboardDisplay> _leaderboards;
private final Map<Leaderboard, Runnable> _loading;
public LeaderboardManager(StatsManager statsManager)
{ {
super("Leaderboard Manager", plugin); super("Leaderboard");
_repo = new LeaderboardRepository(plugin); _statsManager = statsManager;
_hologramManager = require(HologramManager.class);
_repo = new LeaderboardRepository();
_leaderboards = new HashMap<>();
_loading = new HashMap<>();
addCommand(new CommandBase<LeaderboardManager>(this, Perm.CYCLE_LEADERBOARD_COMMAND, "cycleleaderboard") addCommand(new CommandBase<LeaderboardManager>(this, Perm.CYCLE_LEADERBOARD_COMMAND, "cycleleaderboard")
{ {
@ -47,9 +58,11 @@ public class LeaderboardManager extends MiniPlugin
} }
}); });
long refreshRate = 5 * 60 * 20 + ((UtilMath.r(5) + 1) * 60 * 20); int oneMinute = 60 * 20;
int refreshRate = oneMinute * 10;
int initialDelay = UtilMath.r(oneMinute);
runSyncTimer(this::refreshBoards, 0, refreshRate); runSyncTimer(this::refreshBoards, initialDelay, refreshRate);
runSyncTimer(() -> runSyncTimer(() ->
{ {
@ -84,65 +97,100 @@ public class LeaderboardManager extends MiniPlugin
private void refreshBoards() private void refreshBoards()
{ {
List<Leaderboard> leaderboards = new ArrayList<>(); List<Leaderboard> leaderboards = new ArrayList<>();
leaderboards.addAll(_leaderboards.values()); _leaderboards.values().forEach(display -> leaderboards.addAll(display.getDisplayedLeaderboards()));
_repo.loadLeaderboards(_leaderboards.values(), boards ->
_repo.loadLeaderboards(leaderboards, boards ->
{ {
for (int i = 0; i < boards.length && i < leaderboards.size(); i++) for (int i = 0; i < boards.length && i < leaderboards.size(); i++)
{ {
leaderboards.get(i).update(boards[i]); leaderboards.get(i).update(boards[i]);
_leaderboards.values().forEach(LeaderboardDisplay::update);
} }
}); });
} }
public HologramManager getHologramManager()
{
return Managers.get(HologramManager.class);
}
public Leaderboard getLeaderboard(String identifier)
{
return _leaderboards.get(identifier);
}
public void handleStatIncrease(Map<Integer, Map<Integer, Long>> stats) public void handleStatIncrease(Map<Integer, Map<Integer, Long>> stats)
{ {
_repo.insertStats(stats); _repo.insertStats(stats);
} }
public void handleStatIncrease(int accountId, Map<Integer, Long> stats) public void registerLeaderboard(String identifier, LeaderboardDisplay display)
{ {
_repo.insertStats(accountId, stats); LeaderboardDisplay oldDisplay = _leaderboards.remove(identifier);
if (oldDisplay != null)
{
oldDisplay.unregister();
} }
public void registerLeaderboard(String identifier, Leaderboard board) List<Leaderboard> boards = display.getDisplayedLeaderboards();
{
if (_leaderboards.containsKey(identifier))
{
board.deconstruct();
return;
}
final Runnable postLoad = () -> final Runnable postLoad = () ->
{ {
_leaderboards.put(identifier, board); _leaderboards.put(identifier, display);
for (Leaderboard board : boards)
{
_repo.loadLeaderboard(board, board::update); _repo.loadLeaderboard(board, board::update);
}
if (display instanceof PlayerActionHook)
{
PlayerActionHook actionHook = (PlayerActionHook) display;
UtilServer.getPlayersCollection().forEach(actionHook::onPlayerJoin);
}
display.update();
}; };
for (Leaderboard board : boards)
{
_loading.put(board, postLoad); _loading.put(board, postLoad);
for (int i = 0; i < board.getStatNames().length; i++) for (int i = 0; i < board.getStatNames().length; i++)
{ {
final int index = i; final int index = i;
Managers.get(StatsManager.class).loadStatId(board.getStatNames()[index], id -> _statsManager.loadStatId(board.getStatNames()[index], id -> board.setStatId(index, id));
{ }
board.setStatId(index, id);
});
} }
} }
public void unregisterLeaderboard(String boardIdentifier) public void unregisterLeaderboard(String boardIdentifier)
{ {
if (!_leaderboards.containsKey(boardIdentifier)) LeaderboardDisplay display = _leaderboards.remove(boardIdentifier);
if (display != null)
{ {
return; display.unregister();
} }
_leaderboards.remove(boardIdentifier).deconstruct(); }
@EventHandler
public void playerJoin(PlayerJoinEvent event)
{
_leaderboards.values().forEach(display ->
{
if (display instanceof PlayerActionHook)
{
((PlayerActionHook) display).onPlayerJoin(event.getPlayer());
}
});
}
@EventHandler
public void playerQuit(PlayerQuitEvent event)
{
_leaderboards.values().forEach(display ->
{
if (display instanceof PlayerActionHook)
{
((PlayerActionHook) display).onPlayerQuit(event.getPlayer());
}
});
}
public HologramManager getHologramManager()
{
return _hologramManager;
} }
} }

View File

@ -38,7 +38,7 @@ public class LeaderboardRepository extends RepositoryBase
private static final String FETCH_STAT_ALL_SEASON = "SELECT a.name, sl.value FROM accountStatsSeasonal AS sl INNER JOIN accounts AS a ON a.id=sl.accountId WHERE sl.statId=%STAT% AND seasonId=(SELECT id FROM statSeasons WHERE now() BETWEEN startDate AND endDate LIMIT 1) ORDER BY sl.value DESC LIMIT %START%,%LIMIT%;"; private static final String FETCH_STAT_ALL_SEASON = "SELECT a.name, sl.value FROM accountStatsSeasonal AS sl INNER JOIN accounts AS a ON a.id=sl.accountId WHERE sl.statId=%STAT% AND seasonId=(SELECT id FROM statSeasons WHERE now() BETWEEN startDate AND endDate LIMIT 1) ORDER BY sl.value DESC LIMIT %START%,%LIMIT%;";
public LeaderboardRepository(JavaPlugin plugin) public LeaderboardRepository()
{ {
super(DBPool.getAccount()); super(DBPool.getAccount());
} }
@ -227,7 +227,7 @@ public class LeaderboardRepository extends RepositoryBase
}); });
} }
public static enum LeaderboardSQLType public enum LeaderboardSQLType
{ {
DAILY(FETCH_STAT_DAILY), DAILY(FETCH_STAT_DAILY),
WEEKLY(FETCH_STAT_WEEKLY), WEEKLY(FETCH_STAT_WEEKLY),
@ -239,7 +239,7 @@ public class LeaderboardRepository extends RepositoryBase
private String _sql; private String _sql;
private LeaderboardSQLType(String sql) LeaderboardSQLType(String sql)
{ {
_sql = sql; _sql = sql;
} }

View File

@ -0,0 +1,12 @@
package mineplex.core.leaderboard;
import org.bukkit.entity.Player;
interface PlayerActionHook
{
void onPlayerJoin(Player player);
void onPlayerQuit(Player player);
}

View File

@ -0,0 +1,127 @@
package mineplex.core.leaderboard;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import mineplex.core.common.Pair;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.hologram.Hologram;
import mineplex.core.recharge.Recharge;
public class RotatingLeaderboard extends LeaderboardDisplay implements PlayerActionHook
{
private final Map<Player, Integer> _viewingGroup;
private final List<Pair<String, List<DynamicLeaderboard>>> _leaderboards;
private final Hologram _rotator;
public RotatingLeaderboard(LeaderboardManager manager, Location rotatorLocation)
{
super(manager);
_viewingGroup = new HashMap<>();
_leaderboards = new ArrayList<>(3);
_rotator = new Hologram(manager.getHologramManager(), rotatorLocation, C.cGreenB + "Click to view the", C.cGreenB + "next mode!")
.setInteraction((player, clickType) -> rotateGroup(player));
}
public RotatingLeaderboard addMode(String modeName, List<DynamicLeaderboard> leaderboards)
{
_leaderboards.add(Pair.create(modeName, leaderboards));
return this;
}
public void rotateGroup(Player player)
{
if (!Recharge.Instance.use(player, "Leaderboard Interact", 500, false, false))
{
return;
}
int newIndex = _viewingGroup.get(player) + 1;
if (newIndex == _leaderboards.size())
{
newIndex = 0;
}
setViewingGroup(player, newIndex);
}
@Override
public void onPlayerJoin(Player player)
{
_viewingGroup.put(player, 0);
_leaderboards.get(0).getRight().forEach(leaderboard -> leaderboard.onPlayerJoin(player));
}
@Override
public void onPlayerQuit(Player player)
{
_viewingGroup.remove(player);
_leaderboards.forEach(pair -> pair.getRight().forEach(leaderboard -> leaderboard.onPlayerQuit(player)));
}
private void setViewingGroup(Player player, int newIndex)
{
Integer oldIndex = _viewingGroup.put(player, newIndex);
Pair<String, List<DynamicLeaderboard>> newPair = _leaderboards.get(newIndex);
List<DynamicLeaderboard> newLeaderboards = newPair.getRight();
if (oldIndex != null)
{
_leaderboards.get(oldIndex).getRight().forEach(leaderboard -> leaderboard.setViewingTime(player, -1));
player.playSound(player.getLocation(), Sound.CLICK, 1, 1);
player.sendMessage(F.main(_manager.getName(), "You are now viewing " + F.name(newPair.getLeft()) + "."));
}
newLeaderboards.forEach(leaderboard -> leaderboard.setViewingTime(player));
}
@Override
public void register()
{
_rotator.start();
}
@Override
public void unregister()
{
_rotator.stop();
_leaderboards.forEach(pair -> pair.getRight().forEach(LeaderboardDisplay::unregister));
_leaderboards.clear();
_viewingGroup.clear();
}
@Override
public void update()
{
_leaderboards.forEach(pair -> pair.getRight().forEach(leaderboard ->
{
leaderboard.update();
leaderboard.getLeaderboards().forEach(staticLeaderboard ->
{
String[] newText = staticLeaderboard.getHologram().getText();
newText[0] += " " + pair.getLeft();
staticLeaderboard.getHologram().setText(newText);
});
}));
}
@Override
public List<Leaderboard> getDisplayedLeaderboards()
{
List<Leaderboard> leaderboards = new ArrayList<>();
_leaderboards.forEach(pair -> pair.getRight().forEach(leaderboard -> leaderboards.addAll(leaderboard.getDisplayedLeaderboards())));
return leaderboards;
}
}

View File

@ -0,0 +1,71 @@
package mineplex.core.leaderboard;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Location;
import mineplex.core.common.util.C;
import mineplex.core.hologram.Hologram;
public class StaticLeaderboard extends LeaderboardDisplay
{
private final String _name;
private final Leaderboard _leaderboard;
private final Hologram _hologram;
public StaticLeaderboard(LeaderboardManager manager, String name, Leaderboard leaderboard, Location location)
{
super(manager);
_name = name;
_leaderboard = leaderboard;
_hologram = new Hologram(manager.getHologramManager(), location);
}
@Override
public void register()
{
}
@Override
public void unregister()
{
_hologram.stop();
}
@Override
public void update()
{
List<String> text = new ArrayList<>();
text.add(C.cAquaB + _name);
text.add(C.blankLine);
text.addAll(_leaderboard.getFormattedEntries());
_hologram.setText(text.toArray(new String[0]));
if (!_hologram.isInUse())
{
_hologram.start();
}
}
@Override
public List<Leaderboard> getDisplayedLeaderboards()
{
return Collections.singletonList(_leaderboard);
}
public String getName()
{
return _name;
}
public Hologram getHologram()
{
return _hologram;
}
}

View File

@ -62,7 +62,7 @@ public class StatsManager extends MiniDbClientPlugin<PlayerStats>
_repository = new StatsRepository(); _repository = new StatsRepository();
_coreClientManager = clientManager; _coreClientManager = clientManager;
_leaderboard = new LeaderboardManager(plugin); _leaderboard = new LeaderboardManager(this);
clientManager.addStoredProcedureLoginProcessor(new ILoginProcessor() clientManager.addStoredProcedureLoginProcessor(new ILoginProcessor()
{ {

View File

@ -183,7 +183,7 @@ public class Clans extends JavaPlugin
new CustomTagFix(this, packetHandler); new CustomTagFix(this, packetHandler);
GearManager customGear = new GearManager(this, packetHandler, _clientManager, _donationManager); GearManager customGear = new GearManager(this, packetHandler, _clientManager, _donationManager);
HologramManager hologram = new HologramManager(this, packetHandler); HologramManager hologram = require(HologramManager.class);
_clansManager = new ClansManager(this, serverStatusManager.getCurrentServerName(), incognito, packetHandler, punish, _clientManager, _donationManager, preferenceManager, blockRestore, statsManager, teleport, chat, customGear, hologram, inventory); _clansManager = new ClansManager(this, serverStatusManager.getCurrentServerName(), incognito, packetHandler, punish, _clientManager, _donationManager, preferenceManager, blockRestore, statsManager, teleport, chat, customGear, hologram, inventory);
new Recipes(this); new Recipes(this);
new Farming(this); new Farming(this);

View File

@ -121,7 +121,7 @@ public class ClansHub extends JavaPlugin
Creature creature = new Creature(this); Creature creature = new Creature(this);
NpcManager npcManager = new NpcManager(this, creature); NpcManager npcManager = new NpcManager(this, creature);
InventoryManager inventoryManager = new InventoryManager(this, clientManager); InventoryManager inventoryManager = new InventoryManager(this, clientManager);
HologramManager hologramManager = new HologramManager(this, packetHandler); HologramManager hologramManager = require(HologramManager.class);
CastleManager castleManager = new CastleManager(this, clientManager, hologramManager, false); CastleManager castleManager = new CastleManager(this, clientManager, hologramManager, false);
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore); PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore);
PollManager pollManager = new PollManager(this, clientManager, donationManager); PollManager pollManager = new PollManager(this, clientManager, donationManager);

View File

@ -119,7 +119,7 @@ public class Hub extends JavaPlugin implements IRelation
incognito.setPreferencesManager(preferenceManager); incognito.setPreferencesManager(preferenceManager);
HologramManager hologramManager = new HologramManager(this, packetHandler); HologramManager hologramManager = require(HologramManager.class);
preferenceManager.GiveItem = true; preferenceManager.GiveItem = true;
Creature creature = new Creature(this); Creature creature = new Creature(this);

View File

@ -190,7 +190,7 @@ public class Arcade extends JavaPlugin
BlockRestore blockRestore = require(BlockRestore.class); BlockRestore blockRestore = require(BlockRestore.class);
ProjectileManager projectileManager = new ProjectileManager(this); ProjectileManager projectileManager = new ProjectileManager(this);
HologramManager hologramManager = new HologramManager(this, packetHandler); HologramManager hologramManager = require(HologramManager.class);
//Inventory //Inventory
InventoryManager inventoryManager = new InventoryManager(this, _clientManager); InventoryManager inventoryManager = new InventoryManager(this, _clientManager);

View File

@ -1,7 +1,10 @@
package nautilus.game.arcade.game.games.cakewars; package nautilus.game.arcade.game.games.cakewars;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -13,10 +16,17 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.Managers;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.leaderboard.DynamicLeaderboard;
import mineplex.core.leaderboard.Leaderboard;
import mineplex.core.leaderboard.LeaderboardManager;
import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType;
import mineplex.core.leaderboard.RotatingLeaderboard;
import mineplex.core.leaderboard.StaticLeaderboard;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
@ -25,14 +35,14 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame; import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.AbsorptionFix; import nautilus.game.arcade.game.games.AbsorptionFix;
import nautilus.game.arcade.game.games.cakewars.capturepoint.CakePointModule;
import nautilus.game.arcade.game.games.cakewars.general.CakePlayerModule;
import nautilus.game.arcade.game.games.cakewars.general.CakeSpawnerModule;
import nautilus.game.arcade.game.games.cakewars.island.CakeIslandModule;
import nautilus.game.arcade.game.games.cakewars.kits.KitCakeArcher; import nautilus.game.arcade.game.games.cakewars.kits.KitCakeArcher;
import nautilus.game.arcade.game.games.cakewars.kits.KitCakeBuilder; import nautilus.game.arcade.game.games.cakewars.kits.KitCakeBuilder;
import nautilus.game.arcade.game.games.cakewars.kits.KitCakeWarrior; import nautilus.game.arcade.game.games.cakewars.kits.KitCakeWarrior;
import nautilus.game.arcade.game.games.cakewars.island.CakeIslandModule;
import nautilus.game.arcade.game.games.cakewars.general.CakePlayerModule;
import nautilus.game.arcade.game.games.cakewars.capturepoint.CakePointModule;
import nautilus.game.arcade.game.games.cakewars.shop.CakeShopModule; import nautilus.game.arcade.game.games.cakewars.shop.CakeShopModule;
import nautilus.game.arcade.game.games.cakewars.general.CakeSpawnerModule;
import nautilus.game.arcade.game.games.cakewars.team.CakeTeam; import nautilus.game.arcade.game.games.cakewars.team.CakeTeam;
import nautilus.game.arcade.game.games.cakewars.team.CakeTeamModule; import nautilus.game.arcade.game.games.cakewars.team.CakeTeamModule;
import nautilus.game.arcade.game.games.cakewars.trackers.EatAllCakesTracker; import nautilus.game.arcade.game.games.cakewars.trackers.EatAllCakesTracker;
@ -81,6 +91,7 @@ public class CakeWars extends TeamGame
"All players standing on the Resource Generator get the items generated." "All players standing on the Resource Generator get the items generated."
}; };
private static final int RESPAWN_TIME = 6; private static final int RESPAWN_TIME = 6;
private static final LeaderboardManager LEADERBOARD_MANAGER = Managers.get(LeaderboardManager.class);
private final Map<GameTeam, Location> _averages; private final Map<GameTeam, Location> _averages;
@ -363,6 +374,116 @@ public class CakeWars extends TeamGame
{ {
WorldData.GetAllCustomLocs().computeIfAbsent("POINT Center GOLD", k -> new ArrayList<>()).add(location); WorldData.GetAllCustomLocs().computeIfAbsent("POINT Center GOLD", k -> new ArrayList<>()).add(location);
} }
if (Manager.IsRewardStats() && Manager.GetLobby() instanceof NewGameLobbyManager)
{
Map<String, List<Location>> locations = ((NewGameLobbyManager) Manager.GetLobby()).getCustomLocs();
if (!locations.containsKey("LEADERBOARDS"))
{
return;
}
Location rotator = locations.get("ROTATOR").get(0);
Location topStreak = locations.get("TOP_STREAK").get(0);
Location topWins = locations.get("TOP_WINS").get(0);
Location topKills = locations.get("TOP_KILLS").get(0);
String two = "Cake Wars Duos.";
String four = "Cake Wars 4v4v4v4.";
String bestStreakDuos = two + WinStreakModule.BEST_STREAK_STAT;
String killsDuos = two + "Kills";
String winsDuos = two + "Wins";
String bestStreak4 = four + WinStreakModule.BEST_STREAK_STAT;
String kills4 = four + "Kills";
String wins4 = four + "Wins";
LEADERBOARD_MANAGER.registerLeaderboard(GetName(),
new RotatingLeaderboard(LEADERBOARD_MANAGER, rotator)
.addMode("Duos", Arrays.asList(
new DynamicLeaderboard(LEADERBOARD_MANAGER, Collections.singletonList(
new StaticLeaderboard(LEADERBOARD_MANAGER, "Best Win Streak", new Leaderboard(
LeaderboardSQLType.ALL,
bestStreakDuos
), topStreak)
)),
new DynamicLeaderboard(LEADERBOARD_MANAGER, Arrays.asList(
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Wins", new Leaderboard(
LeaderboardSQLType.ALL,
winsDuos
), topWins),
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Weekly Wins", new Leaderboard(
LeaderboardSQLType.WEEKLY,
winsDuos
), topWins),
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Daily Wins", new Leaderboard(
LeaderboardSQLType.DAILY,
winsDuos
), topWins)
)),
new DynamicLeaderboard(LEADERBOARD_MANAGER, Arrays.asList(
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Kills", new Leaderboard(
LeaderboardSQLType.ALL,
killsDuos
), topKills),
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Weekly Kills", new Leaderboard(
LeaderboardSQLType.WEEKLY,
killsDuos
), topKills),
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Daily Kills", new Leaderboard(
LeaderboardSQLType.DAILY,
killsDuos
), topKills)
))
))
.addMode("4v4v4v4", Arrays.asList(
new DynamicLeaderboard(LEADERBOARD_MANAGER, Collections.singletonList(
new StaticLeaderboard(LEADERBOARD_MANAGER, "Best Win Streak", new Leaderboard(
LeaderboardSQLType.ALL,
bestStreak4
), topStreak)
)),
new DynamicLeaderboard(LEADERBOARD_MANAGER, Arrays.asList(
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Wins", new Leaderboard(
LeaderboardSQLType.ALL,
wins4
), topWins),
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Weekly Wins", new Leaderboard(
LeaderboardSQLType.WEEKLY,
wins4
), topWins),
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Daily Wins", new Leaderboard(
LeaderboardSQLType.DAILY,
wins4
), topWins)
)),
new DynamicLeaderboard(LEADERBOARD_MANAGER, Arrays.asList(
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Kills", new Leaderboard(
LeaderboardSQLType.ALL,
kills4
), topKills),
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Weekly Kills", new Leaderboard(
LeaderboardSQLType.WEEKLY,
kills4
), topKills),
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Daily Kills", new Leaderboard(
LeaderboardSQLType.DAILY,
kills4
), topKills)
))
))
);
}
} }
@EventHandler @EventHandler

View File

@ -49,6 +49,7 @@ import nautilus.game.arcade.game.games.cakewars.event.CakeWarsEatCakeEvent;
import nautilus.game.arcade.game.games.cakewars.shop.CakeItem; import nautilus.game.arcade.game.games.cakewars.shop.CakeItem;
import nautilus.game.arcade.game.games.cakewars.shop.CakeShopModule; import nautilus.game.arcade.game.games.cakewars.shop.CakeShopModule;
import nautilus.game.arcade.game.games.cakewars.shop.trap.CakeTrapItem; import nautilus.game.arcade.game.games.cakewars.shop.trap.CakeTrapItem;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.world.WorldData; import nautilus.game.arcade.world.WorldData;
public class CakeTeamModule extends CakeModule public class CakeTeamModule extends CakeModule
@ -448,6 +449,9 @@ public class CakeTeamModule extends CakeModule
MapUtil.QuickChangeBlockAt(cakeTeam.getCake(), Material.AIR); MapUtil.QuickChangeBlockAt(cakeTeam.getCake(), Material.AIR);
} }
}); });
_game.getModule(CompassModule.class)
.setGiveCompassToAlive(true);
} }
return null; return null;

View File

@ -60,7 +60,6 @@ import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import mineplex.core.Managers; import mineplex.core.Managers;
import mineplex.core.common.Pair;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
@ -79,6 +78,7 @@ import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.leaderboard.Leaderboard; import mineplex.core.leaderboard.Leaderboard;
import mineplex.core.leaderboard.LeaderboardManager; import mineplex.core.leaderboard.LeaderboardManager;
import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType; import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType;
import mineplex.core.leaderboard.StaticLeaderboard;
import mineplex.core.loot.ChestLoot; import mineplex.core.loot.ChestLoot;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
@ -210,31 +210,58 @@ public class CastleAssault extends TeamGame
_wearableTnt = new ItemBuilder(Material.TNT).setTitle(C.cRed + "TNT").addLore(C.cRedB + "Right Click with Weapon to " + F.name("Detonate")); _wearableTnt = new ItemBuilder(Material.TNT).setTitle(C.cRed + "TNT").addLore(C.cRedB + "Right Click with Weapon to " + F.name("Detonate"));
generateLoot(); generateLoot();
if (manager.IsRewardStats()) if (manager.IsRewardStats() && manager.GetLobby() instanceof NewGameLobbyManager)
{
if (manager.GetLobby() instanceof NewGameLobbyManager)
{ {
LeaderboardManager leaderboardManager = Managers.get(LeaderboardManager.class);
Map<String, List<Location>> lobbyCustomLocs = ((NewGameLobbyManager)manager.GetLobby()).getCustomLocs(); Map<String, List<Location>> lobbyCustomLocs = ((NewGameLobbyManager)manager.GetLobby()).getCustomLocs();
if (lobbyCustomLocs.containsKey("TOP_DAILY_WINS")) if (lobbyCustomLocs.containsKey("TOP_DAILY_WINS"))
{ {
Location loc = lobbyCustomLocs.get("TOP_DAILY_WINS").get(0); Location loc = lobbyCustomLocs.get("TOP_DAILY_WINS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_DAILY_WINS", new Leaderboard("Top Daily Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault.Wins"}, LeaderboardSQLType.DAILY, loc, 10)); leaderboardManager.registerLeaderboard("TOP_CA_DAILY_WINS", new StaticLeaderboard(
leaderboardManager,
"Top Daily Wins",
new Leaderboard(
LeaderboardSQLType.DAILY,
GetName() + ".Wins"
),
loc));
} }
if (lobbyCustomLocs.containsKey("TOP_DAILY_KILLS")) if (lobbyCustomLocs.containsKey("TOP_DAILY_KILLS"))
{ {
Location loc = lobbyCustomLocs.get("TOP_DAILY_KILLS").get(0); Location loc = lobbyCustomLocs.get("TOP_DAILY_KILLS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_DAILY_KILLS", new Leaderboard("Top Daily Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault.Kills"}, LeaderboardSQLType.DAILY, loc, 10)); leaderboardManager.registerLeaderboard("TOP_CA_DAILY_KILLS", new StaticLeaderboard(
leaderboardManager,
"Top Daily Kills",
new Leaderboard(
LeaderboardSQLType.DAILY,
GetName() + ".Kills"
),
loc));
} }
if (lobbyCustomLocs.containsKey("TOP_WINS")) if (lobbyCustomLocs.containsKey("TOP_WINS"))
{ {
Location loc = lobbyCustomLocs.get("TOP_WINS").get(0); Location loc = lobbyCustomLocs.get("TOP_WINS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_WINS", new Leaderboard("Top Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault.Wins"}, LeaderboardSQLType.ALL_SEASON, loc, 10)); leaderboardManager.registerLeaderboard("TOP_CA_WINS", new StaticLeaderboard(
leaderboardManager,
"Top Wins",
new Leaderboard(
LeaderboardSQLType.ALL,
GetName() + ".Wins"
),
loc));
} }
if (lobbyCustomLocs.containsKey("TOP_KILLS")) if (lobbyCustomLocs.containsKey("TOP_KILLS"))
{ {
Location loc = lobbyCustomLocs.get("TOP_KILLS").get(0); Location loc = lobbyCustomLocs.get("TOP_KILLS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_KILLS", new Leaderboard("Top Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault.Kills"}, LeaderboardSQLType.ALL_SEASON, loc, 10)); leaderboardManager.registerLeaderboard("TOP_CA_KILLS", new StaticLeaderboard(
} leaderboardManager,
"Top Kills",
new Leaderboard(
LeaderboardSQLType.ALL,
GetName() + ".Kills"
),
loc));
} }
} }
} }

View File

@ -48,7 +48,6 @@ import org.bukkit.material.Dispenser;
import org.bukkit.material.MaterialData; import org.bukkit.material.MaterialData;
import mineplex.core.Managers; import mineplex.core.Managers;
import mineplex.core.common.Pair;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
@ -64,6 +63,7 @@ import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.leaderboard.Leaderboard; import mineplex.core.leaderboard.Leaderboard;
import mineplex.core.leaderboard.LeaderboardManager; import mineplex.core.leaderboard.LeaderboardManager;
import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType; import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType;
import mineplex.core.leaderboard.StaticLeaderboard;
import mineplex.core.loot.ChestLoot; import mineplex.core.loot.ChestLoot;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
@ -179,31 +179,58 @@ public class CastleAssaultTDM extends TeamGame
_flintAndSteel = new ItemBuilder(Material.FLINT_AND_STEEL).setData((short) (Material.FLINT_AND_STEEL.getMaxDurability() - MAX_FLINT_AND_STEEL_USES)); _flintAndSteel = new ItemBuilder(Material.FLINT_AND_STEEL).setData((short) (Material.FLINT_AND_STEEL.getMaxDurability() - MAX_FLINT_AND_STEEL_USES));
generateLoot(); generateLoot();
if (manager.IsRewardStats()) if (manager.IsRewardStats() && manager.GetLobby() instanceof NewGameLobbyManager)
{
if (manager.GetLobby() instanceof NewGameLobbyManager)
{ {
LeaderboardManager leaderboardManager = Managers.get(LeaderboardManager.class);
Map<String, List<Location>> lobbyCustomLocs = ((NewGameLobbyManager)manager.GetLobby()).getCustomLocs(); Map<String, List<Location>> lobbyCustomLocs = ((NewGameLobbyManager)manager.GetLobby()).getCustomLocs();
if (lobbyCustomLocs.containsKey("TOP_DAILY_WINS")) if (lobbyCustomLocs.containsKey("TOP_DAILY_WINS"))
{ {
Location loc = lobbyCustomLocs.get("TOP_DAILY_WINS").get(0); Location loc = lobbyCustomLocs.get("TOP_DAILY_WINS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_DAILY_WINS", new Leaderboard("Top Daily Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault TDM.Wins"}, LeaderboardSQLType.DAILY, loc, 10)); leaderboardManager.registerLeaderboard("TOP_CA_DAILY_WINS", new StaticLeaderboard(
leaderboardManager,
"Top Daily Wins",
new Leaderboard(
LeaderboardSQLType.DAILY,
GetName() + ".Wins"
),
loc));
} }
if (lobbyCustomLocs.containsKey("TOP_DAILY_KILLS")) if (lobbyCustomLocs.containsKey("TOP_DAILY_KILLS"))
{ {
Location loc = lobbyCustomLocs.get("TOP_DAILY_KILLS").get(0); Location loc = lobbyCustomLocs.get("TOP_DAILY_KILLS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_DAILY_KILLS", new Leaderboard("Top Daily Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault TDM.Kills"}, LeaderboardSQLType.DAILY, loc, 10)); leaderboardManager.registerLeaderboard("TOP_CA_DAILY_KILLS", new StaticLeaderboard(
leaderboardManager,
"Top Daily Kills",
new Leaderboard(
LeaderboardSQLType.DAILY,
GetName() + ".Kills"
),
loc));
} }
if (lobbyCustomLocs.containsKey("TOP_WINS")) if (lobbyCustomLocs.containsKey("TOP_WINS"))
{ {
Location loc = lobbyCustomLocs.get("TOP_WINS").get(0); Location loc = lobbyCustomLocs.get("TOP_WINS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_WINS", new Leaderboard("Top Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault TDM.Wins"}, LeaderboardSQLType.ALL_SEASON, loc, 10)); leaderboardManager.registerLeaderboard("TOP_CA_WINS", new StaticLeaderboard(
leaderboardManager,
"Top Wins",
new Leaderboard(
LeaderboardSQLType.ALL,
GetName() + ".Wins"
),
loc));
} }
if (lobbyCustomLocs.containsKey("TOP_KILLS")) if (lobbyCustomLocs.containsKey("TOP_KILLS"))
{ {
Location loc = lobbyCustomLocs.get("TOP_KILLS").get(0); Location loc = lobbyCustomLocs.get("TOP_KILLS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_KILLS", new Leaderboard("Top Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault TDM.Kills"}, LeaderboardSQLType.ALL_SEASON, loc, 10)); leaderboardManager.registerLeaderboard("TOP_CA_KILLS", new StaticLeaderboard(
} leaderboardManager,
"Top Kills",
new Leaderboard(
LeaderboardSQLType.ALL,
GetName() + ".Kills"
),
loc));
} }
} }
} }

View File

@ -29,7 +29,6 @@ import mineplex.core.Managers;
import mineplex.core.account.permissions.Permission; import mineplex.core.account.permissions.Permission;
import mineplex.core.account.permissions.PermissionGroup; import mineplex.core.account.permissions.PermissionGroup;
import mineplex.core.antihack.AntiHack; import mineplex.core.antihack.AntiHack;
import mineplex.core.common.Pair;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
@ -41,6 +40,7 @@ import mineplex.core.imagemap.objects.PlayerMapBoard;
import mineplex.core.leaderboard.Leaderboard; import mineplex.core.leaderboard.Leaderboard;
import mineplex.core.leaderboard.LeaderboardManager; import mineplex.core.leaderboard.LeaderboardManager;
import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType; import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType;
import mineplex.core.leaderboard.StaticLeaderboard;
import mineplex.minecraft.game.core.combat.DeathMessageType; import mineplex.minecraft.game.core.combat.DeathMessageType;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
@ -252,35 +252,75 @@ public class Moba extends TeamGame
if (Manager.IsRewardStats() && Manager.GetLobby() instanceof NewGameLobbyManager) if (Manager.IsRewardStats() && Manager.GetLobby() instanceof NewGameLobbyManager)
{ {
LeaderboardManager leaderboardManager = Managers.get(LeaderboardManager.class);
Map<String, List<Location>> lobbyCustomLocs = ((NewGameLobbyManager) Manager.GetLobby()).getCustomLocs(); Map<String, List<Location>> lobbyCustomLocs = ((NewGameLobbyManager) Manager.GetLobby()).getCustomLocs();
LeaderboardManager leaderboard = Managers.get(LeaderboardManager.class); LeaderboardManager leaderboard = Managers.get(LeaderboardManager.class);
Pair<String, String> winPair = Pair.create("Win", "Wins");
Pair<String, String> killPair = Pair.create("Kill", "Kills");
Pair<String, String> goldPair = Pair.create("Gold", "Gold");
{ {
Location location = lobbyCustomLocs.get("TOP_DAILY_WINS").get(0); Location location = lobbyCustomLocs.get("TOP_DAILY_WINS").get(0);
leaderboard.registerLeaderboard("TOP_HOG_DAILY_WINS", new Leaderboard("Top Daily Wins", winPair, new String[]{GetName() + ".Wins"}, LeaderboardSQLType.DAILY, location, 10)); leaderboard.registerLeaderboard("TOP_HOG_DAILY_WINS", new StaticLeaderboard(
leaderboardManager,
"Top Daily Wins",
new Leaderboard(
LeaderboardSQLType.DAILY,
GetName() + ".Wins"
),
location));
} }
{ {
Location location = lobbyCustomLocs.get("TOP_DAILY_KILLS").get(0); Location location = lobbyCustomLocs.get("TOP_DAILY_KILLS").get(0);
leaderboard.registerLeaderboard("TOP_HOG_DAILY_KILLS", new Leaderboard("Top Daily Kills", killPair, new String[]{GetName() + ".Kills"}, LeaderboardSQLType.DAILY, location, 10)); leaderboard.registerLeaderboard("TOP_HOG_DAILY_KILLS", new StaticLeaderboard(
leaderboardManager,
"Top Daily Kills",
new Leaderboard(
LeaderboardSQLType.DAILY,
GetName() + ".Kills"
),
location));
} }
{ {
Location location = lobbyCustomLocs.get("TOP_DAILY_GOLD").get(0); Location location = lobbyCustomLocs.get("TOP_DAILY_GOLD").get(0);
leaderboard.registerLeaderboard("TOP_HOG_DAILY_GOLD", new Leaderboard("Top Daily Gold Earned", goldPair, new String[]{GetName() + ".GoldEarned"}, LeaderboardSQLType.DAILY, location, 10)); leaderboard.registerLeaderboard("TOP_HOG_DAILY_GOLD", new StaticLeaderboard(
leaderboardManager,
"Top Daily Gold Earned",
new Leaderboard(
LeaderboardSQLType.DAILY,
GetName() + ".GoldEarned"
),
location));
} }
{ {
Location location = lobbyCustomLocs.get("TOP_WINS").get(0); Location location = lobbyCustomLocs.get("TOP_WINS").get(0);
leaderboard.registerLeaderboard("TOP_HOG_WINS", new Leaderboard("Top Wins", winPair, new String[]{GetName() + ".Wins"}, LeaderboardSQLType.ALL, location, 10)); leaderboard.registerLeaderboard("TOP_HOG_WINS", new StaticLeaderboard(
leaderboardManager,
"Top Wins",
new Leaderboard(
LeaderboardSQLType.ALL,
GetName() + ".Wins"
),
location));
} }
{ {
Location location = lobbyCustomLocs.get("TOP_KILLS").get(0); Location location = lobbyCustomLocs.get("TOP_KILLS").get(0);
leaderboard.registerLeaderboard("TOP_HOG_KILLS", new Leaderboard("Top Kills", killPair, new String[]{GetName() + ".Kills"}, LeaderboardSQLType.ALL, location, 10)); leaderboard.registerLeaderboard("TOP_HOG_KILLS", new StaticLeaderboard(
leaderboardManager,
"Top Kills",
new Leaderboard(
LeaderboardSQLType.ALL,
GetName() + ".Kills"
),
location));
} }
{ {
Location location = lobbyCustomLocs.get("TOP_GOLD").get(0); Location location = lobbyCustomLocs.get("TOP_GOLD").get(0);
leaderboard.registerLeaderboard("TOP_HOG_GOLD", new Leaderboard("Top Gold Earned", goldPair, new String[]{GetName() + ".GoldEarned"}, LeaderboardSQLType.ALL, location, 10)); leaderboard.registerLeaderboard("TOP_HOG_GOLD", new StaticLeaderboard(
leaderboardManager,
"Top Gold",
new Leaderboard(
LeaderboardSQLType.ALL,
GetName() + ".GoldEarned"
),
location));
} }
_progression.spawnRoleViewers(lobbyCustomLocs); _progression.spawnRoleViewers(lobbyCustomLocs);

View File

@ -18,8 +18,8 @@ import nautilus.game.arcade.game.modules.gamesummary.GameSummaryModule;
public class WinStreakModule extends Module public class WinStreakModule extends Module
{ {
static final String STREAK_STAT = "WinStreak"; public static final String STREAK_STAT = "WinStreak";
static final String BEST_STREAK_STAT = "BestWinStreak"; public static final String BEST_STREAK_STAT = "BestWinStreak";
private static final String SCRAMBLE_TEXT = C.cGold + C.Scramble + "!"; private static final String SCRAMBLE_TEXT = C.cGold + C.Scramble + "!";
static final String BEST_STREAK_TEXT = SCRAMBLE_TEXT + C.cGreenB + " NEW BEST STREAK " + SCRAMBLE_TEXT; static final String BEST_STREAK_TEXT = SCRAMBLE_TEXT + C.cGreenB + " NEW BEST STREAK " + SCRAMBLE_TEXT;

View File

@ -120,7 +120,7 @@ public class Hub extends JavaPlugin
BlockRestore blockRestore = require(BlockRestore.class); BlockRestore blockRestore = require(BlockRestore.class);
ProjectileManager projectileManager = new ProjectileManager(this); ProjectileManager projectileManager = new ProjectileManager(this);
HologramManager hologramManager = new HologramManager(this, packetHandler); HologramManager hologramManager = require(HologramManager.class);
ServerConfiguration serverConfiguration = new ServerConfiguration(this, _clientManager); ServerConfiguration serverConfiguration = new ServerConfiguration(this, _clientManager);

View File

@ -241,7 +241,7 @@ public class GemHunters extends JavaPlugin
new CustomTagFix(this, packetHandler); new CustomTagFix(this, packetHandler);
// Holograms // Holograms
HologramManager hologramManager = new HologramManager(this, packetHandler); HologramManager hologramManager = require(HologramManager.class);
// Menus // Menus
new MenuManager(this); new MenuManager(this);

View File

@ -1,14 +1,17 @@
package mineplex.gemhunters.world; package mineplex.gemhunters.world;
import mineplex.core.Managers; import mineplex.core.Managers;
import mineplex.core.common.Pair;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.leaderboard.Leaderboard; import mineplex.core.leaderboard.Leaderboard;
import mineplex.core.leaderboard.LeaderboardManager; import mineplex.core.leaderboard.LeaderboardManager;
import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType; import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType;
import mineplex.core.leaderboard.StaticLeaderboard;
public class Leaderboards public class Leaderboards
{ {
private static final String STAT_BASE = "Gem Hunters";
private final LeaderboardManager _manager; private final LeaderboardManager _manager;
private final WorldDataModule _worldData; private final WorldDataModule _worldData;
@ -23,9 +26,37 @@ public class Leaderboards
private void createLeaderboards() private void createLeaderboards()
{ {
_manager.registerLeaderboard("TOP_GEM_HUNTERS_KILLS", new Leaderboard("Top Kills", Pair.create("Kill", "Kills"), new String[] {"Gem Hunters.Kills"}, LeaderboardSQLType.ALL, _worldData.getCustomLocation("TOP_KILLS").get(0), 10)); _manager.registerLeaderboard("TOP_GEM_HUNTERS_KILLS", new StaticLeaderboard(
_manager.registerLeaderboard("TOP_GEM_HUNTERS_DAILY_KILLS", new Leaderboard("Top Daily Kills", Pair.create("Kill", "Kills"), new String[] {"Gem Hunters.Kills"}, LeaderboardSQLType.DAILY, _worldData.getCustomLocation("TOP_DAILY_KILLS").get(0), 10)); _manager,
_manager.registerLeaderboard("TOP_GEM_HUNTERS_GEMS", new Leaderboard("Top Gems Cashed Out", Pair.create("Gem", "Gems"), new String[] {"Gem Hunters.GemsEarned"}, LeaderboardSQLType.ALL, _worldData.getCustomLocation("TOP_GEMS").get(0), 10)); "Top Kills",
_manager.registerLeaderboard("TOP_GEM_HUNTERS_DAILY_GEMS", new Leaderboard("Top Daily Gems Cashed Out", Pair.create("Gem", "Gems"), new String[] {"Gem Hunters.GemsEarned"}, LeaderboardSQLType.DAILY, _worldData.getCustomLocation("TOP_DAILY_GEMS").get(0), 10)); new Leaderboard(
LeaderboardSQLType.ALL,
STAT_BASE + ".Kills"
),
_worldData.getCustomLocation("TOP_KILLS").get(0)));
_manager.registerLeaderboard("TOP_GEM_HUNTERS_DAILY_KILLS", new StaticLeaderboard(
_manager,
"Top Daily Kills",
new Leaderboard(
LeaderboardSQLType.DAILY,
STAT_BASE + ".Kills"
),
_worldData.getCustomLocation("TOP_DAILY_KILLS").get(0)));
_manager.registerLeaderboard("TOP_GEM_HUNTERS_GEMS", new StaticLeaderboard(
_manager,
"Top Gems Cashed Out",
new Leaderboard(
LeaderboardSQLType.ALL,
STAT_BASE + ".GemsEarned"
),
_worldData.getCustomLocation("TOP_GEMS").get(0)));
_manager.registerLeaderboard("TOP_GEM_HUNTERS_DAILY_GEMS", new StaticLeaderboard(
_manager,
"Top Daily Gems Cashed Out",
new Leaderboard(
LeaderboardSQLType.DAILY,
STAT_BASE + ".GemsEarned"
),
_worldData.getCustomLocation("TOP_DAILY_GEMS").get(0)));
} }
} }