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

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

import java.util.Locale;
import com.hypixel.hytale.component.ComponentAccessor;
import com.hypixel.hytale.server.core.universe.world.World;
import com.hypixel.hytale.server.core.modules.entity.damage.DamageCause;
import it.unimi.dsi.fastutil.objects.Object2FloatMap;
import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.combat.DamageCalculator;
import com.hypixel.hytale.server.core.inventory.ItemStack;
import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.combat.DamageEffects;
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
import com.hypixel.hytale.protocol.ChangeStatBehaviour;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.server.core.modules.entitystats.EntityStatMap;
import com.hypixel.hytale.server.core.asset.type.entityeffect.config.EntityEffect;
import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.CommandBuffer;
import com.hypixel.hytale.server.core.modules.entity.damage.DamageCalculatorSystems;
import javax.annotation.Nullable;
import com.hypixel.hytale.server.core.Message;
import javax.annotation.Nonnull;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.server.core.modules.entity.damage.Damage;

public class ActiveEntityEffect implements Damage.Source
{
    @Nonnull
    public static final BuilderCodec<ActiveEntityEffect> CODEC;
    private static final float DEFAULT_DURATION = 1.0f;
    @Nonnull
    private static final Message MESSAGE_GENERAL_DAMAGE_CAUSES_UNKNOWN;
    protected String entityEffectId;
    protected int entityEffectIndex;
    protected float initialDuration;
    protected float remainingDuration;
    protected boolean infinite;
    protected boolean debuff;
    @Nullable
    protected String statusEffectIcon;
    private float sinceLastDamage;
    private boolean hasBeenDamaged;
    protected boolean invulnerable;
    private DamageCalculatorSystems.Sequence sequentialHits;
    
    public ActiveEntityEffect() {
    }
    
    public ActiveEntityEffect(@Nonnull final String entityEffectId, final int entityEffectIndex, final float initialDuration, final float remainingDuration, final boolean infinite, final boolean debuff, @Nullable final String statusEffectIcon, final float sinceLastDamage, final boolean hasBeenDamaged, @Nonnull final DamageCalculatorSystems.Sequence sequentialHits, final boolean invulnerable) {
        this.entityEffectId = entityEffectId;
        this.entityEffectIndex = entityEffectIndex;
        this.initialDuration = initialDuration;
        this.remainingDuration = remainingDuration;
        this.infinite = infinite;
        this.debuff = debuff;
        this.statusEffectIcon = statusEffectIcon;
        this.sinceLastDamage = sinceLastDamage;
        this.hasBeenDamaged = hasBeenDamaged;
        this.sequentialHits = sequentialHits;
        this.invulnerable = invulnerable;
    }
    
    public ActiveEntityEffect(@Nonnull final String entityEffectId, final int entityEffectIndex, final float duration, final boolean debuff, @Nullable final String statusEffectIcon, final boolean invulnerable) {
        this(entityEffectId, entityEffectIndex, duration, duration, false, debuff, statusEffectIcon, 0.0f, false, new DamageCalculatorSystems.Sequence(), invulnerable);
    }
    
    public ActiveEntityEffect(@Nonnull final String entityEffectId, final int entityEffectIndex, final boolean infinite, final boolean invulnerable) {
        this(entityEffectId, entityEffectIndex, 1.0f, 1.0f, infinite, false, "", 0.0f, false, new DamageCalculatorSystems.Sequence(), invulnerable);
    }
    
    public void tick(@Nonnull final CommandBuffer<EntityStore> commandBuffer, @Nonnull final Ref<EntityStore> ref, @Nonnull final EntityEffect entityEffect, @Nonnull final EntityStatMap entityStatMapComponent, final float dt) {
        final int cyclesToRun = this.calculateCyclesToRun(entityEffect, dt);
        this.tickDamage(commandBuffer, ref, entityEffect, cyclesToRun);
        tickStatChanges(commandBuffer, ref, entityEffect, entityStatMapComponent, cyclesToRun);
        if (!this.infinite) {
            this.remainingDuration -= dt;
        }
    }
    
