HyCodeYourTale
classpublicPriority 3

FieldcraftCategory

com.hypixel.hytale.server.core.asset.type.item.config.FieldcraftCategory

implements JsonAssetWithMap<String, DefaultAssetMap<String, FieldcraftCategory>>, NetworkSerializable

6

Methods

6

Public Methods

7

Fields

1

Constructors

Constants

AssetBuilderCodec<String, FieldcraftCategory>CODEC= AssetBuilderCodec.builder( FieldcraftCategory.class, FieldcraftCategory::new, ...

Constructors

protected
FieldcraftCategory()

Methods

Public Methods (6)

publicstatic
DefaultAssetMap<String, FieldcraftCategory> getAssetMap()
public
String getIcon()
public
String getId()
public
String getName()
public
com.hypixel.hytale.protocol.ItemCategory toPacket()
@Nonnull
public
String toString()
@Nonnull@Override

Fields

Protected Fields (5)

protectedAssetExtraInfo.Data data
protectedString icon
protectedString id
protectedString name
protectedint order

Private/Package Fields (2)

privateDefaultAssetMap<String, FieldcraftCategory> ASSET_MAP
privateSoftReference<com.hypixel.hytale.protocol.ItemCategory> cachedPacket

Inheritance

Parent
Current
Interface
Child

Use mouse wheel to zoom, drag to pan. Click nodes to navigate.

Related Classes

Source Code

package com.hypixel.hytale.server.core.asset.type.item.config;

import com.hypixel.hytale.assetstore.AssetExtraInfo;
import com.hypixel.hytale.assetstore.codec.AssetBuilderCodec;
import com.hypixel.hytale.assetstore.map.DefaultAssetMap;
import com.hypixel.hytale.assetstore.map.JsonAssetWithMap;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.server.core.asset.common.CommonAssetValidator;
import com.hypixel.hytale.server.core.io.NetworkSerializable;
import java.lang.ref.SoftReference;
import javax.annotation.Nonnull;

public class FieldcraftCategory
   implements JsonAssetWithMap<String, DefaultAssetMap<String, FieldcraftCategory>>,
   NetworkSerializable<com.hypixel.hytale.protocol.ItemCategory> {
   public static final AssetBuilderCodec<String, FieldcraftCategory> CODEC = AssetBuilderCodec.builder(
         FieldcraftCategory.class,
         FieldcraftCategory::new,
         Codec.STRING,
         (itemCategory, k) -> itemCategory.id = k,
         itemCategory -> itemCategory.id,
         (asset, data) -> asset.data = data,
         asset -> asset.data
      )
      .addField(new KeyedCodec<>("Name", Codec.STRING), (itemCategory, s) -> itemCategory.name = s, itemCategory -> itemCategory.name)
      .<String>append(new KeyedCodec<>("Icon", Codec.STRING), (itemCategory, s) -> itemCategory.icon = s, itemCategory -> itemCategory.icon)
      .addValidator(CommonAssetValidator.ICON_CRAFTING)
      .add()
      .addField(new KeyedCodec<>("Order", Codec.INTEGER), (itemCategory, s) -> itemCategory.order = s, itemCategory -> itemCategory.order)
      .build();
   private static DefaultAssetMap<String, FieldcraftCategory> ASSET_MAP;
   protected AssetExtraInfo.Data data;
   protected String id;
   protected String name;
   protected String icon;
   protected int order;
   private SoftReference<com.hypixel.hytale.protocol.ItemCategory> cachedPacket;

   public static DefaultAssetMap<String, FieldcraftCategory> getAssetMap() {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.StackOverflowError
      //   at java.base/java.lang.ThreadLocal$ThreadLocalMap.getEntry(ThreadLocal.java:491)
      //   at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:186)
      //   at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:171)
      //   at org.jetbrains.java.decompiler.main.DecompilerContext.getCurrentContext(DecompilerContext.java:67)
      //   at org.jetbrains.java.decompiler.main.DecompilerContext.getStructContext(DecompilerContext.java:137)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.lambda$isMappingInBounds$18(InvocationExprent.java:1598)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.lambda$isMappingInBounds$19(InvocationExprent.java:1648)
      //
      // Bytecode:
      // 00: getstatic com/hypixel/hytale/server/core/asset/type/item/config/FieldcraftCategory.ASSET_MAP Lcom/hypixel/hytale/assetstore/map/DefaultAssetMap;
      // 03: ifnonnull 14
      // 06: ldc com/hypixel/hytale/server/core/asset/type/item/config/FieldcraftCategory
      // 08: invokestatic com/hypixel/hytale/assetstore/AssetRegistry.getAssetStore (Ljava/lang/Class;)Lcom/hypixel/hytale/assetstore/AssetStore;
      // 0b: invokevirtual com/hypixel/hytale/assetstore/AssetStore.getAssetMap ()Lcom/hypixel/hytale/assetstore/AssetMap;
      // 0e: checkcast com/hypixel/hytale/assetstore/map/DefaultAssetMap
      // 11: putstatic com/hypixel/hytale/server/core/asset/type/item/config/FieldcraftCategory.ASSET_MAP Lcom/hypixel/hytale/assetstore/map/DefaultAssetMap;
      // 14: getstatic com/hypixel/hytale/server/core/asset/type/item/config/FieldcraftCategory.ASSET_MAP Lcom/hypixel/hytale/assetstore/map/DefaultAssetMap;
      // 17: areturn
   }

   protected FieldcraftCategory() {
   }

   @Nonnull
   public com.hypixel.hytale.protocol.ItemCategory toPacket() {
      com.hypixel.hytale.protocol.ItemCategory cached = this.cachedPacket == null ? null : this.cachedPacket.get();
      if (cached != null) {
         return cached;
      } else {
         com.hypixel.hytale.protocol.ItemCategory packet = new com.hypixel.hytale.protocol.ItemCategory();
         packet.id = this.id;
         packet.icon = this.icon;
         packet.name = this.name;
         packet.order = this.order;
         this.cachedPacket = new SoftReference<>(packet);
         return packet;
      }
   }

   public String getId() {
      return this.id;
   }

   public String getName() {
      return this.name;
   }

   public String getIcon() {
      return this.icon;
   }

   @Nonnull
   @Override
   public String toString() {
      return "FieldcraftCategory{id='" + this.id + "', name='" + this.name + "', icon='" + this.icon + "', order=" + this.order + "}";
   }
}