Contents
Class WorldEventStorage
java.lang.Object
com.hypixel.hytale.builtin.adventure.worldevents.WorldEventStorage
- All Implemented Interfaces:
Resource<EntityStore>, Cloneable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<WorldEventStorage> static final StringFields inherited from interface Resource
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(WorldEvent event) voidaddComplete(UUID uuid) voidclear()Removes every stored event and completion record, then marks the storage for a save.clone()intbooleancontains(WorldEvent event) <T> voidforEach(T ctx, BiConsumer<WorldEvent, T> consumer) UUID[]static ResourceType<EntityStore, WorldEventStorage> booleanisComplete(UUID uuid) voidmarkLoad()voidmarkSave()voidonCompleteLoad(WorldEventStorage loaded, Throwable error) voidonCompleteSave(Object ignored, Throwable error) voidremove(WorldEvent event)
-
Field Details
-
ID
- See Also:
-
CODEC
-
-
Constructor Details
-
WorldEventStorage
public WorldEventStorage() -
WorldEventStorage
-
-
Method Details
-
clear
public void clear()Removes every stored event and completion record, then marks the storage for a save.Clears in place instead of replacing the resource. A replacement would drop an in-flight save of the old instance, and the two writes would then race for the same file.
-
consumeState
-
markLoad
public void markLoad() -
markSave
public void markSave() -
add
-
remove
-
contains
-
forEach
-
addComplete
-
isComplete
-
completeCount
public int completeCount()- Returns:
- the number of completed events, without the copy that
getComplete()makes
-
onCompleteSave
-
onCompleteLoad
-
getComplete
- Returns:
- a sorted snapshot of the completed event ids
-
clone
- Specified by:
clonein interfaceResource<EntityStore>- Returns:
- a clone instance of the original resource instance.
-
getResourceType
-