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

package com.hypixel.hytale.server.spawning.beacons;

import com.hypixel.hytale.server.core.modules.entity.component.HiddenFromAdventurePlayers;
import com.hypixel.hytale.server.spawning.suppression.component.SpawnSuppressionComponent;
import com.hypixel.hytale.server.core.entity.nameplate.Nameplate;
import com.hypixel.hytale.server.core.modules.entity.component.DisplayNameComponent;
import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.server.core.modules.entity.component.PersistentModel;
import com.hypixel.hytale.server.core.modules.entity.component.ModelComponent;
import com.hypixel.hytale.server.core.entity.UUIDComponent;
import com.hypixel.hytale.server.core.asset.type.model.config.Model;
import com.hypixel.hytale.server.spawning.SpawningPlugin;
import com.hypixel.hytale.server.core.asset.type.model.config.ModelAsset;
import com.hypixel.hytale.component.Holder;
import com.hypixel.hytale.component.AddReason;
import it.unimi.dsi.fastutil.Pair;
import com.hypixel.hytale.math.vector.Vector3f;
import com.hypixel.hytale.server.npc.role.Role;
import com.hypixel.hytale.server.npc.components.SpawnBeaconReference;
import com.hypixel.hytale.component.CommandBuffer;
import com.hypixel.hytale.server.spawning.SpawningContext;
import com.hypixel.hytale.math.vector.Vector3d;
import java.time.Duration;
import com.hypixel.hytale.server.core.modules.entity.component.TransformComponent;
import com.hypixel.hytale.server.core.modules.time.WorldTimeResource;
import java.time.temporal.TemporalAmount;
import com.hypixel.hytale.math.random.RandomExtra;
import com.hypixel.hytale.server.spawning.assets.spawns.config.BeaconNPCSpawn;
import com.hypixel.hytale.server.npc.entities.NPCEntity;
import com.hypixel.hytale.server.core.entity.group.EntityGroup;
import com.hypixel.hytale.server.flock.FlockMembership;
import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.server.spawning.util.FloodFillPositionSelector;
import com.hypixel.hytale.protocol.GameMode;
import com.hypixel.hytale.server.core.entity.entities.Player;
import com.hypixel.hytale.component.ComponentAccessor;
import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.server.core.universe.world.World;
import com.hypixel.hytale.server.core.modules.entity.EntityModule;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.ComponentType;
import java.time.Instant;
import com.hypixel.hytale.server.spawning.wrappers.BeaconSpawnWrapper;
import javax.annotation.Nullable;
import java.util.UUID;
import com.hypixel.hytale.server.spawning.controllers.BeaconSpawnController;
import javax.annotation.Nonnull;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.server.core.entity.Entity;

public class LegacySpawnBeaconEntity extends Entity
{
    @Nonnull
    public static final BuilderCodec<LegacySpawnBeaconEntity> CODEC;
    private BeaconSpawnController spawnController;
    @Nullable
    protected UUID objectiveUUID;
    private BeaconSpawnWrapper spawnWrapper;
    private String spawnConfigId;
    private Instant nextSpawnAfter;
    private boolean nextSpawnAfterRealtime;
    @Nullable
    private Instant despawnSelfAfter;
    private int spawnAttempts;
    private int lastPlayerCount;
    
    @Nullable
    public static ComponentType<EntityStore, LegacySpawnBeaconEntity> getComponentType() {
        return EntityModule.get().getComponentType(LegacySpawnBeaconEntity.class);
    }
    
    public LegacySpawnBeaconEntity(@Nullable final World world) {
        super(world);
    }
    
    private LegacySpawnBeaconEntity() {
    }
    
    public String getSpawnConfigId() {
        return this.spawnConfigId;
    }
    
    public BeaconSpawnController getSpawnController() {
        return this.spawnController;
    }
    
    public void setSpawnController(@Nonnull final BeaconSpawnController spawnController) {
        this.spawnController = spawnController;
    }
    
    public Instant getNextSpawnAfter() {
        return this.nextSpawnAfter;
    }
    
    public boolean isNextSpawnAfterRealtime() {
        return this.nextSpawnAfterRealtime;
    }
    
