Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- public class EntityNew extends EntityPurgatoryAnimal
- {
- public EntityNew(World world)
- {
- super(world);
- this.texture = "/Purgatory/Mobs/Spider1.png";
- setSize(1.5F, 1.9F);
- this.setSize(1.4F, 0.9F);
- this.moveSpeed = 0.8F;
- }
- public double getMountedYOffset() {
- return (double)this.height * 0.75D - 0.5D;
- }
- protected boolean canTriggerWalking() {
- return false;
- }
- protected Entity findPlayerToAttack() {
- float var1 = this.getEntityBrightness(1.0F);
- if(var1 < 0.5F) {
- double var2 = 16.0D;
- return this.worldObj.getClosestPlayerToEntity(this, var2);
- } else {
- return null;
- }
- }
- public void writeEntityToNBT(NBTTagCompound nbttagcompound)
- {
- super.writeEntityToNBT(nbttagcompound);
- }
- public void readEntityFromNBT(NBTTagCompound nbttagcompound)
- {
- super.readEntityFromNBT(nbttagcompound);
- }
- protected void attackEntity(Entity var1, float var2) {
- float var3 = this.getEntityBrightness(1.0F);
- if(var3 > 0.5F && this.rand.nextInt(100) == 0) {
- this.playerToAttack = null;
- } else {
- if(var2 > 2.0F && var2 < 6.0F && this.rand.nextInt(10) == 0) {
- if(this.onGround) {
- double var4 = var1.posX - this.posX;
- double var6 = var1.posZ - this.posZ;
- float var8 = MathHelper.sqrt_double(var4 * var4 + var6 * var6);
- this.motionX = var4 / (double)var8 * 0.5D * 0.800000011920929D + this.motionX * 0.20000000298023224D;
- this.motionZ = var6 / (double)var8 * 0.5D * 0.800000011920929D + this.motionZ * 0.20000000298023224D;
- this.motionY = 0.4000000059604645D;
- }
- } else {
- super.attackEntity(var1, var2);
- }
- }
- }
- protected String getLivingSound() {
- return "mob.spider";
- }
- protected String getHurtSound() {
- return "mob.spider";
- }
- protected String getDeathSound() {
- return "mob.spiderdeath";
- }
- protected float getSoundVolume()
- {
- return 0.4F;
- }
- protected boolean canDespawn()
- {
- return false;
- }
- protected int getDropItemId() {
- return Item.silk.shiftedIndex;
- }
- public boolean isOnLadder() {
- return this.isCollidedHorizontally;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement