Class PrefabEditSessionManager
java.lang.Object
com.hypixel.hytale.builtin.buildertools.prefabeditor.PrefabEditSessionManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<UUID, PrefabEditSession> static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Colorprivate static final com.hypixel.hytale.logger.HytaleLoggerprivate static final Messageprivate static final Messagestatic final floatstatic final Stringprivate static final Stringprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidapplyWorldGenWorldConfig(PrefabEditorCreationContext context, int yLevelToPastePrefabsAt, WorldConfig worldConfig) private int[]calculateRowGroups(PrefabEditorCreationContext context, int prefabCount) voidcancelLoading(UUID playerUuid) cleanupCancelledSession(UUID playerUuid, String worldName) cleanupCancelledSession(UUID playerUuid, String worldName, Consumer<PrefabLoadingState> progressCallback) voidclearLoadingState(UUID playerUuid) private CompletableFuture<Void> createEditSession(Ref<EntityStore> ref, PrefabEditorCreationContext context, boolean createNewPrefab, ComponentAccessor<EntityStore> componentAccessor) private CompletableFuture<Void> createEditSession(Ref<EntityStore> ref, PrefabEditorCreationContext context, boolean createNewPrefab, ComponentAccessor<EntityStore> componentAccessor, PrefabLoadingState loadingState, Consumer<PrefabLoadingState> progressCallback) createEditSessionForNewPrefab(Ref<EntityStore> ref, Player editor, com.hypixel.hytale.builtin.buildertools.prefabeditor.PrefabEditorCreationSettings settings, ComponentAccessor<EntityStore> componentAccessor) exitEditSession(Ref<EntityStore> ref, World world, PlayerRef playerRef, ComponentAccessor<EntityStore> componentAccessor) private intgetAmountOfBlocksBelowPrefab(int prefabHeight, int desiredYLevel) private CompletableFuture<IPrefabBuffer> getPrefabBuffer(CommandSender sender, Path path) private CompletableFuture<World> getPrefabCreatingCompletableFuture(PrefabEditorCreationContext context, PrefabEditSession editSession, WorldConfig worldConfig) getPrefabEditSession(UUID playerUUID) private CompletableFuture<World> getPrefabLoadingCompletableFuture(PrefabEditorCreationContext context, PrefabEditSession editSession, WorldConfig worldConfig, PrefabLoadingState loadingState, Consumer<PrefabLoadingState> progressCallback, UUID playerUuid) private PathgetSavePath(PrefabEditorCreationContext context) private StringgetWeatherFromEnvironment(String environmentId) private CompletableFuture<World> getWorldCreatingFuture(PrefabEditorCreationContext context, WorldConfig config) private StringgetWorldName(PrefabEditorCreationContext context) private voidgivePrefabSelectorTool(Player playerComponent, PlayerRef playerRef) booleanhasInProgressLoading(UUID playerUuid) booleanisEditingAPrefab(UUID playerUUID) booleanisLoadingCancelled(UUID playerUuid) loadPrefabAndCreateEditSession(Ref<EntityStore> ref, Player editor, com.hypixel.hytale.builtin.buildertools.prefabeditor.PrefabEditorCreationSettings settings, ComponentAccessor<EntityStore> componentAccessor) loadPrefabAndCreateEditSession(Ref<EntityStore> ref, Player editor, com.hypixel.hytale.builtin.buildertools.prefabeditor.PrefabEditorCreationSettings settings, ComponentAccessor<EntityStore> componentAccessor, Consumer<PrefabLoadingState> progressCallback) private voidnotifyProgress(Consumer<PrefabLoadingState> progressCallback, PrefabLoadingState loadingState) voidprivate voidonPlayerReady(PlayerReadyEvent event) (package private) voidpopulateActiveEditSession(UUID playerUuid, PrefabEditSession editSession) (package private) voidpopulatePrefabsBeingEdited(Path prefabPath) (package private) voidscheduleAnchorEntityRecreation(PrefabEditSession editSession) voidupdatePathOfLoadedPrefab(Path oldPath, Path newPath)
-
Field Details
-
LOGGER
@Nonnull private static final com.hypixel.hytale.logger.HytaleLogger LOGGER -
MESSAGE_COMMANDS_PREFAB_EDIT_SESSION_MANAGER_EXISTING_EDIT_SESSION
@Nonnull private static final Message MESSAGE_COMMANDS_PREFAB_EDIT_SESSION_MANAGER_EXISTING_EDIT_SESSION -
MESSAGE_COMMANDS_EDIT_PREFAB_SOMETHING_WENT_WRONG
-
NOON_TIME
public static final float NOON_TIME- See Also:
-
DEFAULT_NEW_WORLD_ZERO_COORDINATE_BLOCK_NAME
- See Also:
-
DEFAULT_ENVIRONMENT
- See Also:
-
PREFAB_SELECTOR_TOOL_ID
- See Also:
-
DEFAULT_CHUNK_ENVIRONMENT
- See Also:
-
PREFAB_EDITING_WORLD_NAME_PREFIX
- See Also:
-
DEFAULT_TINT
-
PROGRESS_UPDATE_INTERVAL_NANOS
private static final long PROGRESS_UPDATE_INTERVAL_NANOS- See Also:
-
DEFAULT_GRASS_TINT_HEX
- See Also:
-
activeEditSessions
-
prefabsBeingEdited
-
inProgressTeleportations
-
inProgressLoading
-
cancelledLoading
-
-
Constructor Details
-
PrefabEditSessionManager
-
-
Method Details
-
onPlayerReady
-
givePrefabSelectorTool
-
onPlayerAddedToWorld
-
updatePathOfLoadedPrefab
-
isEditingAPrefab
-
getPrefabEditSession
-
getActiveEditSessions
-
populateActiveEditSession
-
populatePrefabsBeingEdited
-
scheduleAnchorEntityRecreation
-
hasInProgressLoading
-
cancelLoading
-
isLoadingCancelled
-
clearLoadingState
-
createEditSessionForNewPrefab
@Nonnull public CompletableFuture<Void> createEditSessionForNewPrefab(@Nonnull Ref<EntityStore> ref, @Nonnull Player editor, @Nonnull com.hypixel.hytale.builtin.buildertools.prefabeditor.PrefabEditorCreationSettings settings, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
loadPrefabAndCreateEditSession
@Nullable public CompletableFuture<Void> loadPrefabAndCreateEditSession(@Nonnull Ref<EntityStore> ref, @Nonnull Player editor, @Nonnull com.hypixel.hytale.builtin.buildertools.prefabeditor.PrefabEditorCreationSettings settings, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
loadPrefabAndCreateEditSession
@Nullable public CompletableFuture<Void> loadPrefabAndCreateEditSession(@Nonnull Ref<EntityStore> ref, @Nonnull Player editor, @Nonnull com.hypixel.hytale.builtin.buildertools.prefabeditor.PrefabEditorCreationSettings settings, @Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nullable Consumer<PrefabLoadingState> progressCallback) -
notifyProgress
private void notifyProgress(@Nullable Consumer<PrefabLoadingState> progressCallback, @Nonnull PrefabLoadingState loadingState) -
createEditSession
@Nonnull private CompletableFuture<Void> createEditSession(@Nonnull Ref<EntityStore> ref, @Nonnull PrefabEditorCreationContext context, boolean createNewPrefab, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
createEditSession
@Nonnull private CompletableFuture<Void> createEditSession(@Nonnull Ref<EntityStore> ref, @Nonnull PrefabEditorCreationContext context, boolean createNewPrefab, @Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nullable PrefabLoadingState loadingState, @Nullable Consumer<PrefabLoadingState> progressCallback) -
getWorldCreatingFuture
@Nonnull private CompletableFuture<World> getWorldCreatingFuture(@Nonnull PrefabEditorCreationContext context, @Nonnull WorldConfig config) -
getWorldName
-
getWeatherFromEnvironment
-
getSavePath
-
applyWorldGenWorldConfig
private void applyWorldGenWorldConfig(@Nonnull PrefabEditorCreationContext context, int yLevelToPastePrefabsAt, @Nonnull WorldConfig worldConfig) -
getPrefabCreatingCompletableFuture
@Nonnull private CompletableFuture<World> getPrefabCreatingCompletableFuture(@Nonnull PrefabEditorCreationContext context, @Nonnull PrefabEditSession editSession, @Nonnull WorldConfig worldConfig) -
getPrefabLoadingCompletableFuture
@Nullable private CompletableFuture<World> getPrefabLoadingCompletableFuture(@Nonnull PrefabEditorCreationContext context, @Nonnull PrefabEditSession editSession, @Nonnull WorldConfig worldConfig, @Nullable PrefabLoadingState loadingState, @Nullable Consumer<PrefabLoadingState> progressCallback, @Nonnull UUID playerUuid) -
calculateRowGroups
@Nonnull private int[] calculateRowGroups(@Nonnull PrefabEditorCreationContext context, int prefabCount) -
getAmountOfBlocksBelowPrefab
private int getAmountOfBlocksBelowPrefab(int prefabHeight, int desiredYLevel) -
exitEditSession
@Nullable public CompletableFuture<Void> exitEditSession(@Nonnull Ref<EntityStore> ref, @Nonnull World world, @Nonnull PlayerRef playerRef, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
cleanupCancelledSession
@Nonnull public CompletableFuture<Void> cleanupCancelledSession(@Nonnull UUID playerUuid, @Nonnull String worldName, @Nullable Consumer<PrefabLoadingState> progressCallback) -
cleanupCancelledSession
@Nonnull public CompletableFuture<Void> cleanupCancelledSession(@Nonnull UUID playerUuid, @Nonnull String worldName) -
getPrefabBuffer
@Nullable private CompletableFuture<IPrefabBuffer> getPrefabBuffer(@Nonnull CommandSender sender, @Nonnull Path path)
-