    @Nullable
    public Instant getDespawnSelfAfter() {
        return this.despawnSelfAfter;
    }
    
    public void setSpawnAttempts(final int spawnAttempts) {
        this.spawnAttempts = spawnAttempts;
    }
    
    public BeaconSpawnWrapper getSpawnWrapper() {
        return this.spawnWrapper;
    }
    
    public void setSpawnWrapper(final BeaconSpawnWrapper spawnWrapper) {
        this.spawnWrapper = spawnWrapper;
    }
    
    public int getSpawnAttempts() {
        return this.spawnAttempts;
    }
    
    public int getLastPlayerCount() {
        return this.lastPlayerCount;
    }
    
    public void setLastPlayerCount(final int lastPlayerCount) {
        this.lastPlayerCount = lastPlayerCount;
    }
    
    private void setSpawnConfiguration(final BeaconSpawnWrapper spawn) {
        this.spawnWrapper = spawn;
    }
    
    private void setSpawnConfigId(final String spawnConfigId) {
        this.spawnConfigId = spawnConfigId;
    }
    
    @Nullable
    public UUID getObjectiveUUID() {
        return this.objectiveUUID;
    }
    
    public void setObjectiveUUID(@Nullable final UUID objectiveUUID) {
        this.objectiveUUID = objectiveUUID;
    }
    
    @Override
    public boolean isHiddenFromLivingEntity(@Nonnull final Ref<EntityStore> ref, @Nonnull final Ref<EntityStore> targetRef, @Nonnull final ComponentAccessor<EntityStore> componentAccessor) {
        final Player targetPlayerComponent = componentAccessor.getComponent(targetRef, Player.getComponentType());
        return targetPlayerComponent == null || targetPlayerComponent.getGameMode() != GameMode.Creative;
    }
    
    @Override
    public boolean isCollidable() {
        return false;
    }
    
    @Override
    public void moveTo(@Nonnull final Ref<EntityStore> ref, final double locX, final double locY, final double locZ, @Nonnull final ComponentAccessor<EntityStore> componentAccessor) {
        super.moveTo(ref, locX, locY, locZ, componentAccessor);
        final FloodFillPositionSelector floodFillPositionSelectorComponent = componentAccessor.getComponent(ref, FloodFillPositionSelector.getComponentType());
        assert floodFillPositionSelectorComponent != null;
        floodFillPositionSelectorComponent.setCalculatePositionsAfter(SpawnBeaconSystems.POSITION_CALCULATION_DELAY_RANGE[1]);
        floodFillPositionSelectorComponent.forceRebuildCache();
        this.spawnController.clearUnspawnableNPCs();
    }
    
    public void notifyFailedSpawn() {
        ++this.spawnAttempts;
    }
    
    public void notifySpawn(@Nonnull final Player target, @Nonnull final Ref<EntityStore> spawnedEntity, @Nonnull final Store<EntityStore> store) {
        this.processSpawn(spawnedEntity, target, store);
        final FlockMembership flockMembershipComponent = store.getComponent(spawnedEntity, FlockMembership.getComponentType());
        final Ref<EntityStore> flockReference = (flockMembershipComponent != null) ? flockMembershipComponent.getFlockRef() : null;
        if (flockReference != null && flockReference.isValid()) {
            final EntityGroup entityGroup = store.getComponent(flockReference, EntityGroup.getComponentType());
            entityGroup.forEachMemberExcludingSelf((member, sender, beacon, player) -> {
                if (!store.getArchetype(member).contains(NPCEntity.getComponentType())) {
                    return;
                }
                else {
                    beacon.processSpawn(member, player, store);
                    return;
                }
            }, spawnedEntity, this, target);
        }
        this.spawnController.onJobFinished(store);
    }
    
