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

package com.hypixel.hytale.builtin.adventure.farming.interactions;

import com.hypixel.hytale.component.Holder;
import com.hypixel.hytale.component.Ref;
import java.time.Instant;
import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.server.core.asset.type.blocktype.config.farming.FarmingData;
import com.hypixel.hytale.server.core.asset.type.blocktype.config.BlockType;
import com.hypixel.hytale.server.core.universe.world.chunk.WorldChunk;
import com.hypixel.hytale.component.ComponentAccessor;
import com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection;
import com.hypixel.hytale.component.AddReason;
import com.hypixel.hytale.builtin.adventure.farming.states.FarmingBlock;
import com.hypixel.hytale.server.core.modules.block.BlockModule;
import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
import com.hypixel.hytale.server.core.asset.type.blocktype.config.farming.FarmingStageData;
import com.hypixel.hytale.server.core.universe.world.chunk.BlockComponentChunk;
import com.hypixel.hytale.server.core.modules.time.WorldTimeResource;
import com.hypixel.hytale.protocol.InteractionState;
import com.hypixel.hytale.math.util.ChunkUtil;
import com.hypixel.hytale.server.core.modules.interaction.interaction.CooldownHandler;
import com.hypixel.hytale.math.vector.Vector3i;
import com.hypixel.hytale.server.core.inventory.ItemStack;
import com.hypixel.hytale.server.core.entity.InteractionContext;
import com.hypixel.hytale.protocol.InteractionType;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.CommandBuffer;
import com.hypixel.hytale.server.core.universe.world.World;
import javax.annotation.Nonnull;
import com.hypixel.hytale.protocol.WaitForDataFrom;
import javax.annotation.Nullable;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.logger.HytaleLogger;
import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.SimpleBlockInteraction;

public class ChangeFarmingStageInteraction extends SimpleBlockInteraction
{
    private static final HytaleLogger LOGGER;
    public static final BuilderCodec<ChangeFarmingStageInteraction> CODEC;
    protected int targetStage;
    @Nullable
    protected Integer increaseBy;
    @Nullable
    protected Integer decreaseBy;
    @Nullable
    protected String targetStageSet;
    
    public ChangeFarmingStageInteraction() {
        this.targetStage = -1;
        this.increaseBy = null;
        this.decreaseBy = null;
        this.targetStageSet = null;
    }
    
    @Nonnull
    @Override
    public WaitForDataFrom getWaitForDataFrom() {
        return WaitForDataFrom.Server;
    }
    
