From d06625228874985b7c279c54ea63b5cb47f19f4f Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 15 Sep 2018 14:38:14 +0100 Subject: [PATCH] Make changes from the QA testing --- .../core/achievement/Achievement.java | 2 +- .../mineplex/core/game/nano/NanoDisplay.java | 4 +- .../core/noteblock/LoopedNotePlayer.java | 2 +- .../src/mineplex/game/nano/NanoGames.java | 3 +- .../mineplex/game/nano/cycle/GameCycle.java | 2 +- .../src/mineplex/game/nano/game/GameType.java | 5 +- .../player/DoubleJumpComponent.java | 29 +++ .../components/player/GamePlayerManager.java | 35 ++- .../components/player/GiveItemComponent.java | 7 +- .../components/stats/GameStatsComponent.java | 12 + .../components/stats/GeneralStatsTracker.java | 8 +- .../game/nano/game/games/copycat/CopyCat.java | 40 +-- .../nano/game/games/deathtag/DeathTag.java | 1 + .../game/nano/game/games/dropper/Dropper.java | 74 +++--- .../game/nano/game/games/minekart/Kart.java | 10 +- .../game/games/minekart/KartController.java | 10 +- .../nano/game/games/minekart/MineKart.java | 11 +- .../game/nano/game/games/mobfarm/MobFarm.java | 241 ------------------ .../game/nano/game/games/quick/Challenge.java | 4 +- .../nano/game/games/quick/ChallengeType.java | 2 +- .../games/quick/ChallengeWinConditions.java | 13 + .../quick/challenges/ChallengeIgniteTNT.java | 4 +- .../quick/challenges/ChallengeIntoVoid.java | 2 +- .../quick/challenges/ChallengeMilkCow.java | 2 +- .../quick/challenges/ChallengePlayMusic.java | 2 + .../games/quick/challenges/ChallengePole.java | 2 +- .../game/games/reversetag/ReverseTag.java | 10 + .../game/games/slimecycles/SlimeCycles.java | 2 +- .../game/nano/lobby/LobbyManager.java | 58 +---- .../game/nano/lobby/ReturnToHubManager.java | 5 +- .../mineplex/game/nano/world/GameWorld.java | 2 +- .../hub/server/ui/game/ServerGameMenu.java | 4 +- 32 files changed, 229 insertions(+), 379 deletions(-) delete mode 100644 Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/mobfarm/MobFarm.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index bab8f4cb8..da9f35120 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -1523,7 +1523,7 @@ public enum Achievement NANO_SLIME_TAIL("Not dead yet", 3000, new String[]{"Nano Games.SlimeCyclesTail"}, - new String[]{"Get a trail length of 60 blocks", "in Slime Cycles"}, + new String[]{"Get a trail length of 100 blocks", "in Slime Cycles"}, new int[]{1}, AchievementCategory.NANO_GAMES), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/nano/NanoDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/nano/NanoDisplay.java index 1cac38ce8..b2a7cb2d6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/nano/NanoDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/nano/NanoDisplay.java @@ -14,14 +14,14 @@ public enum NanoDisplay implements Display COPY_CAT(2, "Copy Cat", Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.OCELOT)), CHICKEN_SHOOT(3, "Chicken Shoot", Material.BOW), COLOUR_CHANGE(4, "Color Swap", Material.WOOL, (byte) 4), - DEATH_TAG(5, "Zombie Survival", Material.SKULL_ITEM, (byte) 2), + DEATH_TAG(5, "Zombie Survival", Material.ROTTEN_FLESH), DROPPER(6, "Dropper", Material.ANVIL), FIND_ORES(7, "Ores Ores Ores", Material.DIAMOND_PICKAXE), HOT_POTATO(8, "Hot Potato", Material.POTATO_ITEM), JUMP_ROPE(9, "Jump Rope", Material.LEASH), KING_SLIME(10, "King Slime", Material.SLIME_BALL), MICRO_BATTLE(11, "Nano Battle", Material.IRON_SWORD), - MOB_FARM(12, "Mob Farm", Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.PIG)), +// MOB_FARM(12, "Mob Farm", Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.PIG)), MUSIC_MINECARTS(13, "Musical Minecarts", Material.MINECART), QUICK(14, "Quick", Material.DIAMOND), PARKOUR(15, "Hardcore Parkour", Material.FEATHER), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/noteblock/LoopedNotePlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/noteblock/LoopedNotePlayer.java index fec5cdbfd..b3f9531f9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/noteblock/LoopedNotePlayer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/noteblock/LoopedNotePlayer.java @@ -93,7 +93,7 @@ public class LoopedNotePlayer implements Runnable, Component, Lifetimed if (!_playing) { sleep(); - return; + continue; } setTick(_tick + 1); diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/NanoGames.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/NanoGames.java index fa420e285..9d00d982c 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/NanoGames.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/NanoGames.java @@ -149,7 +149,8 @@ public class NanoGames extends JavaPlugin ThankManager thankManager = new ThankManager(this, clientManager, donationManager); BoosterManager boosterManager = new BoosterManager(this, boosterGroup, clientManager, donationManager, inventoryManager, thankManager); - new CosmeticManager(this, clientManager, donationManager, inventoryManager, require(GadgetManager.class), petManager, require(TreasureManager.class), boosterManager, punish).setActive(false); + CosmeticManager cosmeticManager = new CosmeticManager(this, clientManager, donationManager, inventoryManager, require(GadgetManager.class), petManager, require(TreasureManager.class), boosterManager, punish); + cosmeticManager.setInterfaceSlot(7); new MessageManager(this, incognito, clientManager, preferenceManager, ignoreManager, punish, friendManager, require(Chat.class)); new MemoryFix(this); diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/cycle/GameCycle.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/cycle/GameCycle.java index 35e842a9f..c4a0f3080 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/cycle/GameCycle.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/cycle/GameCycle.java @@ -110,7 +110,7 @@ public class GameCycle extends GameManager cancel(); } } - }, 10, 10); + }, 20, 10); } } diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/GameType.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/GameType.java index cf015d8e9..725348e6b 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/GameType.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/GameType.java @@ -17,7 +17,6 @@ import mineplex.game.nano.game.games.jumprope.JumpRope; import mineplex.game.nano.game.games.kingslime.KingSlime; import mineplex.game.nano.game.games.microbattle.MicroBattle; import mineplex.game.nano.game.games.minekart.MineKart; -import mineplex.game.nano.game.games.mobfarm.MobFarm; import mineplex.game.nano.game.games.musicminecart.MusicMinecarts; import mineplex.game.nano.game.games.oits.SnowballTrouble; import mineplex.game.nano.game.games.parkour.Parkour; @@ -45,8 +44,8 @@ public enum GameType JUMP_ROPE(JumpRope.class, NanoDisplay.JUMP_ROPE), FIND_ORES(FindOres.class, NanoDisplay.FIND_ORES), MUSIC_MINECARTS(MusicMinecarts.class, NanoDisplay.MUSIC_MINECARTS), - MOB_FARM(MobFarm.class, NanoDisplay.MOB_FARM), - CHICKEN_SHOOT(ChickenShoot.class, NanoDisplay.CHICKEN_SHOOT, mapsFromNano(NanoDisplay.MOB_FARM)), +// MOB_FARM(MobFarm.class, NanoDisplay.MOB_FARM), + CHICKEN_SHOOT(ChickenShoot.class, NanoDisplay.CHICKEN_SHOOT), SLIME_CYCLES(SlimeCycles.class, NanoDisplay.SLIME_CYCLES), TERRITORY(Territory.class, NanoDisplay.TERRITORY), COPY_CAT(CopyCat.class, NanoDisplay.COPY_CAT), diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/player/DoubleJumpComponent.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/player/DoubleJumpComponent.java index f797b99bc..e50477e3f 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/player/DoubleJumpComponent.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/player/DoubleJumpComponent.java @@ -7,13 +7,16 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.util.Vector; +import mineplex.core.common.util.C; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.game.nano.game.Game; import mineplex.game.nano.game.Game.GameState; import mineplex.game.nano.game.GameComponent; +import mineplex.game.nano.game.event.GameStateChangeEvent; public class DoubleJumpComponent extends GameComponent { @@ -44,6 +47,32 @@ public class DoubleJumpComponent extends GameComponent return this; } + @EventHandler + public void live(GameStateChangeEvent event) + { + if (event.getState() != GameState.Live) + { + return; + } + + getGame().getManager().runSyncLater(() -> + { + if (!getGame().isLive()) + { + return; + } + + Player[] players = getGame().getAllPlayers().toArray(new Player[0]); + + for (Player player : players) + { + player.playEffect(player.getLocation(), Effect.BLAZE_SHOOT, 8); + } + + UtilTextMiddle.display(C.cYellow + "Double Jump", "Double Tap Jump to Leap!", 0, 30, 20, players); + }, 5); + } + @EventHandler(priority = EventPriority.HIGH) public void updateJump(UpdateEvent event) { diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/player/GamePlayerManager.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/player/GamePlayerManager.java index 803f90510..9b534e75a 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/player/GamePlayerManager.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/player/GamePlayerManager.java @@ -17,6 +17,8 @@ import mineplex.core.account.permissions.Permission; import mineplex.core.account.permissions.PermissionGroup; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.gadget.event.GadgetEnableEvent; +import mineplex.core.gadget.persistence.UserGadgetPersistence; import mineplex.core.teleport.event.MineplexTeleportEvent; import mineplex.game.nano.GameManager; import mineplex.game.nano.game.Game.GameState; @@ -154,7 +156,38 @@ public class GamePlayerManager extends GameManager implements ComponentHook @EventHandler public void respawn(PlayerGameRespawnEvent event) { - Player player = event.getPlayer(); + giveItems(event.getPlayer()); + } + public void giveItems(Player player) + { if (_items != null) { player.getInventory().clear(); @@ -54,4 +57,4 @@ public class GiveItemComponent extends GameComponent player.getInventory().setArmorContents(_armour); } } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/stats/GameStatsComponent.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/stats/GameStatsComponent.java index 28caafbc9..6de626e9a 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/stats/GameStatsComponent.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/stats/GameStatsComponent.java @@ -12,6 +12,7 @@ import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerJoinEvent; import mineplex.core.achievement.Achievement; import mineplex.core.achievement.AchievementCategory; @@ -82,6 +83,12 @@ public class GameStatsComponent extends GameComponent implements StatsComp _statsManager.incrementStat(player, stat, amount); } + @EventHandler + public void playerJoin(PlayerJoinEvent event) + { + getGame().getManager().getAchievementManager().clearLog(event.getPlayer()); + } + /* Copied from AchievementSummaryComponent // TODO Replace and reinvent when reimplementing achievements @@ -99,6 +106,11 @@ public class GameStatsComponent extends GameComponent implements StatsComp for (Player player : UtilServer.getPlayersCollection()) { + if (_statsManager.Get(player).isTemporary()) + { + continue; + } + Map logs = manager.getLog(player); if (logs == null) diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/stats/GeneralStatsTracker.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/stats/GeneralStatsTracker.java index 6008bfec6..193ae045e 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/stats/GeneralStatsTracker.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/stats/GeneralStatsTracker.java @@ -64,6 +64,12 @@ public class GeneralStatsTracker extends StatTracker } GamePlacements placements = _game.getGamePlacements(); + + if (placements == null) + { + return; + } + List allPlayers = _game.getAllPlayers(); List winners = placements.getWinners(); @@ -76,7 +82,7 @@ public class GeneralStatsTracker extends StatTracker // Wins & Losses winners.forEach(player -> addStat(player, "Wins", 1, true, false)); - if (_game.getTeams().size() > 1 && winners.size() > 1) + if (_game.getTeams().size() == 1 && winners.size() > 1) { winners.forEach(player -> addStat(player, "ShareFirst", 1, true, false)); } diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/copycat/CopyCat.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/copycat/CopyCat.java index c5cc4a3b5..b57f1e081 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/copycat/CopyCat.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/copycat/CopyCat.java @@ -19,10 +19,13 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.inventory.ItemStack; +import org.bukkit.util.Vector; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.updater.UpdateType; @@ -30,7 +33,6 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.game.nano.NanoManager; import mineplex.game.nano.game.GameType; import mineplex.game.nano.game.components.player.NightVisionComponent; -import mineplex.game.nano.game.event.PlayerGameRespawnEvent; import mineplex.game.nano.game.games.copycat.CopyCat.SealBreakerRoom; import mineplex.game.nano.game.roomed.Room; import mineplex.game.nano.game.roomed.RoomedSoloGame; @@ -90,16 +92,7 @@ public class CopyCat extends RoomedSoloGame } @EventHandler - public void respawn(PlayerGameRespawnEvent event) - { - Player player = event.getPlayer(); - - player.setAllowFlight(true); - player.setFlying(true); - } - - @EventHandler - public void update(UpdateEvent event) + public void updateLevels(UpdateEvent event) { if (event.getType() != UpdateType.FAST || !isLive()) { @@ -108,11 +101,6 @@ public class CopyCat extends RoomedSoloGame _rooms.forEach((player, room) -> { - if (!player.isFlying()) - { - player.setFlying(true); - } - if (room.next()) { UtilTextMiddle.display(C.cYellowB + "Level " + room.Level, C.cRed + room.Blocks + " Blocks", 0, 40, 0, player); @@ -130,6 +118,26 @@ public class CopyCat extends RoomedSoloGame }); } + @EventHandler + public void updateFlight(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + { + return; + } + + for (Player player : getAllPlayers()) + { + player.setAllowFlight(true); + player.setFlying(true); + + if (UtilEnt.isGrounded(player)) + { + UtilAction.velocity(player, new Vector(0, 0.3, 0)); + } + } + } + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void blockPlace(BlockPlaceEvent event) { diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/deathtag/DeathTag.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/deathtag/DeathTag.java index f99d52b8a..f590b74b5 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/deathtag/DeathTag.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/deathtag/DeathTag.java @@ -212,6 +212,7 @@ public class DeathTag extends SoloGame { announce(F.main(getManager().getName(), F.elem(_runners.getChatColour() + player.getName()) + " has become an " + F.elem(_chasers.getChatColour() + "Alpha Zombie") + ".")); player.getWorld().strikeLightningEffect(player.getLocation()); + _itemComponent.giveItems(player); player.getInventory().setArmorContents(new ItemStack[] { null, diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/dropper/Dropper.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/dropper/Dropper.java index adbe79154..eac7b3300 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/dropper/Dropper.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/dropper/Dropper.java @@ -7,7 +7,6 @@ import java.util.concurrent.TimeUnit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; -import org.bukkit.entity.Villager; import org.bukkit.event.EventHandler; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; @@ -17,12 +16,10 @@ import com.mineplex.anticheat.checks.move.Glide; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.MapUtil; -import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTime; -import mineplex.core.newnpc.NPC; -import mineplex.core.newnpc.SimpleNPC; -import mineplex.core.newnpc.event.NPCInteractEvent; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; import mineplex.game.nano.NanoManager; import mineplex.game.nano.game.GamePlacements; import mineplex.game.nano.game.GameType; @@ -37,8 +34,9 @@ public class Dropper extends SoloGame { private List _floor; + private int _goalY, _goalDelay; - private final List _completed; + private final List _completed, _delayed; public Dropper(NanoManager manager) { @@ -49,6 +47,7 @@ public class Dropper extends SoloGame }); _completed = new ArrayList<>(); + _delayed = new ArrayList<>(); _prepareComponent.setPrepareFreeze(false); @@ -90,19 +89,16 @@ public class Dropper extends SoloGame @Override protected void parseData() { - Location goal = _mineplexWorld.getIronLocation("YELLOW"); - goal.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(goal, getSpectatorLocation()))); + _mineplexWorld.getSpongeLocations().forEach((key, locations) -> + { + if (!key.startsWith("END")) + { + return; + } - _worldComponent.setCreatureAllowOverride(true); - - NPC npc = SimpleNPC.of(goal, Villager.class, getGameType().getName()); - - npc.getEntity().setCustomName(C.cYellowB + "CLICK ME"); - npc.getEntity().setCustomNameVisible(true); - - _manager.getNpcManager().addNPC(npc); - - _worldComponent.setCreatureAllowOverride(false); + _goalY = locations.get(0).getBlockY(); + _goalDelay = Integer.parseInt(key.split(" ")[1]); + }); _floor = _mineplexWorld.getSpongeLocations(String.valueOf(Material.GLASS.getId())); _floor.forEach(location -> MapUtil.QuickChangeBlockAt(location, Material.STAINED_GLASS, (byte) 5)); @@ -129,7 +125,10 @@ public class Dropper extends SoloGame @EventHandler public void respawn(PlayerGameRespawnEvent event) { - event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 0, false, false)); + Player player = event.getPlayer(); + + _delayed.remove(player); + player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 0, false, false)); } @EventHandler @@ -144,28 +143,35 @@ public class Dropper extends SoloGame } @EventHandler - public void npcInteract(NPCInteractEvent event) + public void update(UpdateEvent event) { - if (!isLive()) + if (event.getType() != UpdateType.TICK) { return; } - Player player = event.getPlayer(); - - if (!event.getNpc().getMetadata().equals(getGameType().getName()) || !isAlive(player)) + for (Player player : getAlivePlayers()) { - return; + if (_delayed.contains(player) || player.getLocation().getY() > _goalY) + { + continue; + } + + _delayed.add(player); + + getManager().runSyncLater(() -> + { + if (!isLive() || !isAlive(player)) + { + return; + } + + announce(F.main(getManager().getName(), F.name(player.getName()) + " completed the fall in " + F.time(UtilTime.MakeStr(System.currentTimeMillis() - getStateTime())) + "!"), null); + UtilTextMiddle.display(C.cGreen + "End!", "You survived the drop!", 0, 50, 20, player); + _completed.add(player); + addSpectator(player, false, true); + }, _goalDelay); } - - event.setCancelled(true); - - announce(F.main(getManager().getName(), F.name(player.getName()) + " completed the fall in " + F.time(UtilTime.MakeStr(System.currentTimeMillis() - getStateTime())) + "!"), null); - UtilTextMiddle.display(C.cGreen + "End!", "You survived the drop!", 0, 50, 20, player); - - _completed.add(player); - - addSpectator(event.getPlayer(), false, true); } @Override diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/Kart.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/Kart.java index e5c4a343d..08927bbdf 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/Kart.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/Kart.java @@ -7,6 +7,7 @@ import org.bukkit.entity.Sheep; import org.bukkit.util.Vector; import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; import mineplex.game.nano.game.games.minekart.KartController.DriftDirection; @@ -45,7 +46,14 @@ public class Kart UtilEnt.ghost(_vehicle, true, false); UtilEnt.setFakeHead(_vehicle, true); - _vehicle.setColor(DyeColor.RED); + if (driver.isOp()) + { + _vehicle.setCustomName("jeb_"); + } + else + { + _vehicle.setColor(UtilMath.randomElement(DyeColor.values())); + } _vehicle.setPassenger(driver); diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/KartController.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/KartController.java index 4defecbdd..295894ec9 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/KartController.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/KartController.java @@ -79,12 +79,12 @@ public class KartController if (length > 0.4) { velocity.multiply(-0.6); - velocity.setY(0.4); + velocity.setY(0.3); } else { velocity = UtilAlg.getTrajectory(kart.getYaw(), 0).multiply(-0.4); - velocity.setY(0.4); + velocity.setY(0.3); kart.setVelocity(velocity); } @@ -158,13 +158,13 @@ public class KartController } float velocityInverse = (float) (2 - speed); - float newYaw = kart.getYaw() - (3 * kart.getSidewaysInput() * velocityInverse); + float newYaw = kart.getYaw() - (4 * kart.getSidewaysInput() * velocityInverse); kart.setYaw(newYaw); Vector turn = UtilAlg.getTrajectory(newYaw, 0); - turn.subtract(new Vector(velocity.getX(), 0, velocity.getZ()).normalize()).multiply(0.033); + turn.subtract(new Vector(velocity.getX(), 0, velocity.getZ()).normalize()).multiply(0.05); velocity.add(turn); @@ -185,7 +185,7 @@ public class KartController return; } - if (kart.getDriftDirection() != null && kart.getVelocity().length() > 0.1) + if (kart.getDriftDirection() != null && kart.getVelocity().length() > 0.25) { float power = kart.getDriftPower() + (0.05F * (kart.getDriftDirection() == DriftDirection.LEFT ? kart.getSidewaysInput() : -kart.getSidewaysInput())); diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/MineKart.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/MineKart.java index f43ae493a..47568abe7 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/MineKart.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/minekart/MineKart.java @@ -91,16 +91,16 @@ public class MineKart extends SoloGame implements IPacketHandler return 1; } - if (o1.getLapKeyCheckpoint() != o2.getLapKeyCheckpoint()) - { - return Integer.compare(o2.getLapKeyCheckpoint(), o1.getLapKeyCheckpoint()); - } - if (o1.getLap() != o2.getLap()) { return Integer.compare(o2.getLap(), o1.getLap()); } + if (o1.getLapKeyCheckpoint() != o2.getLapKeyCheckpoint()) + { + return Integer.compare(o2.getLapKeyCheckpoint(), o1.getLapKeyCheckpoint()); + } + return Integer.compare(o2.getLapCheckpoint(), o1.getLapCheckpoint()); }; @@ -491,6 +491,7 @@ public class MineKart extends SoloGame implements IPacketHandler if (points.isEmpty()) { kart.setVelocity(new Vector()); + kart.getVehicle().setFallDistance(0); kart.setResetting(false); cancel(); return; diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/mobfarm/MobFarm.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/mobfarm/MobFarm.java deleted file mode 100644 index b3348c4b5..000000000 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/mobfarm/MobFarm.java +++ /dev/null @@ -1,241 +0,0 @@ -package mineplex.game.nano.game.games.mobfarm; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -import org.bukkit.ChatColor; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.entity.EntityDeathEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - -import mineplex.core.common.util.C; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilMath; -import mineplex.core.itemstack.ItemBuilder; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.game.nano.NanoManager; -import mineplex.game.nano.game.GameType; -import mineplex.game.nano.game.ScoredSoloGame; -import mineplex.game.nano.game.components.player.GiveItemComponent; -import mineplex.game.nano.game.event.GameStateChangeEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; - -public class MobFarm extends ScoredSoloGame -{ - - private static final int MAX_MOBS = 30; - private static final int MAX_MINUS_TICKS = 400; - - private enum MobType - { - - CHICKEN(EntityType.CHICKEN, 1, ChatColor.WHITE, 1), - PIG(EntityType.PIG, 3, ChatColor.LIGHT_PURPLE, 6), - COW(EntityType.COW, 5, ChatColor.GOLD, 10), - - ; - - final EntityType Type; - final int Points; - final ChatColor Colour; - final int Health; - - MobType(EntityType type, int points, ChatColor colour, int health) - { - Type = type; - Points = points; - Colour = colour; - Health = health; - } - } - - private final Map _mobs; - private List _mobSpawns; - - public MobFarm(NanoManager manager) - { - super(manager, GameType.MOB_FARM, new String[] - { - "Kill " + C.cYellow + "Mobs" + C.Reset + " to earn points.", - C.cGreen + "Bigger" + C.Reset + " mobs give more points.", - "Watch out for " + C.cRed + "Minus" + C.Reset + " mobs. They will reduce your score.", - C.cYellow + "Most points" + C.Reset + " wins!" - }); - - _mobs = new HashMap<>(); - - _prepareComponent.setPrepareFreeze(false); - - _damageComponent.setPvp(false); - _damageComponent.setFall(false); - - _endComponent.setTimeout(TimeUnit.SECONDS.toMillis(75)); - - new GiveItemComponent(this) - .setItems(new ItemStack[] - { - new ItemBuilder(Material.WOOD_SWORD) - .setUnbreakable(true) - .build() - }); - } - - @Override - protected void parseData() - { - _mobSpawns = _mineplexWorld.getIronLocations("LIME"); - } - - @Override - public void disable() - { - super.disable(); - - _mobSpawns.clear(); - } - - @EventHandler - public void updateMobs(UpdateEvent event) - { - if (event.getType() != UpdateType.FAST || !isLive()) - { - return; - } - - _mobs.entrySet().removeIf(entry -> - { - LivingEntity entity = entry.getKey(); - - if (entry.getValue() && entity.getTicksLived() > MAX_MINUS_TICKS) - { - entity.setHealth(0); - return true; - } - - return false; - }); - - while (_mobs.size() < MAX_MOBS) - { - MobType mobType = getRandomMob(); - Location location = UtilAlg.Random(_mobSpawns); - - if (location == null) - { - return; - } - - _worldComponent.setCreatureAllowOverride(true); - - location.setYaw(UtilMath.r(360)); - - LivingEntity entity = (LivingEntity) location.getWorld().spawnEntity(location, mobType.Type); - - if (Math.random() < 0.1) - { - entity.setCustomName(C.cRedB + "MINUS 50%"); - entity.setMaxHealth(1); - _mobs.put(entity, true); - } - else - { - entity.setCustomName(mobType.Colour + C.Bold + "+" + mobType.Points + " Point" + (mobType.Points == 1 ? "" : "s")); - entity.setMaxHealth(mobType.Health); - _mobs.put(entity, false); - } - - entity.setCustomNameVisible(true); - entity.setHealth(entity.getMaxHealth()); - } - } - - @EventHandler(ignoreCancelled = true) - public void damage(CustomDamageEvent event) - { - if (_mobs.containsKey(event.GetDamageeEntity())) - { - event.GetDamageeEntity().addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 1, false, false)); - } - } - - @EventHandler - public void entityDeath(EntityDeathEvent event) - { - LivingEntity entity = event.getEntity(); - Boolean minus = _mobs.remove(entity); - - if (minus != null) - { - event.getDrops().clear(); - event.setDroppedExp(0); - - Player killer = entity.getKiller(); - - if (killer == null) - { - return; - } - - if (minus) - { - getScores().put(killer, getScores().getOrDefault(killer, 0) / 2); - killer.playSound(entity.getLocation(), Sound.SILVERFISH_KILL, 1, 1); - } - else - { - incrementScore(killer, getPointsFor(entity)); - } - } - } - - @EventHandler - public void end(GameStateChangeEvent event) - { - if (event.getState() != GameState.End) - { - return; - } - - _mobs.keySet().forEach(entity -> entity.setHealth(0)); - } - - private MobType getRandomMob() - { - double random = Math.random(); - - if (random > 0.5) - { - return MobType.CHICKEN; - } - else if (random > 0.1) - { - return MobType.PIG; - } - - return MobType.COW; - } - - private int getPointsFor(LivingEntity entity) - { - for (MobType type : MobType.values()) - { - if (type.Type == entity.getType()) - { - return type.Points; - } - } - - return 0; - } -} diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/Challenge.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/Challenge.java index 87a12e2f9..cfaf73297 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/Challenge.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/Challenge.java @@ -128,14 +128,14 @@ public abstract class Challenge extends ListenerComponent implements Lifetimed, { _playerWon = true; - _game.announce(F.main(_game.getManager().getName(), "A player has completed the challenge. " + F.time("3 Seconds") + " left."), Sound.NOTE_STICKS); + _game.announce(F.main(_game.getManager().getName(), "A player has completed the challenge. " + F.time(_winConditions.getTimeout() + " Second" + (_winConditions.getTimeout() == 1 ? "" : "s")) + " left."), Sound.NOTE_STICKS); _game.getManager().runSyncLater(() -> { if (isRunning()) { end(); } - }, 3 * 20); + }, _winConditions.getTimeout() * 20); } } } diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/ChallengeType.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/ChallengeType.java index e89431531..c3172f77e 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/ChallengeType.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/ChallengeType.java @@ -48,7 +48,7 @@ public enum ChallengeType SLIME_JUMP(ChallengeSlimeJump.class, "Get on the emerald blocks!"), PUNCH_A_PIG(ChallengePunchAPig.class, "Punch 5 Pigs!"), IGNITE_TNT(ChallengeIgniteTNT.class, "Ignite the TNT!"), - SPIN(ChallengeSpin.class, "Spin around has fast as you can!"), + SPIN(ChallengeSpin.class, "Spin around as fast as you can!"), PLAY_MUSIC(ChallengePlayMusic.class, "Play a song on the noteblocks!"), MATHS_QUESTION(ChallengeMaths.class, "Get ready! Solve this math equation..."), MILK_A_COW(ChallengeMilkCow.class, "Drink the milk from one of the cows!"), diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/ChallengeWinConditions.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/ChallengeWinConditions.java index 62d37045f..44346ee14 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/ChallengeWinConditions.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/ChallengeWinConditions.java @@ -5,6 +5,7 @@ public class ChallengeWinConditions private boolean _lastOne, _lastThree, _timeoutWin; private boolean _timeoutAfterFirst; + private int _timeout = 3; public ChallengeWinConditions setLastOne(boolean lastOne) { @@ -47,8 +48,20 @@ public class ChallengeWinConditions return this; } + public ChallengeWinConditions setTimeoutAfterFirst(boolean firstHalfWin, int timeout) + { + _timeoutAfterFirst = firstHalfWin; + _timeout = timeout; + return this; + } + public boolean isTimeoutAfterFirst() { return _timeoutAfterFirst; } + + public int getTimeout() + { + return _timeout; + } } diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeIgniteTNT.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeIgniteTNT.java index 8e6c3fa9f..c26816d02 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeIgniteTNT.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeIgniteTNT.java @@ -80,13 +80,13 @@ public class ChallengeIgniteTNT extends Challenge } ItemStack itemStack = player.getItemInHand(); + Block block = event.getClickedBlock(); - if (itemStack == null || itemStack.getType() != Material.FLINT_AND_STEEL || event.getClickedBlock().getType() != Material.TNT) + if (itemStack == null || itemStack.getType() != Material.FLINT_AND_STEEL || block.getType() != Material.TNT || !inArena(block)) { return; } - _game.getManager().runSyncLater(() -> { completePlayer(player, true); diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeIntoVoid.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeIntoVoid.java index 59df00dd4..e884a5602 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeIntoVoid.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeIntoVoid.java @@ -16,7 +16,7 @@ public class ChallengeIntoVoid extends Challenge { super(game, ChallengeType.INTO_VOID); - _winConditions.setTimeoutAfterFirst(true); + _winConditions.setTimeoutAfterFirst(true, 1); } @Override diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeMilkCow.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeMilkCow.java index b21968d46..94bcdc997 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeMilkCow.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengeMilkCow.java @@ -21,7 +21,7 @@ public class ChallengeMilkCow extends Challenge { super(game, ChallengeType.MILK_A_COW); - _winConditions.setTimeoutAfterFirst(true); + _timeout = 2500; } @Override diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengePlayMusic.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengePlayMusic.java index 2c11d6a99..0d145c93d 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengePlayMusic.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengePlayMusic.java @@ -51,6 +51,8 @@ public class ChallengePlayMusic extends Challenge _song = song; _songTick = new HashMap<>(); + + _timeout = 2500; } @Override diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengePole.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengePole.java index d7f4844a0..60f082282 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengePole.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/quick/challenges/ChallengePole.java @@ -25,7 +25,7 @@ public class ChallengePole extends Challenge super(game, ChallengeType.POLE); _timeout = TimeUnit.SECONDS.toMillis(25); - _winConditions.setTimeoutAfterFirst(true); + _winConditions.setTimeoutAfterFirst(true, 1); } @Override diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/reversetag/ReverseTag.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/reversetag/ReverseTag.java index 6af69832c..beb6f1ab3 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/reversetag/ReverseTag.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/reversetag/ReverseTag.java @@ -27,6 +27,7 @@ import mineplex.game.nano.NanoManager; import mineplex.game.nano.game.GameType; import mineplex.game.nano.game.ScoredSoloGame; import mineplex.game.nano.game.event.GameStateChangeEvent; +import mineplex.game.nano.game.event.PlayerStateChangeEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; public class ReverseTag extends ScoredSoloGame @@ -184,4 +185,13 @@ public class ReverseTag extends ScoredSoloGame event.setCancelled(true); } } + + @EventHandler + public void playerQut(PlayerStateChangeEvent event) + { + if (!event.isAlive()) + { + _holders.remove(event.getPlayer()); + } + } } diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/slimecycles/SlimeCycles.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/slimecycles/SlimeCycles.java index fd042262e..0d9d8da73 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/slimecycles/SlimeCycles.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/slimecycles/SlimeCycles.java @@ -154,7 +154,7 @@ public class SlimeCycles extends SoloGame _trailSize++; - if (_trailSize == 60) + if (_trailSize == 100) { getAlivePlayers().forEach(player -> addStat(player, "SlimeCyclesTail", 1, true, false)); } diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/lobby/LobbyManager.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/lobby/LobbyManager.java index 4dfea81e1..0e5d78b18 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/lobby/LobbyManager.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/lobby/LobbyManager.java @@ -11,19 +11,13 @@ import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerLoginEvent; -import org.bukkit.event.player.PlayerLoginEvent.Result; import mineplex.core.ReflectivelyCreateMiniPlugin; -import mineplex.core.account.permissions.Permission; -import mineplex.core.account.permissions.PermissionGroup; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTextMiddle; -import mineplex.core.powerplayclub.PowerPlayClubRepository; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.world.MineplexWorld; @@ -34,48 +28,24 @@ import mineplex.game.nano.NanoPlayer; public class LobbyManager extends GameManager { - public enum Perm implements Permission - { - BETA_WHITELIST, - } - - private final PowerPlayClubRepository _powerPlayClub; - private final MineplexWorld _mineplexWorld; private final Location _spawn; - private boolean _infoTick; + private final String[] _info = + { + "This game goes on forever! If you ever want to cash out on your rewards, you can do so at any time using the " + C.cGreen + "Cash Out Clock" + C.cPurple + " or " + C.cYellow + "/hub" + C.cPurple + "!", + "Suggest new " + C.cGreen + "Nano Games" + C.cPurple + "! We're open to hearing your ideas and changes! Click " + C.cYellowB + "HERE" + C.cPurple + " to go to the forums and suggest them!", + }; + private int _infoTick; private LobbyManager() { super("Lobby"); - _powerPlayClub = new PowerPlayClubRepository(_plugin, _manager.getClientManager(), _manager.getDonationManager()); - _mineplexWorld = new MineplexWorld(Bukkit.getWorlds().get(0)); _spawn = _mineplexWorld.getSpongeLocation("SPAWN"); _mineplexWorld.getWorld().setSpawnLocation(_spawn.getBlockX(), _spawn.getBlockY(), _spawn.getBlockZ()); - - generatePermissions(); - } - - private void generatePermissions() - { - PermissionGroup.TITAN.setPermission(Perm.BETA_WHITELIST, true, true); - } - - @EventHandler(priority = EventPriority.HIGHEST) - public void playerLogin(PlayerLoginEvent event) - { - Player player = event.getPlayer(); - - if (_manager.getClientManager().Get(player).hasPermission(Perm.BETA_WHITELIST) || _powerPlayClub.getCachedData(player).isSubscribed()) - { - return; - } - - event.disallow(Result.KICK_WHITELIST, "Only players with Eternal or PPC can participate in the BETA."); } @EventHandler @@ -86,24 +56,14 @@ public class LobbyManager extends GameManager return; } - String info = C.cPurpleB + "INFO" + C.cDGrayB + "> " + C.cPurple; - - if (_infoTick) - { - info += C.cGreen + "Nano Games" + C.cPurple + " are still in development and do not represent a finished product. You can leave feedback and report bugs " + C.cYellowB + "HERE" + C.cPurple + "."; - } - else - { - info += "This game goes on forever! If you ever want to cash out on your rewards, you can do so at any time using the " + C.cGreen + "Cash Out Clock" + C.cPurple + " or " + C.cYellow + "/hub" + C.cPurple + "!"; - } - - _infoTick = !_infoTick; + String info = C.cPurpleB + "INFO" + C.cDGrayB + "> " + C.cPurple + _info[_infoTick]; + _infoTick = (_infoTick + 1) % _info.length; BaseComponent[] components = TextComponent.fromLegacyText(info); HoverEvent hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Click here to visit the forums.") .color(ChatColor.YELLOW) .create()); - ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.mineplex.com/forums/m/11929946/viewforum/3983713"); + ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.OPEN_URL, "https://mineplex.com/forums/nano-games.388/"); for (BaseComponent component : components) { diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/lobby/ReturnToHubManager.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/lobby/ReturnToHubManager.java index 988e539cc..7d32bd009 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/lobby/ReturnToHubManager.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/lobby/ReturnToHubManager.java @@ -68,7 +68,7 @@ public class ReturnToHubManager extends GameManager sendToHub(caller); } }); - addCommand(new CommandBase(this, Perm.COMMANDS, "favorite", "favoritegames") + addCommand(new CommandBase(this, Perm.COMMANDS, "favorite", "fav") { @Override public void Execute(Player caller, String[] args) @@ -151,7 +151,8 @@ public class ReturnToHubManager extends GameManager PlayerInventory inventory = player.getInventory(); inventory.setItem(8, HUB_CLOCK); - inventory.setItem(7, FAVOURITE_STAR); + _manager.getCosmeticManager().giveInterfaceItem(player); + inventory.setItem(6, FAVOURITE_STAR); } private void sendToHub(Player player) diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/world/GameWorld.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/world/GameWorld.java index 45598aaec..91ff667b2 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/world/GameWorld.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/world/GameWorld.java @@ -138,7 +138,7 @@ public class GameWorld MapUtil.UnloadWorld(_game.getManager().getPlugin(), _world); MapUtil.ClearWorldReferences(_world.getName()); - FileUtil.DeleteFolder(_world.getWorldFolder()); + FileUtil.DeleteFolder(new File(_world.getName())); _world = null; } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/game/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/game/ServerGameMenu.java index e683da7c2..851c15677 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/game/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/game/ServerGameMenu.java @@ -330,7 +330,7 @@ public class ServerGameMenu extends ShopPageBase "", C.cWhite + "Perfect for Solo or Parties of any size." }, null); - add(13, new ItemBuilder(Material.EGG), "Nano Games", C.cYellow + C.Scramble + "ABC" + C.cGreenB + " Nano Games " + C.cYellow + C.Scramble + "DEF" + C.cGray + " Limited Beta Game", new String[] + add(13, new ItemBuilder(Material.EGG), "Nano Games", C.cYellow + C.Scramble + "ABC" + C.cGreenB + " Nano Games " + C.cYellow + C.Scramble + "DEF" + C.cGray + " Beta Game", new String[] { "Game Over? Straight into the next!", "Want to enjoy constant action with no", @@ -339,8 +339,6 @@ public class ServerGameMenu extends ShopPageBase "you're down hit the Cash Out Clock and", "claim your rewards.", "", - C.cWhite + "Limited Beta for " + C.cRedB + "TITAN" + C.cWhite + " and " + C.cAquaB + "PPC" + C.cWhite + "!", - "", C.cWhite + "Perfect for Solo or Parties up to 16." }, "Nano_Games", true);