Class WorldStorage
java.lang.Object
org.cyclops.cyclopscore.persist.world.WorldStorage
- All Implemented Interfaces:
org.cyclops.cyclopscore.persist.nbt.INBTProvider
- Direct Known Subclasses:
GlobalCounters
public abstract class WorldStorage
extends Object
implements org.cyclops.cyclopscore.persist.nbt.INBTProvider
Instances of this can store data inside the world NBT.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Data holder for the global counter data. -
Field Summary
Fields -
Constructor Summary
Constructors -
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, net.minecraft.core.HolderLookup.Provider holderLookupProvider) Read the counters.abstract void
reset()
Reset the stored data because it will be reloaded from NBT.void
writeToNBT
(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider holderLookupProvider) 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, net.minecraft.core.HolderLookup.Provider holderLookupProvider) Read the counters.- Parameters:
tag
- The tag to read from.holderLookupProvider
-
-
writeToNBT
public void writeToNBT(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider holderLookupProvider) Write the counters.- Parameters:
tag
- The tag to write to.holderLookupProvider
-
-
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.
-