Class FrameUtil
java.lang.Object
com.mrbysco.itemframes.util.FrameUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 positionstatic com.hypixel.hytale.server.core.inventory.ItemStackgetFrameItem(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 positionstatic com.hypixel.hytale.server.core.asset.type.model.config.ModelgetItemModel(com.hypixel.hytale.server.core.asset.type.item.config.Item item) static StringgetItemModelId(com.hypixel.hytale.server.core.asset.type.item.config.Item item) static booleanisFrameBlock(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 framestatic booleanisItemFrame(String frameId) Check if the given frame ID corresponds to an item framestatic 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 stackstatic voidremoveVariantComponents(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 booleansetFrameItem(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
-
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_COMPONENTThe 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
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 worldpos- 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 worldpos- 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 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
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 worldpos- 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 storeoldRef- the old entity referencestack- 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)
-