package net.minecraft.world.entity.boss;

import net.minecraft.world.entity.Pose;
import net.minecraft.network.protocol.Packet;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
import net.minecraft.world.entity.Entity;

public class EnderDragonPart extends Entity {
    public final EnderDragon parentMob;
    public final String name;
    private final EntityDimensions size;
    
    public EnderDragonPart(final EnderDragon bac, final String string, final float float3, final float float4) {
        super(bac.getType(), bac.level);
        this.size = EntityDimensions.scalable(float3, float4);
        this.refreshDimensions();
        this.parentMob = bac;
        this.name = string;
    }
    
    @Override
    protected void defineSynchedData() {
    }
    
    @Override
    protected void readAdditionalSaveData(final CompoundTag le) {
    }
    
    @Override
    protected void addAdditionalSaveData(final CompoundTag le) {
    }
    
    @Override
    public boolean isPickable() {
        return true;
    }
    
    @Override
    public boolean hurt(final DamageSource anw, final float float2) {
        return !this.isInvulnerableTo(anw) && this.parentMob.hurt(this, anw, float2);
    }
    
    @Override
    public boolean is(final Entity aom) {
        return this == aom || this.parentMob == aom;
    }
    
    @Override
    public Packet<?> getAddEntityPacket() {
        throw new UnsupportedOperationException();
    }
    
    @Override
    public EntityDimensions getDimensions(final Pose apj) {
        return this.size;
    }
}
