// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.core.entity;

import java.lang.invoke.CallSite;
import java.lang.reflect.UndeclaredThrowableException;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.StringConcatFactory;
import java.lang.invoke.MethodType;
import java.lang.invoke.MethodHandles;
import com.hypixel.hytale.server.core.modules.entity.damage.DamageCause;
import com.hypixel.hytale.protocol.MovementStates;
import com.hypixel.hytale.component.Archetype;
import java.util.concurrent.Executor;
import java.util.concurrent.CompletableFuture;
import com.hypixel.hytale.component.NonSerialized;
import com.hypixel.hytale.component.ComponentType;
import com.hypixel.hytale.server.core.entity.entities.Player;
import com.hypixel.hytale.component.Holder;
import org.bson.BsonDocument;
import java.util.function.Function;
import com.hypixel.hytale.codec.DirectDecodeCodec;
import org.bson.BsonValue;
import org.bson.BsonString;
import com.hypixel.hytale.codec.ExtraInfo;
import com.hypixel.hytale.server.core.modules.entity.EntityModule;
import java.util.Arrays;
import com.hypixel.hytale.component.ComponentAccessor;
import com.hypixel.hytale.component.Store;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import com.hypixel.hytale.event.IEventDispatcher;
import com.hypixel.hytale.component.RemoveReason;
import com.hypixel.hytale.server.core.event.events.entity.EntityRemoveEvent;
import com.hypixel.hytale.server.core.HytaleServer;
import com.hypixel.hytale.server.core.universe.world.chunk.WorldChunk;
import java.util.concurrent.atomic.AtomicBoolean;
import com.hypixel.hytale.server.core.modules.entity.component.TransformComponent;
import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.server.core.universe.world.World;
import javax.annotation.Nullable;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import java.util.UUID;
import com.hypixel.hytale.server.core.asset.type.model.config.Model;
import com.hypixel.hytale.codec.KeyedCodec;
import javax.annotation.Nonnull;
import com.hypixel.hytale.logger.HytaleLogger;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.Component;

public abstract class Entity implements Component<EntityStore>
{
    @Nonnull
    public static final HytaleLogger LOGGER;
    public static final int VERSION = 5;
    @Nonnull
    public static final KeyedCodec<Model.ModelReference> MODEL;
    @Nonnull
    public static final KeyedCodec<String> DISPLAY_NAME;
    @Nonnull
    public static final KeyedCodec<UUID> UUID;
    @Nonnull
    public static final BuilderCodec<Entity> CODEC;
    public static final int UNASSIGNED_ID = -1;
    protected int networkId;
    @Nullable
    protected UUID legacyUuid;
    @Nullable
    protected World world;
    @Nullable
    protected Ref<EntityStore> reference;
    @Deprecated
    private TransformComponent transformComponent;
    @Deprecated(forRemoval = true)
    protected String legacyDisplayName;
    @Nonnull
    protected final AtomicBoolean wasRemoved;
    @Nullable
    protected Throwable removedBy;
    
    @Deprecated
    public Entity(@Nullable final World world) {
        this();
        this.networkId = ((world != null) ? world.getEntityStore().takeNextNetworkId() : -1);
        this.world = world;
    }
    
    public Entity() {
        this.networkId = -1;
        this.wasRemoved = new AtomicBoolean();
    }
    
    @Deprecated(forRemoval = true)
    public void markNeedsSave() {
        if (this.transformComponent == null) {
            return;
        }
        final WorldChunk chunk = this.transformComponent.getChunk();
        if (chunk != null) {
            chunk.getEntityChunk().markNeedsSaving();
        }
    }
    
    public void setLegacyUUID(@Nullable final UUID uuid) {
        this.legacyUuid = uuid;
    }
    