    public static void prepareNextSpawnTimer(@Nonnull final Ref<EntityStore> ref, @Nonnull final ComponentAccessor<EntityStore> componentAccessor) {
        final LegacySpawnBeaconEntity legacySpawnBeaconComponent = componentAccessor.getComponent(ref, getComponentType());
        assert legacySpawnBeaconComponent != null;
        final BeaconNPCSpawn beaconSpawn = legacySpawnBeaconComponent.spawnWrapper.getSpawn();
        final boolean realtime = beaconSpawn.isRespawnRealtime();
        if (realtime) {
            final Duration[] spawnAfterRange = beaconSpawn.getSpawnAfterRealTimeRange();
            final Duration nextValue = RandomExtra.randomDuration(spawnAfterRange[0], spawnAfterRange[1]);
            legacySpawnBeaconComponent.nextSpawnAfter = Instant.now().plus((TemporalAmount)nextValue);
            legacySpawnBeaconComponent.nextSpawnAfterRealtime = true;
        }
        else {
            final WorldTimeResource worldTimeResource = componentAccessor.getResource(WorldTimeResource.getResourceType());
            final Duration[] spawnAfterRange2 = beaconSpawn.getSpawnAfterGameTimeRange();
            final Duration nextValue2 = RandomExtra.randomDuration(spawnAfterRange2[0], spawnAfterRange2[1]);
            legacySpawnBeaconComponent.nextSpawnAfter = worldTimeResource.getGameTime().plus((TemporalAmount)nextValue2);
            legacySpawnBeaconComponent.nextSpawnAfterRealtime = false;
        }
        final TransformComponent transformComponent = componentAccessor.getComponent(ref, TransformComponent.getComponentType());
        assert transformComponent != null;
        transformComponent.markChunkDirty(componentAccessor);
    }
    
    public static void clearDespawnTimer(@Nonnull final Ref<EntityStore> ref, @Nonnull final ComponentAccessor<EntityStore> componentAccessor) {
        final LegacySpawnBeaconEntity legacySpawnBeaconComponent = componentAccessor.getComponent(ref, getComponentType());
        assert legacySpawnBeaconComponent != null;
        if (legacySpawnBeaconComponent.despawnSelfAfter == null) {
            return;
        }
        legacySpawnBeaconComponent.despawnSelfAfter = null;
        final TransformComponent transformComponent = componentAccessor.getComponent(ref, TransformComponent.getComponentType());
        assert transformComponent != null;
        transformComponent.markChunkDirty(componentAccessor);
    }
    
    public static void setToDespawnAfter(@Nonnull final Ref<EntityStore> ref, @Nullable final Duration duration, @Nonnull final ComponentAccessor<EntityStore> componentAccessor) {
        final LegacySpawnBeaconEntity legacySpawnBeaconComponent = componentAccessor.getComponent(ref, getComponentType());
        assert legacySpawnBeaconComponent != null;
        if (duration == null || legacySpawnBeaconComponent.despawnSelfAfter != null) {
            return;
        }
        final WorldTimeResource worldTimeResource = componentAccessor.getResource(WorldTimeResource.getResourceType());
        legacySpawnBeaconComponent.despawnSelfAfter = worldTimeResource.getGameTime().plus((TemporalAmount)duration);
        final TransformComponent transformComponent = componentAccessor.getComponent(ref, TransformComponent.getComponentType());
        assert transformComponent != null;
        transformComponent.markChunkDirty(componentAccessor);
    }
    
    public void markNPCUnspawnable(final int roleIndex) {
        this.spawnController.markNPCUnspawnable(roleIndex);
    }
    
    public boolean prepareSpawnContext(@Nonnull final Vector3d playerPosition, final int spawnsThisRound, final int roleIndex, @Nonnull final SpawningContext spawningContext, @Nonnull final CommandBuffer<EntityStore> commandBuffer) {
        final FloodFillPositionSelector floodFillPositionSelectorComponent = commandBuffer.getComponent(this.reference, FloodFillPositionSelector.getComponentType());
        assert floodFillPositionSelectorComponent != null;
        if (!floodFillPositionSelectorComponent.hasPositionsForRole(roleIndex)) {
            this.markNPCUnspawnable(roleIndex);
            return false;
        }
        return floodFillPositionSelectorComponent.prepareSpawnContext(playerPosition, spawnsThisRound, roleIndex, spawningContext, this.spawnWrapper);
    }
    
