From d7eec02bdd8229ef7a2a0aa29c98e4b93676ab9f Mon Sep 17 00:00:00 2001 From: Alexander Meech Date: Thu, 15 Feb 2018 04:55:40 -0500 Subject: [PATCH] Remove PlayWire (#585) --- .../mineplex/core/bonuses/BonusManager.java | 18 +- .../mineplex/core/bonuses/gui/BonusGui.java | 12 +- .../bonuses/gui/buttons/PlayWireButton.java | 94 -------- .../core/playwire/PlayWireClientData.java | 40 ---- .../core/playwire/PlayWireCommand.java | 34 --- .../core/playwire/PlayWireManager.java | 206 ------------------ .../core/playwire/PlayWireRepository.java | 61 ------ .../mineplex/core/playwire/ResponseType.java | 35 --- Plugins/Mineplex.Hub.Clans/plugin.yml | 2 - .../src/mineplex/clanshub/HubManager.java | 4 +- Plugins/Mineplex.Hub/plugin.yml | 2 - .../src/mineplex/hub/HubManager.java | 4 +- Plugins/Nautilus.Game.Arcade/plugin.yml | 2 - .../nautilus/game/arcade/ArcadeManager.java | 4 +- Plugins/mineplex-game-gemhunters/plugin.yml | 2 - 15 files changed, 11 insertions(+), 509 deletions(-) delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PlayWireButton.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireClientData.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireCommand.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireManager.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireRepository.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/playwire/ResponseType.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java index eda71defc..d869ba17e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java @@ -69,7 +69,6 @@ import mineplex.core.inventory.InventoryManager; import mineplex.core.npc.Npc; import mineplex.core.npc.NpcManager; import mineplex.core.pet.PetManager; -import mineplex.core.playwire.PlayWireManager; import mineplex.core.poll.PollManager; import mineplex.core.powerplayclub.PowerPlayClubRepository; import mineplex.core.recharge.Recharge; @@ -151,7 +150,6 @@ public class BonusManager extends MiniClientPlugin implements I private TreasureRewardManager _rewardManager; private StatsManager _statsManager; private YoutubeManager _youtubeManager; - private PlayWireManager _playWireManager; private PowerPlayClubRepository _powerPlayClubRepository; private ThankManager _thankManager; public boolean _enabled; @@ -202,7 +200,7 @@ public class BonusManager extends MiniClientPlugin implements I generatePermissions(); } - public BonusManager(JavaPlugin plugin, Location carlLocation, PlayWireManager playWireManager, CoreClientManager clientManager, DonationManager donationManager, PollManager pollManager, NpcManager npcManager, HologramManager hologramManager, StatsManager statsManager, InventoryManager inventoryManager, PetManager petManager, YoutubeManager youtubeManager, GadgetManager gadgetManager, ThankManager thankManager, String creeperName) + public BonusManager(JavaPlugin plugin, Location carlLocation, CoreClientManager clientManager, DonationManager donationManager, PollManager pollManager, NpcManager npcManager, HologramManager hologramManager, StatsManager statsManager, InventoryManager inventoryManager, PetManager petManager, YoutubeManager youtubeManager, GadgetManager gadgetManager, ThankManager thankManager, String creeperName) { super("Bonus", plugin); _repository = new BonusRepository(plugin, this, donationManager); @@ -225,8 +223,6 @@ public class BonusManager extends MiniClientPlugin implements I _statsManager = statsManager; _youtubeManager = youtubeManager; - _playWireManager = playWireManager; - _powerPlayClubRepository = new PowerPlayClubRepository(plugin, _clientManager, _donationManager); ClansBonus = _plugin.getClass().getSimpleName().equalsIgnoreCase("ClansHub"); @@ -974,7 +970,7 @@ public class BonusManager extends MiniClientPlugin implements I if (entity.equals(_carlNpc.getEntity())) { updateDailyStreak(player); - new BonusGui(_plugin, player, this, _rewardManager, _youtubeManager, _thankManager, _playWireManager).openInventory(); + new BonusGui(_plugin, player, this, _rewardManager, _youtubeManager, _thankManager).openInventory(); } } @@ -1010,7 +1006,6 @@ public class BonusManager extends MiniClientPlugin implements I int availableRewards = 0; if (canVote(player)) availableRewards++; - if (_playWireManager.Get(player) != null && _playWireManager.Get(player).getAccountId() != -1 && _playWireManager.canRedeemTickets(_playWireManager.Get(player))) availableRewards++; if (_youtubeManager.canYoutube(player)) availableRewards++; if (canRank(player) && _clientManager.Get(player).hasPermission(Perm.MONTHLY_BONUS) && isPastAugust()) availableRewards++; if (canDaily(player)) availableRewards++; @@ -1161,7 +1156,7 @@ public class BonusManager extends MiniClientPlugin implements I { if (Recharge.Instance.use(player, "Carl Inform", 240000, false, false)) { - if (_pollManager.hasPoll(player) || canVote(player) || _youtubeManager.canYoutube(player) || (_playWireManager.Get(player) != null && _playWireManager.Get(player).getAccountId() != -1 && _playWireManager.canRedeemTickets(_playWireManager.Get(player))) || (canRank(player) && _clientManager.Get(player).hasPermission(Perm.MONTHLY_BONUS) && isPastAugust()) || canDaily(player) || PowerPlayClubButton.isAvailable(player, _powerPlayClubRepository)) + if (_pollManager.hasPoll(player) || canVote(player) || _youtubeManager.canYoutube(player) || (canRank(player) && _clientManager.Get(player).hasPermission(Perm.MONTHLY_BONUS) && isPastAugust()) || canDaily(player) || PowerPlayClubButton.isAvailable(player, _powerPlayClubRepository)) { if (_showCarl.containsKey(player.getName())) { @@ -1233,11 +1228,6 @@ public class BonusManager extends MiniClientPlugin implements I return _inventoryManager; } - public PlayWireManager getPlayWireManager() - { - return _playWireManager; - } - public Location getCarlLocation() { return _carlLocation; @@ -1252,4 +1242,4 @@ public class BonusManager extends MiniClientPlugin implements I { return _carlNpc; } -} \ No newline at end of file +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/BonusGui.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/BonusGui.java index efc458ee0..1095a1716 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/BonusGui.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/BonusGui.java @@ -16,14 +16,13 @@ import mineplex.core.bonuses.gui.buttons.TwitterButton; import mineplex.core.bonuses.gui.buttons.VoteButton; import mineplex.core.bonuses.gui.buttons.YoutubeButton; import mineplex.core.gui.SimpleGui; -import mineplex.core.playwire.PlayWireManager; import mineplex.core.thank.ThankManager; import mineplex.core.treasure.reward.TreasureRewardManager; import mineplex.core.youtube.YoutubeManager; public class BonusGui extends SimpleGui { - private final int VOTE_SLOT = 40; + private final int VOTE_SLOT = 32; private final int RANK_BONUS_SLOT = 10; private final int DAILY_BONUS_SLOT = 12; private final int POLL_SLOT = 28; @@ -33,11 +32,10 @@ public class BonusGui extends SimpleGui private final int CARL_SPINNER_SLOT = 14; private final int YOUTUBE_SLOT = 24; private final int TWITTER_SLOT = 34; - private final int PLAY_WIRE_SLOT = 32; - private static final int INV_SIZE = 54; + private static final int INV_SIZE = 45; - public BonusGui(Plugin plugin, Player player, BonusManager manager, TreasureRewardManager rewardManager, YoutubeManager youtubeManager, ThankManager thankManager, PlayWireManager playWireManager) + public BonusGui(Plugin plugin, Player player, BonusManager manager, TreasureRewardManager rewardManager, YoutubeManager youtubeManager, ThankManager thankManager) { super(plugin, player, player.getName() + "'s Bonuses", INV_SIZE); @@ -60,8 +58,6 @@ public class BonusGui extends SimpleGui setItem(POWER_PLAY_SLOT, new PowerPlayClubButton(player, manager)); setItem(CARL_SPINNER_SLOT, new CarlSpinButton(getPlugin(), player, manager, rewardManager)); - - setItem(PLAY_WIRE_SLOT, new PlayWireButton(playWireManager, player)); } @Override @@ -69,4 +65,4 @@ public class BonusGui extends SimpleGui { super.finalize(); } -} \ No newline at end of file +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PlayWireButton.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PlayWireButton.java deleted file mode 100644 index ae4c59806..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PlayWireButton.java +++ /dev/null @@ -1,94 +0,0 @@ -package mineplex.core.bonuses.gui.buttons; - -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.inventory.ItemStack; - -import mineplex.core.common.util.C; -import mineplex.core.gui.GuiItem; -import mineplex.core.itemstack.ItemBuilder; -import mineplex.core.playwire.PlayWireManager; -import mineplex.core.recharge.Recharge; - -/** - * - */ -public class PlayWireButton implements GuiItem -{ - - private static final ItemStack DISABLED_ICON = new ItemBuilder(Material.REDSTONE_BLOCK) - .setTitle(C.cGreen + C.Bold + "Watch an Ad!") - .addLore( - C.cWhite + "You have already redeemed your", - C.cWhite + "rewards for watching the Ads!", - " ", - C.cWhite + "You can watch some more, but you won't earn any rewards!", - " ", - C.cWhite + "You can watch 5 Ads every 24 hours.", - " ", - C.cWhite + "Ads help us keep Mineplex awesome", - C.cRedB + "Be sure to have your AdBlocker disabled!", - " ", - C.cGreen + "Click to watch the Ad now!" - ) - .build(); - - private static final ItemStack ENABLED_ICON = new ItemBuilder(Material.TRIPWIRE_HOOK) - .setTitle(C.cGreen + C.Bold + "Watch an Ad!") - .addLore( - C.cYellow + "Earn 1 Carl Spin Ticket", - C.cWhite + "by checking out our partner's Advertisement", - " ", - C.cWhite + "You can watch 5 Ads every 24 hours.", - " ", - C.cWhite + "Ads help us keep Mineplex awesome", - C.cRedB + "Be sure to have your AdBlocker disabled!", - " ", - C.cGreen + "Click to watch the Ad now!" - ) - .build(); - - private final Player _player; - private final PlayWireManager _manager; - - public PlayWireButton(PlayWireManager manager, Player player) - { - _manager = manager; - _player = player; - } - - @Override - public ItemStack getObject() - { - if (_manager.Get(_player) == null || _manager.Get(_player).getAccountId() == -1) - { - return DISABLED_ICON; - } - return _manager.canRedeemTickets(_manager.Get(_player)) ? ENABLED_ICON : DISABLED_ICON; - } - - @Override - public void click(ClickType clickType) - { - if(!Recharge.Instance.use(_player, "PlayWire Ad", 1000, false, false)) - { - return; - } - - _manager.getPlugin().getServer().dispatchCommand(_manager.getPlugin().getServer().getConsoleSender(), "adlink " + _player.getName()); - _player.closeInventory(); - } - - @Override - public void setup() - { - - } - - @Override - public void close() - { - - } -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireClientData.java b/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireClientData.java deleted file mode 100644 index c5513684e..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireClientData.java +++ /dev/null @@ -1,40 +0,0 @@ -package mineplex.core.playwire; - -public class PlayWireClientData -{ - private int _accountId; - private int _ticketsRemaining; - private long _ticketRefresh; - - public PlayWireClientData(int accountId, int ticketsRemaining, long ticketRefresh) - { - _accountId = accountId; - _ticketsRemaining = ticketsRemaining; - _ticketRefresh = ticketRefresh; - } - - public int getAccountId() - { - return _accountId; - } - - public int getTicketsRemaining() - { - return _ticketsRemaining; - } - - public long getTicketRefresh() - { - return _ticketRefresh; - } - - public void setTicketsRemaining(int ticketsRemaining) - { - _ticketsRemaining = ticketsRemaining; - } - - public void setTicketRefresh(long ticketRefresh) - { - _ticketRefresh = ticketRefresh; - } -} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireCommand.java deleted file mode 100644 index 709804c93..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireCommand.java +++ /dev/null @@ -1,34 +0,0 @@ -package mineplex.core.playwire; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -/** - * - */ -public class PlayWireCommand implements CommandExecutor -{ - - private PlayWireManager _manager; - - public PlayWireCommand(PlayWireManager manager) - { - _manager = manager; - } - - @Override - public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) - { - if (commandSender instanceof Player) - { - commandSender.sendMessage("Unknown command. Type \"/help\" for help."); - } - else - { - _manager.onCommand(args); - } - return true; - } -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireManager.java b/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireManager.java deleted file mode 100644 index 1dab55afc..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireManager.java +++ /dev/null @@ -1,206 +0,0 @@ -package mineplex.core.playwire; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.plugin.java.JavaPlugin; - -import mineplex.core.Managers; -import mineplex.core.MiniDbClientPlugin; -import mineplex.core.account.CoreClientManager; -import mineplex.core.bonuses.BonusManager; -import mineplex.core.common.util.C; -import mineplex.core.common.util.Callback; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilTime.TimeUnit; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.serverdata.database.DBPool; - -public class PlayWireManager extends MiniDbClientPlugin -{ - private static final int MAX_TICKETS_PER_PERIOD = 5; - private final long COOL_DOWN = TimeUnit.HOURS.getMilliseconds() * 24; - private static final int REWARD_MESSAGE_DELAY_SECONDS = 10; - - private final CoreClientManager _clientManager; - private final PlayWireRepository _repository; - - public PlayWireManager(JavaPlugin plugin, CoreClientManager clientManager) - { - super("PlayWire", plugin, clientManager); - _clientManager = clientManager; - _repository = new PlayWireRepository(this); - getPlugin().getCommand("playwire").setExecutor(new PlayWireCommand(this)); - } - - @EventHandler - public void onUpdate(UpdateEvent event) - { - if (event.getType() != UpdateType.SEC) - { - return; - } - final Map update = new HashMap<>(); - Bukkit.getOnlinePlayers().stream().filter(player -> Get(player) != null && Get(player).getAccountId() != -1 && Get(player).getTicketRefresh() != -1 && Get(player).getTicketRefresh() < System.currentTimeMillis()).forEach(player -> - { - PlayWireClientData data = Get(player); - data.setTicketRefresh(-1); - data.setTicketsRemaining(MAX_TICKETS_PER_PERIOD); - update.put(data, player); - }); - - if (!update.isEmpty()) - { - runAsync(() -> - { - update.entrySet().forEach(entry -> - { - PlayWireClientData data = entry.getKey(); - _repository.attemptPlayWire(data, () -> - { - UtilPlayer.message(entry.getValue(), F.main("Carl", "Your Ad Ticketssssss have refresssshed! Come ssssee me for ssssome " + F.elem("Spin Tickets") + "!")); - }, false); - }); - - update.clear(); - }); - } - } - - @Override - public String getQuery(int accountId, String uuid, String name) - { - return "SELECT ticketsRemaining, ticketRefresh FROM play_wire WHERE accountId=" + accountId + ";"; - } - - public boolean canRedeemTickets(PlayWireClientData data) - { - long now = System.currentTimeMillis(); - - return data == null || (data.getTicketRefresh() < now || data.getTicketRefresh() == -1) || data.getTicketsRemaining() > 0; - } - - public void attemptRedeem(Player player) - { - final PlayWireClientData client = Get(player); - if (client == null || client.getAccountId() == -1) - { - player.sendMessage(ResponseType.UNFILLED.getMessage(Managers.get(BonusManager.class).getCreeperName())); - return; - } - if (!canRedeemTickets(client)) - { - player.sendMessage(ResponseType.UNCOUNTED.getMessage(Managers.get(BonusManager.class).getCreeperName(), UtilTime.MakeStr(client.getTicketRefresh() - System.currentTimeMillis()))); - return; - } - - if (client.getTicketsRemaining() >= MAX_TICKETS_PER_PERIOD) - { - client.setTicketRefresh(System.currentTimeMillis() + COOL_DOWN); - } - client.setTicketsRemaining(Math.max(client.getTicketsRemaining() - 1, 0)); - - _repository.attemptPlayWireAsync(client, () -> - { - final int accountId = _clientManager.Get(player).getAccountId(); - final Callback ticketCallback = new Callback() - { - public void run(Integer newTickets) - { - Managers.get(BonusManager.class).Get(player).setTickets(newTickets); - Managers.get(BonusManager.class).updateCreeperVisual(player, true, C.cAqua); - } - }; - runAsync(() -> - { - try (Connection c = DBPool.getAccount().getConnection(); Statement statement = c.createStatement()) - { - final String query = "UPDATE bonus SET tickets = tickets + 1 WHERE accountId = " + accountId + ";SELECT tickets FROM bonus WHERE accountId = " + accountId; - - statement.execute(query); - statement.getUpdateCount(); - statement.getMoreResults(); - - ResultSet rs = statement.getResultSet(); - if (rs.next()) - { - final int newTickets = rs.getInt(1); - runSync(() -> - { - ticketCallback.run(newTickets); - }); - } - } - catch (Exception e) - { - System.out.println("Failed to award ticket to player: " + player); - e.printStackTrace(); - } - }); - Managers.get(BonusManager.class).addPendingExplosion(player, player.getName()); - Bukkit.getScheduler().runTaskLater(getClientManager().getPlugin(), () -> UtilPlayer.message(player, ResponseType.COUNTED.getMessage(Managers.get(BonusManager.class).getCreeperName(), client.getTicketsRemaining() + "")), REWARD_MESSAGE_DELAY_SECONDS * 20L); - }); - } - - public void onCommand(String[] args) - { - String argument = args[0]; - String target = args[1]; - - ResponseType response = ResponseType.valueOf(argument.toUpperCase()); - Player player = Bukkit.getPlayer(target); - - if (player == null) - { - getPlugin().getLogger().severe("PLAY WIRE PLAYER NOT FOUND ERROR: PlayerName: " + target); - return; - } - - if (response == ResponseType.UNCOUNTED) - { - response = ResponseType.UNFILLED; - } - - if (response == ResponseType.COUNTED) - { - attemptRedeem(player); - } - else - { - player.sendMessage(response.getMessage(Managers.get(BonusManager.class).getCreeperName())); - } - } - - @Override - public void processLoginResultSet(String playerName, UUID uuid, int accountId, ResultSet resultSet) throws SQLException - { - boolean hasRow = resultSet.next(); - if (hasRow) - { - PlayWireClientData client = new PlayWireClientData(accountId, resultSet.getInt("ticketsRemaining"), resultSet.getLong("ticketRefresh")); - Set(uuid, client); - } - else - { - PlayWireClientData client = new PlayWireClientData(accountId, MAX_TICKETS_PER_PERIOD, -1L); - Set(uuid, client); - } - } - - @Override - protected PlayWireClientData addPlayer(UUID uuid) - { - return new PlayWireClientData(-1, -1, -1); - } -} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireRepository.java deleted file mode 100644 index cb97496bd..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/playwire/PlayWireRepository.java +++ /dev/null @@ -1,61 +0,0 @@ -package mineplex.core.playwire; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - -import mineplex.serverdata.database.DBPool; - -public class PlayWireRepository -{ - private static final String INSERT_LAST_REDEEMED = "INSERT INTO play_wire (accountId, ticketsRemaining, ticketRefresh) VALUES (?,?,?) ON DUPLICATE KEY UPDATE ticketsRemaining=VALUES(ticketsRemaining), ticketRefresh=VALUES(ticketRefresh)"; - - private final PlayWireManager _manager; - - public PlayWireRepository(PlayWireManager manager) - { - _manager = manager; - } - - public void attemptPlayWire(final PlayWireClientData client, final Runnable runnable, boolean forceAsync) - { - if (client.getAccountId() == -1) - { - return; - } - Runnable doSQL = () -> - { - try (Connection connection = DBPool.getAccount().getConnection()) - { - PreparedStatement statement = connection.prepareStatement(INSERT_LAST_REDEEMED); - statement.setInt(1, client.getAccountId()); - statement.setInt(2, client.getTicketsRemaining()); - statement.setLong(3, client.getTicketRefresh()); - - statement.executeUpdate(); - - if (runnable != null) - { - _manager.runSync(runnable); - } - } - catch (SQLException e) - { - e.printStackTrace(); - } - }; - if (forceAsync) - { - _manager.runAsync(doSQL); - } - else - { - doSQL.run(); - } - } - - public void attemptPlayWireAsync(final PlayWireClientData client, final Runnable runnable) - { - attemptPlayWire(client, runnable, false); - } -} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/playwire/ResponseType.java b/Plugins/Mineplex.Core/src/mineplex/core/playwire/ResponseType.java deleted file mode 100644 index 8e4483e68..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/playwire/ResponseType.java +++ /dev/null @@ -1,35 +0,0 @@ -package mineplex.core.playwire; - -import mineplex.core.common.util.F; - -/** - * - */ -public enum ResponseType -{ - COUNTED(F.main("%creeper%", "Rewarded " + F.elem("1 Spin Ticket") + " for watching the Ad! You have " + F.elem("%elem%") + " tickets remaining for the current 24 hour period!")), - UNCOUNTED(F.main("%creeper%", "You already received your " + F.elem("5 Spin Tickets") + " for the current 24 hour period! Your available tickets will refresh in " + F.elem("%elem%") + "!")), - BLOCKED(F.main("%creeper%", "You have an AdBlocker on, but tried to watch the Ad! Ssssssslight problem there!")), - UNFILLED(F.main("%creeper%", "Ssssomething went wrong with the Ad, we'll get it ssssorted ASAP. Try again in a few minutessss!")),; - - private String _message; - - ResponseType(String message) - { - _message = message; - } - - public String getMessage(String creeperName, String... elements) - { - String message = _message; - message = message.replaceFirst("%creeper%", creeperName); - if (elements.length > 0) - { - for (int i = 0; i < elements.length; i++) - { - message = message.replaceFirst("%elem%", elements[i]); - } - } - return message; - } -} diff --git a/Plugins/Mineplex.Hub.Clans/plugin.yml b/Plugins/Mineplex.Hub.Clans/plugin.yml index 57fd19a3a..1c50682be 100644 --- a/Plugins/Mineplex.Hub.Clans/plugin.yml +++ b/Plugins/Mineplex.Hub.Clans/plugin.yml @@ -1,5 +1,3 @@ name: ClansHub main: mineplex.clanshub.ClansHub version: 0.1 -commands: - playwire: \ No newline at end of file diff --git a/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java b/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java index e9ac40466..315422a8e 100644 --- a/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java +++ b/Plugins/Mineplex.Hub.Clans/src/mineplex/clanshub/HubManager.java @@ -94,7 +94,6 @@ import mineplex.core.party.PartyManager; import mineplex.core.personalServer.PersonalServerManager; import mineplex.core.pet.PetManager; import mineplex.core.playerCount.PlayerCountManager; -import mineplex.core.playwire.PlayWireManager; import mineplex.core.poll.PollManager; import mineplex.core.portal.GenericServer; import mineplex.core.portal.Intent; @@ -198,8 +197,7 @@ public class HubManager extends MiniPlugin implements IChatMessageFormatter _gadgetManager = require(GadgetManager.class); YoutubeManager youtubeManager = new YoutubeManager(plugin, clientManager, donationManager); - PlayWireManager playWireManager = new PlayWireManager(plugin, clientManager); - _bonusManager = new BonusManager(plugin, null, playWireManager, clientManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager, youtubeManager, _gadgetManager, thankManager, "Carter"); + _bonusManager = new BonusManager(plugin, null, clientManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager, youtubeManager, _gadgetManager, thankManager, "Carter"); World world = _spawn.getWorld(); _treasureManager = require(TreasureManager.class); diff --git a/Plugins/Mineplex.Hub/plugin.yml b/Plugins/Mineplex.Hub/plugin.yml index a366ccd82..c17c65c06 100644 --- a/Plugins/Mineplex.Hub/plugin.yml +++ b/Plugins/Mineplex.Hub/plugin.yml @@ -2,5 +2,3 @@ name: Hub main: mineplex.hub.Hub version: 0.1 loadbefore: [MineplexAnticheat] -commands: - playwire: \ No newline at end of file diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 85a648758..089f551db 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -69,7 +69,6 @@ import mineplex.core.npc.NpcManager; import mineplex.core.party.Party; import mineplex.core.party.PartyManager; import mineplex.core.pet.PetManager; -import mineplex.core.playwire.PlayWireManager; import mineplex.core.poll.PollManager; import mineplex.core.portal.GenericServer; import mineplex.core.portal.Intent; @@ -177,9 +176,8 @@ public class HubManager extends MiniClientPlugin implements IChatMess _gadgetManager = require(GadgetManager.class); YoutubeManager youtubeManager = new YoutubeManager(_plugin, clientManager, donationManager); - PlayWireManager playWireManager = new PlayWireManager(_plugin, clientManager); - new BonusManager(_plugin, null, playWireManager, clientManager, donationManager, pollManager, npcManager, hologramManager, statsManager, inventoryManager, petManager, youtubeManager, _gadgetManager, thankManager, "Carl"); + new BonusManager(_plugin, null, clientManager, donationManager, pollManager, npcManager, hologramManager, statsManager, inventoryManager, petManager, youtubeManager, _gadgetManager, thankManager, "Carl"); TreasureManager treasureManager = require(TreasureManager.class); new CosmeticManager(_plugin, clientManager, donationManager, inventoryManager, _gadgetManager, petManager, treasureManager, boosterManager, punish); diff --git a/Plugins/Nautilus.Game.Arcade/plugin.yml b/Plugins/Nautilus.Game.Arcade/plugin.yml index ef6ad7acc..d4bbeca84 100644 --- a/Plugins/Nautilus.Game.Arcade/plugin.yml +++ b/Plugins/Nautilus.Game.Arcade/plugin.yml @@ -2,5 +2,3 @@ name: Arcade main: nautilus.game.arcade.Arcade version: 0.1 loadbefore: [MineplexAnticheat] -commands: - playwire: \ No newline at end of file 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 3978a7567..8f3735bce 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -93,7 +93,6 @@ import mineplex.core.party.PartyManager; import mineplex.core.party.event.PartySelectServerEvent; import mineplex.core.personalServer.PersonalServerManager; import mineplex.core.pet.PetManager; -import mineplex.core.playwire.PlayWireManager; import mineplex.core.poll.PollManager; import mineplex.core.portal.Portal; import mineplex.core.preferences.PreferencesManager; @@ -349,8 +348,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation _gameTournamentManager = new GameTournamentManager(this); new GameStatManager(this); YoutubeManager youtubeManager = new YoutubeManager(plugin, clientManager, donationManager); - PlayWireManager playWireManager = new PlayWireManager(plugin, clientManager); - _bonusManager = new BonusManager(plugin, _gameLobbyManager.getCarl(), playWireManager, clientManager, donationManager, pollManager, npcManager, hologramManager, statsManager, _inventoryManager, petManager, youtubeManager, _cosmeticManager.getGadgetManager(), thankManager, "Carl"); + _bonusManager = new BonusManager(plugin, _gameLobbyManager.getCarl(), clientManager, donationManager, pollManager, npcManager, hologramManager, statsManager, _inventoryManager, petManager, youtubeManager, _cosmeticManager.getGadgetManager(), thankManager, "Carl"); new GameLootManager(this, petManager); _spectatorManager = new GameSpectatorManager(this); diff --git a/Plugins/mineplex-game-gemhunters/plugin.yml b/Plugins/mineplex-game-gemhunters/plugin.yml index 4f013d203..a5af44c62 100644 --- a/Plugins/mineplex-game-gemhunters/plugin.yml +++ b/Plugins/mineplex-game-gemhunters/plugin.yml @@ -1,5 +1,3 @@ name: GemHunters main: mineplex.gemhunters.GemHunters version: 0.1 -commands: - playwire: \ No newline at end of file