Fix merge conflicts
This commit is contained in:
parent
9312ce10d3
commit
b80c010e67
@ -1468,7 +1468,7 @@ public enum Achievement
|
|||||||
|
|
||||||
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 Rumble.FloorIsLava", "Cake Wars Duos.FloorIsLava"},
|
||||||
new String[]{"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),
|
||||||
|
|
||||||
|
@ -247,17 +247,19 @@ public enum AchievementCategory
|
|||||||
CAKE_WARS("Cake Wars", null,
|
CAKE_WARS("Cake Wars", null,
|
||||||
new StatDisplay[]
|
new StatDisplay[]
|
||||||
{
|
{
|
||||||
new StatDisplay("Rumble", true),
|
new StatDisplay(C.Bold + "Rumble", 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("Kills", GameDisplay.CakeWars4, "Kills"),
|
StatDisplay.fromGame("Kills", GameDisplay.CakeWars4, "Kills"),
|
||||||
StatDisplay.fromGame("Deaths", GameDisplay.CakeWars4, "Deaths"),
|
StatDisplay.fromGame("Deaths", GameDisplay.CakeWars4, "Deaths"),
|
||||||
StatDisplay.fromGame("Cake Bites", GameDisplay.CakeWars4, "Bites"),
|
StatDisplay.fromGame("Cake Bites", GameDisplay.CakeWars4, "Bites"),
|
||||||
StatDisplay.fromGame("Whole Cakes", GameDisplay.CakeWars4, "EatWholeCake"),
|
StatDisplay.fromGame("Whole Cakes", GameDisplay.CakeWars4, "EatWholeCake"),
|
||||||
null,
|
null,
|
||||||
new StatDisplay("Duos", true),
|
new StatDisplay(C.Bold + "Duos", true),
|
||||||
StatDisplay.fromGame("Wins", GameDisplay.CakeWarsDuos, "Wins"),
|
StatDisplay.fromGame("Wins", GameDisplay.CakeWarsDuos, "Wins"),
|
||||||
StatDisplay.fromGame("Games Play", GameDisplay.CakeWarsDuos, "Wins", "Losses"),
|
StatDisplay.fromGame("Games Play", GameDisplay.CakeWarsDuos, "Wins", "Losses"),
|
||||||
|
StatDisplay.fromGame("Best Win Streak", GameDisplay.CakeWarsDuos, "BestWinStreak"),
|
||||||
StatDisplay.fromGame("Kills", GameDisplay.CakeWarsDuos, "Kills"),
|
StatDisplay.fromGame("Kills", GameDisplay.CakeWarsDuos, "Kills"),
|
||||||
StatDisplay.fromGame("Deaths", GameDisplay.CakeWarsDuos, "Deaths"),
|
StatDisplay.fromGame("Deaths", GameDisplay.CakeWarsDuos, "Deaths"),
|
||||||
StatDisplay.fromGame("Cake Bites", GameDisplay.CakeWarsDuos, "Bites"),
|
StatDisplay.fromGame("Cake Bites", GameDisplay.CakeWarsDuos, "Bites"),
|
||||||
|
@ -91,7 +91,7 @@ public class ItemPaintballGun extends ItemGadget
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void enderPearlTeleport(PlayerTeleportEvent event)
|
public void enderPearlTeleport(PlayerTeleportEvent event)
|
||||||
{
|
{
|
||||||
if (event.getCause() != TeleportCause.ENDER_PEARL)
|
if (event.getCause() != TeleportCause.ENDER_PEARL && !isActive(event.getPlayer()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package mineplex.core.leaderboard;
|
package mineplex.core.leaderboard;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.Collections;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
|
||||||
@ -11,10 +11,13 @@ import mineplex.core.Managers;
|
|||||||
import mineplex.core.common.Pair;
|
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.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 final String _display;
|
private final String _display;
|
||||||
private final Pair<String, String> _statDisplay;
|
private final Pair<String, String> _statDisplay;
|
||||||
private final String[] _statNames;
|
private final String[] _statNames;
|
||||||
@ -29,6 +32,7 @@ public class Leaderboard
|
|||||||
this(display, statDisplayNames, statNames, type, displayLoc, size, 0);
|
this(display, statDisplayNames, statNames, type, displayLoc, size, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public Leaderboard(String display, Pair<String, String> statDisplayNames, String[] statNames, LeaderboardSQLType type, Location displayLoc, int size, int start)
|
public Leaderboard(String display, Pair<String, String> statDisplayNames, String[] statNames, LeaderboardSQLType type, Location displayLoc, int size, int start)
|
||||||
{
|
{
|
||||||
_display = display;
|
_display = display;
|
||||||
@ -40,7 +44,7 @@ public class Leaderboard
|
|||||||
_start = start;
|
_start = start;
|
||||||
_loc = displayLoc;
|
_loc = displayLoc;
|
||||||
|
|
||||||
update(new LinkedHashMap<>());
|
update(Collections.EMPTY_MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSize()
|
public int getSize()
|
||||||
@ -76,29 +80,17 @@ public class Leaderboard
|
|||||||
deconstruct();
|
deconstruct();
|
||||||
LinkedList<String> display = new LinkedList<>();
|
LinkedList<String> display = new LinkedList<>();
|
||||||
display.add(C.cAqua + _display);
|
display.add(C.cAqua + _display);
|
||||||
display.add(C.cRed + " ");
|
display.add(C.blankLine);
|
||||||
int place = _start + 1;
|
AtomicInteger place = new AtomicInteger(_start + 1);
|
||||||
for (Entry<String, Long> entry : names.entrySet())
|
|
||||||
|
names.forEach((name, value) ->
|
||||||
{
|
{
|
||||||
if (entry.getValue() == 1)
|
display.add(C.cGreen + "#" + place + " " + name + C.cRed + " " + value + " " + (value == 1 ? _statDisplay.getLeft() : _statDisplay.getRight()));
|
||||||
{
|
place.getAndIncrement();
|
||||||
display.add(C.cGreen + "#" + place + " " + entry.getKey() + C.cRed + " " + entry.getValue() + " " + _statDisplay.getLeft());
|
});
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
display.add(C.cGreen + "#" + place + " " + entry.getKey() + C.cRed + " " + entry.getValue() + " " + _statDisplay.getRight());
|
|
||||||
}
|
|
||||||
place++;
|
|
||||||
}
|
|
||||||
|
|
||||||
//TEMP FOR CONVERSION
|
_holo = new Hologram(HOLOGRAM_MANAGER, _loc, display.toArray(new String[0]))
|
||||||
display.clear();
|
.start();
|
||||||
display.add(C.cAqua + _display);
|
|
||||||
display.add(C.cRed + " ");
|
|
||||||
display.add(C.cRed + "Disabled for stat conversion");
|
|
||||||
//TEMP FOR CONVERSION
|
|
||||||
|
|
||||||
_holo = new Hologram(Managers.get(LeaderboardManager.class).getHologramManager(), _loc, display.toArray(new String[display.size()])).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void setStatId(int index, int id)
|
public synchronized void setStatId(int index, int id)
|
||||||
|
@ -28,7 +28,6 @@ public class LeaderboardManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final Map<String, Leaderboard> _leaderboards = new HashMap<>();
|
private final Map<String, Leaderboard> _leaderboards = new HashMap<>();
|
||||||
private final long REFRESH_RATE;
|
|
||||||
private final LeaderboardRepository _repo;
|
private final LeaderboardRepository _repo;
|
||||||
private final Map<Leaderboard, Runnable> _loading = new HashMap<>();
|
private final Map<Leaderboard, Runnable> _loading = new HashMap<>();
|
||||||
|
|
||||||
@ -48,9 +47,9 @@ public class LeaderboardManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
REFRESH_RATE = 5 * 60 * 20 + ((UtilMath.r(5) + 1) * 60 * 20);
|
long refreshRate = 5 * 60 * 20 + ((UtilMath.r(5) + 1) * 60 * 20);
|
||||||
|
|
||||||
runSyncTimer(() -> refreshBoards(), 0, REFRESH_RATE);
|
runSyncTimer(this::refreshBoards, 0, refreshRate);
|
||||||
|
|
||||||
runSyncTimer(() ->
|
runSyncTimer(() ->
|
||||||
{
|
{
|
||||||
|
@ -51,6 +51,7 @@ import nautilus.game.arcade.game.modules.capturepoint.CapturePointModule;
|
|||||||
import nautilus.game.arcade.game.modules.chest.ChestLootModule;
|
import nautilus.game.arcade.game.modules.chest.ChestLootModule;
|
||||||
import nautilus.game.arcade.game.modules.chest.ChestLootPool;
|
import nautilus.game.arcade.game.modules.chest.ChestLootPool;
|
||||||
import nautilus.game.arcade.game.modules.compass.CompassModule;
|
import nautilus.game.arcade.game.modules.compass.CompassModule;
|
||||||
|
import nautilus.game.arcade.game.modules.winstreak.WinStreakModule;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
import nautilus.game.arcade.managers.lobby.GameLobbyConfig;
|
import nautilus.game.arcade.managers.lobby.GameLobbyConfig;
|
||||||
import nautilus.game.arcade.managers.lobby.current.NewGameLobbyManager;
|
import nautilus.game.arcade.managers.lobby.current.NewGameLobbyManager;
|
||||||
@ -141,6 +142,9 @@ public class CakeWars extends TeamGame
|
|||||||
new CompassModule()
|
new CompassModule()
|
||||||
.register(this);
|
.register(this);
|
||||||
|
|
||||||
|
new WinStreakModule()
|
||||||
|
.register(this);
|
||||||
|
|
||||||
_cakeTeamModule = new CakeTeamModule(this);
|
_cakeTeamModule = new CakeTeamModule(this);
|
||||||
_cakeTeamModule.register();
|
_cakeTeamModule.register();
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package nautilus.game.arcade.game.games.cakewars.trackers;
|
package nautilus.game.arcade.game.games.cakewars.trackers;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@ -42,6 +43,9 @@ public class FloorIsLavaTracker extends StatTracker<CakeWars>
|
|||||||
}
|
}
|
||||||
else if (event.GetState() == GameState.End)
|
else if (event.GetState() == GameState.End)
|
||||||
{
|
{
|
||||||
|
List<Player> winners = getGame().getWinners();
|
||||||
|
|
||||||
|
_successful.removeIf(player -> !winners.contains(player));
|
||||||
_successful.forEach(player -> addStat(player, "FloorIsLava", 1, true, false));
|
_successful.forEach(player -> addStat(player, "FloorIsLava", 1, true, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public class EnderPearlModule extends Module
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void interactEnderPearl(PlayerInteractEvent event)
|
public void interactEnderPearl(PlayerInteractEvent event)
|
||||||
{
|
{
|
||||||
if (!UtilEvent.isAction(event, ActionType.R))
|
if (!UtilEvent.isAction(event, ActionType.R) || !getGame().IsLive())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ import java.util.Map;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.FireworkEffect.Type;
|
import org.bukkit.FireworkEffect.Type;
|
||||||
@ -150,13 +149,14 @@ public class CapturePoint
|
|||||||
{
|
{
|
||||||
_lastInform = System.currentTimeMillis();
|
_lastInform = System.currentTimeMillis();
|
||||||
|
|
||||||
for (Player player : Bukkit.getOnlinePlayers())
|
String message = F.main("Game", "Team " + highest.GetFormattedName() + C.mBody + " is capturing the " + _colour + _name + C.mBody + " Beacon!");
|
||||||
{
|
|
||||||
player.playSound(player.getLocation(), Sound.GHAST_SCREAM2, 1, 1.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
_host.Announce(F.main("Game", "Team " + highest.GetFormattedName() + C.mBody + " is capturing the " + _colour + _name + C.mBody + " Beacon!"), false);
|
sendMessage(highest, message);
|
||||||
//UtilTextMiddle.display("", "Team " + highest.GetFormattedName() + C.cWhite + " is capturing beacon " + _colour + _name, 0, 30, 10);
|
|
||||||
|
if (_owner != null)
|
||||||
|
{
|
||||||
|
sendMessage(_owner, message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If it has just reached the maximum progress, set the owner.
|
// If it has just reached the maximum progress, set the owner.
|
||||||
@ -168,6 +168,15 @@ public class CapturePoint
|
|||||||
capture(highest);
|
capture(highest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendMessage(GameTeam team, String message)
|
||||||
|
{
|
||||||
|
team.GetPlayers(true).forEach(player ->
|
||||||
|
{
|
||||||
|
player.playSound(player.getLocation(), Sound.GHAST_SCREAM2, 1, 1);
|
||||||
|
player.sendMessage(message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void capture(GameTeam team)
|
private void capture(GameTeam team)
|
||||||
{
|
{
|
||||||
// No player has ever stood on the point
|
// No player has ever stood on the point
|
||||||
@ -211,13 +220,10 @@ public class CapturePoint
|
|||||||
{
|
{
|
||||||
setBeaconColour(team);
|
setBeaconColour(team);
|
||||||
|
|
||||||
if (_owner != null)
|
// Same team no need to inform
|
||||||
|
if (_owner != null && _owner.equals(team))
|
||||||
{
|
{
|
||||||
// Same team no need to inform
|
return;
|
||||||
if (_owner.equals(team))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -227,10 +233,15 @@ public class CapturePoint
|
|||||||
_progress = MAX_PROGRESS;
|
_progress = MAX_PROGRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
_owner = team;
|
String message = F.main("Game", "Team " + team.GetFormattedName() + C.mBody + " captured the " + _colour + _name + C.mBody + " Beacon!");
|
||||||
|
|
||||||
_host.Announce(F.main("Game", "Team " + team.GetFormattedName() + C.mBody + " captured the " + _colour + _name + C.mBody + " Beacon!"));
|
if (_owner != null)
|
||||||
//UtilTextMiddle.display("", "Team " + team.GetFormattedName() + C.cWhite + " captured beacon " + _colour + _name, 0, 30, 10);
|
{
|
||||||
|
sendMessage(_owner, message);
|
||||||
|
}
|
||||||
|
sendMessage(team, message);
|
||||||
|
|
||||||
|
_owner = team;
|
||||||
|
|
||||||
UtilFirework.playFirework(_center, Type.BURST, team.GetColorBase(), false, false);
|
UtilFirework.playFirework(_center, Type.BURST, team.GetColorBase(), false, false);
|
||||||
UtilServer.CallEvent(new CapturePointCaptureEvent(this));
|
UtilServer.CallEvent(new CapturePointCaptureEvent(this));
|
||||||
|
@ -59,7 +59,7 @@ public class WinStreakSummaryComponent extends GameSummaryComponent<Pair<Long, L
|
|||||||
{
|
{
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
F.count(String.valueOf(data.getLeft())) + " Current Streak",
|
F.count(String.valueOf(data.getLeft())) + " Current Streak",
|
||||||
F.count(String.valueOf(data.getRight())) + " Best Current Streak"
|
F.count(String.valueOf(data.getRight())) + " Best Streak"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user