diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java index d8492b753..f25fdedaa 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java @@ -29,18 +29,28 @@ import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; +import mineplex.core.itemstack.ItemStackFactory; import mineplex.minecraft.game.core.combat.event.ClearCombatEvent; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; public class CombatManager extends MiniPlugin { + public enum AttackReason + { + Attack, + CustomWeaponName, + DefaultWeaponName + } + private NautHashMap _active = new NautHashMap(); private NautHashMap _combatClients = new NautHashMap(); private HashSet _removeList = new HashSet(); protected long ExpireTime = 15000; + + protected AttackReason _attackReason = AttackReason.CustomWeaponName; public CombatManager(JavaPlugin plugin) { @@ -203,20 +213,40 @@ public class CombatManager extends MiniPlugin { Player damager = event.GetDamagerPlayer(false); - reason = "Fists"; - - if (damager.getItemInHand() != null) + + reason = "Attack"; + + if (_attackReason == AttackReason.DefaultWeaponName) { - ItemStack itemStack = CraftItemStack.asNMSCopy(damager - .getItemInHand()); - - if (itemStack != null) + reason = "Fists"; + + if (damager.getItemInHand() != null) { - reason = CraftItemStack.asNMSCopy( - damager.getItemInHand()).getName(); + byte data = 0; + if (damager.getItemInHand().getData() != null) + data = damager.getItemInHand().getData().getData(); + + reason = ItemStackFactory.Instance.GetName(damager.getItemInHand().getType(), data, false); } } - } else if (event.GetProjectile() != null) + else if (_attackReason == AttackReason.CustomWeaponName) + { + reason = "Fists"; + + if (damager.getItemInHand() != null) + { + ItemStack itemStack = CraftItemStack.asNMSCopy(damager + .getItemInHand()); + + if (itemStack != null) + { + reason = CraftItemStack.asNMSCopy( + damager.getItemInHand()).getName(); + } + } + } + } + else if (event.GetProjectile() != null) { if (event.GetProjectile() instanceof Arrow) reason = "Archery"; @@ -582,4 +612,14 @@ public class CombatManager extends MiniPlugin player.sendMessage(F.main(getName(), nameBuilder.toString())); } + + public void setUseWeaponName(AttackReason var) + { + _attackReason = var; + } + + public AttackReason getUseWeapoName() + { + return _attackReason; + } } 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 29d029683..f4fda6331 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 @@ -1332,12 +1332,12 @@ public abstract class Game implements Listener if (WinnerTeam != null && team.equals(WinnerTeam)) { for (Player player : team.GetPlayers(false)) - AddGems(player, 10, "Winning Team", false); + AddGems(player, 10, "Winning Team", false, false); } for (Player player : team.GetPlayers(false)) if (player.isOnline()) - AddGems(player, 10, "Participation", false); + AddGems(player, 10, "Participation", false, false); } //End diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/SearchAndDestroy.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/SearchAndDestroy.java index ce52c10b9..269904620 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/SearchAndDestroy.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/searchanddestroy/SearchAndDestroy.java @@ -11,6 +11,7 @@ import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.combat.CombatComponent; +import mineplex.minecraft.game.core.combat.CombatManager.AttackReason; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; @@ -68,6 +69,8 @@ public class SearchAndDestroy extends TeamGame DisableKillCommand = false; AllowParticles = false; DamageSelf = false; + + Manager.GetDamage().GetCombatManager().setUseWeaponName(AttackReason.DefaultWeaponName); } public ArrayList getBombs() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java index 5ab646033..6e68abc90 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java @@ -10,6 +10,7 @@ import mineplex.core.common.util.UtilTime; import mineplex.core.timing.TimingManager; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.combat.CombatManager.AttackReason; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.game.Game; @@ -161,6 +162,7 @@ public class GameCreationManager implements Listener Manager.GetExplosion().SetTNTSpread(true); // Manager.GetAntiStack().SetEnabled(true); Manager.getCosmeticManager().setHideParticles(false); + Manager.GetDamage().GetCombatManager().setUseWeaponName(AttackReason.CustomWeaponName); HashMap pastTeams = null;