Contents
- Description
- Nested Class Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- setTotalPrefabs(int)
- setPhase(PrefabLoadingState.Phase)
- onPrefabLoaded(Path)
- onPrefabPasted(Path)
- addError(PrefabLoadingState.LoadingError)
- addError(String)
- addError(String, String)
- getCurrentPhase()
- getTotalPrefabs()
- getLoadedPrefabs()
- getPastedPrefabs()
- getCurrentPrefabPath()
- getErrors()
- hasErrors()
- isShuttingDown()
- isShutdownComplete()
- getProgressPercentage()
- getElapsedTimeMillis()
- getLastNotifyTimeNanos()
- setLastNotifyTimeNanos(long)
- getStatusMessage()
- markComplete()
Class PrefabLoadingState
java.lang.Object
com.hypixel.hytale.builtin.buildertools.prefabeditor.PrefabLoadingState
Tracks the progress and state of prefab loading operations.
Provides progress updates and error reporting to the UI.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents an error that occurred during loading.static enumThe current phase of the loading operation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRecords an error that occurred during loading.voidRecords an error with a translation key.voidRecords an error with a translation key and details.longlongintintfloatintbooleanbooleanbooleanvoidMarks the loading as complete.voidonPrefabLoaded(Path path) Called when a prefab file has been loaded from disk.voidonPrefabPasted(Path path) Called when a prefab has been pasted into the world.voidsetLastNotifyTimeNanos(long nanos) Sets the last time a UI notification was sent.voidsetPhase(PrefabLoadingState.Phase phase) Advances to the specified phase.voidsetTotalPrefabs(int totalPrefabs) Sets the total number of prefabs to be loaded.
-
Constructor Details
-
PrefabLoadingState
public PrefabLoadingState()Default Constructor for aPrefabLoadingStateinstance.
-
-
Method Details
-
setTotalPrefabs
public void setTotalPrefabs(int totalPrefabs) Sets the total number of prefabs to be loaded.- Parameters:
totalPrefabs- The total count of prefabs.
-
setPhase
Advances to the specified phase.- Parameters:
phase- The new phase.
-
onPrefabLoaded
Called when a prefab file has been loaded from disk.- Parameters:
path- The path of the loaded prefab.
-
onPrefabPasted
Called when a prefab has been pasted into the world.- Parameters:
path- The path of the pasted prefab.
-
addError
Records an error that occurred during loading.- Parameters:
error- The error to record.
-
addError
Records an error with a translation key.- Parameters:
translationKey- The translation key for the error message.
-
addError
-
getCurrentPhase
- Returns:
- The current loading phase.
-
getTotalPrefabs
public int getTotalPrefabs()- Returns:
- The total number of prefabs to load.
-
getLoadedPrefabs
public int getLoadedPrefabs()- Returns:
- The number of prefabs loaded from disk.
-
getPastedPrefabs
public int getPastedPrefabs()- Returns:
- The number of prefabs pasted into the world.
-
getCurrentPrefabPath
- Returns:
- The path of the prefab currently being processed, or null if none.
-
getErrors
- Returns:
- All errors that occurred during loading.
-
hasErrors
public boolean hasErrors()- Returns:
- true if any errors have occurred.
-
isShuttingDown
public boolean isShuttingDown()- Returns:
- true if we are in a cancellation/shutdown phase.
-
isShutdownComplete
public boolean isShutdownComplete()- Returns:
- true if the shutdown process is complete.
-
getProgressPercentage
public float getProgressPercentage()- Returns:
- The overall progress as a percentage (0.0 to 1.0).
-
getElapsedTimeMillis
public long getElapsedTimeMillis()- Returns:
- The elapsed time in milliseconds since loading started.
-
getLastNotifyTimeNanos
public long getLastNotifyTimeNanos()- Returns:
- The last time a UI notification was sent, in nanoseconds.
-
setLastNotifyTimeNanos
public void setLastNotifyTimeNanos(long nanos) Sets the last time a UI notification was sent.- Parameters:
nanos- The time in nanoseconds.
-
getStatusMessage
- Returns:
- A human-readable status message for the current state.
-
markComplete
public void markComplete()Marks the loading as complete.
-