diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 5c47a0517..fa7b90825 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -24,6 +24,7 @@ import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.event.player.PlayerToggleSneakEvent; import org.bukkit.inventory.AnvilInventory; import org.bukkit.inventory.Inventory; @@ -383,6 +384,7 @@ import mineplex.core.packethandler.PacketHandler; import mineplex.core.pet.PetManager; import mineplex.core.preferences.PreferencesManager; import mineplex.core.projectile.ProjectileManager; +import mineplex.core.recharge.Recharge; import mineplex.core.stats.event.PlayerStatsLoadedEvent; @ReflectivelyCreateMiniPlugin @@ -1306,13 +1308,24 @@ public class GadgetManager extends MiniPlugin player.sendMessage(F.main(getName(), "You cannot use that cosmetic in this area.")); } + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void doubleJump(PlayerToggleFlightEvent event) + { + playLeapEffect(event.getPlayer()); + } + public void playLeapEffect(Player player) { - if (hideParticles()) + if (UtilPlayer.isSpectator(player) || hideParticles() || player.isFlying()) { return; } + if (!UtilServer.isHubServer()) + { + _missionManager.incrementProgress(player, 1, MissionTrackerType.GAME_LEAP, null, null); + } + Gadget gadget = getActive(player, GadgetType.DOUBLE_JUMP); if (gadget != null) @@ -1635,7 +1648,13 @@ public class GadgetManager extends MiniPlugin return; } - _missionManager.incrementProgress(player, 1, MissionTrackerType.GAME_TAUNT, null, gadget.getClass()); + // TODO FIX ME + // LCastr0 is an idiot so this is the only solution + if (Recharge.Instance.use(player, "Taunt Mission", 30000, false, false)) + { + _missionManager.incrementProgress(player, 1, MissionTrackerType.GAME_TAUNT, null, gadget.getClass()); + } + taunt.start(player); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java index 0c8bfbcef..d1ab95f5c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java @@ -2,10 +2,7 @@ package mineplex.core.gadget.types; import org.bukkit.Material; import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.player.PlayerToggleFlightEvent; -import mineplex.core.common.util.UtilPlayer; import mineplex.core.gadget.GadgetManager; public abstract class DoubleJumpEffectGadget extends Gadget @@ -16,23 +13,5 @@ public abstract class DoubleJumpEffectGadget extends Gadget super(manager, GadgetType.DOUBLE_JUMP, name, desc, cost, mat, data, 1, altNames); } - private boolean shouldDisplay(Player player) - { - return !UtilPlayer.isSpectator(player) && !Manager.hideParticles() && !player.isFlying() && isActive(player); - } - - @EventHandler - public void jump(PlayerToggleFlightEvent event) - { - Player player = event.getPlayer(); - - if (!shouldDisplay(player)) - { - return; - } - - doEffect(event.getPlayer()); - } - public abstract void doEffect(Player player); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mission/Mission.java b/Plugins/Mineplex.Core/src/mineplex/core/mission/Mission.java index f9a5d2810..98d261ff8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mission/Mission.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mission/Mission.java @@ -32,7 +32,7 @@ public interface Mission } } - return getGames().length == 0; + return getGames().length == 0 || getGames().length == GameDisplay.values().length; } default boolean validateData(T data) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionLength.java b/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionLength.java index 36ae509a0..e8f4f99d1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionLength.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionLength.java @@ -11,7 +11,7 @@ import mineplex.core.common.util.UtilText; public enum MissionLength { - DAY("Daily", UtilText.splitLineToArray(C.cGray + "Here you will find missions that you can only participate in only for today. Each day you get a handful of brand new missions.", LineFormat.LORE), ChatColor.WHITE, 0, 1, Calendar.DAY_OF_WEEK), + DAY("Daily", UtilText.splitLineToArray(C.cGray + "Here you will find missions that you can participate in only for today. Each day you get a handful of brand new missions.", LineFormat.LORE), ChatColor.WHITE, 0, 1, Calendar.DAY_OF_WEEK), WEEK("Weekly", UtilText.splitLineToArray(C.cGray + "These missions wil rotate out every Monday. They will be daily missions that have an increased objective and rewards.", LineFormat.LORE), ChatColor.GREEN, 7, 7, Calendar.WEEK_OF_YEAR), EVENT("Event", UtilText.splitLineToArray(C.cGray + "These super special missions will only show up every once in a while and come with a super special reward!", LineFormat.LORE), ChatColor.LIGHT_PURPLE, 10, 1, -1); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionManager.java b/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionManager.java index f790afcbe..9653003d5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionManager.java @@ -6,6 +6,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.TimeZone; @@ -35,6 +36,7 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.donation.DonationManager; import mineplex.core.game.GameDisplay; import mineplex.core.mission.commands.DebugMissionCommand; +import mineplex.core.mission.commands.SetMissionsCommand; import mineplex.core.mission.commands.ViewMissionsCommand; import mineplex.core.mission.ui.MissionShop; import mineplex.core.newnpc.NPC; @@ -50,7 +52,7 @@ public class MissionManager extends MiniDbClientPlugin public enum Perm implements Permission { VIEW_MISSION_COMMAND, - START_MISSION_COMMAND, + SET_MISSIONS_COMMAND, DEBUG_MISSION_COMMAND } @@ -97,14 +99,21 @@ public class MissionManager extends MiniDbClientPlugin private void generatePermissions() { PermissionGroup.PLAYER.setPermission(Perm.VIEW_MISSION_COMMAND, true, true); - PermissionGroup.ADMIN.setPermission(Perm.START_MISSION_COMMAND, true, true); + PermissionGroup.ADMIN.setPermission(Perm.SET_MISSIONS_COMMAND, true, true); PermissionGroup.ADMIN.setPermission(Perm.DEBUG_MISSION_COMMAND, true, true); + + if (UtilServer.isTestServer()) + { + PermissionGroup.QA.setPermission(Perm.SET_MISSIONS_COMMAND, true, true); + PermissionGroup.QA.setPermission(Perm.DEBUG_MISSION_COMMAND, true, true); + } } @Override public void addCommands() { addCommand(new ViewMissionsCommand(this)); + addCommand(new SetMissionsCommand(this)); addCommand(new DebugMissionCommand(this)); } @@ -147,7 +156,9 @@ public class MissionManager extends MiniDbClientPlugin { MissionClient client = Get(uuid); TimeZone utc = TimeZone.getTimeZone("UTC"); - Calendar now = Calendar.getInstance(utc); + // Why UK? because we want Monday to be the first day of the week + Locale uk = Locale.UK; + Calendar now = Calendar.getInstance(utc, uk); int nonEventMissions = 0; while (resultSet.next()) @@ -179,10 +190,11 @@ public class MissionManager extends MiniDbClientPlugin long startTime = resultSet.getLong("startTime"); PlayerMission mission = new PlayerMission<>(context, MissionLength.values()[length], x, y, progress, false); - Calendar start = Calendar.getInstance(utc); + Calendar start = Calendar.getInstance(utc, uk); start.setTimeInMillis(startTime); int lengthField = mission.getLength().getCalendarField(); + System.out.println(mission.getName() + " - " + now.get(lengthField) + " " + start.get(lengthField)); if (lengthField != -1 && now.get(lengthField) != start.get(lengthField)) { runAsync(() -> _repository.clearMission(accountId, missionId)); @@ -296,6 +308,31 @@ public class MissionManager extends MiniDbClientPlugin runAsync(_repository::bulkProcess); } + public void setMissions(Player player, Map>> missions) + { + int accountId = ClientManager.getAccountId(player); + double rankBonus = getRankBonus(player); + MissionClient client = Get(player); + + player.sendMessage(F.main(getName(), "Clearing old missions...")); + client.getMissions().forEach(mission -> runAsync(() -> _repository.clearMission(accountId, mission.getId()))); + client.getMissions().clear(); + + missions.forEach((length, contexts) -> + { + contexts.forEach(context -> + { + player.sendMessage(F.main(getName(), "Starting " + F.name(context.getName()) + "...")); + PlayerMission mission = length.createFromContext(context); + _repository.addQueryToQueue(MissionRepository.startMission(accountId, () -> + { + mission.createRewards(rankBonus); + client.startMission(mission); + }, mission)); + }); + }); + } + private void selectNewMissions(Player player) { MissionClient client = Get(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionPopulator.java b/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionPopulator.java index 38b179892..95a201e0c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionPopulator.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionPopulator.java @@ -160,6 +160,19 @@ public class MissionPopulator ) .build(); + MissionContext.newBuilder(manager, 104) + .name("Leap Higher!") + .description("Leap or Double Jump %s times in game") + .games(GameDisplay.values()) + .xRange(20, 40) + .tracker(GAME_LEAP) + .rewards( + new LevelExperienceReward(6), + new LevelCurrencyReward(GlobalCurrency.GEM, 3), + new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 3) + ) + .build(); + // Turf Wars 200-299 MissionContext.newBuilder(manager, 200) @@ -229,19 +242,6 @@ public class MissionPopulator ) .build(); - MissionContext.newBuilder(manager, 302) - .name("Streak!") - .description("Guess the word %s times in a row") - .games(Draw) - .yRange(2, 5) - .tracker(DMT_GUESS_STREAK) - .rewards( - new LevelExperienceReward(250), - new LevelCurrencyReward(GlobalCurrency.GEM, 125), - new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 125) - ) - .build(); - // Survival Games 400-499 MissionContext.newBuilder(manager, 400) @@ -314,7 +314,7 @@ public class MissionPopulator MissionContext.newBuilder(manager, 405) .name("Iron Weaponsmith") - .description("Craft %s gold swords") + .description("Craft %s iron swords") .games(SurvivalGames, SurvivalGamesTeams) .xRange(1, 10) .tracker(GAME_CRAFT_ITEM) @@ -661,21 +661,7 @@ public class MissionPopulator ) .build(); - MissionContext.newBuilder(manager, 703) - .name("They Stick The Landing!") - .description("Catch %s players with Spin Web") - .games(Smash, SmashTeams) - .xRange(1, 5) - .tracker(GAME_DAMAGE_REASON) - .trackerData("Spin Web") - .rewards( - new LevelExperienceReward(500), - new LevelCurrencyReward(GlobalCurrency.GEM, 250), - new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 250) - ) - .build(); - - MissionContext.newBuilder(manager, 704) + MissionContext.newBuilder(manager, 703) .name("Balancing Trick") .description("Be airborne for %s seconds") .games(Smash, SmashTeams) @@ -868,7 +854,7 @@ public class MissionPopulator ) .build(); - MissionContext.newBuilder(manager, 1003) + MissionContext.newBuilder(manager, 1004) .name("EXPLOSION") .description("Pickup %s Throwable TNT") .games(Skywars, SkywarsTeams) @@ -881,7 +867,7 @@ public class MissionPopulator ) .build(); - MissionContext.newBuilder(manager, 1004) + MissionContext.newBuilder(manager, 1005) .name("Megimin Approved") .description("Throw %s Throwable TNT") .games(Skywars, SkywarsTeams) @@ -894,7 +880,7 @@ public class MissionPopulator ) .build(); - MissionContext.newBuilder(manager, 1005) + MissionContext.newBuilder(manager, 1006) .name("Destructor") .description("Break %s blocks") .games(Skywars, SkywarsTeams) @@ -907,7 +893,7 @@ public class MissionPopulator ) .build(); - MissionContext.newBuilder(manager, 1006) + MissionContext.newBuilder(manager, 1007) .name("Skilled In The Craft") .description("Craft %s items") .games(Skywars, SkywarsTeams) @@ -920,7 +906,7 @@ public class MissionPopulator ) .build(); - MissionContext.newBuilder(manager, 1007) + MissionContext.newBuilder(manager, 1008) .name("Ella Was Enchanted") .description("Enchant %s items") .games(Skywars, SkywarsTeams) @@ -933,7 +919,7 @@ public class MissionPopulator ) .build(); - MissionContext.newBuilder(manager, 1008) + MissionContext.newBuilder(manager, 1009) .name("Who Needs A Hammer?") .description("Smelt %s items in a furnace") .games(Skywars, SkywarsTeams) @@ -1034,7 +1020,7 @@ public class MissionPopulator MissionContext.newBuilder(manager, 1301) .name("Da Bomb") - .description("Rate %s other players") + .description("Rate %s other builds") .games(Build) .xRange(4, 20) .tracker(BUILD_RATE) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionTrackerType.java b/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionTrackerType.java index fa95113a5..8e72d0b64 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionTrackerType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mission/MissionTrackerType.java @@ -30,13 +30,13 @@ public enum MissionTrackerType GAME_FURNACE_SMELT, GAME_GENERATOR_COLLECT, GAME_THROW_TNT, + GAME_LEAP, TURF_WARS_ON_ENEMY, TURF_WARS_BOW_BREAK, DMT_GUESS, DMT_GUESS_ALL, - DMT_GUESS_STREAK, SG_BOW_HORSE_KILL, SG_SUPPLY_DROP_OPEN, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mission/PlayerMission.java b/Plugins/Mineplex.Core/src/mineplex/core/mission/PlayerMission.java index eca2aace4..49b508188 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mission/PlayerMission.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mission/PlayerMission.java @@ -28,7 +28,7 @@ public class PlayerMission implements Mission _x = fromContext && x > 1 ? x * length.getxScale() : x; _y = y; - if (x == 1) + if (x == 1 && y > 0) { _description = String.format(context.getDescription(), y); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mission/commands/SetMissionsCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/mission/commands/SetMissionsCommand.java new file mode 100644 index 000000000..ba75ba213 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/mission/commands/SetMissionsCommand.java @@ -0,0 +1,69 @@ +package mineplex.core.mission.commands; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.util.F; +import mineplex.core.mission.MissionContext; +import mineplex.core.mission.MissionLength; +import mineplex.core.mission.MissionManager; +import mineplex.core.mission.MissionManager.Perm; + +public class SetMissionsCommand extends CommandBase +{ + + public SetMissionsCommand(MissionManager plugin) + { + super(plugin, Perm.SET_MISSIONS_COMMAND, "setmissions"); + } + + @Override + public void Execute(Player caller, String[] args) + { + if (args.length < 2) + { + caller.sendMessage(F.main(Plugin.getName(), "/" + _aliasUsed + " ")); + return; + } + + Map>> missions = new HashMap<>(); + + missions.put(MissionLength.DAY, getFromArg(args[0], caller)); + missions.put(MissionLength.WEEK, getFromArg(args[1], caller)); + + Plugin.setMissions(caller, missions); + } + + private List> getFromArg(String arg, Player caller) + { + String[] split = arg.split(","); + List> missions = new ArrayList<>(split.length); + + for (String idString : split) + { + try + { + int id = Integer.parseInt(idString); + MissionContext context = Plugin.getMission(id); + + if (context == null) + { + continue; + } + + missions.add(context); + } + catch (NumberFormatException ex) + { + caller.sendMessage(F.main(Plugin.getName(), F.elem(idString) + " is not a number.")); + } + } + + return missions; + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mission/ui/MissionMainPage.java b/Plugins/Mineplex.Core/src/mineplex/core/mission/ui/MissionMainPage.java index 5c9a5dcbd..f7061cf35 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mission/ui/MissionMainPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mission/ui/MissionMainPage.java @@ -56,6 +56,11 @@ public class MissionMainPage extends ShopPageBase for (PlayerMission mission : missions) { + if (mission.getRewards() == null) + { + continue; + } + int row = mission.getLength().ordinal(); int progress = mission.getCurrentProgress(); int requiredProgress = mission.getRequiredProgress(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/mission/KillLastTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/mission/KillLastTracker.java index b93835b76..0256063dc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/mission/KillLastTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/mission/KillLastTracker.java @@ -25,7 +25,7 @@ public class KillLastTracker extends GameMissionTracker Player player = event.getEntity(); Player killer = player.getKiller(); - if (killer == null || killer.equals(player)) + if (player.equals(killer)) { return; } @@ -37,6 +37,6 @@ public class KillLastTracker extends GameMissionTracker return; } - _manager.incrementProgress(player, 1, _trackerType, getGameType(), null); + _manager.incrementProgress(killer, 1, _trackerType, getGameType(), null); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java index 73f633058..b5b66adde 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java @@ -376,9 +376,6 @@ public class Domination extends TeamGame AddGems(player, 10, "Participation", false, false); } } - - boolean red = team.GetColor() == ChatColor.RED; - team.GetPlayers(false).forEach(player -> getArcadeManager().getMissionsManager().incrementProgress(player, red ? _redScore : _blueScore, MissionTrackerType.DOM_POINT, GetType().getDisplay(), null)); } endElo(); @@ -500,4 +497,19 @@ public class Domination extends TeamGame { event.getPlayers().forEach(player -> getArcadeManager().getMissionsManager().incrementProgress(player, 1, MissionTrackerType.GAME_CAPTURE_POINT, GetType().getDisplay(), null)); } + + @EventHandler + public void end(GameStateChangeEvent event) + { + if (event.GetState() != GameState.End) + { + return; + } + + GetTeamList().forEach(team -> + { + boolean red = team.GetColor() == ChatColor.RED; + team.GetPlayers(false).forEach(player -> getArcadeManager().getMissionsManager().incrementProgress(player, red ? _redScore : _blueScore, MissionTrackerType.DOM_POINT, GetType().getDisplay(), null)); + }); + } } \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java index 38b9c8cfb..8b6c391d3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java @@ -54,7 +54,6 @@ import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.GameScore; import nautilus.game.arcade.game.games.draw.kits.KitArtist; -import nautilus.game.arcade.game.games.draw.mission.GuessStreakTracker; import nautilus.game.arcade.game.games.draw.tools.Tool; import nautilus.game.arcade.game.games.draw.tools.ToolCircle; import nautilus.game.arcade.game.games.draw.tools.ToolLine; @@ -258,8 +257,6 @@ public class Draw extends SoloGame new DrawGuessStatTracker(this) ); - registerMissions(new GuessStreakTracker(this)); - registerChatStats( new ChatStatData("TotalGuess", "Total Guesses", true), new ChatStatData("PureLuck", "Lucky Guesses", true) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/mission/GuessStreakTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/mission/GuessStreakTracker.java deleted file mode 100644 index c3ce1f800..000000000 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/mission/GuessStreakTracker.java +++ /dev/null @@ -1,49 +0,0 @@ -package nautilus.game.arcade.game.games.draw.mission; - -import java.util.HashMap; -import java.util.Map; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; - -import mineplex.core.mission.MissionTrackerType; - -import nautilus.game.arcade.game.games.draw.Draw; -import nautilus.game.arcade.game.games.draw.DrawGuessCorrectlyEvent; -import nautilus.game.arcade.game.games.draw.DrawRoundEndEvent; -import nautilus.game.arcade.missions.GameMissionTracker; - -public class GuessStreakTracker extends GameMissionTracker -{ - - private final Map _streaks; - - public GuessStreakTracker(Draw game) - { - super(MissionTrackerType.DMT_GUESS_STREAK, game); - - _streaks = new HashMap<>(); - } - - @Override - public void cleanup() - { - _streaks.clear(); - } - - @EventHandler - public void guessCorrect(DrawGuessCorrectlyEvent event) - { - Player player = event.getPlayer(); - - int streak = _streaks.getOrDefault(player.getName(), 0) + 1; - _streaks.put(player.getName(), streak); - _manager.incrementProgress(player, 1, MissionTrackerType.DMT_GUESS_STREAK, getGameType(), null, streak); - } - - @EventHandler - public void round(DrawRoundEndEvent event) - { - _streaks.keySet().removeIf(player -> !event.getDrawRound().Guessed.contains(player)); - } -} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/mission/Last2Tracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/mission/Last2Tracker.java index 0844f682d..ab90a96f1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/mission/Last2Tracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/mission/Last2Tracker.java @@ -39,7 +39,7 @@ public class Last2Tracker extends GameMissionTracker for (Player player : _game.GetPlayers(true)) { - _manager.incrementProgress(player, 1, MissionTrackerType.MICRO_LAST_TWO, getGameType(), null); + _manager.incrementProgress(player, 1, _trackerType, getGameType(), null); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/misison/BowHorseKillTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/misison/BowHorseKillTracker.java index 276e2f830..f59c0a909 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/misison/BowHorseKillTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/misison/BowHorseKillTracker.java @@ -3,7 +3,6 @@ package nautilus.game.arcade.game.games.survivalgames.misison; import org.bukkit.entity.Horse; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; import org.bukkit.event.entity.PlayerDeathEvent; import mineplex.core.mission.MissionTrackerType; @@ -19,7 +18,7 @@ public class BowHorseKillTracker extends GameMissionTracker super(MissionTrackerType.SG_BOW_HORSE_KILL, game); } - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler public void playerDeath(PlayerDeathEvent event) { Player player = event.getEntity(); @@ -30,6 +29,6 @@ public class BowHorseKillTracker extends GameMissionTracker return; } - _manager.incrementProgress(player, 1, _trackerType, getGameType(), null); + _manager.incrementProgress(killer, 1, _trackerType, getGameType(), null); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/mission/KillMidAirMissionTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/mission/KillMidAirMissionTracker.java index 4838f270e..fbf16f998 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/mission/KillMidAirMissionTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/mission/KillMidAirMissionTracker.java @@ -30,6 +30,6 @@ public class KillMidAirMissionTracker extends GameMissionTracker return; } - _manager.incrementProgress(player, 1, _trackerType, getGameType(), null); + _manager.incrementProgress(killer, 1, _trackerType, getGameType(), null); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/lobby/LobbyManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/lobby/LobbyManager.java index e308ef274..36b37257c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/lobby/LobbyManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/lobby/LobbyManager.java @@ -435,6 +435,7 @@ public abstract class LobbyManager implements Listener { writeGameLine("Voting for the next", 0, Material.STAINED_CLAY.getId(), (byte) 14); writeGameLine(vote.getName(), 1, Material.STAINED_CLAY.getId(), (byte) 4); + writeGameLine("", 2, Material.AIR.getId(), (byte) 0); displayVotingTime(vote); }