Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- parseGradientMaterials(String)
- getPrefabSaveExecutor()
- get()
- prefetchBudget()
- registerPrefabSaveContributor(PrefabSaveContributor)
- getPrefabSaveContributors()
- registerClipboardContributor(PrefabSaveContributor)
- getClipboardContributors()
- setSelectionBoundsUpdatedCallback(BiConsumer)
- setBuilderToolModeDeactivatedCallback(BiConsumer)
- setSelectionClearedCallback(BiConsumer)
- getSelectionBoundsUpdatedCallback()
- getBuilderToolModeDeactivatedCallback()
- getSelectionClearedCallback()
- getBlockColorIndex()
- invalidateWorldMapForSelection(BlockSelection, World)
- invalidateWorldMapForBounds(Vector3i, Vector3i, World)
- getState(Player, PlayerRef)
- getMaskSelection(BlockSelection)
- addToQueue(Player, PlayerRef, ThrowableTriConsumer)
- addToQueue(Player, PlayerRef, long, ThrowableTriConsumer)
- addToQueue(Player, PlayerRef, BuilderToolsPlugin.TaskRegion, ThrowableTriConsumer)
- addToQueue(Player, PlayerRef, long, BuilderToolsPlugin.TaskRegion, ThrowableTriConsumer)
- resolveTargetPack(String, Player, CommandContext)
- resolveTargetPack(String, Path, Player, CommandContext)
- getPrefabEditSessionResourceType()
- setToolHistorySize(int)
- onToolArgUpdate(Ref, PlayerRef, BuilderToolArgUpdate, ComponentAccessor)
- getBuilderState(Player, PlayerRef)
- clearBuilderState(UUID)
- getUserDataComponentType()
- sendFeedback(Message, CommandSender, NotificationStyle, ComponentAccessor)
- sendFeedback(Message, CommandSender, NotificationStyle, String, ComponentAccessor)
- sendFeedback(String, int, CommandSender, ComponentAccessor)
- sendFeedback(String, int, int, CommandSender, ComponentAccessor)
- computeSelectionCopy(Ref, Player, ThrowableConsumer, ComponentAccessor)
- toMetricResults()
- getPrefabAnchorComponentType()
- getPrefabEditSessionManager()
- createBlockComponent(int, int, Holder, boolean)
- forEachCopyableInSelection(World, int, int, int, int, int, int, Consumer)
- getNewPathIdOnPrefabPasted(UUID, String, int)
- onPasteStart(int, ComponentAccessor)
- onPasteEnd(int, ComponentAccessor)
- getPastedPrefabPathUUIDMap()
Class BuilderToolsPlugin
java.lang.Object
com.hypixel.hytale.server.core.plugin.PluginBase
com.hypixel.hytale.server.core.plugin.JavaPlugin
com.hypixel.hytale.builtin.buildertools.BuilderToolsPlugin
- All Implemented Interfaces:
MetricProvider, CommandOwner, SelectionProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic classstatic classstatic final recordstatic classA system to handlePrefabPasteEventevents.static enumstatic interfaceThe area a queued task works on, and how to load it. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final BuilderToolsPlugin.TaskRegionThe region of a task that reads or fills the current selection, so the area under it is loaded before the task runs.static final intstatic final intstatic final intFields inherited from class PluginBase
METRICS_REGISTRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Throwable>
voidaddToQueue(Player player, PlayerRef playerRef, long estimatedBlockChanges, BuilderToolsPlugin.TaskRegion region, ThrowableTriConsumer<Ref<EntityStore>, BuilderToolsPlugin.BuilderState, ComponentAccessor<EntityStore>, T> task) static <T extends Throwable>
voidaddToQueue(Player player, PlayerRef playerRef, long estimatedBlockChanges, ThrowableTriConsumer<Ref<EntityStore>, BuilderToolsPlugin.BuilderState, ComponentAccessor<EntityStore>, T> task) static <T extends Throwable>
voidaddToQueue(Player player, PlayerRef playerRef, BuilderToolsPlugin.TaskRegion region, ThrowableTriConsumer<Ref<EntityStore>, BuilderToolsPlugin.BuilderState, ComponentAccessor<EntityStore>, T> task) static <T extends Throwable>
voidaddToQueue(Player player, PlayerRef playerRef, ThrowableTriConsumer<Ref<EntityStore>, BuilderToolsPlugin.BuilderState, ComponentAccessor<EntityStore>, T> task) clearBuilderState(UUID uuid) Immediately remove the BuilderState associated with the UUID bypassing any expire-time or persistence checks.<T extends Throwable>
voidcomputeSelectionCopy(Ref<EntityStore> ref, Player player, ThrowableConsumer<BlockSelection, T> task, ComponentAccessor<EntityStore> componentAccessor) Computes a copy of the given Player's BlockSelection and performs the provided task with it.static Holder<ChunkStore> createBlockComponent(int newId, int oldId, Holder<ChunkStore> oldHolder, boolean copy) Deprecated.static voidforEachCopyableInSelection(World world, int minX, int minY, int minZ, int width, int height, int depth, Consumer<Ref<EntityStore>> action) Helper method for safely iterating all copyable ECS entities within a selection volume who's lower corner is position in the world at min x/y/z and has the dimensions width/height/depth (length x, length y, length z respectively).static BuilderToolsPluginget()getBuilderState(Player player, PlayerRef playerRef) static BlockSelectiongetMaskSelection(BlockSelection selection) Returns the selection that the#block mask filter matches against, or null when the player has no selection area.getNewPathIdOnPrefabPasted(UUID id, String name, int prefabId) com.hypixel.fastutil.ints.Int2ObjectConcurrentHashMap<ConcurrentHashMap<UUID, UUID>> Shared withPrefabSaverso saves to the same file stay ordered regardless of which path triggered them.static voidinvalidateWorldMapForBounds(org.joml.Vector3i min, org.joml.Vector3i max, World world) static voidinvalidateWorldMapForSelection(BlockSelection selection, World world) voidonPasteEnd(int prefabId, ComponentAccessor<EntityStore> componentAccessor) static booleanonPasteStart(int prefabId, ComponentAccessor<EntityStore> componentAccessor) voidonToolArgUpdate(Ref<EntityStore> ref, PlayerRef playerRef, BuilderToolArgUpdate packet, ComponentAccessor<EntityStore> componentAccessor) parseGradientMaterials(String materialsStr) static Prefetch.BudgetHow much a load may bring in, as the configuration last read it.voidregisterClipboardContributor(PrefabSaveContributor contributor) voidregisterPrefabSaveContributor(PrefabSaveContributor contributor) static AssetPackresolveTargetPack(String explicitPackName, Player playerComponent, CommandContext context) static AssetPackresolveTargetPack(String explicitPackName, Path prefabPath, Player playerComponent, CommandContext context) static voidsendFeedback(Message message, CommandSender feedback, NotificationStyle notificationStyle, ComponentAccessor<EntityStore> componentAccessor) static voidsendFeedback(Message message, CommandSender feedback, NotificationStyle notificationStyle, String tag, ComponentAccessor<EntityStore> componentAccessor) static voidsendFeedback(String key, int total, int num, CommandSender feedback, ComponentAccessor<EntityStore> componentAccessor) static voidsendFeedback(String key, int total, CommandSender feedback, ComponentAccessor<EntityStore> componentAccessor) voidvoidsetSelectionBoundsUpdatedCallback(BiConsumer<PlayerRef, Store<EntityStore>> callback) voidsetSelectionClearedCallback(BiConsumer<PlayerRef, Store<EntityStore>> callback) voidsetToolHistorySize(int size) Methods inherited from class JavaPlugin
getClassLoader, getFile, getTypeMethods inherited from class PluginBase
getAssetRegistry, getBasePermission, getChunkStoreRegistry, getClientFeatureRegistry, getCodecRegistry, getCodecRegistry, getCodecRegistry, getCommandRegistry, getDataDirectory, getEntityRegistry, getEntityStoreRegistry, getEventRegistry, getIdentifier, getLogger, getManifest, getName, getState, getTaskRegistry, isDisabled, isEnabled, preLoad
-
Field Details
-
EDITOR_BLOCK
- See Also:
-
EDITOR_BLOCK_PREFAB_AIR
- See Also:
-
EDITOR_BLOCK_PREFAB_ANCHOR
- See Also:
-
STREAM_TO_CLIENT_LIMIT
public static final int STREAM_TO_CLIENT_LIMIT- See Also:
-
SHAPE_PREVIEW_THRESHOLD
public static final int SHAPE_PREVIEW_THRESHOLD- See Also:
-
SHAPE_PREVIEW_MAX_VOLUME
public static final int SHAPE_PREVIEW_MAX_VOLUME- See Also:
-
SELECTION_REGION
The region of a task that reads or fills the current selection, so the area under it is loaded before the task runs. Queue with this region for a command that works on the selection. Queue with no region for a brush or a tool, which works where the player aims and must not load a selection it never touches.
-
-
Constructor Details
-
BuilderToolsPlugin
-
-
Method Details
-
parseGradientMaterials
@Nonnull public static List<BuilderToolsPlugin.ColorGradientMaterial> parseGradientMaterials(@Nullable String materialsStr) -
getPrefabSaveExecutor
Shared withPrefabSaverso saves to the same file stay ordered regardless of which path triggered them. -
get
-
prefetchBudget
How much a load may bring in, as the configuration last read it. -
registerPrefabSaveContributor
-
getPrefabSaveContributors
-
registerClipboardContributor
-
getClipboardContributors
-
setSelectionBoundsUpdatedCallback
public void setSelectionBoundsUpdatedCallback(@Nullable BiConsumer<PlayerRef, Store<EntityStore>> callback) -
setBuilderToolModeDeactivatedCallback
public void setBuilderToolModeDeactivatedCallback(@Nullable BiConsumer<PlayerRef, Store<EntityStore>> callback) -
setSelectionClearedCallback
public void setSelectionClearedCallback(@Nullable BiConsumer<PlayerRef, Store<EntityStore>> callback) -
getSelectionBoundsUpdatedCallback
-
getBuilderToolModeDeactivatedCallback
-
getSelectionClearedCallback
-
getBlockColorIndex
- Returns:
- the shared block color index for color-to-block matching
-
invalidateWorldMapForSelection
public static void invalidateWorldMapForSelection(@Nonnull BlockSelection selection, @Nonnull World world) -
invalidateWorldMapForBounds
public static void invalidateWorldMapForBounds(@Nonnull org.joml.Vector3i min, @Nonnull org.joml.Vector3i max, @Nonnull World world) -
getState
@Nonnull public static BuilderToolsPlugin.BuilderState getState(@Nonnull Player player, @Nonnull PlayerRef playerRef) -
getMaskSelection
Returns the selection that the#block mask filter matches against, or null when the player has no selection area. ABlockSelectioncan exist before its area is set, and the filter must match nothing in that state rather than match the block at the world origin. -
addToQueue
public static <T extends Throwable> void addToQueue(@Nonnull Player player, @Nonnull PlayerRef playerRef, @Nonnull ThrowableTriConsumer<Ref<EntityStore>, BuilderToolsPlugin.BuilderState, ComponentAccessor<EntityStore>, T> task) -
addToQueue
public static <T extends Throwable> void addToQueue(@Nonnull Player player, @Nonnull PlayerRef playerRef, long estimatedBlockChanges, @Nonnull ThrowableTriConsumer<Ref<EntityStore>, BuilderToolsPlugin.BuilderState, ComponentAccessor<EntityStore>, T> task) -
addToQueue
public static <T extends Throwable> void addToQueue(@Nonnull Player player, @Nonnull PlayerRef playerRef, @Nullable BuilderToolsPlugin.TaskRegion region, @Nonnull ThrowableTriConsumer<Ref<EntityStore>, BuilderToolsPlugin.BuilderState, ComponentAccessor<EntityStore>, T> task) -
addToQueue
public static <T extends Throwable> void addToQueue(@Nonnull Player player, @Nonnull PlayerRef playerRef, long estimatedBlockChanges, @Nullable BuilderToolsPlugin.TaskRegion region, @Nonnull ThrowableTriConsumer<Ref<EntityStore>, BuilderToolsPlugin.BuilderState, ComponentAccessor<EntityStore>, T> task) -
resolveTargetPack
@Nullable public static AssetPack resolveTargetPack(@Nonnull String explicitPackName, @Nonnull Player playerComponent, @Nonnull CommandContext context) -
resolveTargetPack
@Nullable public static AssetPack resolveTargetPack(@Nonnull String explicitPackName, @Nullable Path prefabPath, @Nonnull Player playerComponent, @Nonnull CommandContext context) -
getPrefabEditSessionResourceType
-
setToolHistorySize
public void setToolHistorySize(int size) -
onToolArgUpdate
public void onToolArgUpdate(@Nonnull Ref<EntityStore> ref, @Nonnull PlayerRef playerRef, @Nonnull BuilderToolArgUpdate packet, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
getBuilderState
@Nonnull public BuilderToolsPlugin.BuilderState getBuilderState(@Nonnull Player player, @Nonnull PlayerRef playerRef) -
clearBuilderState
Immediately remove the BuilderState associated with the UUID bypassing any expire-time or persistence checks.- Parameters:
uuid- The UUID of the Player whose BuilderState should be removed.- Returns:
- The removed BuilderState if present, or null.
-
getUserDataComponentType
-
sendFeedback
public static void sendFeedback(@Nonnull Message message, @Nullable CommandSender feedback, @Nonnull NotificationStyle notificationStyle, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
sendFeedback
public static void sendFeedback(@Nonnull Message message, @Nullable CommandSender feedback, @Nonnull NotificationStyle notificationStyle, @Nullable String tag, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
sendFeedback
public static void sendFeedback(@Nonnull String key, int total, CommandSender feedback, ComponentAccessor<EntityStore> componentAccessor) -
sendFeedback
public static void sendFeedback(@Nonnull String key, int total, int num, CommandSender feedback, ComponentAccessor<EntityStore> componentAccessor) -
computeSelectionCopy
public <T extends Throwable> void computeSelectionCopy(@Nonnull Ref<EntityStore> ref, @Nonnull Player player, @Nonnull ThrowableConsumer<BlockSelection, T> task, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Description copied from interface:SelectionProviderComputes a copy of the given Player's BlockSelection and performs the provided task with it.- Specified by:
computeSelectionCopyin interfaceSelectionProvider- Type Parameters:
T- The type of exception that may be thrown by the task.- Parameters:
ref- The entity reference of the instigating entity.player- The Player whose selection should be retrieved.task- The task to perform on the selection.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
toMetricResults
- Specified by:
toMetricResultsin interfaceMetricProvider
-
getPrefabAnchorComponentType
-
getPrefabEditSessionManager
-
createBlockComponent
@Nullable @Deprecated public static Holder<ChunkStore> createBlockComponent(int newId, int oldId, @Nullable Holder<ChunkStore> oldHolder, boolean copy) Deprecated.Returns a new BlockState holder to replace the existing one when setting/replacing a block at a position in the chunk.- Parameters:
newId- The new block id being set at the position in the chunk.oldId- The current block id value held at the position in the chunk.oldHolder- The current BlockState data held at the position in the chunk.copy- A flag controlling whether the existing BlockState data should be copied when it is valid for the new BlockType.- Returns:
- The BlockState holder that will replace the old one or null.
-
forEachCopyableInSelection
public static void forEachCopyableInSelection(@Nonnull World world, int minX, int minY, int minZ, int width, int height, int depth, @Nonnull Consumer<Ref<EntityStore>> action) Helper method for safely iterating all copyable ECS entities within a selection volume who's lower corner is position in the world at min x/y/z and has the dimensions width/height/depth (length x, length y, length z respectively). This method ensures collection and iteration of the entities is carried out on the world thread.- Parameters:
world- The world in which the selection is made.minX- The lower x-coordinate of the selection.minY- The lower y-coordinate of the selection.minZ- The lower z-coordinate of the selection.width- The width (x-axis) of the selection.height- The height (y-axis) of the selection.depth- The depth (z-axis) of the selection.action- The action to perform for each entity found.
-
getNewPathIdOnPrefabPasted
-
onPasteStart
public static boolean onPasteStart(int prefabId, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
onPasteEnd
-
getPastedPrefabPathUUIDMap
public com.hypixel.fastutil.ints.Int2ObjectConcurrentHashMap<ConcurrentHashMap<UUID,UUID>> getPastedPrefabPathUUIDMap()
-