    @Override
    protected void interactWithBlock(@Nonnull final World world, @Nonnull final CommandBuffer<EntityStore> commandBuffer, @Nonnull final InteractionType type, @Nonnull final InteractionContext context, @Nullable final ItemStack itemInHand, @Nonnull final Vector3i targetBlock, @Nonnull final CooldownHandler cooldownHandler) {
        final int x = targetBlock.getX();
        final int y = targetBlock.getY();
        final int z = targetBlock.getZ();
        ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Starting interaction at pos=(%d, %d, %d), increaseBy=%s, decreaseBy=%s, targetStage=%d, targetStageSet=%s", x, y, z, this.increaseBy, this.decreaseBy, this.targetStage, this.targetStageSet);
        final WorldChunk worldChunk = world.getChunk(ChunkUtil.indexChunkFromBlock(x, z));
        if (worldChunk == null) {
            ChangeFarmingStageInteraction.LOGGER.atWarning().log("[ChangeFarmingStage] FAILED: worldChunk is null at pos=(%d, %d, %d)", x, y, z);
            context.getState().state = InteractionState.Failed;
            return;
        }
        final BlockType blockType = worldChunk.getBlockType(targetBlock);
        if (blockType == null) {
            ChangeFarmingStageInteraction.LOGGER.atWarning().log("[ChangeFarmingStage] FAILED: blockType is null at pos=(%d, %d, %d)", x, y, z);
            context.getState().state = InteractionState.Failed;
            return;
        }
        ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Block type: %s (id=%s)", blockType.getId(), blockType.getClass().getSimpleName());
        final FarmingData farmingConfig = blockType.getFarming();
        if (farmingConfig == null || farmingConfig.getStages() == null) {
            ChangeFarmingStageInteraction.LOGGER.atWarning().log("[ChangeFarmingStage] FAILED: farmingConfig is null or has no stages. blockType=%s, hasFarmingConfig=%s", blockType.getId(), farmingConfig != null);
            context.getState().state = InteractionState.Failed;
            return;
        }
        ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Farming config found. StartingStageSet=%s, StageSetAfterHarvest=%s, AvailableStageSets=%s", farmingConfig.getStartingStageSet(), farmingConfig.getStageSetAfterHarvest(), (farmingConfig.getStages() != null) ? farmingConfig.getStages().keySet() : "null");
        final Store<ChunkStore> chunkStore = world.getChunkStore().getStore();
        final WorldTimeResource worldTimeResource = world.getEntityStore().getStore().getResource(WorldTimeResource.getResourceType());
        final Instant now = worldTimeResource.getGameTime();
        final Ref<ChunkStore> chunkRef = world.getChunkStore().getChunkReference(ChunkUtil.indexChunkFromBlock(x, z));
        if (chunkRef == null) {
            ChangeFarmingStageInteraction.LOGGER.atWarning().log("[ChangeFarmingStage] FAILED: chunkRef is null at pos=(%d, %d, %d)", x, y, z);
            context.getState().state = InteractionState.Failed;
            return;
        }
        final BlockComponentChunk blockComponentChunk = chunkStore.getComponent(chunkRef, BlockComponentChunk.getComponentType());
        if (blockComponentChunk == null) {
            ChangeFarmingStageInteraction.LOGGER.atWarning().log("[ChangeFarmingStage] FAILED: blockComponentChunk is null at pos=(%d, %d, %d)", x, y, z);
            context.getState().state = InteractionState.Failed;
            return;
        }
        final int blockIndexColumn = ChunkUtil.indexBlockInColumn(x, y, z);
        Ref<ChunkStore> blockRef = blockComponentChunk.getEntityReference(blockIndexColumn);
        final boolean hadExistingBlockRef = blockRef != null;
        ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Initial blockRef from getEntityReference: %s", hadExistingBlockRef ? "exists" : "null");
        final String initialStageSetLookup = (this.targetStageSet != null) ? this.targetStageSet : farmingConfig.getStartingStageSet();
        FarmingStageData[] stages = farmingConfig.getStages().get(initialStageSetLookup);
        if (stages == null || stages.length == 0) {
            ChangeFarmingStageInteraction.LOGGER.atWarning().log("[ChangeFarmingStage] FAILED: stages is null or empty for stageSet=%s", initialStageSetLookup);
            context.getState().state = InteractionState.Failed;
            return;
        }
        ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Initial stages lookup: stageSet=%s, stageCount=%d", initialStageSetLookup, stages.length);
        FarmingBlock farmingBlock;
        if (blockRef == null) {
            ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Creating new block entity (harvest0 pattern)");
            final Holder<ChunkStore> blockEntity = ChunkStore.REGISTRY.newHolder();
            blockEntity.putComponent(BlockModule.BlockStateInfo.getComponentType(), new BlockModule.BlockStateInfo(blockIndexColumn, chunkRef));
            farmingBlock = new FarmingBlock();
            farmingBlock.setLastTickGameTime(now);
            farmingBlock.setCurrentStageSet((this.targetStageSet != null) ? this.targetStageSet : farmingConfig.getStartingStageSet());
            final int initStage = Math.max(0, stages.length - 2);
            farmingBlock.setGrowthProgress((float)initStage);
            blockEntity.addComponent(FarmingBlock.getComponentType(), farmingBlock);
            blockRef = chunkStore.addEntity(blockEntity, AddReason.SPAWN);
            ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Created new block entity with FarmingBlock: stageSet=%s, initialProgress=%d (second-to-last to avoid removal)", farmingBlock.getCurrentStageSet(), initStage);
            if (blockRef != null) {
                farmingBlock.setGrowthProgress((float)(stages.length - 1));
                ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Updated growthProgress to %d (actual final stage)", stages.length - 1);
            }
        }
        else {
            farmingBlock = chunkStore.getComponent(blockRef, FarmingBlock.getComponentType());
            final boolean hadExistingFarmingBlock = farmingBlock != null;
            ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Block entity exists, FarmingBlock component: %s", hadExistingFarmingBlock ? "exists" : "null");
            if (farmingBlock == null) {
                farmingBlock = new FarmingBlock();
                farmingBlock.setLastTickGameTime(now);
                farmingBlock.setCurrentStageSet((this.targetStageSet != null) ? this.targetStageSet : farmingConfig.getStartingStageSet());
                farmingBlock.setGrowthProgress((float)(stages.length - 1));
                chunkStore.putComponent(blockRef, FarmingBlock.getComponentType(), farmingBlock);
                ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Added FarmingBlock to existing entity: stageSet=%s, initialProgress=%d", farmingBlock.getCurrentStageSet(), stages.length - 1);
            }
            else {
                ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Existing FarmingBlock: stageSet=%s, growthProgress=%.2f, lastTickGameTime=%d", farmingBlock.getCurrentStageSet(), farmingBlock.getGrowthProgress(), farmingBlock.getLastTickGameTime());
            }
        }
        if (blockRef == null) {
            ChangeFarmingStageInteraction.LOGGER.atWarning().log("[ChangeFarmingStage] FAILED: blockRef is still null after entity creation");
            context.getState().state = InteractionState.Failed;
            return;
        }
        final String stageSetName = (this.targetStageSet != null) ? this.targetStageSet : farmingBlock.getCurrentStageSet();
        stages = farmingConfig.getStages().get(stageSetName);
        if (stages == null || stages.length == 0) {
            ChangeFarmingStageInteraction.LOGGER.atWarning().log("[ChangeFarmingStage] FAILED: stages null/empty after re-fetch with stageSet=%s", stageSetName);
            context.getState().state = InteractionState.Failed;
            return;
        }
        ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Using stageSet=%s with %d stages", stageSetName, stages.length);
        int currentStage = (int)farmingBlock.getGrowthProgress();
        final int originalCurrentStage;
        if ((originalCurrentStage = currentStage) >= stages.length) {
            ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Clamping currentStage from %d to %d (was >= stages.length)", currentStage, stages.length - 1);
            currentStage = stages.length - 1;
        }
        int stageIndex;
        if (this.increaseBy != null) {
            stageIndex = currentStage + this.increaseBy;
            ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Mode=INCREASE: %d + %d = %d", currentStage, this.increaseBy, stageIndex);
        }
        else if (this.decreaseBy != null) {
            stageIndex = currentStage - this.decreaseBy;
            ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Mode=DECREASE: %d - %d = %d", currentStage, this.decreaseBy, stageIndex);
        }
        else {
            stageIndex = this.targetStage;
            if (stageIndex < 0) {
                stageIndex = stages.length - 1;
            }
            ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Mode=ABSOLUTE: targetStage=%d, resolved=%d", this.targetStage, stageIndex);
        }
        final int preClampStageIndex = stageIndex;
        if (stageIndex < 0) {
            stageIndex = 0;
        }
        if (stageIndex >= stages.length) {
            stageIndex = stages.length - 1;
        }
        if (preClampStageIndex != stageIndex) {
            ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Clamped stageIndex from %d to %d", preClampStageIndex, stageIndex);
        }
        final int previousStageIndex = (int)farmingBlock.getGrowthProgress();
        FarmingStageData previousStage = null;
        final FarmingStageData[] currentStages = farmingConfig.getStages().get(farmingBlock.getCurrentStageSet());
        if (currentStages != null && previousStageIndex >= 0 && previousStageIndex < currentStages.length) {
            previousStage = currentStages[previousStageIndex];
        }
        ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Previous stage data: index=%d, hasPreviousStage=%s", previousStageIndex, previousStage != null);
        farmingBlock.setCurrentStageSet(stageSetName);
        farmingBlock.setGrowthProgress((float)stageIndex);
        farmingBlock.setExecutions(0);
        farmingBlock.setGeneration(farmingBlock.getGeneration() + 1);
        farmingBlock.setLastTickGameTime(now);
        ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Updated FarmingBlock: stageSet=%s, growthProgress=%d, generation=%d", stageSetName, stageIndex, farmingBlock.getGeneration());
        final Ref<ChunkStore> sectionRef = world.getChunkStore().getChunkSectionReference(ChunkUtil.chunkCoordinate(x), ChunkUtil.chunkCoordinate(y), ChunkUtil.chunkCoordinate(z));
        if (sectionRef != null) {
            final BlockSection section = chunkStore.getComponent(sectionRef, BlockSection.getComponentType());
            if (section != null) {
                section.scheduleTick(ChunkUtil.indexBlock(x, y, z), now);
            }
            stages[stageIndex].apply(chunkStore, sectionRef, blockRef, x, y, z, previousStage);
            ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] Applied stage %d via stages[%d].apply()", stageIndex, stageIndex);
        }
        else {
            ChangeFarmingStageInteraction.LOGGER.atWarning().log("[ChangeFarmingStage] sectionRef was null - could not apply stage!");
        }
        worldChunk.setTicking(x, y, z, true);
        ChangeFarmingStageInteraction.LOGGER.atInfo().log("[ChangeFarmingStage] SUCCESS: Changed stage from %d to %d at pos=(%d, %d, %d)", originalCurrentStage, stageIndex, x, y, z);
    }
    
    @Override
    protected void simulateInteractWithBlock(@Nonnull final InteractionType type, @Nonnull final InteractionContext context, @Nullable final ItemStack itemInHand, @Nonnull final World world, @Nonnull final Vector3i targetBlock) {
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "ChangeFarmingStageInteraction{targetStage=" + this.targetStage + ", increaseBy=" + this.increaseBy + ", decreaseBy=" + this.decreaseBy + ", targetStageSet='" + this.targetStageSet + "'} " + super.toString();
    }
    
    static {
        // 
        // This method could not be decompiled.
        // 
        // Original Bytecode:
        // 
        //     3: putstatic       com/hypixel/hytale/builtin/adventure/farming/interactions/ChangeFarmingStageInteraction.LOGGER:Lcom/hypixel/hytale/logger/HytaleLogger;
        //     6: ldc             Lcom/hypixel/hytale/builtin/adventure/farming/interactions/ChangeFarmingStageInteraction;.class
        //     8: invokedynamic   BootstrapMethod #1, get:()Ljava/util/function/Supplier;
        //    13: getstatic       com/hypixel/hytale/server/core/modules/interaction/interaction/config/client/SimpleBlockInteraction.CODEC:Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //    16: invokestatic    com/hypixel/hytale/codec/builder/BuilderCodec.builder:(Ljava/lang/Class;Ljava/util/function/Supplier;Lcom/hypixel/hytale/codec/builder/BuilderCodec;)Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    19: ldc_w           "Changes the farming stage of the target block."
        //    22: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.documentation:(Ljava/lang/String;)Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //    25: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    28: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    31: dup            
        //    32: ldc_w           "Stage"
        //    35: getstatic       com/hypixel/hytale/codec/Codec.INTEGER:Lcom/hypixel/hytale/codec/codecs/simple/IntegerCodec;
        //    38: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    41: invokedynamic   BootstrapMethod #2, accept:()Ljava/util/function/BiConsumer;
        //    46: invokedynamic   BootstrapMethod #3, apply:()Ljava/util/function/Function;
        //    51: invokedynamic   BootstrapMethod #4, accept:()Ljava/util/function/BiConsumer;
        //    56: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.appendInherited:(Lcom/hypixel/hytale/codec/KeyedCodec;Ljava/util/function/BiConsumer;Ljava/util/function/Function;Ljava/util/function/BiConsumer;)Lcom/hypixel/hytale/codec/builder/BuilderField$FieldBuilder;
        //    59: ldc_w           "The stage index to set (0, 1, 2, etc.). Use -1 for the final stage. Ignored if Increase is set."
        //    62: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.documentation:(Ljava/lang/String;)Lcom/hypixel/hytale/codec/builder/BuilderField$FieldBuilder;
        //    65: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //    68: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    71: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    74: dup            
        //    75: ldc_w           "Increase"
        //    78: getstatic       com/hypixel/hytale/codec/Codec.INTEGER:Lcom/hypixel/hytale/codec/codecs/simple/IntegerCodec;
        //    81: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    84: invokedynamic   BootstrapMethod #5, accept:()Ljava/util/function/BiConsumer;
        //    89: invokedynamic   BootstrapMethod #6, apply:()Ljava/util/function/Function;
        //    94: invokedynamic   BootstrapMethod #7, accept:()Ljava/util/function/BiConsumer;
        //    99: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.appendInherited:(Lcom/hypixel/hytale/codec/KeyedCodec;Ljava/util/function/BiConsumer;Ljava/util/function/Function;Ljava/util/function/BiConsumer;)Lcom/hypixel/hytale/codec/builder/BuilderField$FieldBuilder;
        //   102: ldc_w           "Add this amount to the current stage (e.g., 1 = advance one stage, 2 = advance two stages). Takes priority over Decrease and Stage."
        //   105: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.documentation:(Ljava/lang/String;)Lcom/hypixel/hytale/codec/builder/BuilderField$FieldBuilder;
        //   108: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   111: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   114: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   117: dup            
        //   118: ldc_w           "Decrease"
        //   121: getstatic       com/hypixel/hytale/codec/Codec.INTEGER:Lcom/hypixel/hytale/codec/codecs/simple/IntegerCodec;
        //   124: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   127: invokedynamic   BootstrapMethod #8, accept:()Ljava/util/function/BiConsumer;
        //   132: invokedynamic   BootstrapMethod #9, apply:()Ljava/util/function/Function;
        //   137: invokedynamic   BootstrapMethod #10, accept:()Ljava/util/function/BiConsumer;
        //   142: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.appendInherited:(Lcom/hypixel/hytale/codec/KeyedCodec;Ljava/util/function/BiConsumer;Ljava/util/function/Function;Ljava/util/function/BiConsumer;)Lcom/hypixel/hytale/codec/builder/BuilderField$FieldBuilder;
        //   145: ldc_w           "Subtract this amount from the current stage (e.g., 1 = go back one stage). Takes priority over Stage."
        //   148: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.documentation:(Ljava/lang/String;)Lcom/hypixel/hytale/codec/builder/BuilderField$FieldBuilder;
        //   151: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   154: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   157: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   160: dup            
        //   161: ldc_w           "StageSet"
        //   164: getstatic       com/hypixel/hytale/codec/Codec.STRING:Lcom/hypixel/hytale/codec/codecs/simple/StringCodec;
        //   167: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   170: invokedynamic   BootstrapMethod #11, accept:()Ljava/util/function/BiConsumer;
        //   175: invokedynamic   BootstrapMethod #12, apply:()Ljava/util/function/Function;
        //   180: invokedynamic   BootstrapMethod #13, accept:()Ljava/util/function/BiConsumer;
        //   185: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.appendInherited:(Lcom/hypixel/hytale/codec/KeyedCodec;Ljava/util/function/BiConsumer;Ljava/util/function/Function;Ljava/util/function/BiConsumer;)Lcom/hypixel/hytale/codec/builder/BuilderField$FieldBuilder;
        //   188: ldc_w           "Optional. The stage set to switch to (e.g., 'Default', 'Harvested'). If not provided, uses current stage set."
        //   191: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.documentation:(Ljava/lang/String;)Lcom/hypixel/hytale/codec/builder/BuilderField$FieldBuilder;
        //   194: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   197: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   200: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.build:()Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //   203: putstatic       com/hypixel/hytale/builtin/adventure/farming/interactions/ChangeFarmingStageInteraction.CODEC:Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //   206: 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.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: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: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.");
    }
}