    private int calculateCyclesToRun(@Nonnull final EntityEffect entityEffect, final float dt) {
        int cycles = 0;
        final float damageCalculatorCooldown = entityEffect.getDamageCalculatorCooldown();
        if (damageCalculatorCooldown > 0.0f) {
            this.sinceLastDamage += dt;
            cycles = MathUtil.fastFloor(this.sinceLastDamage / damageCalculatorCooldown);
            this.sinceLastDamage %= damageCalculatorCooldown;
        }
        else if (!this.hasBeenDamaged) {
            cycles = 1;
            this.hasBeenDamaged = true;
        }
        return cycles;
    }
    
    private static void tickStatChanges(@Nonnull final CommandBuffer<EntityStore> commandBuffer, @Nonnull final Ref<EntityStore> ref, @Nonnull final EntityEffect entityEffect, @Nonnull final EntityStatMap entityStatMapComponent, final int cyclesToRun) {
        final Int2FloatMap entityStats = entityEffect.getEntityStats();
        if (entityStats == null) {
            return;
        }
        if (cyclesToRun <= 0) {
            return;
        }
        final DamageEffects statModifierEffects = entityEffect.getStatModifierEffects();
        if (statModifierEffects != null) {
            statModifierEffects.spawnAtEntity(commandBuffer, ref);
        }
        entityStatMapComponent.processStatChanges(EntityStatMap.Predictable.ALL, entityStats, entityEffect.getValueType(), ChangeStatBehaviour.Add);
    }
    
    private void tickDamage(@Nonnull final CommandBuffer<EntityStore> commandBuffer, @Nonnull final Ref<EntityStore> ref, @Nonnull final EntityEffect entityEffect, final int cyclesToRun) {
        final DamageCalculator damageCalculator = entityEffect.getDamageCalculator();
        if (damageCalculator == null) {
            return;
        }
        if (cyclesToRun <= 0) {
            return;
        }
        final Object2FloatMap<DamageCause> relativeDamage = damageCalculator.calculateDamage(this.initialDuration);
        if (relativeDamage == null || relativeDamage.isEmpty()) {
            return;
        }
        final World world = commandBuffer.getExternalData().getWorld();
        final DamageEffects damageEffects = entityEffect.getDamageEffects();
        final Damage[] queueDamageCalculator;
        final Damage[] hits = queueDamageCalculator = DamageCalculatorSystems.queueDamageCalculator(world, relativeDamage, ref, commandBuffer, this, null);
        for (final Damage damageEvent : queueDamageCalculator) {
            final DamageCalculatorSystems.DamageSequence damageSequence = new DamageCalculatorSystems.DamageSequence(this.sequentialHits, damageCalculator);
            damageEvent.putMetaObject(DamageCalculatorSystems.DAMAGE_SEQUENCE, damageSequence);
            if (damageEffects != null) {
                damageEffects.addToDamage(damageEvent);
            }
            commandBuffer.invoke(ref, damageEvent);
        }
    }
    
    public int getEntityEffectIndex() {
        return this.entityEffectIndex;
    }
    
    public float getInitialDuration() {
        return this.initialDuration;
    }
    
    public float getRemainingDuration() {
        return this.remainingDuration;
    }
    
    public boolean isInfinite() {
        return this.infinite;
    }
    
    public boolean isDebuff() {
        return this.debuff;
    }
    
    public boolean isInvulnerable() {
        return this.invulnerable;
    }
    
