From 60819c6693daf19dde68b04af38a4fee8c7da988 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Wed, 24 Oct 2012 22:53:23 -0500 Subject: Update CraftBukkit to Minecraft 1.4(.2). --- .../java/net/minecraft/server/EntitySnowman.java | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/main/java/net/minecraft/server/EntitySnowman.java') diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java index 9348b6a6..b6fe1c4b 100644 --- a/src/main/java/net/minecraft/server/EntitySnowman.java +++ b/src/main/java/net/minecraft/server/EntitySnowman.java @@ -5,21 +5,21 @@ import org.bukkit.event.block.EntityBlockFormEvent; import org.bukkit.event.entity.EntityDamageEvent; // CraftBukkit end -public class EntitySnowman extends EntityGolem { +public class EntitySnowman extends EntityGolem implements IRangedEntity { public EntitySnowman(World world) { super(world); this.texture = "/mob/snowman.png"; this.a(0.4F, 1.8F); this.getNavigation().a(true); - this.goalSelector.a(1, new PathfinderGoalArrowAttack(this, 0.25F, 2, 20)); + this.goalSelector.a(1, new PathfinderGoalArrowAttack(this, 0.25F, 20, 10.0F)); this.goalSelector.a(2, new PathfinderGoalRandomStroll(this, 0.2F)); this.goalSelector.a(3, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); this.goalSelector.a(4, new PathfinderGoalRandomLookaround(this)); - this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget(this, EntityMonster.class, 16.0F, 0, true)); + this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, true, false, IMonster.a)); } - public boolean aV() { + public boolean bb() { return true; } @@ -27,8 +27,8 @@ public class EntitySnowman extends EntityGolem { return 4; } - public void d() { - super.d(); + public void c() { + super.c(); if (this.G()) { // CraftBukkit start EntityDamageEvent event = new EntityDamageEvent(this.getBukkitEntity(), EntityDamageEvent.DamageCause.DROWNING, 1); @@ -93,4 +93,16 @@ public class EntitySnowman extends EntityGolem { org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } + + public void d(EntityLiving entityliving) { + EntitySnowball entitysnowball = new EntitySnowball(this.world, this); + double d0 = entityliving.locX - this.locX; + double d1 = entityliving.locY + (double) entityliving.getHeadHeight() - 1.100000023841858D - entitysnowball.locY; + double d2 = entityliving.locZ - this.locZ; + float f = MathHelper.sqrt(d0 * d0 + d2 * d2) * 0.2F; + + entitysnowball.shoot(d0, d1 + (double) f, d2, 1.6F, 12.0F); + this.world.makeSound(this, "random.bow", 1.0F, 1.0F / (this.aA().nextFloat() * 0.4F + 0.8F)); + this.world.addEntity(entitysnowball); + } } -- cgit v1.2.3