Class WorldStorage
java.lang.Object
org.cyclops.cyclopscore.persist.world.WorldStorage
- All Implemented Interfaces:
INBTProvider
- Direct Known Subclasses:
GlobalCounters
Instances of this can store data inside the world NBT.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Data holder for the global counter data. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called after the data is loaded from the world storage.void
Called before the data is saved to the world storage.protected abstract String
void
onAboutToStartEvent
(net.neoforged.neoforge.event.server.ServerAboutToStartEvent event) When a server is started.void
onStartedEvent
(net.neoforged.neoforge.event.server.ServerStartedEvent event) When a server is started.void
onStoppingEvent
(net.neoforged.neoforge.event.server.ServerStoppingEvent event) When a server is stopping.void
readFromNBT
(net.minecraft.nbt.CompoundTag tag) Read the counters.abstract void
reset()
Reset the stored data because it will be reloaded from NBT.void
writeToNBT
(net.minecraft.nbt.CompoundTag tag) Write the counters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cyclops.cyclopscore.persist.nbt.INBTProvider
readGeneratedFieldsFromNBT, writeGeneratedFieldsToNBT
-
Field Details
-
mod
-
-
Constructor Details
-
WorldStorage
-
-
Method Details
-
readFromNBT
public void readFromNBT(net.minecraft.nbt.CompoundTag tag) Read the counters.- Parameters:
tag
- The tag to read from.
-
writeToNBT
public void writeToNBT(net.minecraft.nbt.CompoundTag tag) Write the counters.- Parameters:
tag
- The tag to write to.
-
reset
public abstract void reset()Reset the stored data because it will be reloaded from NBT. -
onAboutToStartEvent
public void onAboutToStartEvent(net.neoforged.neoforge.event.server.ServerAboutToStartEvent event) When a server is started.- Parameters:
event
- The received event.
-
onStartedEvent
public void onStartedEvent(net.neoforged.neoforge.event.server.ServerStartedEvent event) When a server is started.- Parameters:
event
- The received event.
-
onStoppingEvent
public void onStoppingEvent(net.neoforged.neoforge.event.server.ServerStoppingEvent event) When a server is stopping.- Parameters:
event
- The received event.
-
getDataId
-
afterLoad
public void afterLoad()Called after the data is loaded from the world storage. -
beforeSave
public void beforeSave()Called before the data is saved to the world storage.
-