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

package com.hypixel.hytale.server.core.modules.entityui.asset;

import javax.annotation.Nonnull;
import com.hypixel.hytale.assetstore.AssetRegistry;
import com.hypixel.hytale.assetstore.AssetStore;
import java.lang.ref.SoftReference;
import com.hypixel.hytale.protocol.Vector2f;
import com.hypixel.hytale.assetstore.AssetExtraInfo;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.assetstore.codec.AssetCodecMapCodec;
import com.hypixel.hytale.server.core.io.NetworkSerializable;
import com.hypixel.hytale.assetstore.map.IndexedLookupTableAssetMap;
import com.hypixel.hytale.assetstore.map.JsonAssetWithMap;

public abstract class EntityUIComponent implements JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, EntityUIComponent>>, NetworkSerializable<com.hypixel.hytale.protocol.EntityUIComponent>
{
    public static final AssetCodecMapCodec<String, EntityUIComponent> CODEC;
    public static final BuilderCodec<EntityUIComponent> ABSTRACT_CODEC;
    protected String id;
    protected AssetExtraInfo.Data data;
    private Vector2f hitboxOffset;
    private transient SoftReference<com.hypixel.hytale.protocol.EntityUIComponent> cachedPacket;
    private static AssetStore<String, EntityUIComponent, IndexedLookupTableAssetMap<String, EntityUIComponent>> ASSET_STORE;
    
    public static AssetStore<String, EntityUIComponent, IndexedLookupTableAssetMap<String, EntityUIComponent>> getAssetStore() {
        if (EntityUIComponent.ASSET_STORE == null) {
            EntityUIComponent.ASSET_STORE = AssetRegistry.getAssetStore(EntityUIComponent.class);
        }
        return EntityUIComponent.ASSET_STORE;
    }
    
    public static IndexedLookupTableAssetMap<String, EntityUIComponent> getAssetMap() {
        return getAssetStore().getAssetMap();
    }
    
    protected EntityUIComponent() {
        this.hitboxOffset = new Vector2f(0.0f, 0.0f);
    }
    
    @Nonnull
    public static EntityUIComponent getUnknownFor(final String id) {
        return new Unknown(id);
    }
    
    @Override
    public String getId() {
        return this.id;
    }
    
    @Nonnull
    @Override
    public final com.hypixel.hytale.protocol.EntityUIComponent toPacket() {
        final com.hypixel.hytale.protocol.EntityUIComponent cached = (this.cachedPacket == null) ? null : this.cachedPacket.get();
        if (cached != null) {
            return cached;
        }
        final com.hypixel.hytale.protocol.EntityUIComponent packet = this.generatePacket();
        this.cachedPacket = new SoftReference<com.hypixel.hytale.protocol.EntityUIComponent>(packet);
        return packet;
    }
    
    @Nonnull
    protected com.hypixel.hytale.protocol.EntityUIComponent generatePacket() {
        final com.hypixel.hytale.protocol.EntityUIComponent packet = new com.hypixel.hytale.protocol.EntityUIComponent();
        packet.hitboxOffset = this.hitboxOffset;
        return packet;
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "EntityUIComponentConfig{data=" + String.valueOf(this.data) + ", id='" + this.id + "', hitboxOffset='" + String.valueOf(this.hitboxOffset) + "'}";
    }
    
    static {
        // 
        // This method could not be decompiled.
        // 
        // Original Bytecode:
        // 
        //     3: dup            
        //     4: getstatic       com/hypixel/hytale/codec/Codec.STRING:Lcom/hypixel/hytale/codec/codecs/simple/StringCodec;
        //     7: invokedynamic   BootstrapMethod #1, accept:()Ljava/util/function/BiConsumer;
        //    12: invokedynamic   BootstrapMethod #2, apply:()Ljava/util/function/Function;
        //    17: invokedynamic   BootstrapMethod #3, accept:()Ljava/util/function/BiConsumer;
        //    22: invokedynamic   BootstrapMethod #4, apply:()Ljava/util/function/Function;
        //    27: invokespecial   com/hypixel/hytale/assetstore/codec/AssetCodecMapCodec.<init>:(Lcom/hypixel/hytale/codec/Codec;Ljava/util/function/BiConsumer;Ljava/util/function/Function;Ljava/util/function/BiConsumer;Ljava/util/function/Function;)V
        //    30: putstatic       com/hypixel/hytale/server/core/modules/entityui/asset/EntityUIComponent.CODEC:Lcom/hypixel/hytale/assetstore/codec/AssetCodecMapCodec;
        //    33: ldc             Lcom/hypixel/hytale/server/core/modules/entityui/asset/EntityUIComponent;.class
        //    35: invokestatic    com/hypixel/hytale/assetstore/codec/AssetBuilderCodec.abstractBuilder:(Ljava/lang/Class;)Lcom/hypixel/hytale/codec/builder/BuilderCodec$Builder;
        //    38: new             Lcom/hypixel/hytale/codec/KeyedCodec;
        //    41: dup            
        //    42: ldc             "HitboxOffset"
        //    44: getstatic       com/hypixel/hytale/server/core/codec/ProtocolCodecs.VECTOR2F:Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //    47: invokespecial   com/hypixel/hytale/codec/KeyedCodec.<init>:(Ljava/lang/String;Lcom/hypixel/hytale/codec/Codec;)V
        //    50: invokedynamic   BootstrapMethod #5, accept:()Ljava/util/function/BiConsumer;
        //    55: invokedynamic   BootstrapMethod #6, apply:()Ljava/util/function/Function;
        //    60: 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;
        //    63: ldc             "Offset from the centre of the entity's hitbox to display this component."
        //    65: invokevirtual   com/hypixel/hytale/codec/builder/BuilderField$FieldBuilder.documentation:(Ljava/lang/String;)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: invokevirtual   com/hypixel/hytale/codec/builder/BuilderCodec$Builder.build:()Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //    77: putstatic       com/hypixel/hytale/server/core/modules/entityui/asset/EntityUIComponent.ABSTRACT_CODEC:Lcom/hypixel/hytale/codec/builder/BuilderCodec;
        //    80: 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: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.runInference(TypeAnalysis.java:684)
        //     at com.strobel.decompiler.ast.TypeAnalysis.inferTypesForVariables(TypeAnalysis.java:593)
        //     at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:405)
        //     at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:95)
        //     at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)
        //     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.");
    }
    
    private static class Unknown extends EntityUIComponent
    {
        public Unknown(final String id) {
            this.id = id;
        }
        
        @Nonnull
        @Override
        protected com.hypixel.hytale.protocol.EntityUIComponent generatePacket() {
            final com.hypixel.hytale.protocol.EntityUIComponent packet = super.generatePacket();
            packet.unknown = true;
            return packet;
        }
    }
}
