Class RelativeHitboxInfoBuilderImpl
java.lang.Object
com.hammy275.immersivemc.client.immersive.RelativeHitboxInfoBuilderImpl
- All Implemented Interfaces:
RelativeHitboxInfoBuilder,Cloneable
public class RelativeHitboxInfoBuilderImpl
extends Object
implements RelativeHitboxInfoBuilder, Cloneable
-
Constructor Summary
ConstructorsConstructorDescriptionRelativeHitboxInfoBuilderImpl(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> centerOffset, double size, boolean constantOffset) RelativeHitboxInfoBuilderImpl(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> centerOffset, double sizeX, double sizeY, double sizeZ, boolean constantOffset) RelativeHitboxInfoBuilderImpl(net.minecraft.world.phys.Vec3 centerOffset, double size) RelativeHitboxInfoBuilderImpl(net.minecraft.world.phys.Vec3 centerOffset, double sizeX, double sizeY, double sizeZ) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build this builder into a proper relative hitbox.clone()create(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> centerOffset, double size) create(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> centerOffset, double sizeX, double sizeY, double sizeZ) create(net.minecraft.world.phys.Vec3 centerOffset, double size) create(net.minecraft.world.phys.Vec3 centerOffset, double sizeX, double sizeY, double sizeZ) createItemInput(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> centerOffset, double size) createItemInput(net.minecraft.world.phys.Vec3 centerOffset, double size) forceUpDownRenderDir(ForcedUpDownRenderDir forcedDir) forceUpDownRenderDir(Function<BuiltImmersiveInfo<?>, ForcedUpDownRenderDir> forcedDirFunction) holdsItems(boolean holdsItems) isInput(boolean isInput) itemRenderSizeMultiplier(float multiplier) itemSpins(boolean spins) needs3DResourcePackCompat(boolean needs3dCompat) renderItem(boolean renderItem) renderItemCount(boolean renderItemCount) setCenterOffset(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> newOffset) Set the offset from the starting position for this relative hitbox.setCenterOffset(net.minecraft.world.phys.Vec3 newOffset) Set the offset from the starting position for this relative hitbox.setVRMovementInfo(HitboxVRMovementInfo vrMovementInfo) textSupplier(Function<BuiltImmersiveInfo<?>, List<com.mojang.datafixers.util.Pair<net.minecraft.network.chat.Component, net.minecraft.world.phys.Vec3>>> textSupplier) triggerHitbox(boolean isTriggerHitbox)
-
Constructor Details
-
RelativeHitboxInfoBuilderImpl
public RelativeHitboxInfoBuilderImpl(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> centerOffset, double size, boolean constantOffset) -
RelativeHitboxInfoBuilderImpl
public RelativeHitboxInfoBuilderImpl(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> centerOffset, double sizeX, double sizeY, double sizeZ, boolean constantOffset) -
RelativeHitboxInfoBuilderImpl
public RelativeHitboxInfoBuilderImpl(net.minecraft.world.phys.Vec3 centerOffset, double size) -
RelativeHitboxInfoBuilderImpl
public RelativeHitboxInfoBuilderImpl(net.minecraft.world.phys.Vec3 centerOffset, double sizeX, double sizeY, double sizeZ)
-
-
Method Details
-
setCenterOffset
public RelativeHitboxInfoBuilderImpl setCenterOffset(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> newOffset) Description copied from interface:RelativeHitboxInfoBuilderSet the offset from the starting position for this relative hitbox. SeeHitboxPositioningModefor more info on how this positioning works.- Specified by:
setCenterOffsetin interfaceRelativeHitboxInfoBuilder- Parameters:
newOffset- A function that returns the offset in blocks from the center this hitbox should be placed at. The function can return null if this hitbox shouldn't render or be interacted with.- Returns:
- This builder object.
-
setCenterOffset
Description copied from interface:RelativeHitboxInfoBuilderSet the offset from the starting position for this relative hitbox. SeeHitboxPositioningModefor more info on how this positioning works.- Specified by:
setCenterOffsetin interfaceRelativeHitboxInfoBuilder- Parameters:
newOffset- The offset in blocks from the center this hitbox should be placed at.- Returns:
- This builder object.
-
holdsItems
- Specified by:
holdsItemsin interfaceRelativeHitboxInfoBuilder- Parameters:
holdsItems- Whether this relative hitbox should hold items.- Returns:
- This builder object.
-
isInput
- Specified by:
isInputin interfaceRelativeHitboxInfoBuilder- Parameters:
isInput- Relative this relative hitbox is an input. If this relative hitbox is both an input and holds items, it will render an item guide.- Returns:
- This builder object.
-
itemSpins
- Specified by:
itemSpinsin interfaceRelativeHitboxInfoBuilder- Parameters:
spins- Whether the item in this hitbox should rotate when displayed. This only matters if this hitbox already holds items.- Returns:
- This builder object.
-
itemRenderSizeMultiplier
- Specified by:
itemRenderSizeMultiplierin interfaceRelativeHitboxInfoBuilder- Parameters:
multiplier- A multiplier for the size of the item when rendering.- Returns:
- This builder object.
-
triggerHitbox
- Specified by:
triggerHitboxin interfaceRelativeHitboxInfoBuilder- Parameters:
isTriggerHitbox- Whether this hitbox should act as a trigger hitbox, meaning it will require the break block button to pressed when a controller is inside of it in VR.- Returns:
- This builder object.
-
textSupplier
public RelativeHitboxInfoBuilderImpl textSupplier(Function<BuiltImmersiveInfo<?>, List<com.mojang.datafixers.util.Pair<net.minecraft.network.chat.Component, net.minecraft.world.phys.Vec3>>> textSupplier) - Specified by:
textSupplierin interfaceRelativeHitboxInfoBuilder- Parameters:
textSupplier- A function that provides a list of text components to render and the relative offset from the center offset to render the text at.- Returns:
- This builder object.
-
forceUpDownRenderDir
- Specified by:
forceUpDownRenderDirin interfaceRelativeHitboxInfoBuilder- Parameters:
forcedDir- Forces the direction passed to upDownImmersiveRenderHelpers.renderItem(ItemStack, PoseStack, float, BoundingBox, boolean, int, Float, Direction, Direction)instead of determining it based on the hitbox positioning mode.- Returns:
- This builder object.
-
forceUpDownRenderDir
public RelativeHitboxInfoBuilder forceUpDownRenderDir(Function<BuiltImmersiveInfo<?>, ForcedUpDownRenderDir> forcedDirFunction) - Specified by:
forceUpDownRenderDirin interfaceRelativeHitboxInfoBuilder- Parameters:
forcedDirFunction- Forces the direction passed to upDownImmersiveRenderHelpers.renderItem(ItemStack, PoseStack, float, BoundingBox, boolean, int, Float, Direction, Direction)instead of determining it based on the hitbox positioning mode.- Returns:
- This builder object.
-
needs3DResourcePackCompat
- Specified by:
needs3DResourcePackCompatin interfaceRelativeHitboxInfoBuilder- Parameters:
needs3dCompat- Whether this hitbox should be moved on the Z axis for 3D resource packs.- Returns:
- This builder object.
-
setVRMovementInfo
- Specified by:
setVRMovementInfoin interfaceRelativeHitboxInfoBuilder- Parameters:
vrMovementInfo- How this hitbox should react to VR hand movements.- Returns:
- This builder object.
-
renderItem
- Specified by:
renderItemin interfaceRelativeHitboxInfoBuilder- Parameters:
renderItem- Whether this hitbox should render the item it contains, if it contains one.- Returns:
- This builder object.
-
renderItemCount
- Specified by:
renderItemCountin interfaceRelativeHitboxInfoBuilder- Parameters:
renderItemCount- Whether this hitbox should render the item count if it's rendering an item.- Returns:
- This builder object.
-
build
Description copied from interface:RelativeHitboxInfoBuilderBuild this builder into a proper relative hitbox.- Specified by:
buildin interfaceRelativeHitboxInfoBuilder- Returns:
- A built relative hitbox.
-
create
public static RelativeHitboxInfoBuilderImpl create(net.minecraft.world.phys.Vec3 centerOffset, double size) -
create
public static RelativeHitboxInfoBuilderImpl create(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> centerOffset, double size) -
create
public static RelativeHitboxInfoBuilderImpl create(net.minecraft.world.phys.Vec3 centerOffset, double sizeX, double sizeY, double sizeZ) -
create
public static RelativeHitboxInfoBuilderImpl create(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> centerOffset, double sizeX, double sizeY, double sizeZ) -
createItemInput
public static RelativeHitboxInfoBuilderImpl createItemInput(net.minecraft.world.phys.Vec3 centerOffset, double size) -
createItemInput
public static RelativeHitboxInfoBuilderImpl createItemInput(Function<BuiltImmersiveInfo<?>, net.minecraft.world.phys.Vec3> centerOffset, double size) -
clone
-