final fixes for bacon brawl

This commit is contained in:
Cheese 2015-04-01 18:07:45 +11:00
parent 987bf266ee
commit 5737df8d6a
2 changed files with 5 additions and 9 deletions

View File

@ -78,21 +78,17 @@ public class KitMamaPig extends Kit
@EventHandler(priority=EventPriority.LOWEST)
public void damageTransfer(CustomDamageEvent event)
{
System.out.println("A");
if (event.IsCancelled())
return;
System.out.println("B");
if (!(event.GetDamageeEntity() instanceof Pig))
return;
System.out.println("C");
Pig pig = (Pig)event.GetDamageeEntity();
if (pig.getVehicle() == null || !(pig.getPassenger() instanceof LivingEntity))
if (pig.getVehicle() == null || !(pig.getVehicle() instanceof LivingEntity))
return;
System.out.println("D");
event.SetCancelled("Pig Damage");
Manager.GetDamage().NewDamageEvent((LivingEntity)pig.getVehicle(), event.GetDamagerEntity(true), event.GetProjectile(), event.GetCause(),
event.GetDamage(), event.IsKnockback(), event.IgnoreRate(), event.IgnoreArmor(), UtilEnt.getName(pig.getVehicle()), event.GetReason());
event.setDamagee((LivingEntity)pig.getVehicle());
}
}

View File

@ -65,7 +65,7 @@ public class PerkBaconBlast extends Perk implements IThrown
UtilInv.Update(player);
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.PORK, (byte)0, 16));
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection().multiply(1.5)), ItemStackFactory.Instance.CreateStack(Material.PORK, (byte)0, 16));
UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false);