/******************************************************************************* * AbyssalCraft * Copyright (c) 2012 - 2017 Shinoow. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v3 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-3.0.txt * * Contributors: * Shinoow - implementation ******************************************************************************/ package com.shinoow.abyssalcraft.common.entity.demon; import net.minecraft.block.Block; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.init.SoundEvents; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import com.shinoow.abyssalcraft.lib.ACConfig; import com.shinoow.abyssalcraft.lib.ACLoot; public class EntityDemonChicken extends EntityDemonAnimal { public float field_70886_e; public float destPos; public float field_70884_g; public float field_70888_h; public float field_70889_i = 1.0F; public EntityDemonChicken(World par1World) { super(par1World); setSize(0.3F, 0.7F); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); if(ACConfig.hardcoreMode){ getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D); getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D); } else getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D); } @Override protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_CHICKEN_AMBIENT; } @Override protected SoundEvent getHurtSound() { return SoundEvents.ENTITY_GHAST_HURT; } @Override protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_CHICKEN_DEATH; } @Override protected void playStepSound(BlockPos pos, Block par4) { playSound(SoundEvents.ENTITY_CHICKEN_STEP, 0.15F, 1.0F); } @Override public void fall(float p_70069_1_, float par2) {} @Override public void onLivingUpdate() { super.onLivingUpdate(); field_70888_h = field_70886_e; field_70884_g = destPos; destPos = (float)(destPos + (onGround ? -1 : 4) * 0.3D); if (destPos < 0.0F) destPos = 0.0F; if (destPos > 1.0F) destPos = 1.0F; if (!onGround && field_70889_i < 1.0F) field_70889_i = 1.0F; field_70889_i = (float)(field_70889_i * 0.9D); if (!onGround && motionY < 0.0D) motionY *= 0.6D; field_70886_e += field_70889_i * 2.0F; } @Override protected ResourceLocation getLootTable(){ return ACLoot.ENTITY_DEMON_CHICKEN; } }