Class FrameUtil
java.lang.Object
com.mrbysco.itemframes.util.FrameUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Supplier<ComponentType<EntityStore, ItemFrameComponent>> The component type for item frame components (For mod compatibility) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Ref<EntityStore> getFrameEntity(World world, org.joml.Vector3i pos) Get the item frame's entity store reference at the given positionstatic ItemStackgetFrameItem(World world, org.joml.Vector3i pos) Get the item in the item frame at the given positionstatic ModelgetItemModel(Item item) static StringgetItemModelId(Item item) static booleanisFrameBlock(World world, org.joml.Vector3i pos) Check if the block at the given position is an item framestatic booleanisItemFrame(String frameId) Check if the given frame ID corresponds to an item framestatic Ref<EntityStore> remakeItemEntity(Store<EntityStore> store, Ref<EntityStore> oldRef, ItemStack stack, int yawDegrees) Remake the item entity for the given item stackstatic voidremoveVariantComponents(Store<EntityStore> store, Ref<EntityStore> ref) static booleansetFrameItem(CommandBuffer<EntityStore> commandBuffer, World world, org.joml.Vector3i pos, ItemStack stack, boolean overwrite) Set the item in the item frame at the given position
-
Field Details
-
ITEM_FRAME_COMPONENT
The component type for item frame components (For mod compatibility)
-
-
Constructor Details
-
FrameUtil
public FrameUtil()
-
-
Method Details
-
isItemFrame
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
Get the item frame's entity store reference at the given position- Parameters:
world- The worldpos- The position of the item frame block- Returns:
- The entity store reference of the item frame, or null if not found
-
isFrameBlock
Check if the block at the given position is an item frame- Parameters:
world- The worldpos- 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 worldpos- The position of the item frame blockstack- The item stack to set in the item frameoverwrite- Whether to overwrite the existing item if present- Returns:
- True if the item was set successfully, false otherwise
-
getFrameItem
-
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 storeoldRef- the old entity referencestack- the item stack to set- Returns:
- the new entity reference
-
removeVariantComponents
-
getItemModelId
-
getItemModel
-