diff --git a/Plugins/BuildFiles/EnjinTranslator.xml b/Plugins/BuildFiles/EnjinTranslator.xml index 55ac5b86f..6207ea3d4 100644 --- a/Plugins/BuildFiles/EnjinTranslator.xml +++ b/Plugins/BuildFiles/EnjinTranslator.xml @@ -16,9 +16,17 @@ + - + + + + + + + + diff --git a/Plugins/BuildFiles/common.xml b/Plugins/BuildFiles/common.xml index 1941653ef..98bb39185 100644 --- a/Plugins/BuildFiles/common.xml +++ b/Plugins/BuildFiles/common.xml @@ -35,6 +35,7 @@ + @@ -75,6 +76,7 @@ + @@ -97,21 +99,25 @@ + + + + - - + - + + diff --git a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java index 4ad8c7946..25afae99d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java @@ -3,7 +3,6 @@ package mineplex.core; import java.lang.reflect.Field; import java.util.Iterator; import java.util.List; -import java.util.Map.Entry; import mineplex.core.common.DummyEntity; import mineplex.core.common.util.NautHashMap; @@ -27,7 +26,6 @@ import net.minecraft.server.v1_7_R4.WatchableObject; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; -import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerQuitEvent; @@ -64,6 +62,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler public void playerQuit(PlayerQuitEvent event) { _entityMap.remove(event.getPlayer()); + _entityNameMap.remove(event.getPlayer()); + _entityVehicleMap.remove(event.getPlayer()); _loggedIn.remove(event.getPlayer()); } @@ -81,6 +81,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler { iterator.remove(); _entityMap.remove(player); + _entityNameMap.remove(player); + _entityVehicleMap.remove(player); System.out.println("Found broken player in CustomTagFix.... '" + player.getName() + "'"); } } @@ -437,3 +439,4 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler }); } } + diff --git a/Plugins/Mineplex.Core/src/mineplex/core/Replay.java b/Plugins/Mineplex.Core/src/mineplex/core/Replay.java new file mode 100644 index 000000000..fd1740616 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/Replay.java @@ -0,0 +1,79 @@ +package mineplex.core; + +import java.util.Iterator; +import java.util.Map.Entry; + +import mineplex.core.common.util.NautHashMap; +import mineplex.core.packethandler.IPacketHandler; +import mineplex.core.packethandler.PacketHandler; +import mineplex.core.packethandler.PacketInfo; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +import org.bukkit.Material; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; + +public class Replay extends MiniPlugin implements IPacketHandler +{ + private NautHashMap _packetList = new NautHashMap(); + private long _startTime = 0; + private long _replayTime = 0; + private boolean _replay = false; + private long _speed = 20; + + public Replay(JavaPlugin plugin, PacketHandler packetHandler) + { + super("Replay", plugin); + } + + @EventHandler + public void interact(PlayerInteractEvent event) + { + if (event.getItem().getType() == Material.WEB) + { + event.getPlayer().setItemInHand(new ItemStack(Material.STICK, 1)); + _replay = true; + _replayTime = System.currentTimeMillis(); + } + } + + @EventHandler + public void replay(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK || !_replay) + return; + + for (Iterator> entryIterator = _packetList.entrySet().iterator(); entryIterator.hasNext();) + { + Entry entry = entryIterator.next(); + + if ((System.currentTimeMillis() + _speed) - _replayTime > entry.getValue()) + { + entry.getKey().getVerifier().bypassProcess(entry.getKey().getPacket()); + entryIterator.remove(); + } + } + } + + @SuppressWarnings("unchecked") + public void handle(PacketInfo packetInfo) + { + if (_replay) + { + packetInfo.setCancelled(true); + return; + } + + if (_startTime == 0) + _startTime = System.currentTimeMillis(); + + _packetList.put(packetInfo, System.currentTimeMillis() - _startTime); + + // write out packets? + if (packetInfo.isCancelled()) + return; + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java index 51f7c031f..a562aad6a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java @@ -68,7 +68,7 @@ public class AccountRepository extends RepositoryBase return new JsonWebCall(_webAddress + "PlayerAccount/GetAccountByUUID").ExecuteReturnStream(uuid.toString()); } - public void saveRank(final Callback callback, final String name, Rank rank, final boolean perm) + public void saveRank(final Callback callback, final String name, final Rank rank, final boolean perm) { final RankUpdateToken token = new RankUpdateToken(); token.Name = name; @@ -79,19 +79,19 @@ public class AccountRepository extends RepositoryBase { public void run(Rank response) { - if (response == Rank.ULTRA || response == Rank.HERO) + if (rank == Rank.ULTRA || rank == Rank.HERO) { if (perm) - executeUpdate(UPDATE_ACCOUNT_RANK_DONOR_PERM, new ColumnVarChar("rank", 100, response.toString()), new ColumnVarChar("donorRank", 100, response.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString())); + executeUpdate(UPDATE_ACCOUNT_RANK_DONOR_PERM, new ColumnVarChar("rank", 100, rank.toString()), new ColumnVarChar("donorRank", 100, rank.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString())); else - executeUpdate(UPDATE_ACCOUNT_RANK_DONOR, new ColumnVarChar("rank", 100, response.toString()), new ColumnVarChar("donorRank", 100, response.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString())); + executeUpdate(UPDATE_ACCOUNT_RANK_DONOR, new ColumnVarChar("rank", 100, rank.toString()), new ColumnVarChar("donorRank", 100, rank.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString())); } else { if (perm) - executeUpdate(UPDATE_ACCOUNT_RANK_PERM, new ColumnVarChar("rank", 100, response.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString())); + executeUpdate(UPDATE_ACCOUNT_RANK_PERM, new ColumnVarChar("rank", 100, rank.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString())); else - executeUpdate(UPDATE_ACCOUNT_RANK, new ColumnVarChar("rank", 100, response.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString())); + executeUpdate(UPDATE_ACCOUNT_RANK, new ColumnVarChar("rank", 100, rank.toString()), new ColumnVarChar("uuid", 100, UUIDFetcher.getUUIDOf(name).toString())); } callback.run(response); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java index 457aba91e..d33ff369e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java @@ -265,7 +265,7 @@ public class NpcManager extends MiniPlugin String inHand = itemStackToYaml(player.getInventory().getItemInHand()); NpcsRecord npcsRecord = DSL.using(connection).newRecord(Tables.npcs); - npcsRecord.setServer(GetPlugin().getClass().getSimpleName()); + npcsRecord.setServer(getServerName()); npcsRecord.setName(name); npcsRecord.setWorld(player.getWorld().getName()); npcsRecord.setX(player.getLocation().getX()); @@ -410,7 +410,7 @@ public class NpcManager extends MiniPlugin ((EntityInsentient) ((CraftLivingEntity) entity).getHandle()).persistent = true; UtilEnt.silence(entity, true); - if (!entity.getLocation().getChunk().isLoaded() || !(entity instanceof CraftCreature)) + if (!entity.getLocation().getChunk().isLoaded()) continue; if (!entity.isDead() && entity.isValid()) @@ -476,7 +476,7 @@ public class NpcManager extends MiniPlugin public void loadNpcs() throws SQLException { - String serverType = _plugin.getClass().getSimpleName(); + String serverType = getServerName(); try (Connection connection = DBPool.getInstance().getConnection()) { @@ -502,7 +502,7 @@ public class NpcManager extends MiniPlugin { if (deleteFromDatabase) { - String serverType = _plugin.getClass().getSimpleName(); + String serverType = getServerName(); try (Connection connection = DBPool.getInstance().getConnection()) { @@ -585,4 +585,14 @@ public class NpcManager extends MiniPlugin if (npc != null) npc.setEntity(null); } + + public String getServerName() + { + String serverName = GetPlugin().getClass().getSimpleName(); + + if (Bukkit.getMotd() != null && Bukkit.getMotd().equalsIgnoreCase("test")) + serverName += "-Test"; + + return serverName; + } } diff --git a/Plugins/Mineplex.EnjinTranslator/.externalToolBuilders/Translator.launch b/Plugins/Mineplex.EnjinTranslator/.externalToolBuilders/Translator.launch index 124c318a1..12d9261c3 100644 --- a/Plugins/Mineplex.EnjinTranslator/.externalToolBuilders/Translator.launch +++ b/Plugins/Mineplex.EnjinTranslator/.externalToolBuilders/Translator.launch @@ -10,5 +10,5 @@ - + diff --git a/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java b/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java index 73b0e086b..e25526450 100644 --- a/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java +++ b/Plugins/Mineplex.EnjinTranslator/src/mineplex/enjinTranslator/Enjin.java @@ -14,6 +14,7 @@ import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClientManager; +import mineplex.core.common.Rank; import mineplex.core.common.util.UUIDFetcher; import mineplex.core.donation.DonationManager; import mineplex.core.inventory.InventoryManager; @@ -73,7 +74,6 @@ public class Enjin extends MiniPlugin implements CommandExecutor String name = args[1]; int amount = Integer.parseInt(args[2]); - ; _donationManager.RewardGems(null, "purchase", name, UUIDFetcher.getUUIDOf(name), amount); System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " received " + amount + " gems."); } @@ -96,12 +96,25 @@ public class Enjin extends MiniPlugin implements CommandExecutor } else if (args.length == 4 && args[0].equalsIgnoreCase("rank")) { - String name = args[1]; - String rank = args[2]; - boolean perm = Boolean.parseBoolean(args[3]); + final String name = args[1]; + final String rank = args[2]; + final boolean perm = Boolean.parseBoolean(args[3]); - _clientManager.SaveRank(name, mineplex.core.common.Rank.valueOf(rank), perm); - System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " received " + rank + " " + (perm ? "permanently." : "for 1 month.")); + _clientManager.loadClientByName(name, new Runnable() + { + public void run() + { + if (_clientManager.Get(name).GetRank() == Rank.ALL || _clientManager.Get(name).GetRank() == Rank.ULTRA || _clientManager.Get(name).GetRank() == Rank.HERO) + { + _clientManager.SaveRank(name, mineplex.core.common.Rank.valueOf(rank), perm); + System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " received " + rank + " " + (perm ? "permanently." : "for 1 month.")); + } + else + { + System.out.println("[" + _dateFormat.format(new Date()) + "] " + name + " DENIED INFERIOR " + rank + " " + (perm ? "permanently." : "for 1 month.")); + } + } + }); } else if (args.length >= 3 && args[0].equalsIgnoreCase("purchase")) { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java index b13f586e8..c2cd4696e 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java @@ -4,6 +4,7 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.CustomTagFix; +import mineplex.core.Replay; import mineplex.core.account.CoreClientManager; import mineplex.core.antihack.AntiHack; import mineplex.core.antistack.AntiStack; @@ -108,6 +109,7 @@ public class Hub extends JavaPlugin implements IRelation new MemoryFix(this); new FileUpdater(this, portal); new CustomTagFix(this, packetHandler); + //new Replay(this, packetHandler); CombatManager combatManager = new CombatManager(this); BlockRestore blockRestore = new BlockRestore(this); 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 6f398d4ec..d6d05d97b 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -142,7 +142,8 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Dragons", ChatColor.RESET + "One in the Quiver", ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "Sneaky Assassins", + ChatColor.RESET + "Micro Battle", ChatColor.RESET + "Super Paintball", ChatColor.RESET + "Turf Wars", ChatColor.RESET + "Death Tag", @@ -159,7 +160,8 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Dragons", ChatColor.RESET + "One in the Quiver", ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "Sneaky Assassins", + ChatColor.RESET + "Micro Battle", ChatColor.RESET + "Super Paintball", ChatColor.RESET + "Turf Wars", ChatColor.RESET + "Death Tag", @@ -176,7 +178,8 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragons", ChatColor.RESET + "One in the Quiver", ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "Sneaky Assassins", + ChatColor.RESET + "Micro Battle", ChatColor.RESET + "Super Paintball", ChatColor.RESET + "Turf Wars", ChatColor.RESET + "Death Tag", @@ -193,7 +196,8 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Dragons", ChatColor.RESET + C.Bold + ChatColor.GREEN + "One in the Quiver", ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "Sneaky Assassins", + ChatColor.RESET + "Micro Battle", ChatColor.RESET + "Super Paintball", ChatColor.RESET + "Turf Wars", ChatColor.RESET + "Death Tag", @@ -210,7 +214,8 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Dragons", ChatColor.RESET + "One in the Quiver", ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragon Escape", - ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "Sneaky Assassins", + ChatColor.RESET + "Micro Battle", ChatColor.RESET + "Super Paintball", ChatColor.RESET + "Turf Wars", ChatColor.RESET + "Death Tag", @@ -227,7 +232,26 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Dragons", ChatColor.RESET + "One in the Quiver", ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + C.Bold + ChatColor.GREEN + "Milk the Cow", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "Sneaky Assassins", + ChatColor.RESET + "Micro Battle", + ChatColor.RESET + "Super Paintball", + ChatColor.RESET + "Turf Wars", + ChatColor.RESET + "Death Tag", + ChatColor.RESET + "Bacon Brawl", + })); + + _minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.MILK_BUCKET.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String [] + { + ChatColor.RESET + "", + ChatColor.RESET + "Play all of these fun minigames:", + ChatColor.RESET + "", + ChatColor.RESET + "Super Spleef", + ChatColor.RESET + "Runner", + ChatColor.RESET + "Dragons", + ChatColor.RESET + "One in the Quiver", + ChatColor.RESET + "Dragon Escape", + ChatColor.RESET + "Sneaky Assassins", + ChatColor.RESET + C.Bold + ChatColor.GREEN + "Micro Battle", ChatColor.RESET + "Super Paintball", ChatColor.RESET + "Turf Wars", ChatColor.RESET + "Death Tag", @@ -244,7 +268,8 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Dragons", ChatColor.RESET + "One in the Quiver", ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "Sneaky Assassins", + ChatColor.RESET + "Micro Battle", ChatColor.RESET + C.Bold + ChatColor.GREEN + "Super Paintball", ChatColor.RESET + "Turf Wars", ChatColor.RESET + "Death Tag", @@ -261,7 +286,8 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Dragons", ChatColor.RESET + "One in the Quiver", ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "Sneaky Assassins", + ChatColor.RESET + "Micro Battle", ChatColor.RESET + "Super Paintball", ChatColor.RESET + C.Bold + ChatColor.GREEN + "Turf Wars", ChatColor.RESET + "Death Tag", @@ -278,7 +304,8 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Dragons", ChatColor.RESET + "One in the Quiver", ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "Sneaky Assassins", + ChatColor.RESET + "Micro Battle", ChatColor.RESET + "Super Paintball", ChatColor.RESET + "Turf Wars", ChatColor.RESET + C.Bold + ChatColor.GREEN + "Death Tag", @@ -295,7 +322,8 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Dragons", ChatColor.RESET + "One in the Quiver", ChatColor.RESET + "Dragon Escape", - ChatColor.RESET + "Milk the Cow", + ChatColor.RESET + "Sneaky Assassins", + ChatColor.RESET + "Micro Battle", ChatColor.RESET + "Super Paintball", ChatColor.RESET + "Turf Wars", ChatColor.RESET + "Death Tag", diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java index e95af4ba2..5c8d1c89c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java @@ -119,13 +119,13 @@ public class Arcade extends JavaPlugin GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager); CosmeticManager cosmeticManager = new CosmeticManager(this, _clientManager, _donationManager, inventoryManager, gadgetManager, mountManager, petManager, true); cosmeticManager.setInterfaceSlot(7); - new CustomTagFix(this, packetHandler); - + //Arcade Manager _gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, _damageManager, disguiseManager, creature, teleport, new Blood(this), antistack, portal, preferenceManager, inventoryManager, packetHandler, cosmeticManager, projectileManager, petManager, webServerAddress); new PlayerTracker(this, serverStatusManager.getCurrentServerName(), serverStatusManager.getUs()); new MemoryFix(this); + new CustomTagFix(this, packetHandler); new FriendManager(this, preferenceManager); 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 9301a4087..ca9233b90 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -625,15 +625,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation // Reserved Slot Check if (Bukkit.getOnlinePlayers().size() >= Bukkit.getServer().getMaxPlayers()) { - if (_serverStatusManager.getCurrentServerName().contains("BETA")) + if (_clientManager.Get(event.getPlayer().getName()).GetRank().Has(event.getPlayer(), Rank.HELPER, false)) { - if (_clientManager.Get(event.getPlayer().getName()).GetRank() - .Has(event.getPlayer(), Rank.HELPER, false)) - { - event.allow(); - event.setResult(PlayerLoginEvent.Result.ALLOWED); - return; - } + event.allow(); + event.setResult(PlayerLoginEvent.Result.ALLOWED); + return; } else if (_clientManager.Get(event.getPlayer().getName()).GetRank() .Has(event.getPlayer(), Rank.ULTRA, false) @@ -641,7 +637,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation _serverConfig.ServerType + " ULTRA")) { - if (GetGame() != null && (GetGame().GetType() == GameType.UHC || GetGame().GetType() == GameType.ChampionsDominate || GetGame().GetType() == GameType.ChampionsTDM || GetGame().GetType() == GameType.MineStrike)) + if (GetGame() != null && (GetGame().GetType() == GameType.UHC || GetGame().GetType() == GameType.Halloween || GetGame().GetType() == GameType.ChampionsDominate || GetGame().GetType() == GameType.ChampionsTDM || GetGame().GetType() == GameType.MineStrike)) { event.disallow(PlayerLoginEvent.Result.KICK_OTHER, C.Bold + "Server has reached max capacity for gameplay purposes."); return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java index 4683f5df6..c40cd1271 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java @@ -86,6 +86,7 @@ public class Halloween extends SoloGame public long updateBossN = 0; public long updateBossO = 0; + public boolean debug = false; public boolean bossDebug = false; public Halloween(ArcadeManager manager) @@ -183,18 +184,21 @@ public class Halloween extends SoloGame if (event.getType() != UpdateType.SLOW) return; - System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); - System.out.println("Wave: " + _wave); - System.out.println("Mobs: " + _mobs.size()); - System.out.println(" "); - System.out.println("Total Time: " + UtilTime.convertString(total, 4, TimeUnit.MILLISECONDS)); - System.out.println("Move Time: " + UtilTime.convertString(move, 4, TimeUnit.MILLISECONDS)); - System.out.println("Move Count: " + moves); - System.out.println("Wave Time: " + UtilTime.convertString(wave, 4, TimeUnit.MILLISECONDS)); - System.out.println("Sound Time: " + UtilTime.convertString(sound, 4, TimeUnit.MILLISECONDS)); - System.out.println("Update Time: " + UtilTime.convertString(update, 4, TimeUnit.MILLISECONDS)); - System.out.println("Damage Time: " + UtilTime.convertString(damage, 4, TimeUnit.MILLISECONDS)); - System.out.println("Target Time: " + UtilTime.convertString(target, 4, TimeUnit.MILLISECONDS)); + if (debug) + { + System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); + System.out.println("Wave: " + _wave); + System.out.println("Mobs: " + _mobs.size()); + System.out.println(" "); + System.out.println("Total Time: " + UtilTime.convertString(total, 4, TimeUnit.MILLISECONDS)); + System.out.println("Move Time: " + UtilTime.convertString(move, 4, TimeUnit.MILLISECONDS)); + System.out.println("Move Count: " + moves); + System.out.println("Wave Time: " + UtilTime.convertString(wave, 4, TimeUnit.MILLISECONDS)); + System.out.println("Sound Time: " + UtilTime.convertString(sound, 4, TimeUnit.MILLISECONDS)); + System.out.println("Update Time: " + UtilTime.convertString(update, 4, TimeUnit.MILLISECONDS)); + System.out.println("Damage Time: " + UtilTime.convertString(damage, 4, TimeUnit.MILLISECONDS)); + System.out.println("Target Time: " + UtilTime.convertString(target, 4, TimeUnit.MILLISECONDS)); + } if (bossDebug) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitNecromancer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitNecromancer.java index 5388dafd7..1b2227998 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitNecromancer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitNecromancer.java @@ -27,12 +27,12 @@ public class KitNecromancer extends Kit new PerkSkeletons(true) }, EntityType.ZOMBIE, - new ItemStack(Material.SKULL)); + new ItemStack(Material.SKULL_ITEM)); } @Override - public void GiveItems(Player player) + public void GiveItems(Player player) { } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java index 306fa99e1..4d43ee209 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java @@ -69,8 +69,7 @@ import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitSorter; import net.minecraft.server.v1_7_R4.Packet; -import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; -import net.minecraft.server.v1_7_R4.WatchableObject; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; public class GameLobbyManager implements Listener, IPacketHandler { @@ -1086,16 +1085,16 @@ public class GameLobbyManager implements Listener, IPacketHandler { if (_handlingPacket) return; - + Packet packet = packetInfo.getPacket(); Player owner = packetInfo.getPlayer(); PacketVerifier packetVerifier = packetInfo.getVerifier(); int entityId = -1; - if (packet instanceof PacketPlayOutEntityMetadata) + if (packet instanceof PacketPlayOutSpawnEntityLiving) { - entityId = ((PacketPlayOutEntityMetadata)packet).a; + entityId = ((PacketPlayOutSpawnEntityLiving)packet).a; } if (entityId != -1) @@ -1116,33 +1115,12 @@ public class GameLobbyManager implements Listener, IPacketHandler { try { - if (packet instanceof PacketPlayOutEntityMetadata) + if (packet instanceof PacketPlayOutSpawnEntityLiving) { - List watchables = new ArrayList(); - - for (WatchableObject watchableObject : (List)((PacketPlayOutEntityMetadata) packet).b) - { - WatchableObject newWatch = new WatchableObject(watchableObject.c(), watchableObject.a(), watchableObject.b()); - - if (newWatch.a() == 10) - { - newWatch.a(customName); - } - - watchables.add(newWatch); - } - - PacketPlayOutEntityMetadata newPacket = new PacketPlayOutEntityMetadata(); - newPacket.a = entityId; - newPacket.b = watchables; - - _handlingPacket = true; - packetVerifier.process(newPacket); - _handlingPacket = false; - - packetInfo.setCancelled(true); + ((PacketPlayOutSpawnEntityLiving)packet).l.watch(2, customName); + ((PacketPlayOutSpawnEntityLiving)packet).l.watch(10, customName); } - } + } catch (IllegalArgumentException e) { e.printStackTrace();