    @Nonnull
    @Override
    public Message getDeathMessage(@Nonnull final Damage info, @Nonnull final Ref<EntityStore> targetRef, @Nonnull final ComponentAccessor<EntityStore> componentAccessor) {
        final EntityEffect entityEffect = EntityEffect.getAssetMap().getAsset(this.entityEffectIndex);
        Message damageCauseMessage;
        if (entityEffect != null) {
            final String locale = entityEffect.getLocale();
            final String reason = (locale != null) ? locale : entityEffect.getId().toLowerCase(Locale.ROOT);
            damageCauseMessage = Message.translation("server.general.damageCauses." + reason);
        }
        else {
            damageCauseMessage = ActiveEntityEffect.MESSAGE_GENERAL_DAMAGE_CAUSES_UNKNOWN;
        }
        return Message.translation("server.general.killedBy").param("damageSource", damageCauseMessage);
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "ActiveEntityEffect{entityEffectIndex='" + this.entityEffectIndex + "', initialDuration=" + this.initialDuration + ", remainingDuration=" + this.remainingDuration + ", damageCooldown=" + this.sinceLastDamage + ", hasBeenDamaged=" + this.hasBeenDamaged + ", sequentialHits=" + String.valueOf(this.sequentialHits) + ", infinite=" + this.infinite + ", debuff=" + this.debuff + ", statusEffectIcon=" + this.statusEffectIcon;
    }
    
