package net.minecraft.world.entity.animal.horse;

import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.Items;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import javax.annotation.Nullable;
import net.minecraft.world.entity.AgableMob;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.entity.MobType;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.level.Level;
import net.minecraft.world.entity.EntityType;

public class ZombieHorse extends AbstractHorse {
    public ZombieHorse(final EntityType<? extends ZombieHorse> aoq, final Level bqb) {
        super(aoq, bqb);
    }
    
    public static AttributeSupplier.Builder createAttributes() {
        return AbstractHorse.createBaseHorseAttributes().add(Attributes.MAX_HEALTH, 15.0).add(Attributes.MOVEMENT_SPEED, 0.20000000298023224);
    }
    
    @Override
    protected void randomizeAttributes() {
        this.getAttribute(Attributes.JUMP_STRENGTH).setBaseValue(this.generateRandomJumpStrength());
    }
    
    @Override
    public MobType getMobType() {
        return MobType.UNDEAD;
    }
    
    @Override
    protected SoundEvent getAmbientSound() {
        super.getAmbientSound();
        return SoundEvents.ZOMBIE_HORSE_AMBIENT;
    }
    
    @Override
    protected SoundEvent getDeathSound() {
        super.getDeathSound();
        return SoundEvents.ZOMBIE_HORSE_DEATH;
    }
    
    @Override
    protected SoundEvent getHurtSound(final DamageSource anw) {
        super.getHurtSound(anw);
        return SoundEvents.ZOMBIE_HORSE_HURT;
    }
    
    @Nullable
    @Override
    public AgableMob getBreedOffspring(final AgableMob aok) {
        return EntityType.ZOMBIE_HORSE.create(this.level);
    }
    
    @Override
    public InteractionResult mobInteract(final Player bec, final InteractionHand anf) {
        final ItemStack bki4 = bec.getItemInHand(anf);
        if (!this.isTamed()) {
            return InteractionResult.PASS;
        }
        if (this.isBaby()) {
            return super.mobInteract(bec, anf);
        }
        if (bec.isSecondaryUseActive()) {
            this.openInventory(bec);
            return InteractionResult.sidedSuccess(this.level.isClientSide);
        }
        if (this.isVehicle()) {
            return super.mobInteract(bec, anf);
        }
        if (!bki4.isEmpty()) {
            if (bki4.getItem() == Items.SADDLE && !this.isSaddled()) {
                this.openInventory(bec);
                return InteractionResult.sidedSuccess(this.level.isClientSide);
            }
            final InteractionResult ang5 = bki4.interactLivingEntity(bec, this, anf);
            if (ang5.consumesAction()) {
                return ang5;
            }
        }
        this.doPlayerRide(bec);
        return InteractionResult.sidedSuccess(this.level.isClientSide);
    }
    
    @Override
    protected void addBehaviourGoals() {
    }
}
