From f682bb8f9cae6a5ffba09817c672fb6082a0b597 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 3 Apr 2015 12:10:02 +1100 Subject: [PATCH] fixed kit items not spawning horse pet doesnt spawn when dead --- .../src/mineplex/core/common/util/UtilEnt.java | 5 +++++ .../src/mineplex/core/common/util/UtilInv.java | 5 +++++ .../src/nautilus/game/arcade/kit/perks/PerkHorsePet.java | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java index a502bd8e2..bf726be24 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java @@ -627,4 +627,9 @@ public class UtilEnt return null; } + + public static boolean inWater(LivingEntity ent) + { + return ent.getLocation().getBlock().getTypeId() == 8 || ent.getLocation().getBlock().getTypeId() == 9; + } } diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java index d15e401f2..393922947 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java @@ -79,11 +79,16 @@ public class UtilInv for (ItemStack stack : getItems(player, checkArmor, checkCursor)) { if (required <= 0) + { return true; + } if (stack == null) continue; + if (stack.getType() != item) + continue; + if (stack.getAmount() <= 0) continue; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java index e08d1f22a..e6717a68f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java @@ -49,6 +49,9 @@ public class PerkHorsePet extends Perk public void spawnHorse(Player player, boolean baby) { + if (!Manager.GetGame().IsAlive(player)) + return; + Manager.GetGame().CreatureAllowOverride = true; Horse horse = player.getWorld().spawn(player.getLocation(), Horse.class); Manager.GetGame().CreatureAllowOverride = false; @@ -181,7 +184,7 @@ public class PerkHorsePet extends Perk //Damage Event Manager.GetDamage().NewDamageEvent((Player)ent, event.GetDamagerEntity(true), event.GetProjectile(), - event.GetCause(), event.GetDamage() * 0.25, true, false, false, + event.GetCause(), event.GetDamage() * 0.5, true, false, false, UtilEnt.getName(event.GetDamagerEntity(true)), event.GetReason()); }