    private void processSpawn(@Nonnull final Ref<EntityStore> ref, @Nonnull final Player target, @Nonnull final Store<EntityStore> store) {
        final SpawnBeaconReference spawnBeaconReference = store.ensureAndGetComponent(ref, SpawnBeaconReference.getComponentType());
        spawnBeaconReference.getReference().setEntity(this.reference, store);
        spawnBeaconReference.refreshTimeoutCounter();
        this.spawnController.notifySpawnedEntityExists(ref, store);
        final NPCEntity npcComponent = store.getComponent(ref, NPCEntity.getComponentType());
        assert npcComponent != null;
        final Role role = npcComponent.getRole();
        final BeaconNPCSpawn spawn = this.spawnWrapper.getSpawn();
        role.getMarkedEntitySupport().setMarkedEntity(spawn.getTargetSlot(), target.getReference());
        final String spawnState = spawn.getNpcSpawnState();
        if (spawnState != null) {
            role.getStateSupport().setState(ref, spawnState, spawn.getNpcSpawnSubState(), store);
        }
    }
    
    @Nonnull
    public static Pair<Ref<EntityStore>, LegacySpawnBeaconEntity> create(@Nonnull final BeaconSpawnWrapper spawnWrapper, @Nonnull final Vector3d position, @Nonnull final Vector3f rotation, @Nonnull final ComponentAccessor<EntityStore> componentAccessor) {
        final Holder<EntityStore> holder = createHolder(spawnWrapper, position, rotation);
        final Ref<EntityStore> ref = componentAccessor.addEntity(holder, AddReason.SPAWN);
        final LegacySpawnBeaconEntity legacySpawnBeaconComponent = holder.getComponent(getComponentType());
        return Pair.of(ref, legacySpawnBeaconComponent);
    }
    