    public boolean remove() {
        this.world.debugAssertInTickingThread();
        if (this.wasRemoved.getAndSet(true)) {
            return false;
        }
        this.removedBy = new Throwable();
        try {
            final String key = (this.world != null) ? this.world.getName() : null;
            final IEventDispatcher<EntityRemoveEvent, EntityRemoveEvent> dispatcher = HytaleServer.get().getEventBus().dispatchFor((Class<? super EntityRemoveEvent>)EntityRemoveEvent.class, key);
            if (dispatcher.hasListener()) {
                dispatcher.dispatch(new EntityRemoveEvent(this));
            }
            if (this.reference.isValid()) {
                this.world.getEntityStore().getStore().removeEntity(this.reference, RemoveReason.REMOVE);
            }
        }
        catch (final Throwable t) {
            this.wasRemoved.set(false);
        }
        return true;
    }
    
    public void loadIntoWorld(@Nonnull final World world) {
        if (this.world != null) {
            throw new IllegalArgumentException("Entity is already in a world! " + String.valueOf(this));
        }
        this.world = world;
        if (this.networkId == -1) {
            this.networkId = world.getEntityStore().takeNextNetworkId();
        }
    }
    
    public void unloadFromWorld() {
        if (this.world == null) {
            throw new IllegalArgumentException("Entity is already not in a world! " + String.valueOf(this));
        }
        this.networkId = -1;
        this.world = null;
    }
    
    @Deprecated(forRemoval = true)
    public int getNetworkId() {
        return this.networkId;
    }
    
    @Deprecated(forRemoval = true)
    public String getLegacyDisplayName() {
        return this.legacyDisplayName;
    }
    
    @Nullable
    @Deprecated(forRemoval = true)
    public UUID getUuid() {
        return this.legacyUuid;
    }
    
    @Deprecated(forRemoval = true)
    public void setTransformComponent(final TransformComponent transform) {
        this.transformComponent = transform;
    }
    
    @Deprecated(forRemoval = true)
    public TransformComponent getTransformComponent() {
        if (this.world == null || this.reference == null) {
            throw new IllegalStateException("Called before entity was init");
        }
        if (!this.world.isInThread()) {
            Entity.LOGGER.at(Level.WARNING).atMostEvery(5, TimeUnit.MINUTES).withCause(new Throwable()).log("getPositionComponent called async");
            return this.transformComponent;
        }
        final Store<EntityStore> store = this.world.getEntityStore().getStore();
        final TransformComponent transformComponent = store.getComponent(this.reference, TransformComponent.getComponentType());
        assert transformComponent != null;
        return transformComponent;
    }
    
    @Deprecated
    public void moveTo(@Nonnull final Ref<EntityStore> ref, final double locX, final double locY, final double locZ, @Nonnull final ComponentAccessor<EntityStore> componentAccessor) {
        final TransformComponent transformComponent = componentAccessor.getComponent(ref, TransformComponent.getComponentType());
        assert transformComponent != null;
        transformComponent.getPosition().assign(locX, locY, locZ);
    }
    
    @Nullable
    public World getWorld() {
        return this.world;
    }
    
    public boolean wasRemoved() {
        return this.wasRemoved.get();
    }
    
    public boolean isCollidable() {
        return true;
    }
    
    @Override
    public int hashCode() {
        int result = this.networkId;
        result = 31 * result + ((this.world != null) ? this.world.hashCode() : 0);
        return result;
    }
    
