Class FrameUtil

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

public class FrameUtil extends Object
  • Field Details

  • 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 Ref<EntityStore> getFrameEntity(World world, org.joml.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(World world, org.joml.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(CommandBuffer<EntityStore> commandBuffer, World world, org.joml.Vector3i pos, @Nullable 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 ItemStack getFrameItem(World world, org.joml.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 Ref<EntityStore> remakeItemEntity(@Nonnull Store<EntityStore> store, @Nonnull Ref<EntityStore> oldRef, @Nullable 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(Store<EntityStore> store, Ref<EntityStore> ref)
    • getItemModelId

      @Nullable public static String getItemModelId(@Nonnull Item item)
    • getItemModel

      @Nullable public static Model getItemModel(@Nonnull Item item)