HyCodeYourTale
classpublicPriority 3

DeployableSpawner

com.hypixel.hytale.builtin.deployables.config.DeployableSpawner

implements JsonAssetWithMap<String, DefaultAssetMap<String, DeployableSpawner>>

4

Methods

4

Public Methods

5

Fields

2

Constructors

Constants

AssetBuilderCodec<String, DeployableSpawner>CODEC= AssetBuilderCodec.builder( DeployableSpawner.class, DeployableSpawner::new, Codec.STRING...

Constructors

public
DeployableSpawner(String id, DeployableConfig config, Vector3d[] positionOffsets)
public
DeployableSpawner()

Methods

Public Methods (4)

publicstatic
DefaultAssetMap<String, DeployableSpawner> getAssetMap()
public
DeployableConfig getConfig()
public
String getId()
public
Vector3d[] getPositionOffsets()

Fields

Protected Fields (2)

protectedAssetExtraInfo.Data data
protectedString id

Private/Package Fields (3)

privateDefaultAssetMap<String, DeployableSpawner> ASSET_MAP
privateDeployableConfig config
privateVector3d[] positionOffsets

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.builtin.deployables.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.codec.codecs.array.ArrayCodec;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.vector.Vector3d;

public class DeployableSpawner implements JsonAssetWithMap<String, DefaultAssetMap<String, DeployableSpawner>> {
   public static final AssetBuilderCodec<String, DeployableSpawner> CODEC = AssetBuilderCodec.builder(
         DeployableSpawner.class, DeployableSpawner::new, Codec.STRING, (t, k) -> t.id = k, t -> t.id, (asset, data) -> asset.data = data, asset -> asset.data
      )
      .append(new KeyedCodec<>("Config", DeployableConfig.CODEC), (i, s) -> i.config = s, i -> i.config)
      .addValidator(Validators.nonNull())
      .add()
      .append(new KeyedCodec<>("PositionOffsets", new ArrayCodec<>(Vector3d.CODEC, Vector3d[]::new)), (i, s) -> i.positionOffsets = s, i -> i.positionOffsets)
      .add()
      .build();
   private static DefaultAssetMap<String, DeployableSpawner> ASSET_MAP;
   protected String id;
   protected AssetExtraInfo.Data data;
   private DeployableConfig config;
   private Vector3d[] positionOffsets;

   public DeployableSpawner(String id, DeployableConfig config, Vector3d[] positionOffsets) {
      this.id = id;
      this.config = config;
      this.positionOffsets = positionOffsets;
   }

   public DeployableSpawner() {
   }

   public static DefaultAssetMap<String, DeployableSpawner> 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.util.HashMap.put(HashMap.java:619)
      //   at org.jetbrains.java.decompiler.struct.gen.generics.GenericType.mapGenVarsTo(GenericType.java:623)
      //   at org.jetbrains.java.decompiler.struct.gen.generics.GenericType.getGenericSuperType(GenericType.java:677)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.lambda$isMappingInBounds$18(InvocationExprent.java:1608)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.lambda$isMappingInBounds$19(InvocationExprent.java:1648)
      //
      // Bytecode:
      // 00: getstatic com/hypixel/hytale/builtin/deployables/config/DeployableSpawner.ASSET_MAP Lcom/hypixel/hytale/assetstore/map/DefaultAssetMap;
      // 03: ifnonnull 14
      // 06: ldc com/hypixel/hytale/builtin/deployables/config/DeployableSpawner
      // 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/builtin/deployables/config/DeployableSpawner.ASSET_MAP Lcom/hypixel/hytale/assetstore/map/DefaultAssetMap;
      // 14: getstatic com/hypixel/hytale/builtin/deployables/config/DeployableSpawner.ASSET_MAP Lcom/hypixel/hytale/assetstore/map/DefaultAssetMap;
      // 17: areturn
   }

   public Vector3d[] getPositionOffsets() {
      return this.positionOffsets;
   }

   public DeployableConfig getConfig() {
      return this.config;
   }

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