Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getOrCreatePrototypeSettings(UUID)
- calculateInterpolatedPositions(Vector3i, Vector3i, int, int, int)
- getPosition()
- getBrushWidth()
- getBrushHeight()
- getBrushSpacing()
- getBrushRotation(ComponentAccessor)
- executeAsBrushConfig(PrototypePlayerBuilderToolSettings, BuilderToolOnUseInteraction, ComponentAccessor)
- getTargetBlockAvoidingPaint(Ref, double, ComponentAccessor, float, float, float, float, float, float)
- getTargetBlockAvoidingPaint(Ref, double, ComponentAccessor, float, float, float, float, float, float, Vector3d)
- getEditOperation()
- test(int, int, int, Void)
- showEditNotification()
- getSkippedTints()
- execute(ComponentAccessor)
- executeAt(int, int, int, ComponentAccessor)
- executeShapeOperation(int, int, int, TriIntObjPredicate, BrushShape, int, int, int, boolean)
- fromPacket(Ref, Player, PlayerRef, BuilderToolOnUseInteraction, ComponentAccessor)
- combineMasks(BuilderTool.ArgData, BlockMask)
Class ToolOperation
java.lang.Object
com.hypixel.hytale.builtin.buildertools.tooloperations.ToolOperation
- All Implemented Interfaces:
TriIntObjPredicate<Void>
- Direct Known Subclasses:
LaserPointerOperation, LayersOperation, NoiseOperation, OldSculptOperation, PaintOperation, RevolveOperation, ScatterOperation, SculptOperation, SmootherOperation, SmoothOperation, TintOperation
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBrush width and height when the tool args carry neither, because both are optional.static final intDefault brush spacing when not specified by tool args. 0 = automatic (50% of brush size), >0 = number of blocks between executions.static final doubleThe maximum distance, in blocks, in which we can target.static final Map<String, OperationFactory> A map of operations that are available to be created as instances.static final Map<UUID, PrototypePlayerBuilderToolSettings> A map of player builder tool settings, mapped by the playersUUIDinstance. -
Constructor Summary
ConstructorsConstructorDescriptionToolOperation(Ref<EntityStore> ref, BuilderToolOnUseInteraction packet, ComponentAccessor<EntityStore> componentAccessor) -
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.joml.Vector3i> calculateInterpolatedPositions(org.joml.Vector3i lastPosition, org.joml.Vector3i currentPosition, int brushWidth, int brushHeight, int brushSpacing) Calculates positions to execute the brush at based on spacing settings.static BlockMaskcombineMasks(BuilderTool.ArgData args, BlockMask globalMask) voidexecute(ComponentAccessor<EntityStore> componentAccessor) voidexecuteAsBrushConfig(PrototypePlayerBuilderToolSettings prototypePlayerBuilderToolSettings, BuilderToolOnUseInteraction packet, ComponentAccessor<EntityStore> componentAccessor) voidexecuteAt(int posX, int posY, int posZ, ComponentAccessor<EntityStore> componentAccessor) Executes the brush operation at a specific position (for interpolation support).static voidexecuteShapeOperation(int x, int y, int z, TriIntObjPredicate<Void> operation, BrushShape shape, int shapeRange, int shapeHeight, int shapeThickness, boolean capped) static ToolOperationfromPacket(Ref<EntityStore> ref, Player player, PlayerRef playerRef, BuilderToolOnUseInteraction packet, ComponentAccessor<EntityStore> componentAccessor) Creates a new tool operation instance based on the information from the builder tool use interaction packet.intgetBrushRotation(ComponentAccessor<EntityStore> componentAccessor) Gets the brush rotation value from tool args.intGets the brush spacing value from tool args.intgetOrCreatePrototypeSettings(UUID playerUuid) org.joml.Vector3ilongHow many tints the tool dropped because the column they belong to is not loaded.org.joml.Vector3igetTargetBlockAvoidingPaint(Ref<EntityStore> ref, double maxDistance, ComponentAccessor<EntityStore> componentAccessor, float raycastOriginX, float raycastOriginY, float raycastOriginZ, float raycastDirectionX, float raycastDirectionY, float raycastDirectionZ) org.joml.Vector3igetTargetBlockAvoidingPaint(Ref<EntityStore> ref, double maxDistance, ComponentAccessor<EntityStore> componentAccessor, float raycastOriginX, float raycastOriginY, float raycastOriginZ, float raycastDirectionX, float raycastDirectionY, float raycastDirectionZ, org.joml.Vector3d hitPositionOut) booleanfinal boolean
-
Field Details
-
OPERATIONS
A map of operations that are available to be created as instances. -
PROTOTYPE_TOOL_SETTINGS
A map of player builder tool settings, mapped by the playersUUIDinstance. -
MAX_DISTANCE
public static final double MAX_DISTANCEThe maximum distance, in blocks, in which we can target.- See Also:
-
DEFAULT_BRUSH_SPACING
public static final int DEFAULT_BRUSH_SPACINGDefault brush spacing when not specified by tool args. 0 = automatic (50% of brush size), >0 = number of blocks between executions.- See Also:
-
DEFAULT_BRUSH_SIZE
public static final int DEFAULT_BRUSH_SIZEBrush width and height when the tool args carry neither, because both are optional.- See Also:
-
-
Constructor Details
-
ToolOperation
public ToolOperation(@Nonnull Ref<EntityStore> ref, @Nonnull BuilderToolOnUseInteraction packet, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
-
-
Method Details
-
getOrCreatePrototypeSettings
@Nonnull public static PrototypePlayerBuilderToolSettings getOrCreatePrototypeSettings(UUID playerUuid) -
calculateInterpolatedPositions
@Nonnull public static List<org.joml.Vector3i> calculateInterpolatedPositions(@Nullable org.joml.Vector3i lastPosition, @Nonnull org.joml.Vector3i currentPosition, int brushWidth, int brushHeight, int brushSpacing) Calculates positions to execute the brush at based on spacing settings.- Parameters:
lastPosition- The previous brush position (can be null for first stroke)currentPosition- The current brush positionbrushWidth- The width of the brush shapebrushHeight- The height of the brush shapebrushSpacing- 0 = automatic interpolation (50% of brush size), >0 = minimum blocks between executions (no interpolation)- Returns:
- List of positions to execute the brush at (may be empty if spacing threshold not met)
-
getPosition
@Nonnull public org.joml.Vector3i getPosition()- Returns:
- the current position of this operation.
-
getBrushWidth
public int getBrushWidth()- Returns:
- the brush width (shapeRange) for this operation.
-
getBrushHeight
public int getBrushHeight()- Returns:
- the brush height for this operation.
-
getBrushSpacing
public int getBrushSpacing()Gets the brush spacing value from tool args.- Returns:
- The brush spacing: 0 = automatic (50% of brush size), >0 = blocks between executions.
-
getBrushRotation
Gets the brush rotation value from tool args.- Returns:
- The brush rotation as a transform.
-
executeAsBrushConfig
public void executeAsBrushConfig(@Nonnull PrototypePlayerBuilderToolSettings prototypePlayerBuilderToolSettings, @Nonnull BuilderToolOnUseInteraction packet, ComponentAccessor<EntityStore> componentAccessor) -
getTargetBlockAvoidingPaint
@Nullable public org.joml.Vector3i getTargetBlockAvoidingPaint(@Nonnull Ref<EntityStore> ref, double maxDistance, @Nonnull ComponentAccessor<EntityStore> componentAccessor, float raycastOriginX, float raycastOriginY, float raycastOriginZ, float raycastDirectionX, float raycastDirectionY, float raycastDirectionZ) -
getTargetBlockAvoidingPaint
@Nullable public org.joml.Vector3i getTargetBlockAvoidingPaint(@Nonnull Ref<EntityStore> ref, double maxDistance, @Nonnull ComponentAccessor<EntityStore> componentAccessor, float raycastOriginX, float raycastOriginY, float raycastOriginZ, float raycastDirectionX, float raycastDirectionY, float raycastDirectionZ, @Nullable org.joml.Vector3d hitPositionOut) -
getEditOperation
-
test
- Specified by:
testin interfaceTriIntObjPredicate<Void>
-
showEditNotification
public boolean showEditNotification() -
getSkippedTints
public long getSkippedTints()How many tints the tool dropped because the column they belong to is not loaded. A tint is column data, so it cannot be written where the column is absent. -
execute
-
executeAt
public void executeAt(int posX, int posY, int posZ, ComponentAccessor<EntityStore> componentAccessor) Executes the brush operation at a specific position (for interpolation support).- Parameters:
posX- The x coordinate to execute atposY- The y coordinate to execute atposZ- The z coordinate to execute atcomponentAccessor- The component accessor
-
executeShapeOperation
public static void executeShapeOperation(int x, int y, int z, @Nonnull TriIntObjPredicate<Void> operation, @Nonnull BrushShape shape, int shapeRange, int shapeHeight, int shapeThickness, boolean capped) -
fromPacket
@Nonnull public static ToolOperation fromPacket(@Nonnull Ref<EntityStore> ref, @Nonnull Player player, @Nonnull PlayerRef playerRef, @Nonnull BuilderToolOnUseInteraction packet, @Nonnull ComponentAccessor<EntityStore> componentAccessor) throws Exception Creates a new tool operation instance based on the information from the builder tool use interaction packet.- Parameters:
ref- The entity reference of the instigating player entity.player- The player component of the instigating player entity.packet- The packet that we are parsing from.componentAccessor- TheComponentAccessorfor component access.- Returns:
- a new
ToolOperationinstance from the operations factory. - Throws:
Exception- if no tool is found from the given ID.
-
combineMasks
@Nullable public static BlockMask combineMasks(@Nullable BuilderTool.ArgData args, @Nullable BlockMask globalMask)
-