    public static Holder<EntityStore> createHolder(@Nonnull final BeaconSpawnWrapper spawnWrapper, @Nonnull final Vector3d position, @Nonnull final Vector3f rotation) {
        final LegacySpawnBeaconEntity entity = new LegacySpawnBeaconEntity();
        entity.setSpawnConfiguration(spawnWrapper);
        final BeaconNPCSpawn spawn = spawnWrapper.getSpawn();
        final String spawnConfigId = spawn.getId();
        entity.setSpawnConfigId(spawnConfigId);
        final String modelName = spawn.getModel();
        ModelAsset modelAsset = null;
        if (modelName != null && !modelName.isEmpty()) {
            modelAsset = ModelAsset.getAssetMap().getAsset(modelName);
        }
        Model model;
        if (modelAsset == null) {
            model = SpawningPlugin.get().getSpawnMarkerModel();
        }
        else {
            model = Model.createUnitScaleModel(modelAsset);
        }
        final Holder<EntityStore> holder = EntityStore.REGISTRY.newHolder();
        holder.addComponent(getComponentType(), entity);
        holder.addComponent(TransformComponent.getComponentType(), new TransformComponent(position, rotation));
        holder.ensureComponent(UUIDComponent.getComponentType());
        holder.addComponent(ModelComponent.getComponentType(), new ModelComponent(model));
        holder.addComponent(PersistentModel.getComponentType(), new PersistentModel(model.toReference()));
        final DisplayNameComponent displayNameComponent = new DisplayNameComponent(Message.raw(spawnConfigId));
        holder.addComponent(DisplayNameComponent.getComponentType(), displayNameComponent);
        holder.addComponent(Nameplate.getComponentType(), new Nameplate(spawnConfigId));
        final double[] initialSpawnDelay = spawn.getInitialSpawnDelay();
        if (initialSpawnDelay != null) {
            final InitialBeaconDelay delay = holder.ensureAndGetComponent(InitialBeaconDelay.getComponentType());
            delay.setupInitialSpawnDelay(initialSpawnDelay);
        }
        final String suppression = spawn.getSpawnSuppression();
        if (suppression != null && !suppression.isEmpty()) {
            holder.addComponent(SpawnSuppressionComponent.getComponentType(), new SpawnSuppressionComponent(suppression));
        }
        holder.ensureComponent(HiddenFromAdventurePlayers.getComponentType());
        return holder;
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "LegacySpawnBeaconEntity{nextSpawnAfter=" + String.valueOf(this.nextSpawnAfter) + ", nextSpawnAfterRealtime=" + this.nextSpawnAfterRealtime + ", despawnSelfAfter=" + String.valueOf(this.despawnSelfAfter) + ", spawnAttempts=" + this.spawnAttempts + ", lastPlayerCount=" + this.lastPlayerCount;
    }
    
    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/spawning/beacons/LegacySpawnBeaconEntity.$assertionsDisabled:Z
        //    16: ldc             Lcom/hypixel/hytale/server/spawning/beacons/LegacySpawnBeaconEntity;.class
        //    18: invokedynamic   BootstrapMethod #2, get:()Ljava/util/function/Supplier;
        //    23: getstatic       com/hypixel/hytale/server/core/entity/Entity.CODEC:Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //    26: 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;
        //    29: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    32: dup            
        //    33: ldc_w           "SpawnConfiguration"
        //    36: getstatic       com/hypixel/hytale/codec/Codec.STRING:Lcom/hypixel/hytale/codec/codecs/simple/StringCodec;
        //    39: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    42: invokedynamic   BootstrapMethod #3, accept:()Ljava/util/function/BiConsumer;
        //    47: invokedynamic   BootstrapMethod #4, apply:()Ljava/util/function/Function;
        //    52: 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;
        //    55: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //    58: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    61: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    64: dup            
        //    65: ldc_w           "NextSpawnAfter"
        //    68: getstatic       com/hypixel/hytale/codec/Codec.INSTANT:Lcom/hypixel/hytale/codec/function/FunctionCodec;
        //    71: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    74: invokedynamic   BootstrapMethod #5, accept:()Ljava/util/function/BiConsumer;
        //    79: invokedynamic   BootstrapMethod #6, apply:()Ljava/util/function/Function;
        //    84: 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;
        //    87: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //    90: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    93: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    96: dup            
        //    97: ldc_w           "NextSpawnAfterRealtime"
        //   100: getstatic       com/hypixel/hytale/codec/Codec.BOOLEAN:Lcom/hypixel/hytale/codec/codecs/simple/BooleanCodec;
        //   103: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   106: invokedynamic   BootstrapMethod #7, accept:()Ljava/util/function/BiConsumer;
        //   111: invokedynamic   BootstrapMethod #8, apply:()Ljava/util/function/Function;
        //   116: 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;
        //   119: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   122: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   125: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   128: dup            
        //   129: ldc_w           "DespawnSelfAfter"
        //   132: getstatic       com/hypixel/hytale/codec/Codec.INSTANT:Lcom/hypixel/hytale/codec/function/FunctionCodec;
        //   135: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   138: invokedynamic   BootstrapMethod #9, accept:()Ljava/util/function/BiConsumer;
        //   143: invokedynamic   BootstrapMethod #10, apply:()Ljava/util/function/Function;
        //   148: 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;
        //   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           "LastPlayerCount"
        //   164: getstatic       com/hypixel/hytale/codec/Codec.INTEGER:Lcom/hypixel/hytale/codec/codecs/simple/IntegerCodec;
        //   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: 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;
        //   183: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   186: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   189: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //   192: dup            
        //   193: ldc_w           "ObjectiveUUID"
        //   196: getstatic       com/hypixel/hytale/codec/Codec.UUID_BINARY:Lcom/hypixel/hytale/codec/codecs/UUIDBinaryCodec;
        //   199: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //   202: invokedynamic   BootstrapMethod #13, accept:()Ljava/util/function/BiConsumer;
        //   207: invokedynamic   BootstrapMethod #14, apply:()Ljava/util/function/Function;
        //   212: 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;
        //   215: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.add:()Lcom/hypixel/hytale/codec/builder/BuilderCodec$BuilderBase;
        //   218: checkcast       Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //   221: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.build:()Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //   224: putstatic       com/hypixel/hytale/server/spawning/beacons/LegacySpawnBeaconEntity.CODEC:Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //   227: 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.");
    }
}