    @Override
    public boolean equals(@Nullable final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || this.getClass() != o.getClass()) {
            return false;
        }
        final Entity entity = (Entity)o;
        return this.networkId == entity.networkId && ((this.world != null) ? this.world.equals(entity.world) : (entity.world == null));
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "Entity{id=" + this.networkId + ", uuid=" + String.valueOf(this.legacyUuid) + ", reference='" + String.valueOf(this.reference) + "', world=" + ((this.world != null) ? this.world.getName() : null) + ", displayName='" + this.legacyDisplayName + "', wasRemoved='" + String.valueOf(this.wasRemoved) + "', removedBy='" + ((this.removedBy != null) ? /* invokedynamic(!) */ProcyonInvokeDynamicHelper_3.invoke(String.valueOf(this.removedBy), Arrays.toString(this.removedBy.getStackTrace())) : null) + "'}";
    }
    
    public boolean isHiddenFromLivingEntity(@Nonnull final Ref<EntityStore> ref, @Nonnull final Ref<EntityStore> targetRef, @Nonnull final ComponentAccessor<EntityStore> componentAccessor) {
        return false;
    }
    
    public void setReference(@Nonnull final Ref<EntityStore> reference) {
        if (this.reference != null && this.reference.isValid()) {
            throw new IllegalArgumentException("Entity already has a valid EntityReference: " + String.valueOf(this.reference) + " new reference " + String.valueOf(reference));
        }
        this.reference = reference;
    }
    
    @Nullable
    public Ref<EntityStore> getReference() {
        return this.reference;
    }
    
    @Deprecated
    public void clearReference() {
        this.reference = null;
    }
    
    @Override
    public Component<EntityStore> clone() {
        final DirectDecodeCodec<Entity> codec = EntityModule.get().getCodec(this.getClass());
        final Function<World, Entity> constructor = EntityModule.get().getConstructor(this.getClass());
        final BsonDocument document = codec.encode(this, ExtraInfo.THREAD_LOCAL.get()).asDocument();
        document.put("EntityType", new BsonString(EntityModule.get().getIdentifier(this.getClass())));
        final Entity t = constructor.apply(null);
        codec.decode(document, t, ExtraInfo.THREAD_LOCAL.get());
        return t;
    }
    
    public Holder<EntityStore> toHolder() {
        if (this.reference == null || !this.reference.isValid() || this.world == null) {
            final Holder<EntityStore> holder = EntityStore.REGISTRY.newHolder();
            if (this instanceof final Player player) {
                holder.addComponent(Player.getComponentType(), player);
            }
            else {
                final ComponentType<EntityStore, ? extends Entity> componentType = EntityModule.get().getComponentType(this.getClass());
                holder.addComponent((ComponentType<EntityStore, Entity>)componentType, this);
            }
            final DirectDecodeCodec<? extends Entity> codec = EntityModule.get().getCodec(this.getClass());
            if (codec == null) {
                holder.addComponent(EntityStore.REGISTRY.getNonSerializedComponentType(), NonSerialized.get());
            }
            return holder;
        }
        if (!this.world.isInThread()) {
            return CompletableFuture.supplyAsync(this::toHolder, this.world).join();
        }
        final Holder<EntityStore> holder = EntityStore.REGISTRY.newHolder();
        final Store<EntityStore> componentStore = this.world.getEntityStore().getStore();
        final Archetype<EntityStore> archetype = componentStore.getArchetype(this.reference);
        for (int i = archetype.getMinIndex(); i < archetype.length(); ++i) {
            final ComponentType componentType2 = archetype.get(i);
            if (componentType2 != null) {
                final Component component = componentStore.getComponent(this.reference, (ComponentType<EntityStore, Component>)componentType2);
                assert component != null;
                holder.addComponent((ComponentType<EntityStore, Component>)componentType2, component);
            }
        }
        return holder;
    }
    
    static {
        // 
        // This method could not be decompiled.
        // 
        // Original Bytecode:
        // 
        //     2: invokevirtual   java/lang/Class.desiredAssertionStatus:()Z
        //     5: ifne            12
        //     8: iconst_1       
        //     9: goto            13
        //    12: iconst_0       
        //    13: putstatic       com/hypixel/hytale/server/core/entity/Entity.$assertionsDisabled:Z
        //    16: invokestatic    com/hypixel/hytale/logger/HytaleLogger.forEnclosingClass:()Lcom/hypixel/hytale/logger/HytaleLogger;
        //    19: putstatic       com/hypixel/hytale/server/core/entity/Entity.LOGGER:Lcom/hypixel/hytale/logger/HytaleLogger;
        //    22: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    25: dup            
        //    26: ldc_w           "Model"
        //    29: getstatic       com/hypixel/hytale/server/core/asset/type/model/config/Model$ModelReference.CODEC:Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //    32: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    35: putstatic       com/hypixel/hytale/server/core/entity/Entity.MODEL:Lcom/hypixel/hytale/codec/KeyedCodec;
        //    38: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    41: dup            
        //    42: ldc_w           "DisplayName"
        //    45: getstatic       com/hypixel/hytale/codec/Codec.STRING:Lcom/hypixel/hytale/codec/codecs/simple/StringCodec;
        //    48: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    51: putstatic       com/hypixel/hytale/server/core/entity/Entity.DISPLAY_NAME:Lcom/hypixel/hytale/codec/KeyedCodec;
        //    54: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    57: dup            
        //    58: ldc_w           "UUID"
        //    61: getstatic       com/hypixel/hytale/codec/Codec.UUID_BINARY:Lcom/hypixel/hytale/codec/codecs/UUIDBinaryCodec;
        //    64: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    67: putstatic       com/hypixel/hytale/server/core/entity/Entity.UUID:Lcom/hypixel/hytale/codec/KeyedCodec;
        //    70: ldc             Lcom/hypixel/hytale/server/core/entity/Entity;.class
        //    72: invokestatic    com/hypixel/hytale/codec/builder/BuilderCodec.abstractBuilder:(Ljava/lang/Class;)Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    75: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.legacyVersioned:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //    78: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    81: iconst_5       
        //    82: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.codecVersion:(I)Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //    85: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    88: getstatic       com/hypixel/hytale/server/core/entity/Entity.DISPLAY_NAME:Lcom/hypixel/hytale/codec/KeyedCodec;
        //    91: invokedynamic   BootstrapMethod #6, accept:()Ljava/util/function/BiConsumer;
        //    96: invokedynamic   BootstrapMethod #7, apply:()Ljava/util/function/Function;
        //   101: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.append:(Lcom/hypixel/hytale/codec/KeyedCodec;Ljava/util/function/BiConsumer;Ljava/util/function/Function;)Lcom/hypixel/hytale/codec/builder/BuilderField$FieldBuilder;
        //   104: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   107: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   110: getstatic       com/hypixel/hytale/server/core/entity/Entity.UUID:Lcom/hypixel/hytale/codec/KeyedCodec;
        //   113: invokedynamic   BootstrapMethod #8, accept:()Ljava/util/function/BiConsumer;
        //   118: invokedynamic   BootstrapMethod #9, apply:()Ljava/util/function/Function;
        //   123: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.append:(Lcom/hypixel/hytale/codec/KeyedCodec;Ljava/util/function/BiConsumer;Ljava/util/function/Function;)Lcom/hypixel/hytale/codec/builder/BuilderField$FieldBuilder;
        //   126: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   129: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   132: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.build:()Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //   135: putstatic       com/hypixel/hytale/server/core/entity/Entity.CODEC:Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //   138: return         
        //    StackMapTable: 00 02 0C 40 01
        // 
        // The error that occurred was:
        // 
        // java.lang.UnsupportedOperationException: The requested operation is not supported.
        //     at com.strobel.util.ContractUtils.unsupported(ContractUtils.java:27)
        //     at com.strobel.assembler.metadata.TypeReference.getRawType(TypeReference.java:284)
        //     at com.strobel.assembler.metadata.TypeReference.getRawType(TypeReference.java:279)
        //     at com.strobel.assembler.metadata.TypeReference.makeGenericType(TypeReference.java:154)
        //     at com.strobel.assembler.metadata.TypeSubstitutionVisitor.visitParameterizedType(TypeSubstitutionVisitor.java:225)
        //     at com.strobel.assembler.metadata.TypeSubstitutionVisitor.visitParameterizedType(TypeSubstitutionVisitor.java:25)
        //     at com.strobel.assembler.metadata.ParameterizedType.accept(ParameterizedType.java:103)
        //     at com.strobel.assembler.metadata.TypeSubstitutionVisitor.visit(TypeSubstitutionVisitor.java:40)
        //     at com.strobel.assembler.metadata.TypeSubstitutionVisitor.visitParameterizedType(TypeSubstitutionVisitor.java:211)
        //     at com.strobel.assembler.metadata.TypeSubstitutionVisitor.visitParameterizedType(TypeSubstitutionVisitor.java:25)
        //     at com.strobel.assembler.metadata.ParameterizedType.accept(ParameterizedType.java:103)
        //     at com.strobel.assembler.metadata.TypeSubstitutionVisitor.visit(TypeSubstitutionVisitor.java:40)
        //     at com.strobel.assembler.metadata.TypeSubstitutionVisitor.visitMethod(TypeSubstitutionVisitor.java:314)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2611)
        //     at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1040)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:815)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:790)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2689)
        //     at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1040)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:815)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:782)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)
        //     at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1510)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:815)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:790)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2689)
        //     at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1040)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:815)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:790)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2689)
        //     at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1040)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:815)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:782)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)
        //     at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1510)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:815)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:790)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2689)
        //     at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1040)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:815)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:782)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)
        //     at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1083)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:815)
        //     at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:684)
        //     at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:667)
        //     at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:373)
        //     at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:95)
        //     at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:344)
        //     at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)
        //     at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:206)
        //     at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:93)
        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:868)
        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:761)
        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:638)
        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:605)
        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:195)
        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:162)
        //     at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:137)
        //     at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)
        //     at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)
        //     at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:333)
        //     at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:254)
        //     at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:129)
        // 
        throw new IllegalStateException("An error occurred while decompiling this method.");
    }
    
    public static class DefaultAnimations
    {
        @Nonnull
        public static final String DEATH = "Death";
        @Nonnull
        public static final String HURT = "Hurt";
        @Nonnull
        public static final String DESPAWN = "Despawn";
        @Nonnull
        public static final String SWIM_SUFFIX = "Swim";
        @Nonnull
        public static final String FLY_SUFFIX = "Fly";
        
        @Nonnull
        public static String[] getHurtAnimationIds(@Nonnull final MovementStates movementStates, @Nonnull final DamageCause damageCause) {
            final String animationId = damageCause.getAnimationId();
            if (movementStates.swimming) {
                return new String[] { animationId + "Swim", animationId, "Hurt" };
            }
            if (movementStates.flying) {
                return new String[] { animationId + "Fly", animationId, "Hurt" };
            }
            return new String[] { animationId, "Hurt" };
        }
        
        @Nonnull
        public static String[] getDeathAnimationIds(@Nonnull final MovementStates movementStates, @Nonnull final DamageCause damageCause) {
            final String animationId = damageCause.getDeathAnimationId();
            if (movementStates.swimming) {
                return new String[] { animationId + "Swim", animationId, "Death" };
            }
            if (movementStates.flying) {
                return new String[] { animationId + "Fly", animationId, "Death" };
            }
            return new String[] { animationId, "Death" };
        }
    }
    
    // This helper class was generated by Procyon to approximate the behavior of an
    // 'invokedynamic' instruction that it doesn't know how to interpret.
    private static final class ProcyonInvokeDynamicHelper_3
    {
        private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
        private static MethodHandle handle;
        private static volatile int fence;
        
        private static MethodHandle handle() {
            final MethodHandle handle = ProcyonInvokeDynamicHelper_3.handle;
            if (handle != null)
                return handle;
            return ProcyonInvokeDynamicHelper_3.ensureHandle();
        }
        
        private static MethodHandle ensureHandle() {
            ProcyonInvokeDynamicHelper_3.fence = 0;
            MethodHandle handle = ProcyonInvokeDynamicHelper_3.handle;
            if (handle == null) {
                MethodHandles.Lookup lookup = ProcyonInvokeDynamicHelper_3.LOOKUP;
                try {
                    handle = ((CallSite)StringConcatFactory.makeConcatWithConstants(lookup, "makeConcatWithConstants", MethodType.methodType(String.class, String.class, String.class), "\u0001\n\u0001")).dynamicInvoker();
                }
                catch (Throwable t) {
                    throw new UndeclaredThrowableException(t);
                }
                ProcyonInvokeDynamicHelper_3.fence = 1;
                ProcyonInvokeDynamicHelper_3.handle = handle;
                ProcyonInvokeDynamicHelper_3.fence = 0;
            }
            return handle;
        }
        
        private static String invoke(String p0, String p1) {
            try {
                return ProcyonInvokeDynamicHelper_3.handle().invokeExact(p0, p1);
            }
            catch (Throwable t) {
                throw new UndeclaredThrowableException(t);
            }
        }
    }
}
