Class PrefabPreview

java.lang.Object
com.hypixel.hytale.server.core.modules.entity.component.PrefabPreview
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class PrefabPreview extends Object implements Component<EntityStore>
Runtime, network-synced counterpart of PersistentPrefabPreview. Holds the prefab resolved to a flat block list plus the current visible-layer count. The blocks are immutable once resolved, so a viewer receives them once when it first sees the entity. A visible-layer change re-sends only the count, and the client re-meshes from its cached blocks.
  • Constructor Details

    • PrefabPreview

      public PrefabPreview()
    • PrefabPreview

      public PrefabPreview(@Nonnull BlockChange[] blocks, @Nonnull FluidChange[] fluids, int visibleLayerCount, int biomeTint, int waterTint)
  • Method Details

    • getComponentType

      public static ComponentType<EntityStore, PrefabPreview> getComponentType()
    • getBlocks

      @Nonnull public BlockChange[] getBlocks()
    • getFluids

      @Nonnull public FluidChange[] getFluids()
    • getBiomeTint

      public int getBiomeTint()
    • getWaterTint

      public int getWaterTint()
    • getVisibleLayerCount

      public int getVisibleLayerCount()
    • setVisibleLayerCount

      public void setVisibleLayerCount(int visibleLayerCount)
    • consumeNetworkOutdated

      public boolean consumeNetworkOutdated()
    • clone

      @Nonnull public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.