Wizards: Melee with wands should say it was wands that did it
This commit is contained in:
parent
08140f8863
commit
3fcec13e68
@ -35,7 +35,6 @@ import mineplex.core.packethandler.IPacketHandler;
|
||||
import mineplex.core.packethandler.PacketInfo;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.CombatManager.AttackReason;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import mineplex.minecraft.game.core.explosion.CustomExplosion;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
@ -178,7 +177,7 @@ public class Wizards extends SoloGame
|
||||
}
|
||||
|
||||
Manager.getCosmeticManager().setHideParticles(true);
|
||||
Manager.GetDamage().GetCombatManager().setUseWeaponName(AttackReason.DefaultWeaponName);
|
||||
// Manager.GetDamage().GetCombatManager().setUseWeaponName(AttackReason.DefaultWeaponName);
|
||||
|
||||
createLoot();
|
||||
|
||||
@ -307,6 +306,31 @@ public class Wizards extends SoloGame
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWandHit(CustomDamageEvent event)
|
||||
{
|
||||
// Damager is ENTITY
|
||||
if (event.GetDamagerEntity(true) != null)
|
||||
{
|
||||
if (event.GetReason() == null)
|
||||
{
|
||||
if (event.GetDamagerPlayer(false) != null)
|
||||
{
|
||||
Player damager = event.GetDamagerPlayer(false);
|
||||
|
||||
if (damager.getInventory().getHeldItemSlot() < 5)
|
||||
{
|
||||
Wizard wizard = getWizard(damager);
|
||||
|
||||
String reason = damager.getInventory().getHeldItemSlot() < wizard.getWandsOwned() ? "Wand" : "Fist";
|
||||
|
||||
event.AddMod(reason, reason, 0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onDamage(CustomDamageEvent event)
|
||||
{
|
||||
@ -1587,7 +1611,7 @@ public class Wizards extends SoloGame
|
||||
|
||||
UtilPlayer.message(event.getViewers().get(0), C.cRed + "You may not craft weapons");
|
||||
}
|
||||
else if (mat == Material.STICK || mat.name().contains("_HOE"))
|
||||
else if (mat == Material.STICK || mat == Material.BUCKET || mat.name().contains("_HOE"))
|
||||
{
|
||||
event.getInventory().setResult(new ItemStack(Material.AIR));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user