fixed kit items not spawning

horse pet doesnt spawn when dead
This commit is contained in:
Cheese 2015-04-03 12:10:02 +11:00
parent 43c58bd31c
commit f682bb8f9c
3 changed files with 14 additions and 1 deletions

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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());
}