Class FrameUtil

java.lang.Object
com.mrbysco.itemframes.util.FrameUtil

public class FrameUtil extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Supplier<com.hypixel.hytale.component.ComponentType<com.hypixel.hytale.server.core.universe.world.storage.EntityStore, ItemFrameComponent>>
    The component type for item frame components (For mod compatibility)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.hypixel.hytale.component.Ref<com.hypixel.hytale.server.core.universe.world.storage.EntityStore>
    getFrameEntity(com.hypixel.hytale.server.core.universe.world.World world, com.hypixel.hytale.math.vector.Vector3i pos)
    Get the item frame's entity store reference at the given position
    static com.hypixel.hytale.server.core.inventory.ItemStack
    getFrameItem(com.hypixel.hytale.server.core.universe.world.World world, com.hypixel.hytale.math.vector.Vector3i pos)
    Get the item in the item frame at the given position
    static com.hypixel.hytale.server.core.asset.type.model.config.Model
    getItemModel(com.hypixel.hytale.server.core.asset.type.item.config.Item item)
     
    static String
    getItemModelId(com.hypixel.hytale.server.core.asset.type.item.config.Item item)
     
    static boolean
    isFrameBlock(com.hypixel.hytale.server.core.universe.world.World world, com.hypixel.hytale.math.vector.Vector3i pos)
    Check if the block at the given position is an item frame
    static boolean
    Check if the given frame ID corresponds to an item frame
    static com.hypixel.hytale.component.Ref<com.hypixel.hytale.server.core.universe.world.storage.EntityStore>
    remakeItemEntity(com.hypixel.hytale.component.Store<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> store, com.hypixel.hytale.component.Ref<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> oldRef, com.hypixel.hytale.server.core.inventory.ItemStack stack, int yawDegrees)
    Remake the item entity for the given item stack
    static void
    removeVariantComponents(com.hypixel.hytale.component.Store<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> store, com.hypixel.hytale.component.Ref<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> ref)
     
    static boolean
    setFrameItem(com.hypixel.hytale.component.CommandBuffer<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> commandBuffer, com.hypixel.hytale.server.core.universe.world.World world, com.hypixel.hytale.math.vector.Vector3i pos, com.hypixel.hytale.server.core.inventory.ItemStack stack, boolean overwrite)
    Set the item in the item frame at the given position

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ITEM_FRAME_COMPONENT

      public static final Supplier<com.hypixel.hytale.component.ComponentType<com.hypixel.hytale.server.core.universe.world.storage.EntityStore, ItemFrameComponent>> ITEM_FRAME_COMPONENT
      The component type for item frame components (For mod compatibility)
  • Constructor Details

    • FrameUtil

      public FrameUtil()
  • Method Details

    • isItemFrame

      public static boolean isItemFrame(String frameId)
      Check if the given frame ID corresponds to an item frame
      Parameters:
      frameId - The frame ID to check
      Returns:
      True if the frame ID is an item frame, false otherwise
    • getFrameEntity

      public static com.hypixel.hytale.component.Ref<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> getFrameEntity(com.hypixel.hytale.server.core.universe.world.World world, com.hypixel.hytale.math.vector.Vector3i pos)
      Get the item frame's entity store reference at the given position
      Parameters:
      world - The world
      pos - The position of the item frame block
      Returns:
      The entity store reference of the item frame, or null if not found
    • isFrameBlock

      public static boolean isFrameBlock(com.hypixel.hytale.server.core.universe.world.World world, com.hypixel.hytale.math.vector.Vector3i pos)
      Check if the block at the given position is an item frame
      Parameters:
      world - The world
      pos - The position of the block to check
      Returns:
      True if the block is an item frame, false otherwise
    • setFrameItem

      public static boolean setFrameItem(com.hypixel.hytale.component.CommandBuffer<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> commandBuffer, com.hypixel.hytale.server.core.universe.world.World world, com.hypixel.hytale.math.vector.Vector3i pos, @Nullable com.hypixel.hytale.server.core.inventory.ItemStack stack, boolean overwrite)
      Set the item in the item frame at the given position
      Parameters:
      world - The world
      pos - The position of the item frame block
      stack - The item stack to set in the item frame
      overwrite - Whether to overwrite the existing item if present
      Returns:
      True if the item was set successfully, false otherwise
    • getFrameItem

      public static com.hypixel.hytale.server.core.inventory.ItemStack getFrameItem(com.hypixel.hytale.server.core.universe.world.World world, com.hypixel.hytale.math.vector.Vector3i pos)
      Get the item in the item frame at the given position
      Parameters:
      world - The world
      pos - The position of the item frame block
      Returns:
      The item stack in the item frame, or null if not found
    • remakeItemEntity

      public static com.hypixel.hytale.component.Ref<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> remakeItemEntity(@Nonnull com.hypixel.hytale.component.Store<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> store, @Nonnull com.hypixel.hytale.component.Ref<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> oldRef, @Nullable com.hypixel.hytale.server.core.inventory.ItemStack stack, int yawDegrees)
      Remake the item entity for the given item stack
      Parameters:
      store - the entity store
      oldRef - the old entity reference
      stack - the item stack to set
      Returns:
      the new entity reference
    • removeVariantComponents

      public static void removeVariantComponents(com.hypixel.hytale.component.Store<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> store, com.hypixel.hytale.component.Ref<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> ref)
    • getItemModelId

      @Nullable public static String getItemModelId(@Nonnull com.hypixel.hytale.server.core.asset.type.item.config.Item item)
    • getItemModel

      @Nullable public static com.hypixel.hytale.server.core.asset.type.model.config.Model getItemModel(@Nonnull com.hypixel.hytale.server.core.asset.type.item.config.Item item)