diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-11-26 08:32:16 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2014-11-28 17:16:30 +1100 |
commit | 24557bc2b37deb6a0edf497d547471832457b1dd (patch) | |
tree | c560572889a3b0b34964a0cddb35dc87fda3c914 /src/main/java/net/minecraft/server/EntitySilverfish.java | |
parent | a4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff) | |
download | craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip |
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'src/main/java/net/minecraft/server/EntitySilverfish.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntitySilverfish.java | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java deleted file mode 100644 index ac5714f0..00000000 --- a/src/main/java/net/minecraft/server/EntitySilverfish.java +++ /dev/null @@ -1,171 +0,0 @@ -package net.minecraft.server; - -import net.minecraft.util.org.apache.commons.lang3.tuple.ImmutablePair; - -import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit - -public class EntitySilverfish extends EntityMonster { - - private int bp; - - public EntitySilverfish(World world) { - super(world); - this.a(0.3F, 0.7F); - } - - protected void aD() { - super.aD(); - this.getAttributeInstance(GenericAttributes.maxHealth).setValue(8.0D); - this.getAttributeInstance(GenericAttributes.d).setValue(0.6000000238418579D); - this.getAttributeInstance(GenericAttributes.e).setValue(1.0D); - } - - protected boolean g_() { - return false; - } - - protected Entity findTarget() { - double d0 = 8.0D; - - return this.world.findNearbyVulnerablePlayer(this, d0); - } - - protected String t() { - return "mob.silverfish.say"; - } - - protected String aT() { - return "mob.silverfish.hit"; - } - - protected String aU() { - return "mob.silverfish.kill"; - } - - public boolean damageEntity(DamageSource damagesource, float f) { - if (this.isInvulnerable()) { - return false; - } else { - if (this.bp <= 0 && (damagesource instanceof EntityDamageSource || damagesource == DamageSource.MAGIC)) { - this.bp = 20; - } - - return super.damageEntity(damagesource, f); - } - } - - protected void a(Entity entity, float f) { - if (this.attackTicks <= 0 && f < 1.2F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) { - this.attackTicks = 20; - this.n(entity); - } - } - - protected void a(int i, int j, int k, Block block) { - this.makeSound("mob.silverfish.step", 0.15F, 1.0F); - } - - protected Item getLoot() { - return Item.getById(0); - } - - public void h() { - this.aM = this.yaw; - super.h(); - } - - protected void bq() { - super.bq(); - if (!this.world.isStatic) { - int i; - int j; - int k; - int l; - - if (this.bp > 0) { - --this.bp; - if (this.bp == 0) { - i = MathHelper.floor(this.locX); - j = MathHelper.floor(this.locY); - k = MathHelper.floor(this.locZ); - boolean flag = false; - - for (int i1 = 0; !flag && i1 <= 5 && i1 >= -5; i1 = i1 <= 0 ? 1 - i1 : 0 - i1) { - for (l = 0; !flag && l <= 10 && l >= -10; l = l <= 0 ? 1 - l : 0 - l) { - for (int j1 = 0; !flag && j1 <= 10 && j1 >= -10; j1 = j1 <= 0 ? 1 - j1 : 0 - j1) { - if (this.world.getType(i + l, j + i1, k + j1) == Blocks.MONSTER_EGGS) { - // CraftBukkit start - if (CraftEventFactory.callEntityChangeBlockEvent(this, i + l, j + i1, k + j1, Blocks.AIR, 0).isCancelled()) { - continue; - } - // CraftBukkit end - if (!this.world.getGameRules().getBoolean("mobGriefing")) { - int k1 = this.world.getData(i + l, j + i1, k + j1); - ImmutablePair immutablepair = BlockMonsterEggs.b(k1); - - this.world.setTypeAndData(i + l, j + i1, k + j1, (Block) immutablepair.getLeft(), ((Integer) immutablepair.getRight()).intValue(), 3); - } else { - this.world.setAir(i + l, j + i1, k + j1, false); - } - - Blocks.MONSTER_EGGS.postBreak(this.world, i + l, j + i1, k + j1, 0); - if (this.random.nextBoolean()) { - flag = true; - break; - } - } - } - } - } - } - } - - if (this.target == null && !this.bS()) { - i = MathHelper.floor(this.locX); - j = MathHelper.floor(this.locY + 0.5D); - k = MathHelper.floor(this.locZ); - int l1 = this.random.nextInt(6); - Block block = this.world.getType(i + Facing.b[l1], j + Facing.c[l1], k + Facing.d[l1]); - - l = this.world.getData(i + Facing.b[l1], j + Facing.c[l1], k + Facing.d[l1]); - if (BlockMonsterEggs.a(block)) { - // CraftBukkit start - if (CraftEventFactory.callEntityChangeBlockEvent(this, i + Facing.b[l1], j + Facing.c[l1], k + Facing.d[l1], Blocks.MONSTER_EGGS, Block.getId(BlockMonsterEggs.getById(l))).isCancelled()) { - return; - } - // CraftBukkit end - - this.world.setTypeAndData(i + Facing.b[l1], j + Facing.c[l1], k + Facing.d[l1], Blocks.MONSTER_EGGS, BlockMonsterEggs.a(block, l), 3); - this.s(); - this.die(); - } else { - this.bQ(); - } - } else if (this.target != null && !this.bS()) { - this.target = null; - } - } - } - - public float a(int i, int j, int k) { - return this.world.getType(i, j - 1, k) == Blocks.STONE ? 10.0F : super.a(i, j, k); - } - - protected boolean j_() { - return true; - } - - public boolean canSpawn() { - if (super.canSpawn()) { - EntityHuman entityhuman = this.world.findNearbyPlayer(this, 5.0D); - - return entityhuman == null; - } else { - return false; - } - } - - public EnumMonsterType getMonsterType() { - return EnumMonsterType.ARTHROPOD; - } -} |