Class ImmersiveClientLogicHelpersImpl
java.lang.Object
com.hammy275.immersivemc.common.api_impl.ImmersiveLogicHelpersImpl
com.hammy275.immersivemc.client.api_impl.ImmersiveClientLogicHelpersImpl
- All Implemented Interfaces:
ImmersiveClientLogicHelpers,ImmersiveLogicHelpers
public class ImmersiveClientLogicHelpersImpl
extends ImmersiveLogicHelpersImpl
implements ImmersiveClientLogicHelpers
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the intended light level to render with given several positions.intgetLight(net.minecraft.core.BlockPos pos) Get the intended light level to render with at the given position as packed sky light and block light.voidsendSwapPacket(net.minecraft.core.BlockPos pos, List<Integer> slots, net.minecraft.world.InteractionHand hand, boolean modifierPressed) Sends the packet to the server telling it to runImmersiveHandler.swap(int, InteractionHand, BlockPos, ServerPlayer, com.hammy275.immersivemc.server.storage.server.ItemSwapAmount)for the provided block at the given position.voidsetCooldown(int cooldown) Sets both the vanilla, right-click cooldown and ImmersiveMC's VR cooldown for interacting with Immersives (if the player is in VR) to some number of ticks.Methods inherited from class com.hammy275.immersivemc.common.api_impl.ImmersiveLogicHelpersImpl
getHorizontalBlockForward, swapItems, swapItems, swapItemsWithOutputMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hammy275.immersivemc.api.client.ImmersiveClientLogicHelpers
getHorizontalBlockForwardMethods inherited from interface com.hammy275.immersivemc.api.common.ImmersiveLogicHelpers
getHorizontalBlockForward, swapItems, swapItems, swapItemsWithOutput
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
ImmersiveClientLogicHelpersImpl
public ImmersiveClientLogicHelpersImpl()
-
-
Method Details
-
setCooldown
public void setCooldown(int cooldown) Description copied from interface:ImmersiveClientLogicHelpersSets both the vanilla, right-click cooldown and ImmersiveMC's VR cooldown for interacting with Immersives (if the player is in VR) to some number of ticks. You likely don't need this, as the value returned fromImmersive.handleHitboxInteract(ImmersiveInfo, LocalPlayer, List, InteractionHand, boolean)is set as the cooldown where appropriate. This is mainly useful if you're working outside of ImmersiveMC's hitbox system.- Specified by:
setCooldownin interfaceImmersiveClientLogicHelpers- Parameters:
cooldown- The cooldown to set in ticks. This will be increased for VR players, see the aforementioned method for more info.
-
sendSwapPacket
public void sendSwapPacket(net.minecraft.core.BlockPos pos, List<Integer> slots, net.minecraft.world.InteractionHand hand, boolean modifierPressed) Description copied from interface:ImmersiveClientLogicHelpersSends the packet to the server telling it to runImmersiveHandler.swap(int, InteractionHand, BlockPos, ServerPlayer, com.hammy275.immersivemc.server.storage.server.ItemSwapAmount)for the provided block at the given position. You usually should call this when a hitbox is right-clicked in your Immersive.- Specified by:
sendSwapPacketin interfaceImmersiveClientLogicHelpers- Parameters:
pos- The position of the block that a swap is being performed at.slots- The slot numbers that the right-click is taking place for.hand- The hand which is performing the swap.modifierPressed- Whether the modifier key (usually the button mapped to breaking blocks) was held for the interaction.
-
getLight
public int getLight(net.minecraft.core.BlockPos pos) Description copied from interface:ImmersiveClientLogicHelpersGet the intended light level to render with at the given position as packed sky light and block light. This may not necessarily return the actual light level at the given block, though it should be treated as such.- Specified by:
getLightin interfaceImmersiveClientLogicHelpers- Parameters:
pos- The position to get the intended light level for rendering at.- Returns:
- The intended light level for rendering.
-
getLight
Description copied from interface:ImmersiveClientLogicHelpersGet the intended light level to render with given several positions. The value returned is a packed sky light and block light, and intentionally may not necessarily return data consistent with all the positions, though should be treated as such.- Specified by:
getLightin interfaceImmersiveClientLogicHelpers- Parameters:
positions- The positions to get the intended light rendering for.- Returns:
- The intended light level for rendering.
-