Class ImmersiveLogicHelpersImpl
java.lang.Object
com.hammy275.immersivemc.common.api_impl.ImmersiveLogicHelpersImpl
- All Implemented Interfaces:
ImmersiveLogicHelpers
- Direct Known Subclasses:
ImmersiveClientLogicHelpersImpl
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.Direction
getHorizontalBlockForward
(net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos blockPos) Given a player and the position of an immersive block, returns the best direction the block should face to be looking towards the player.swapItems
(net.minecraft.world.item.ItemStack stackFromPlayer, net.minecraft.world.item.ItemStack stackInImmersive, ItemSwapAmount swapAmount) Gets the result of a swap action between a player and an Immersive where the player may place items into and take items out of a slot, such as the input slots of a furnace.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
ImmersiveLogicHelpersImpl
public ImmersiveLogicHelpersImpl()
-
-
Method Details
-
getHorizontalBlockForward
public net.minecraft.core.Direction getHorizontalBlockForward(net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos blockPos) Description copied from interface:ImmersiveLogicHelpers
Given a player and the position of an immersive block, returns the best direction the block should face to be looking towards the player. This is most commonly used for blocks like the crafting table which don't face a direction to come up with a good estimation. This method will always return NORTH, EAST, SOUTH, or WEST.- Specified by:
getHorizontalBlockForward
in interfaceImmersiveLogicHelpers
- Parameters:
player
- The playerblockPos
- The block to determine the facing direction of.- Returns:
- A direction the block is facing, excluding UP and DOWN.
-
swapItems
public SwapResult swapItems(net.minecraft.world.item.ItemStack stackFromPlayer, net.minecraft.world.item.ItemStack stackInImmersive, ItemSwapAmount swapAmount) Description copied from interface:ImmersiveLogicHelpers
Gets the result of a swap action between a player and an Immersive where the player may place items into and take items out of a slot, such as the input slots of a furnace.- Specified by:
swapItems
in interfaceImmersiveLogicHelpers
- Parameters:
stackFromPlayer
- TheItemStack
currently in the player's hand.stackInImmersive
- TheItemStack
currently in the slot of the Immersive the player is interacting with.swapAmount
- TheItemSwapAmount
that is determining the settings for how many items to swap.- Returns:
- A
SwapResult
containing theItemStack
s that should be placed in the player's hand, be placed into the slot of the Immersive being interacted with, and the leftovers that should be given to the player some other way.
-