    static {
        // 
        // This method could not be decompiled.
        // 
        // Original Bytecode:
        // 
        //     2: invokedynamic   BootstrapMethod #2, get:()Ljava/util/function/Supplier;
        //     7: invokestatic    com/hypixel/hytale/codec/builder/BuilderCodec.builder:(Ljava/lang/Class;Ljava/util/function/Supplier;)Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    10: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    13: dup            
        //    14: ldc_w           "EntityEffectId"
        //    17: getstatic       com/hypixel/hytale/codec/Codec.STRING:Lcom/hypixel/hytale/codec/codecs/simple/StringCodec;
        //    20: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    23: invokedynamic   BootstrapMethod #3, accept:()Ljava/util/function/BiConsumer;
        //    28: invokedynamic   BootstrapMethod #4, apply:()Ljava/util/function/Function;
        //    33: 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;
        //    36: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //    39: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    42: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    45: dup            
        //    46: ldc_w           "InitialDuration"
        //    49: getstatic       com/hypixel/hytale/codec/Codec.FLOAT:Lcom/hypixel/hytale/codec/codecs/simple/FloatCodec;
        //    52: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    55: invokedynamic   BootstrapMethod #5, accept:()Ljava/util/function/BiConsumer;
        //    60: invokedynamic   BootstrapMethod #6, apply:()Ljava/util/function/Function;
        //    65: 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;
        //    68: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //    71: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    74: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    77: dup            
        //    78: ldc_w           "RemainingDuration"
        //    81: getstatic       com/hypixel/hytale/codec/Codec.FLOAT:Lcom/hypixel/hytale/codec/codecs/simple/FloatCodec;
        //    84: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    87: invokedynamic   BootstrapMethod #7, accept:()Ljava/util/function/BiConsumer;
        //    92: invokedynamic   BootstrapMethod #8, apply:()Ljava/util/function/Function;
        //    97: 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;
        //   100: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   103: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   106: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   109: dup            
        //   110: ldc_w           "SinceLastDamage"
        //   113: getstatic       com/hypixel/hytale/codec/Codec.FLOAT:Lcom/hypixel/hytale/codec/codecs/simple/FloatCodec;
        //   116: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   119: invokedynamic   BootstrapMethod #9, accept:()Ljava/util/function/BiConsumer;
        //   124: invokedynamic   BootstrapMethod #10, apply:()Ljava/util/function/Function;
        //   129: 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;
        //   132: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   135: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   138: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   141: dup            
        //   142: ldc_w           "HasBeenDamaged"
        //   145: getstatic       com/hypixel/hytale/codec/Codec.BOOLEAN:Lcom/hypixel/hytale/codec/codecs/simple/BooleanCodec;
        //   148: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   151: invokedynamic   BootstrapMethod #11, accept:()Ljava/util/function/BiConsumer;
        //   156: invokedynamic   BootstrapMethod #12, apply:()Ljava/util/function/Function;
        //   161: 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;
        //   164: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   167: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   170: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   173: dup            
        //   174: ldc_w           "SequentialHits"
        //   177: getstatic       com/hypixel/hytale/server/core/modules/entity/damage/DamageCalculatorSystems$Sequence.CODEC:Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //   180: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   183: invokedynamic   BootstrapMethod #13, accept:()Ljava/util/function/BiConsumer;
        //   188: invokedynamic   BootstrapMethod #14, apply:()Ljava/util/function/Function;
        //   193: 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;
        //   196: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   199: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   202: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   205: dup            
        //   206: ldc_w           "Infinite"
        //   209: getstatic       com/hypixel/hytale/codec/Codec.BOOLEAN:Lcom/hypixel/hytale/codec/codecs/simple/BooleanCodec;
        //   212: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   215: invokedynamic   BootstrapMethod #15, accept:()Ljava/util/function/BiConsumer;
        //   220: invokedynamic   BootstrapMethod #16, apply:()Ljava/util/function/Function;
        //   225: 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;
        //   228: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   231: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   234: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   237: dup            
        //   238: ldc_w           "Debuff"
        //   241: getstatic       com/hypixel/hytale/codec/Codec.BOOLEAN:Lcom/hypixel/hytale/codec/codecs/simple/BooleanCodec;
        //   244: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   247: invokedynamic   BootstrapMethod #17, accept:()Ljava/util/function/BiConsumer;
        //   252: invokedynamic   BootstrapMethod #18, apply:()Ljava/util/function/Function;
        //   257: 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;
        //   260: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   263: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   266: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   269: dup            
        //   270: ldc_w           "StatusEffectIcon"
        //   273: getstatic       com/hypixel/hytale/codec/Codec.STRING:Lcom/hypixel/hytale/codec/codecs/simple/StringCodec;
        //   276: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   279: invokedynamic   BootstrapMethod #19, accept:()Ljava/util/function/BiConsumer;
        //   284: invokedynamic   BootstrapMethod #20, apply:()Ljava/util/function/Function;
        //   289: 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;
        //   292: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   295: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   298: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   301: dup            
        //   302: ldc_w           "Invulnerable"
        //   305: getstatic       com/hypixel/hytale/codec/Codec.BOOLEAN:Lcom/hypixel/hytale/codec/codecs/simple/BooleanCodec;
        //   308: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   311: invokedynamic   BootstrapMethod #21, accept:()Ljava/util/function/BiConsumer;
        //   316: invokedynamic   BootstrapMethod #22, apply:()Ljava/util/function/Function;
        //   321: 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;
        //   324: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   327: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   330: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.build:()Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //   333: putstatic       com/hypixel/hytale/server/core/entity/effect/ActiveEntityEffect.CODEC:Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //   336: ldc_w           "server.general.damageCauses.unknown"
        //   339: invokestatic    com/hypixel/hytale/server/core/Message.translation:(Ljava/lang/String;)Lcom/hypixel/hytale/server/core/Message;
        //   342: putstatic       com/hypixel/hytale/server/core/entity/effect/ActiveEntityEffect.MESSAGE_GENERAL_DAMAGE_CAUSES_UNKNOWN:Lcom/hypixel/hytale/server/core/Message;
        //   345: return         
        // 
        // 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.visitClassType(TypeSubstitutionVisitor.java:267)
        //     at com.strobel.assembler.metadata.TypeSubstitutionVisitor.visitClassType(TypeSubstitutionVisitor.java:25)
        //     at com.strobel.assembler.metadata.TypeDefinition.accept(TypeDefinition.java:189)
        //     at com.strobel.assembler.metadata.TypeSubstitutionVisitor.visit(TypeSubstitutionVisitor.java:40)
        //     at com.strobel.assembler.metadata.TypeSubstitutionVisitor.visitMethod(TypeSubstitutionVisitor.java:324)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2586)
        //     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: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: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.inferCall(TypeAnalysis.java:2483)
        //     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:782)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2483)
        //     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.inferCall(TypeAnalysis.java:2483)
        //     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:782)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2483)
        //     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.inferCall(TypeAnalysis.java:2483)
        //     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:782)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2483)
        //     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.inferCall(TypeAnalysis.java:2483)
        //     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:782)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2483)
        //     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.");
    }
}
