From 42a0354c9e808e04a93922dfdfcec3d5ad317594 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Mon, 7 Dec 2015 18:28:05 -0500 Subject: [PATCH 01/14] Now Playing, Preference to disable ads --- .../core/notifier/NotificationManager.java | 21 ++++++++++---- .../core/preferences/PreferencesManager.java | 2 +- .../preferences/PreferencesRepository.java | 9 ++++-- .../core/preferences/UserPreferences.java | 1 + .../core/preferences/ui/PreferencesPage.java | 28 +++++++++++++++++-- .../src/mineplex/hub/HubManager.java | 13 +++++++-- .../nautilus/game/arcade/ArcadeManager.java | 4 +-- .../game/arcade/managers/GameManager.java | 5 +--- 8 files changed, 62 insertions(+), 21 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java b/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java index 6c218986e..8e4cb3dc7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/notifier/NotificationManager.java @@ -13,6 +13,7 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.preferences.PreferencesManager; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -21,6 +22,7 @@ public class NotificationManager extends MiniPlugin private boolean _enabled = true; private CoreClientManager _clientManager; + private PreferencesManager _preferencesManager; private String _summerLine = C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" + @@ -30,11 +32,12 @@ public class NotificationManager extends MiniPlugin C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█" + C.cBlack + "█" + C.cYellow + "█"; - public NotificationManager(JavaPlugin plugin, CoreClientManager client) + public NotificationManager(JavaPlugin plugin, CoreClientManager client, PreferencesManager preferencesManager) { super("Notification Manager", plugin); _clientManager = client; + _preferencesManager = preferencesManager; } @EventHandler @@ -55,11 +58,17 @@ public class NotificationManager extends MiniPlugin private void christmasSale() { - Bukkit.broadcastMessage(C.cWhite + " "); - Bukkit.broadcastMessage(C.cRedB + " MASSIVE WINTER SALE"); - Bukkit.broadcastMessage(C.cWhiteB + " 50% OFF ALL RANKS"); - Bukkit.broadcastMessage(" " + C.cGreen + C.Line + "www.mineplex.com/shop"); - Bukkit.broadcastMessage(C.cWhite + " "); + for (Player player : UtilServer.getPlayers()) + { + if (!_preferencesManager.Get(player).DisableAds) + { + player.sendMessage(C.cWhite + " "); + player.sendMessage(C.cRedB + " MASSIVE WINTER SALE"); + player.sendMessage(C.cWhiteB + " 50% OFF ALL RANKS"); + player.sendMessage(" " + C.cGreen + C.Line + "www.mineplex.com/shop"); + player.sendMessage(C.cWhite + " "); + } + } } private void sale() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java index 23d067d8f..ae7f67755 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesManager.java @@ -136,6 +136,6 @@ public class PreferencesManager extends MiniDbClientPlugin @Override public String getQuery(int accountId, String uuid, String name) { - return "SELECT games, visibility, showChat, friendChat, privateMessaging, partyRequests, invisibility, forcefield, showMacReports, ignoreVelocity, pendingFriendRequests, friendDisplayInventoryUI, clanTips, hubMusic FROM accountPreferences WHERE accountPreferences.uuid = '" + uuid + "' LIMIT 1;"; + return "SELECT games, visibility, showChat, friendChat, privateMessaging, partyRequests, invisibility, forcefield, showMacReports, ignoreVelocity, pendingFriendRequests, friendDisplayInventoryUI, clanTips, hubMusic, disableAds FROM accountPreferences WHERE accountPreferences.uuid = '" + uuid + "' LIMIT 1;"; } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesRepository.java index 895555da6..957785cb4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/PreferencesRepository.java @@ -24,7 +24,7 @@ public class PreferencesRepository extends RepositoryBase // DEFAULT 0, showMacReports BOOL NOT NULL DEFAULT 0, ignoreVelocity BOOL // NOT NULL DEFAULT 0, PRIMARY KEY (id), UNIQUE INDEX uuid_index (uuid));"; private static String INSERT_ACCOUNT = "INSERT INTO accountPreferences (uuid) VALUES (?) ON DUPLICATE KEY UPDATE uuid=uuid;"; - private static String UPDATE_ACCOUNT_PREFERENCES = "UPDATE accountPreferences SET games = ?, visibility = ?, showChat = ?, friendChat = ?, privateMessaging = ?, partyRequests = ?, invisibility = ?, forcefield = ?, showMacReports = ?, ignoreVelocity = ?, pendingFriendRequests = ?, friendDisplayInventoryUI = ?, clanTips = ?, hubMusic = ? WHERE uuid=?;"; + private static String UPDATE_ACCOUNT_PREFERENCES = "UPDATE accountPreferences SET games = ?, visibility = ?, showChat = ?, friendChat = ?, privateMessaging = ?, partyRequests = ?, invisibility = ?, forcefield = ?, showMacReports = ?, ignoreVelocity = ?, pendingFriendRequests = ?, friendDisplayInventoryUI = ?, clanTips = ?, hubMusic = ?, disableAds = ? WHERE uuid=?;"; public PreferencesRepository(JavaPlugin plugin) { @@ -62,8 +62,9 @@ public class PreferencesRepository extends RepositoryBase preparedStatement.setBoolean(12, entry.getValue().friendDisplayInventoryUI); preparedStatement.setBoolean(13, entry.getValue().ClanTips); preparedStatement.setBoolean(14, entry.getValue().HubMusic); + preparedStatement.setBoolean(15, entry.getValue().DisableAds); System.out.println(">> " + entry.getValue().ClanTips); - preparedStatement.setString(15, entry.getKey()); + preparedStatement.setString(16, entry.getKey()); preparedStatement.addBatch(); } @@ -91,8 +92,9 @@ public class PreferencesRepository extends RepositoryBase preparedStatement.setBoolean(12, entry.getValue().friendDisplayInventoryUI); preparedStatement.setBoolean(13, entry.getValue().ClanTips); preparedStatement.setBoolean(14, entry.getValue().HubMusic); + preparedStatement.setBoolean(15, entry.getValue().DisableAds); System.out.println(">> " + entry.getValue().ClanTips); - preparedStatement.setString(15, entry.getKey()); + preparedStatement.setString(16, entry.getKey()); preparedStatement.execute(); } @@ -125,6 +127,7 @@ public class PreferencesRepository extends RepositoryBase preferences.friendDisplayInventoryUI = resultSet.getBoolean(12); preferences.ClanTips = resultSet.getBoolean(13); preferences.HubMusic = resultSet.getBoolean(14); + preferences.DisableAds = resultSet.getBoolean(15); System.out.println("<< " + resultSet.getBoolean(13)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/UserPreferences.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/UserPreferences.java index 4036b494f..ee8e1ca3b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/UserPreferences.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/UserPreferences.java @@ -17,4 +17,5 @@ public class UserPreferences public boolean friendDisplayInventoryUI = true; public boolean ClanTips = true; public volatile boolean HubMusic = true; + public boolean DisableAds = false; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java index 27e20e3d6..a6ae4f518 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java @@ -26,6 +26,7 @@ public class PreferencesPage extends ShopPageBase _achievementManager.setGiveInterfaceItem(true); _packetHandler = packetHandler; - new NotificationManager(getPlugin(), clientManager); + new NotificationManager(getPlugin(), clientManager, preferences); new BotSpamManager(plugin, clientManager, punish); ((CraftWorld)Bukkit.getWorlds().get(0)).getHandle().pvpMode = true; @@ -290,6 +291,14 @@ public class HubManager extends MiniClientPlugin NoteSong song = _songs.get(index); if (song != null) { + for (Player player : UtilServer.getPlayers()) + { + if (_preferences.Get(player).HubMusic) + { + UtilTextBottom.display(C.cWhite + "Now Playing " + C.cYellow + song.getName(), player); + } + } + new NotePlayer(_plugin, song, new INoteVerifier() { @Override @@ -1003,7 +1012,7 @@ public class HubManager extends MiniClientPlugin { if (event.getGadget() != null && event.getGadget().getGadgetType() == GadgetType.MusicDisc) { - UtilPlayer.message(event.getPlayer(), F.main("Hub", "Music Discs are disabled right now")); + UtilPlayer.message(event.getPlayer(), F.main("Hub", "Music Discs are disabled right now!")); event.setCancelled(true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 8a852224a..21e3ea398 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -308,8 +308,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation new SoupAddon(plugin, this); new TeamArmorAddon(plugin, this); - new NotificationManager(getPlugin(), clientManager); - +// new NotificationManager(getPlugin(), clientManager); + new BonusManager(plugin, clientManager, serverStatusManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager, giveawayManager); //Champions Modules diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java index ce83a8995..0c7481f59 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java @@ -68,11 +68,8 @@ public class GameManager implements Listener if (event.getType() != UpdateType.MIN_08) return; - if (Manager.GetGame() == null) - return; - for (Player player : UtilServer.getPlayers()) - if (!Manager.GetGame().IsAlive(player)) + if ((Manager.getName() == null || !Manager.GetGame().IsAlive(player)) && !Manager.getPreferences().Get(player).DisableAds) { player.sendMessage(C.cWhite + " "); player.sendMessage(C.cRedB + " MASSIVE WINTER SALE"); From 4ba2e8c96c56f1819407c4e3a4156a9004dc89b6 Mon Sep 17 00:00:00 2001 From: Cheese Date: Tue, 8 Dec 2015 10:31:11 +1100 Subject: [PATCH 02/14] fixed old staff being stuck invis. partially changed scoreboard to show playercount --- .../src/mineplex/hub/HubClient.java | 14 +------------- .../src/mineplex/hub/HubManager.java | 17 ++++++++--------- .../hub/modules/HubVisibilityManager.java | 2 +- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java index 4008f1b63..4b56eff02 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java @@ -22,9 +22,7 @@ public class HubClient public int DisplayLength = 16; private int _lastGemCount = 0; - - private int _lastCoinCount = 0; - + public HubClient(String name) { ScoreboardString = " Welcome " + name + ", to the Mineplex Network!"; @@ -133,14 +131,4 @@ public class HubClient return display; } - - public void SetLastCoinCount(int coins) - { - _lastCoinCount = coins; - } - - public int GetLastCoinCount() - { - return _lastCoinCount; - } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index ea96b4c65..8e78486e7 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -165,7 +165,7 @@ public class HubManager extends MiniClientPlugin private HashMap _scoreboards = new HashMap(); private String _serverName = ""; - + private int _lastPlayerCount = 0; private boolean _shuttingDown; private HashMap _portalTime = new HashMap(); @@ -719,15 +719,14 @@ public class HubManager extends MiniClientPlugin //Space obj.getScore(" ").setScore(line--); - //Coins - obj.getScore(C.cYellow + C.Bold + "Coins").setScore(line--); + //Players + obj.getScore(C.cYellow + C.Bold + "Players").setScore(line--); - // Remove Old - player.getScoreboard().resetScores(Get(player.getName()).GetLastCoinCount() + ""); - // Add New - obj.getScore(GetDonation().Get(player.getName()).getCoins() + "").setScore(line--); - - Get(player.getName()).SetLastCoinCount(GetDonation().Get(player.getName()).getCoins()); + player.getScoreboard().resetScores(_lastPlayerCount + ""); + + _lastPlayerCount++; + + obj.getScore(_lastPlayerCount + "").setScore(line--); //Space diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java index db7624cd9..1733a2fcc 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java @@ -65,7 +65,7 @@ public class HubVisibilityManager extends MiniPlugin { boolean hideMe = Manager.GetTutorial().InTutorial(player) || UtilMath.offset2d(player.getLocation(), Manager.GetSpawn()) == 0 || - Manager.getPreferences().Get(player).Invisibility || + (Manager.getPreferences().Get(player).Invisibility && Manager.GetClients().Get(player).GetRank().has(Rank.MODERATOR)) || _hiddenPlayers.contains(player); for (Player other : UtilServer.getPlayers()) From fe1f763374bcaf0b98839715b97ed7c81131b87e Mon Sep 17 00:00:00 2001 From: Cheese Date: Tue, 8 Dec 2015 15:26:32 +1100 Subject: [PATCH 03/14] changed order blocks will be added to the list --- .../src/mineplex/core/common/util/UtilBlock.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java index da7bc464c..8f3b37176 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java @@ -552,8 +552,8 @@ public class UtilBlock if (diagonals) { for (int x = -1; x <= 1; x++) - for (int y = -1; y <= 1; y++) - for (int z = -1; z <= 1; z++) + for (int z = -1; z <= 1; z++) + for (int y = 1; y >= -1; y--) { if (x == 0 && y == 0 && z == 0) continue; @@ -563,11 +563,11 @@ public class UtilBlock else { blocks.add(block.getRelative(BlockFace.UP)); - blocks.add(block.getRelative(BlockFace.DOWN)); blocks.add(block.getRelative(BlockFace.NORTH)); blocks.add(block.getRelative(BlockFace.SOUTH)); blocks.add(block.getRelative(BlockFace.EAST)); blocks.add(block.getRelative(BlockFace.WEST)); + blocks.add(block.getRelative(BlockFace.DOWN)); } return blocks; From a84f580719d1b221bbcaa49cd19d4251defa3b11 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 8 Dec 2015 05:45:26 -0500 Subject: [PATCH 04/14] Update IntelliJ to Java 8 --- Plugins/.idea/compiler.xml | 3 ++- Plugins/.idea/misc.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/.idea/compiler.xml b/Plugins/.idea/compiler.xml index 30263f09d..b232f8467 100644 --- a/Plugins/.idea/compiler.xml +++ b/Plugins/.idea/compiler.xml @@ -5,6 +5,7 @@ + @@ -28,7 +29,7 @@ - + - + \ No newline at end of file From b22c64ca6a5419e6b23abea1681cc750d15b6d37 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 8 Dec 2015 05:51:21 -0500 Subject: [PATCH 05/14] Fix excludes --- Plugins/.idea/compiler.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/Plugins/.idea/compiler.xml b/Plugins/.idea/compiler.xml index b232f8467..df8666836 100644 --- a/Plugins/.idea/compiler.xml +++ b/Plugins/.idea/compiler.xml @@ -5,7 +5,6 @@ - From addb2c8c0e91c5ac1162d5d09ed1cca5b4611910 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 8 Dec 2015 08:02:40 -0500 Subject: [PATCH 06/14] Fix java 8 compiler issue --- .../game/arcade/game/games/smash/perks/PerkCowAngryHerd.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkCowAngryHerd.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkCowAngryHerd.java index 79f51f53b..d398bba74 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkCowAngryHerd.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkCowAngryHerd.java @@ -87,7 +87,8 @@ public class PerkCowAngryHerd extends SmashPerk loc.add(UtilAlg.getLeft(dir).multiply(i*1.5)); Manager.GetGame().CreatureAllowOverride = true; - Cow cow = player.getWorld().spawn(loc, isSuperActive(player) ? MushroomCow.class : Cow.class); + Class clazz = isSuperActive(player) ? MushroomCow.class : Cow.class; + Cow cow = player.getWorld().spawn(loc, clazz); Manager.GetGame().CreatureAllowOverride = false; _active.add(new DataCowCharge(player, cow)); From a1915e324c4a7af83142cd83a518c101b925966b Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 8 Dec 2015 08:42:45 -0500 Subject: [PATCH 07/14] Some java 8 code --- .../mineplex/core/common/util/UtilServer.java | 7 ++ .../mineplex/core/noteblock/NotePlayer.java | 94 ++++++++----------- 2 files changed, 45 insertions(+), 56 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilServer.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilServer.java index c56faa15a..79f248c3d 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilServer.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilServer.java @@ -1,10 +1,12 @@ package mineplex.core.common.util; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.LinkedList; import java.util.List; +import java.util.stream.Stream; import org.bukkit.Bukkit; import org.bukkit.Server; @@ -18,6 +20,11 @@ public class UtilServer return getServer().getOnlinePlayers().toArray(new Player[0]); } + public static Collection getPlayersCollection() + { + return getServer().getOnlinePlayers(); + } + public static List getSortedPlayers() { return getSortedPlayers(new Comparator() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/noteblock/NotePlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/noteblock/NotePlayer.java index 941bc1dd9..70e5a8c1f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/noteblock/NotePlayer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/noteblock/NotePlayer.java @@ -1,7 +1,10 @@ package mineplex.core.noteblock; import java.util.ArrayList; +import java.util.Collection; import java.util.List; +import java.util.Objects; +import java.util.stream.Stream; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; @@ -40,78 +43,57 @@ public class NotePlayer private void startThread() { - Thread thread = new Thread(new Runnable() - { - @Override - public void run() + Thread thread = new Thread(() -> { + while (!_finished) { - long startTime = System.currentTimeMillis(); - while (!_finished) + _tick++; + if (_tick > _song.getLength()) { - _tick++; - if (_tick > _song.getLength()) + if (_loop) { - if (_loop) - { - _tick = 1; - } - else - { - _finished = true; - - _plugin.getServer().getScheduler().runTask(_plugin, new Runnable() - { - @Override - public void run() - { - SongFinishEvent event = new SongFinishEvent(_song); - _plugin.getServer().getPluginManager().callEvent(event); - } - }); - - return; - } + _tick = 1; } - - playTick(_tick); - - try + else { - Thread.sleep(_sleepMs); - } - catch (InterruptedException e) - { - e.printStackTrace(); + _finished = true; + + _plugin.getServer().getScheduler().runTask(_plugin, () -> { + SongFinishEvent event = new SongFinishEvent(_song); + _plugin.getServer().getPluginManager().callEvent(event); + }); + + return; } } + + playTick(_tick); + + try + { + Thread.sleep(_sleepMs); + } + catch (InterruptedException e) + { + e.printStackTrace(); + } } }); thread.start(); } + private void playNote(Note note, float volume, Collection players) + { + players.stream().filter(_verifier::shouldPlay).forEach((player) -> + player.playSound(player.getEyeLocation(), UtilNote.getInstrumentSound(note.getInstrument()), volume, (float) UtilNote.getPitch(note.getNote() - 33))); + } + private void playTick(int tick) { - Player[] playerArray = UtilServer.getPlayers(); - List players = new ArrayList<>(playerArray.length); - for (Player player : playerArray) - { - if (_verifier.shouldPlay(player)) - players.add(player); - } + Collection players = UtilServer.getPlayersCollection(); - for (NoteLayer layer : _song.getLayers()) - { - Note note = layer.getNote(tick); - if (note != null) - { - float volume = _volumeMult * (layer.getVolume() / 100F); - for (Player player : players) - { - player.playSound(player.getEyeLocation(), UtilNote.getInstrumentSound(note.getInstrument()), volume, (float) UtilNote.getPitch(note.getNote() - 33)); - } - } - } + float volume = _volumeMult * 1F; + _song.getLayers().stream().map(layer -> layer.getNote(tick)).filter(Objects::nonNull).forEach((note) -> playNote(note, volume, players)); } public void cancel() From 2bf1012fa41ec41d71e8bea7489786bd6ea21805 Mon Sep 17 00:00:00 2001 From: Teddy Date: Tue, 8 Dec 2015 16:34:07 +0000 Subject: [PATCH 08/14] SSM Pig bomb bug fix --- .../mineplex/core/common/util/UtilPlayer.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java index af1712362..8f4e98a6a 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java @@ -1,5 +1,7 @@ package mineplex.core.common.util; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.LinkedList; @@ -496,6 +498,20 @@ public class UtilPlayer return best; } + private static boolean checkClosest(Player player, Entity... ignore) + { + for(Entity e : ignore) + { + if(e instanceof Player) + { + if(e == player) + return true; + } + } + + return false; + } + public static Player getClosest(Location loc, Entity... ignore) { Player best = null; @@ -509,6 +525,9 @@ public class UtilPlayer if (cur.isDead()) continue; + if(checkClosest(cur, ignore)) + continue; + if (ignore != null) { for (int i = 0; i < ignore.length; i++) From 504a49278cb7e140029e4c2ceb85f3defe524a33 Mon Sep 17 00:00:00 2001 From: Teddy Date: Tue, 8 Dec 2015 16:35:49 +0000 Subject: [PATCH 09/14] SSM kit description change, grammar mistake --- .../src/nautilus/game/arcade/game/games/smash/kits/KitPig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitPig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitPig.java index 755cfa69d..4ae1fcb33 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitPig.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitPig.java @@ -62,7 +62,7 @@ public class KitPig extends SmashKit ChatColor.RESET + "dealing damage and knockback to enemies.", ChatColor.RESET + "", ChatColor.RESET + "Eat the bacon to restore some Energy.", - ChatColor.RESET + "Bacon that hit an enemy will restore Health.", + ChatColor.RESET + "Bacon that hits an enemy will restore Health.", })); From 09d8367b4baa87630524cd9c2b11685dc7ad764d Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 9 Dec 2015 07:32:36 +1100 Subject: [PATCH 10/14] fixed method --- .../mineplex/core/common/util/UtilPlayer.java | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java index 8f4e98a6a..f1e17e2df 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java @@ -498,20 +498,6 @@ public class UtilPlayer return best; } - private static boolean checkClosest(Player player, Entity... ignore) - { - for(Entity e : ignore) - { - if(e instanceof Player) - { - if(e == player) - return true; - } - } - - return false; - } - public static Player getClosest(Location loc, Entity... ignore) { Player best = null; @@ -525,16 +511,21 @@ public class UtilPlayer if (cur.isDead()) continue; - if(checkClosest(cur, ignore)) - continue; - + //Ignore Check if (ignore != null) { - for (int i = 0; i < ignore.length; i++) + boolean shouldIgnore = false; + for (Entity ent : ignore) { - if (cur.equals(ignore[i])) - continue; + if (cur.equals(ent)) + { + shouldIgnore = true; + break; + } } + + if (shouldIgnore) + continue; } double dist = UtilMath.offset(cur.getLocation(), loc); From 2decc049c5af3786d4326e74f50bf5e0ca485450 Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 9 Dec 2015 07:47:07 +1100 Subject: [PATCH 11/14] fixed my muddling of perks --- .../game/games/monsterleague/kits/KitEnderman.java | 5 ++--- ...{PerkBlink.java => PerkBlinkMonsterLeague.java} | 8 +++----- .../nautilus/game/arcade/kit/perks/PerkBlink.java | 14 ++++++++++---- 3 files changed, 15 insertions(+), 12 deletions(-) rename Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/perks/{PerkBlink.java => PerkBlinkMonsterLeague.java} (94%) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/kits/KitEnderman.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/kits/KitEnderman.java index 20796f801..5f1c52111 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/kits/KitEnderman.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/kits/KitEnderman.java @@ -6,12 +6,11 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.C; -import mineplex.core.disguise.disguises.DisguiseEnderman; import mineplex.core.itemstack.ItemStackFactory; import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.game.games.monsterleague.perks.PerkBlinkMonsterLeague; import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.Perk; -import nautilus.game.arcade.kit.perks.PerkBlink; import nautilus.game.arcade.kit.perks.PerkDoubleJump; public class KitEnderman extends LeagueKit @@ -28,7 +27,7 @@ public class KitEnderman extends LeagueKit new Perk[] { new PerkDoubleJump("Double Jump", 1, 1, true), - new PerkBlink("Blink", 32, 16000), + new PerkBlinkMonsterLeague("Blink", 32, 16000), }, EntityType.ENDERMAN, new ItemStack(Material.AIR), 1.4); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/perks/PerkBlink.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/perks/PerkBlinkMonsterLeague.java similarity index 94% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/perks/PerkBlink.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/perks/PerkBlinkMonsterLeague.java index 75e0654a9..de32a72e1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/perks/PerkBlink.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monsterleague/perks/PerkBlinkMonsterLeague.java @@ -19,14 +19,15 @@ import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilPlayer; import mineplex.core.recharge.Recharge; +import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.SmashPerk; -public class PerkBlink extends SmashPerk +public class PerkBlinkMonsterLeague extends Perk { private double _range = 32; private long _recharge = 24000; - public PerkBlink(String name, double range, long recharge) + public PerkBlinkMonsterLeague(String name, double range, long recharge) { super("Blink", new String[] { @@ -51,9 +52,6 @@ public class PerkBlink extends SmashPerk return; Player player = event.getPlayer(); - - if (isSuperActive(player)) - return; if (!Kit.HasKit(player)) return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlink.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlink.java index 4890bc63e..dfbc490a4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlink.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlink.java @@ -17,11 +17,12 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilPlayer; import mineplex.core.recharge.Recharge; -import nautilus.game.arcade.kit.Perk; +import nautilus.game.arcade.kit.SmashPerk; -public class PerkBlink extends Perk +public class PerkBlink extends SmashPerk { private String _name = ""; private double _range; @@ -45,17 +46,22 @@ public class PerkBlink extends Perk if (event.isCancelled()) return; - if (event.getAction() != Action.LEFT_CLICK_AIR && event.getAction() != Action.LEFT_CLICK_BLOCK && - event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK) + if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK) return; if (UtilBlock.usable(event.getClickedBlock())) return; + + if (!UtilGear.isAxe(event.getPlayer().getItemInHand())) + return; Player player = event.getPlayer(); if (!Kit.HasKit(player)) return; + + if (isSuperActive(player)) + return; if (!Recharge.Instance.use(player, _name, _recharge, true, true)) return; From fba88ec231a1aa2a68868faa7e6436c4448da0b5 Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 9 Dec 2015 08:19:55 +1100 Subject: [PATCH 12/14] mount stuff is fixed --- .../mineplex/core/mount/types/MountCart.java | 2 +- .../mineplex/core/mount/types/MountSlime.java | 98 ++++++++++--------- 2 files changed, 51 insertions(+), 49 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java index 3abbf00e0..f5aa7f809 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java @@ -75,7 +75,7 @@ public class MountCart extends Mount> if (event.getRightClicked() == null) return; - SingleEntityMountData mount = GetActive().get(event.getPlayer()); + SingleEntityMountData mount = getMountData(event.getRightClicked()); if(mount == null) return; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java index 2a0b3831a..e8a1bd649 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java @@ -30,11 +30,11 @@ public class MountSlime extends Mount> { super(manager, "Slime Mount", Material.SLIME_BALL, (byte)0, new String[] { - ChatColor.RESET + "Bounce around on your very", - ChatColor.RESET + "own personal slime friend!", + ChatColor.RESET + "Bounce around on your very", + ChatColor.RESET + "own personal slime friend!", }, 15000); - + KnownPackage = false; } @@ -42,153 +42,155 @@ public class MountSlime extends Mount> { player.leaveVehicle(); player.eject(); - + //Remove other mounts Manager.DeregisterAll(player); - + SingleEntityMountData mount = new SingleEntityMountData(player, player.getWorld().spawn(player.getLocation(), Slime.class)); mount.getEntity().setSize(2); - + mount.getEntity().setCustomName(player.getName() + "'s " + GetName()); //Inform UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + ".")); - + //Store _active.put(player, mount); } - + public void Disable(Player player) { SingleEntityMountData mount = _active.remove(player); if (mount != null) { mount.remove(); - + //Inform UtilPlayer.message(player, F.main("Mount", "You despawned " + F.elem(GetName()) + ".")); - + Manager.removeActive(player); } } - + @EventHandler public void interactMount(PlayerInteractEntityEvent event) { if (event.getRightClicked() == null) return; - - if (!GetActive().containsKey(event.getPlayer())) - return; - - if(!GetActive().get(event.getPlayer()).ownsMount(event.getPlayer())) - return; - + + SingleEntityMountData data = GetActive().get(event.getPlayer()); + + if(data == null) return; + + if(!data.ownsMount(event.getPlayer())) return; + + if(!data.isPartOfMount(event.getRightClicked())) return; + event.getPlayer().leaveVehicle(); event.getPlayer().eject(); - + event.getRightClicked().setPassenger(event.getPlayer()); } - + @EventHandler public void target(EntityTargetEvent event) { if (!GetActive().containsKey(event.getTarget())) return; - + if (!GetActive().get(event.getTarget()).equals(event.getEntity())) event.setCancelled(true); } - + @EventHandler public void updateBounce(UpdateEvent event) { if (event.getType() != UpdateType.TICK) return; - + //Bounce for (SingleEntityMountData slimeData : GetActive().values()) { Slime slime = slimeData.getEntity(); - + if (slime.getPassenger() == null) { UtilEnt.setFakeHead(slime, false); continue; } - + if (!UtilEnt.isGrounded(slime)) continue; - + if (!(slime.getPassenger() instanceof Player)) continue; - + Player player = (Player)slime.getPassenger(); - + if (!Recharge.Instance.use(player, GetName(), 200, false, false)) continue; Vector dir = slime.getPassenger().getLocation().getDirection(); - + UtilAction.velocity(slime, dir, 1, true, 0, 0.4, 1, true); - + UtilEnt.CreatureForceLook(slime, 0, UtilAlg.GetYaw(dir)); - + slime.getWorld().playSound(slime.getLocation(), Sound.SLIME_WALK, 1f, 0.75f); } - + //Collide for (SingleEntityMountData slimeData : GetActive().values()) { Slime slime = slimeData.getEntity(); if (slime.getPassenger() == null) continue; - + if (!(slime.getPassenger() instanceof Player)) continue; - + Player player = (Player)slime.getPassenger(); - + if (!Recharge.Instance.usable(player, GetName() + " Collide")) continue; - + for (SingleEntityMountData otherSlime : GetActive().values()) { Slime other = otherSlime.getEntity(); - + if (other.equals(slime)) continue; - + if (other.getPassenger() == null) continue; - + if (!(other.getPassenger() instanceof Player)) continue; - + Player otherPlayer = (Player)other.getPassenger(); - + if (!Recharge.Instance.usable(otherPlayer, GetName() + " Collide")) continue; - + //Collide if (UtilMath.offset(slime, other) > 2) continue; - + Recharge.Instance.useForce(player, GetName() + " Collide", 500); Recharge.Instance.useForce(otherPlayer, GetName() + " Collide", 500); - + UtilAction.velocity(slime, UtilAlg.getTrajectory(other, slime), 1.2, false, 0, 0.8, 10, true); UtilAction.velocity(other, UtilAlg.getTrajectory(slime, other), 1.2, false, 0, 0.8, 10, true); - + slime.getWorld().playSound(slime.getLocation(), Sound.SLIME_ATTACK, 1f, 0.5f); slime.getWorld().playSound(slime.getLocation(), Sound.SLIME_WALK, 1f, 0.5f); other.getWorld().playSound(other.getLocation(), Sound.SLIME_WALK, 1f, 0.5f); - + slime.playEffect(EntityEffect.HURT); other.playEffect(EntityEffect.HURT); } } } - - + + } From 26c5c419f8ee1c75357063822608f525bfab438a Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 9 Dec 2015 08:38:05 +1100 Subject: [PATCH 13/14] fixed a bug where old displayName would be used after name was updated. --- .../src/nautilus/game/arcade/game/Game.java | 18 ++++++++++++++++++ .../nautilus/game/arcade/game/GameTeam.java | 9 ++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index 7616b98ad..edf144f5e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -36,6 +36,7 @@ import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.hanging.HangingBreakEvent; import org.bukkit.event.hanging.HangingPlaceEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerQuitEvent; @@ -1723,4 +1724,21 @@ public abstract class Game implements Listener } } } + + @EventHandler + public void debug(PlayerCommandPreprocessEvent event) + { + if (event.getMessage().equals("/debugteams")) + { + for (GameTeam team : GetTeamList()) + { + event.getPlayer().sendMessage(team.GetFormattedName()); + + for (Player player : team.GetPlayers(false)) + { + event.getPlayer().sendMessage(player.getName() + ": " + team.IsAlive(player)); + } + } + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java index ddbd4f68c..7d8264b88 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameTeam.java @@ -79,7 +79,7 @@ public class GameTeam { Host = host; - _displayName = name; + _displayName = null; _name = name; _color = color; _spawns = spawns; @@ -178,7 +178,7 @@ public class GameTeam { _players.put(player, in ? PlayerState.IN : PlayerState.OUT); - UtilPlayer.message(player, F.main("Team", _color + C.Bold + "You joined " + _displayName + " Team.")); + UtilPlayer.message(player, F.main("Team", _color + C.Bold + "You joined " + getDisplayName() + " Team.")); VisibilityManager.Instance.refreshPlayerToAll(player); } @@ -192,7 +192,7 @@ public class GameTeam other.getScoreboard().getTeam(Host.Manager.GetClients().Get(player).GetRank().Name + _name.toUpperCase()).removePlayer(player); other.getScoreboard().getTeam(Host.Manager.GetClients().Get(player).GetRank().Name).addPlayer(player); } - UtilPlayer.message(player, F.main("Team", _color + C.Bold + _displayName + " Team was disbanded.")); + UtilPlayer.message(player, F.main("Team", _color + C.Bold + getDisplayName() + " Team was disbanded.")); } _players.clear(); @@ -323,6 +323,9 @@ public class GameTeam public String getDisplayName() { + if (_displayName == null) + return _name; + return _displayName; } From 2e496110355bf265705015b054b63e9c85f75af2 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 8 Dec 2015 17:45:27 -0500 Subject: [PATCH 14/14] LinkedHashMaps, Buttons --- .../hub/server/ui/ServerGameMenu.java | 6 +++-- .../hub/server/ui/button/SelectBHButton.java | 23 +++++++++++++++++++ .../hub/server/ui/button/SelectMSButton.java | 23 +++++++++++++++++++ .../nautilus/game/arcade/world/WorldData.java | 8 +++---- 4 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectBHButton.java create mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectMSButton.java diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 3cafbb8bf..4e3bc8320 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -14,12 +14,14 @@ import mineplex.core.donation.DonationManager; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.shop.page.ShopPageBase; import mineplex.hub.server.ServerManager; +import mineplex.hub.server.ui.button.SelectBHButton; import mineplex.hub.server.ui.button.SelectBLDButton; import mineplex.hub.server.ui.button.SelectBRButton; import mineplex.hub.server.ui.button.SelectCSButton; import mineplex.hub.server.ui.button.SelectDMTButton; import mineplex.hub.server.ui.button.SelectDOMButton; import mineplex.hub.server.ui.button.SelectMINButton; +import mineplex.hub.server.ui.button.SelectMSButton; import mineplex.hub.server.ui.button.SelectPLAYERButton; import mineplex.hub.server.ui.button.SelectSGButton; import mineplex.hub.server.ui.button.SelectSKYButton; @@ -193,9 +195,9 @@ public class ServerGameMenu extends ShopPageBase getButtonMap().put(8, new SelectWIZButton(this)); getButtonMap().put(18, new SelectCSButton(this)); -// getButtonMap().put(20, new SelectBHButton(this)); + getButtonMap().put(20, new SelectBHButton(this)); getButtonMap().put(22, new SelectSSMButton(this)); -// getButtonMap().put(24, new SelectMSButton(this)); + getButtonMap().put(24, new SelectMSButton(this)); getButtonMap().put(26, new SelectDMTButton(this)); getButtonMap().put(36, new SelectDOMButton(this)); getButtonMap().put(38, new SelectTDMButton(this)); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectBHButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectBHButton.java new file mode 100644 index 000000000..fea9423b6 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectBHButton.java @@ -0,0 +1,23 @@ +package mineplex.hub.server.ui.button; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.shop.item.IButton; +import mineplex.hub.server.ui.ServerGameMenu; + +public class SelectBHButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectBHButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void onClick(Player player, ClickType clickType) + { + _menu.OpenBH(player); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectMSButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectMSButton.java new file mode 100644 index 000000000..ca500cb25 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectMSButton.java @@ -0,0 +1,23 @@ +package mineplex.hub.server.ui.button; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.shop.item.IButton; +import mineplex.hub.server.ui.ServerGameMenu; + +public class SelectMSButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectMSButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void onClick(Player player, ClickType clickType) + { + _menu.openMS(player); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/world/WorldData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/world/WorldData.java index 068035b74..74242f538 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/world/WorldData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/world/WorldData.java @@ -54,10 +54,10 @@ public class WorldData public GameType Game = null; - public HashMap> SpawnLocs = new HashMap>(); - private HashMap> DataLocs = new HashMap>(); - private HashMap> CustomLocs = new HashMap>(); - private final Map _dataEntries = new HashMap<>(); + public HashMap> SpawnLocs = new LinkedHashMap>(); + private HashMap> DataLocs = new LinkedHashMap>(); + private HashMap> CustomLocs = new LinkedHashMap>(); + private final Map _dataEntries = new LinkedHashMap<>(); public WorldData(Game game) {