diff --git a/Plugins/Core/src/me/chiss/Core/Server/Server.java b/Plugins/Core/src/me/chiss/Core/Server/Server.java index ada33dff4..072971ded 100644 --- a/Plugins/Core/src/me/chiss/Core/Server/Server.java +++ b/Plugins/Core/src/me/chiss/Core/Server/Server.java @@ -1,7 +1,6 @@ package me.chiss.Core.Server; import me.chiss.Core.Events.ServerSaveEvent; -import me.chiss.Core.Server.command.BroadcastCommand; import me.chiss.Core.Server.command.ListCommand; import me.chiss.Core.Server.command.SpawnSetCommand; import me.chiss.Core.Server.command.WaterSpreadCommand; @@ -9,6 +8,7 @@ import mineplex.core.MiniPlugin; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.core.account.CoreClientManager; +import mineplex.core.chat.command.BroadcastCommand; import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.F; diff --git a/Plugins/Libraries/craftbukkit.jar b/Plugins/Libraries/craftbukkit.jar index 3853df982..7626189e0 100644 Binary files a/Plugins/Libraries/craftbukkit.jar and b/Plugins/Libraries/craftbukkit.jar differ diff --git a/Plugins/Core/src/me/chiss/Core/Chat/Chat.java b/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java similarity index 81% rename from Plugins/Core/src/me/chiss/Core/Chat/Chat.java rename to Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java index b8b185437..e1f84e4a8 100644 --- a/Plugins/Core/src/me/chiss/Core/Chat/Chat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java @@ -1,12 +1,12 @@ -package me.chiss.Core.Chat; +package mineplex.core.chat; -import me.chiss.Core.Chat.command.SilenceCommand; -import me.chiss.Core.Plugin.IChat; import mineplex.core.MiniPlugin; import mineplex.core.recharge.Recharge; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.core.account.CoreClientManager; +import mineplex.core.chat.command.BroadcastCommand; +import mineplex.core.chat.command.SilenceCommand; import mineplex.core.common.Rank; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; @@ -17,27 +17,27 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.AsyncPlayerChatEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.plugin.java.JavaPlugin; public class Chat extends MiniPlugin { private CoreClientManager _clientManager; - private IChat _chat; private long _silenced = 0; - public Chat(JavaPlugin plugin, CoreClientManager clientManager,IChat chat) + public Chat(JavaPlugin plugin, CoreClientManager clientManager) { super("Chat", plugin); _clientManager = clientManager; - _chat = chat; } @Override public void AddCommands() { AddCommand(new SilenceCommand(this)); + AddCommand(new BroadcastCommand(this)); } public void Silence(long duration, boolean inform) @@ -60,6 +60,16 @@ public class Chat extends MiniPlugin UtilServer.broadcast(F.main("Chat", "Chat has been silenced for " + F.time(UtilTime.MakeStr(duration, 1)) + ".")); } + @EventHandler + public void preventMe(PlayerCommandPreprocessEvent event) + { + if (event.getMessage().startsWith("/me")) + { + event.getPlayer().sendMessage(F.main(GetName(), "Quite full of yourself aren't you? Nobody cares.")); + event.setCancelled(true); + } + } + @EventHandler public void SilenceUpdate(UpdateEvent event) { @@ -96,7 +106,7 @@ public class Chat extends MiniPlugin return true; } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void HandleChat(AsyncPlayerChatEvent event) { if (event.isCancelled()) @@ -114,10 +124,6 @@ public class Chat extends MiniPlugin UtilPlayer.message(sender, F.main("Chat", "You are sending messages too fast.")); event.setCancelled(true); } - else - { - _chat.HandleChat(event, event.getMessage()); - } } public long Silenced() diff --git a/Plugins/Core/src/me/chiss/Core/Server/command/BroadcastCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/chat/command/BroadcastCommand.java similarity index 75% rename from Plugins/Core/src/me/chiss/Core/Server/command/BroadcastCommand.java rename to Plugins/Mineplex.Core/src/mineplex/core/chat/command/BroadcastCommand.java index 0498bb08e..5f2cdd1c2 100644 --- a/Plugins/Core/src/me/chiss/Core/Server/command/BroadcastCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/chat/command/BroadcastCommand.java @@ -1,15 +1,15 @@ -package me.chiss.Core.Server.command; +package mineplex.core.chat.command; import org.bukkit.entity.Player; -import me.chiss.Core.Server.Server; +import mineplex.core.chat.Chat; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.UtilServer; -public class BroadcastCommand extends CommandBase +public class BroadcastCommand extends CommandBase { - public BroadcastCommand(Server plugin) + public BroadcastCommand(Chat plugin) { super(plugin, Rank.MODERATOR, "s"); } diff --git a/Plugins/Core/src/me/chiss/Core/Chat/command/SilenceCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/chat/command/SilenceCommand.java similarity index 92% rename from Plugins/Core/src/me/chiss/Core/Chat/command/SilenceCommand.java rename to Plugins/Mineplex.Core/src/mineplex/core/chat/command/SilenceCommand.java index 5b6501898..d1206f8c1 100644 --- a/Plugins/Core/src/me/chiss/Core/Chat/command/SilenceCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/chat/command/SilenceCommand.java @@ -1,8 +1,8 @@ -package me.chiss.Core.Chat.command; +package mineplex.core.chat.command; import org.bukkit.entity.Player; -import me.chiss.Core.Chat.Chat; +import mineplex.core.chat.Chat; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.F; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java b/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java new file mode 100644 index 000000000..ffd7c8a77 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java @@ -0,0 +1,117 @@ +package mineplex.core.monitor; + +import java.util.HashSet; + +import mineplex.core.MiniPlugin; +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.Rank; +import mineplex.core.common.util.F; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +import org.bukkit.ChatColor; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.plugin.java.JavaPlugin; + +public class LagMeter extends MiniPlugin +{ + private CoreClientManager _clientManager; + private long _lastRun = -1; + private int _count; + private double _ticksPerSecond; + private double _ticksPerSecondAverage; + private long _lastAverage; + + private HashSet _monitoring = new HashSet(); + + public LagMeter(JavaPlugin plugin, CoreClientManager clientManager) + { + super("LagMeter", plugin); + + _clientManager = clientManager; + _lastRun = System.currentTimeMillis(); + _lastAverage = System.currentTimeMillis(); + } + + @EventHandler + public void onPlayerCommandPreProcess(PlayerCommandPreprocessEvent event) + { + if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.MODERATOR)) + { + if (event.getMessage().trim().equalsIgnoreCase("/lag")) + { + sendUpdate(event.getPlayer()); + event.setCancelled(true); + } + else if (event.getMessage().trim().equalsIgnoreCase("/monitor")) + { + if (_monitoring.contains(event.getPlayer())) + _monitoring.remove(event.getPlayer()); + else + _monitoring.add(event.getPlayer()); + + event.setCancelled(true); + } + } + } + + @EventHandler + public void playerQuit(PlayerQuitEvent event) + { + _monitoring.remove(event.getPlayer()); + } + + @EventHandler + public void update(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + if (_count % 20 == 0) + { + _ticksPerSecond = (1000D / (System.currentTimeMillis() - _lastRun)) * 20D; + + sendUpdates(); + _lastRun = System.currentTimeMillis(); + } + + if (_count % 600 == 0) + { + _ticksPerSecondAverage = 30000D / (System.currentTimeMillis() - _lastAverage); + _ticksPerSecond = 0; + _lastAverage = System.currentTimeMillis(); + } + + _count++; + } + + public double GetTicksPerSecond() + { + return _ticksPerSecond; + } + + private void sendUpdates() + { + for (Player player : _monitoring) + { + sendUpdate(player); + } + } + + private void sendUpdate(Player player) + { + player.sendMessage(" "); + player.sendMessage(" "); + player.sendMessage(" "); + player.sendMessage(" "); + player.sendMessage(" "); + player.sendMessage(F.main(GetName(), ChatColor.GRAY + "Live-------" + ChatColor.YELLOW + String.format("%.00f", _ticksPerSecond))); + player.sendMessage(F.main(GetName(), ChatColor.GRAY + "Avg--------" + ChatColor.YELLOW + String.format("%.00f", _ticksPerSecondAverage * 20))); + player.sendMessage(F.main(GetName(), ChatColor.YELLOW + "MEM")); + player.sendMessage(F.main(GetName(), ChatColor.GRAY + "Free-------" + ChatColor.YELLOW + (Runtime.getRuntime().freeMemory() / 1048576) + "MB")); + player.sendMessage(F.main(GetName(), ChatColor.GRAY + "Max--------" + ChatColor.YELLOW + (Runtime.getRuntime().maxMemory() / 1048576)) + "MB"); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java index e23135af1..1107d1a0e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java @@ -51,6 +51,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; @@ -223,11 +224,31 @@ public class PetManager extends MiniClientPlugin } } - @EventHandler + @EventHandler(priority = EventPriority.LOWEST) public void onEntityDamage(EntityDamageEvent event) { if (event.getEntity() instanceof Creature && _activePetOwners.containsValue((Creature)event.getEntity())) { + if (event.getCause() == DamageCause.VOID) + { + String playerName = null; + + for (Entry entry : _activePetOwners.entrySet()) + { + if (entry.getValue() == event.getEntity()) + playerName = entry.getKey(); + } + + if (playerName != null) + { + Player player = Bukkit.getPlayerExact(playerName); + + if (player != null && player.isOnline()) + { + RemovePet(player, true, true); + } + } + } event.setCancelled(true); } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java index d5d21310c..65382669d 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java @@ -3,6 +3,7 @@ package mineplex.hub; import me.chiss.Core.MemoryFix.MemoryFix; import mineplex.core.account.CoreClientManager; import mineplex.core.blockrestore.BlockRestore; +import mineplex.core.chat.Chat; import mineplex.core.command.CommandCenter; import mineplex.core.creature.Creature; import mineplex.core.disguise.DisguiseManager; @@ -10,6 +11,7 @@ import mineplex.core.donation.DonationManager; import mineplex.core.energy.Energy; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.message.MessageManager; +import mineplex.core.monitor.LagMeter; import mineplex.core.movement.Movement; import mineplex.core.npc.NpcManager; import mineplex.core.packethandler.PacketHandler; @@ -75,8 +77,10 @@ public class Hub extends JavaPlugin implements INautilusPlugin, IRelation new HubManager(this, clientManager, donationManager, new DisguiseManager(this, packetHandler), new TaskManager(this, GetWebServerAddress())); new Stacker(this); new ServerManager(this, clientManager, donationManager, portal); + new Chat(this, clientManager); new MemoryFix(this); new FileUpdater(this, portal); + new LagMeter(this, clientManager); CombatManager combatManager = new CombatManager(this); BlockRestore blockRestore = new BlockRestore(this); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index fc29e4b26..35786373d 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -20,6 +20,7 @@ import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftPlayer; import org.bukkit.entity.Chicken; import org.bukkit.entity.Cow; +import org.bukkit.entity.Egg; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Pig; @@ -33,6 +34,7 @@ import org.bukkit.event.block.BlockSpreadEvent; import org.bukkit.event.block.LeavesDecayEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.PlayerDropItemEvent; @@ -147,6 +149,14 @@ public class HubManager extends MiniClientPlugin return line; } + @EventHandler + public void preventEggSpawn(ItemSpawnEvent event) + { + if (event.getEntity() instanceof Egg) + { + event.setCancelled(true); + } + } @EventHandler public void PlayerRespawn(PlayerRespawnEvent event) diff --git a/Plugins/Nautilus.Core/src/nautilus/minecraft/core/utils/LagMeter.java b/Plugins/Nautilus.Core/src/nautilus/minecraft/core/utils/LagMeter.java deleted file mode 100644 index cb8057364..000000000 --- a/Plugins/Nautilus.Core/src/nautilus/minecraft/core/utils/LagMeter.java +++ /dev/null @@ -1,54 +0,0 @@ -package nautilus.minecraft.core.utils; - -import org.bukkit.ChatColor; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerCommandPreprocessEvent; -import org.bukkit.plugin.java.JavaPlugin; - -public class LagMeter implements Runnable, Listener -{ - private long _lastRun = -1; - private int _count; - private double _ticksPerSecond; - private double _ticksPerSecondAverage; - - public LagMeter(JavaPlugin plugin) - { - plugin.getServer().getPluginManager().registerEvents(this, plugin); - plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, this, 0, 20); - } - - @EventHandler - public void OnPlayerCommandPreProcess(PlayerCommandPreprocessEvent event) - { - if (event.getMessage().trim().equalsIgnoreCase("/lag")) - { - event.getPlayer().sendMessage(ChatColor.GRAY + "Server is running at " + String.format("%.00f", _ticksPerSecondAverage * 20) + " TPS (" + String.format("%.00f", _ticksPerSecondAverage) + "% Max speed)"); - event.setCancelled(true); - } - } - - public void run() - { - if (_lastRun != -1) - { - _ticksPerSecond += (double)1000 / (System.currentTimeMillis() - _lastRun); - - if (_count % 5 == 0) - { - _ticksPerSecondAverage = _ticksPerSecond / 5; - _ticksPerSecond = 0; - } - - _count++; - } - - _lastRun = System.currentTimeMillis(); - } - - public double GetTicksPerSecond() - { - return _ticksPerSecond; - } -} 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 c4c5f2aa5..0301b86ed 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java @@ -26,6 +26,7 @@ import me.chiss.Core.Modules.*; import me.chiss.Core.Plugin.IPlugin; import me.chiss.Core.Scheduler.Scheduler; import mineplex.core.message.MessageManager; +import mineplex.core.monitor.LagMeter; import mineplex.core.npc.NpcManager; import mineplex.core.packethandler.PacketHandler; import mineplex.core.pet.PetManager; @@ -109,6 +110,7 @@ public class Arcade extends JavaPlugin implements INautilusPlugin, IPlugin GetSpawn(); GetTeleport(); new FileUpdater(this, new Portal(this)); + new LagMeter(this, _clientManager); PacketHandler packetHandler = new PacketHandler(this); DisguiseManager disguiseManager = new DisguiseManager(this, packetHandler); 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 b28ab69c8..0e495a88f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -20,7 +20,6 @@ import org.bukkit.craftbukkit.v1_6_R2.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; @@ -32,13 +31,12 @@ import mineplex.minecraft.game.core.condition.ConditionManager; import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.minecraft.game.core.damage.DamageManager; import mineplex.minecraft.game.core.fire.Fire; -import me.chiss.Core.Chat.Chat; import mineplex.core.MiniPlugin; import mineplex.core.itemstack.ItemStackFactory; import me.chiss.Core.Modules.Blood; -import me.chiss.Core.Plugin.IChat; import mineplex.core.account.CoreClientManager; import mineplex.core.blockrestore.BlockRestore; +import mineplex.core.chat.Chat; import mineplex.core.common.util.*; import mineplex.core.creature.Creature; import mineplex.core.disguise.DisguiseManager; @@ -48,7 +46,7 @@ import mineplex.core.explosion.Explosion; import mineplex.core.portal.Portal; import mineplex.core.projectile.ProjectileManager; -public class ArcadeManager extends MiniPlugin implements IRelation, IChat +public class ArcadeManager extends MiniPlugin implements IRelation { //Modules private BlockRestore _blockRestore; @@ -70,7 +68,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation, IChat //Managers private GameFactory _gameFactory; - private GameChatManager _gameChatManager; private GameCreationManager _gameCreationManager; private GameGemManager _gameGemManager; private GameManager _gameManager; @@ -101,7 +98,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation, IChat _clientManager = clientManager; - _chat = new Chat(plugin, _clientManager, this); + _chat = new Chat(plugin, _clientManager); _creature = creature; @@ -127,7 +124,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation, IChat _gameFactory = new GameFactory(this); //Managers - _gameChatManager = new GameChatManager(this); + new GameChatManager(this); _gameCreationManager = new GameCreationManager(this); _gameGemManager = new GameGemManager(this); _gameManager = new GameManager(this); @@ -274,12 +271,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation, IChat return team.GetColor(); } - @Override - public void HandleChat(AsyncPlayerChatEvent event, String filteredMessage) - { - _gameChatManager.HandleChat(event, filteredMessage); - } - @Override public boolean CanHurt(String a, String b) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitEnderman.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitEnderman.java index dee911379..ea88ca7ed 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitEnderman.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitEnderman.java @@ -1,6 +1,8 @@ package nautilus.game.arcade.game.standalone.smash.kits; import java.util.HashMap; +import java.util.Iterator; +import java.util.Map.Entry; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -13,6 +15,8 @@ import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.C; import mineplex.core.disguise.disguises.DisguiseEnderman; import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.Perk; @@ -117,4 +121,25 @@ public class KitEnderman extends SmashKit Manager.GetDisguise().updateDisguise(disguise); } + + @EventHandler + public void cleanDisguises(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + for (Iterator> iterator = _disguises.entrySet().iterator(); iterator.hasNext();) + { + Entry current = iterator.next(); + + if (!Manager.GetDisguise().isDisguised(current.getKey())) + { + iterator.remove(); + } + else if (Manager.GetDisguise().getDisguise(current.getKey()) != current.getValue()) + { + iterator.remove(); + } + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitKnight.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitKnight.java index ebbe1690e..bcd1fd2e0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitKnight.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/standalone/smash/kits/KitKnight.java @@ -198,6 +198,7 @@ public class KitKnight extends SmashKit _calledEvents.add(newEvent); Manager.GetPlugin().getServer().getPluginManager().callEvent(newEvent); + _calledEvents.remove(newEvent); } @EventHandler(priority = EventPriority.LOWEST) @@ -223,13 +224,13 @@ public class KitKnight extends SmashKit Player player = (Player)horse.getPassenger(); //Damage Event - CustomDamageEvent newEvent = new CustomDamageEvent(player, event.GetDamagerEntity(true), event.GetProjectile(), + final CustomDamageEvent newEvent = new CustomDamageEvent(player, event.GetDamagerEntity(true), event.GetProjectile(), event.GetCause(), event.GetDamageInitial(), true, false, false, UtilEnt.getName(event.GetDamagerPlayer(true)), event.GetReason(), false); _calledEvents.add(newEvent); Manager.GetPlugin().getServer().getPluginManager().callEvent(newEvent); - + _calledEvents.remove(newEvent); //Add Knockback event.AddKnockback("Knockback Multiplier", 1.2); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/SmashKit.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/SmashKit.java index 58a5ef0b7..ab78e1d8a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/SmashKit.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/SmashKit.java @@ -5,7 +5,6 @@ import mineplex.core.common.util.UtilPlayer; import nautilus.game.arcade.ArcadeFormat; import nautilus.game.arcade.ArcadeManager; -import org.bukkit.Material; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java index bb85fc387..0cdd78697 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java @@ -37,8 +37,12 @@ public class GameChatManager implements Listener } } - public void HandleChat(AsyncPlayerChatEvent event, String filteredMessage) + @EventHandler + public void HandleChat(AsyncPlayerChatEvent event) { + if (event.isCancelled()) + return; + Player sender = event.getPlayer(); //Dead Prefix diff --git a/Plugins/Nautilus.Game.CaptureThePig/src/nautilus/game/capturethepig/CaptureThePig.java b/Plugins/Nautilus.Game.CaptureThePig/src/nautilus/game/capturethepig/CaptureThePig.java index 7b46aa0ab..36dedc85e 100644 --- a/Plugins/Nautilus.Game.CaptureThePig/src/nautilus/game/capturethepig/CaptureThePig.java +++ b/Plugins/Nautilus.Game.CaptureThePig/src/nautilus/game/capturethepig/CaptureThePig.java @@ -2,9 +2,9 @@ package nautilus.game.capturethepig; import org.bukkit.entity.Player; -import me.chiss.Core.Chat.Chat; import me.chiss.Core.PlayerTagNamer.INameColorer; import me.chiss.Core.Plugin.IRelation; +import mineplex.core.chat.Chat; import nautilus.game.capturethepig.arena.CaptureThePigArenaParser; import nautilus.game.capturethepig.arena.ICaptureThePigArena; import nautilus.game.capturethepig.engine.CaptureThePigGameEngine; diff --git a/Plugins/Nautilus.Game.Dominate/src/nautilus/game/dominate/Dominate.java b/Plugins/Nautilus.Game.Dominate/src/nautilus/game/dominate/Dominate.java index 04b1fcd07..838f5addf 100644 --- a/Plugins/Nautilus.Game.Dominate/src/nautilus/game/dominate/Dominate.java +++ b/Plugins/Nautilus.Game.Dominate/src/nautilus/game/dominate/Dominate.java @@ -2,7 +2,7 @@ package nautilus.game.dominate; import org.bukkit.entity.Player; -import me.chiss.Core.Chat.Chat; +import mineplex.core.chat.Chat; import nautilus.game.core.GamePlugin; import nautilus.game.core.arena.ArenaManager; import nautilus.game.dominate.arena.DominateArenaParser; diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/PvP.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/PvP.java index 068182756..149e03802 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/PvP.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/PvP.java @@ -2,7 +2,6 @@ package nautilus.game.pvp; import java.util.HashSet; -import me.chiss.Core.Chat.Chat; import me.chiss.Core.Class.ClassFactory; import me.chiss.Core.Config.Config; import me.chiss.Core.Field.Field; @@ -31,6 +30,7 @@ import mineplex.core.account.CoreClient; import mineplex.core.account.CoreClientManager; import mineplex.core.antistack.AntiStack; import mineplex.core.blockrestore.BlockRestore; +import mineplex.core.chat.Chat; import mineplex.core.command.CommandCenter; import mineplex.core.common.util.C; import mineplex.core.common.util.F;