From 24557bc2b37deb6a0edf497d547471832457b1dd Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 26 Nov 2014 08:32:16 +1100 Subject: Update to Minecraft 1.8 For more information please see http://www.spigotmc.org/ --- .../java/net/minecraft/server/EntitySnowman.java | 89 ---------------------- 1 file changed, 89 deletions(-) delete mode 100644 src/main/java/net/minecraft/server/EntitySnowman.java (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 deleted file mode 100644 index 2811fb46..00000000 --- a/src/main/java/net/minecraft/server/EntitySnowman.java +++ /dev/null @@ -1,89 +0,0 @@ -package net.minecraft.server; - -// CraftBukkit start -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.craftbukkit.util.CraftMagicNumbers; -import org.bukkit.event.block.EntityBlockFormEvent; -// CraftBukkit end - -public class EntitySnowman extends EntityGolem implements IRangedEntity { - - public EntitySnowman(World world) { - super(world); - this.a(0.4F, 1.8F); - this.getNavigation().a(true); - this.goalSelector.a(1, new PathfinderGoalArrowAttack(this, 1.25D, 20, 10.0F)); - this.goalSelector.a(2, new PathfinderGoalRandomStroll(this, 1.0D)); - 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, EntityInsentient.class, 0, true, false, IMonster.a)); - } - - public boolean bk() { - return true; - } - - protected void aD() { - super.aD(); - this.getAttributeInstance(GenericAttributes.maxHealth).setValue(4.0D); - this.getAttributeInstance(GenericAttributes.d).setValue(0.20000000298023224D); - } - - public void e() { - super.e(); - int i = MathHelper.floor(this.locX); - int j = MathHelper.floor(this.locY); - int k = MathHelper.floor(this.locZ); - - if (this.L()) { - this.damageEntity(DamageSource.DROWN, 1.0F); - } - - if (this.world.getBiome(i, k).a(i, j, k) > 1.0F) { - this.damageEntity(CraftEventFactory.MELTING, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING - } - - for (int l = 0; l < 4; ++l) { - i = MathHelper.floor(this.locX + (double) ((float) (l % 2 * 2 - 1) * 0.25F)); - j = MathHelper.floor(this.locY); - k = MathHelper.floor(this.locZ + (double) ((float) (l / 2 % 2 * 2 - 1) * 0.25F)); - if (this.world.getType(i, j, k).getMaterial() == Material.AIR && this.world.getBiome(i, k).a(i, j, k) < 0.8F && Blocks.SNOW.canPlace(this.world, i, j, k)) { - // CraftBukkit start - org.bukkit.block.BlockState blockState = this.world.getWorld().getBlockAt(i, j, k).getState(); - blockState.setType(CraftMagicNumbers.getMaterial(Blocks.SNOW)); - - EntityBlockFormEvent event = new EntityBlockFormEvent(this.getBukkitEntity(), blockState.getBlock(), blockState); - this.world.getServer().getPluginManager().callEvent(event); - - if(!event.isCancelled()) { - blockState.update(true); - } - // CraftBukkit end - } - } - } - - protected Item getLoot() { - return Items.SNOW_BALL; - } - - protected void dropDeathLoot(boolean flag, int i) { - int j = this.random.nextInt(16); - - for (int k = 0; k < j; ++k) { - this.a(Items.SNOW_BALL, 1); - } - } - - public void a(EntityLiving entityliving, float f) { - 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 f1 = MathHelper.sqrt(d0 * d0 + d2 * d2) * 0.2F; - - entitysnowball.shoot(d0, d1 + (double) f1, d2, 1.6F, 12.0F); - this.makeSound("random.bow", 1.0F, 1.0F / (this.aI().nextFloat() * 0.4F + 0.8F)); - this.world.addEntity(entitysnowball); - } -} -- cgit v1.2.3