Class ServerColonySaveData
java.lang.Object
net.minecraft.world.level.saveddata.SavedData
com.minecolonies.api.colony.savedata.ServerColonySaveData
- All Implemented Interfaces:
IServerColonySaveData
public class ServerColonySaveData
extends net.minecraft.world.level.saveddata.SavedData
implements IServerColonySaveData
The implementation of the colonyTagCapability.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.saveddata.SavedData
net.minecraft.world.level.saveddata.SavedData.Factory<T extends net.minecraft.world.level.saveddata.SavedData> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.world.level.saveddata.SavedData.Factory<ServerColonySaveData> Worldsavedata factory.static final StringWorld save data name. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd a new colony to the capability.createColony(@NotNull net.minecraft.server.level.ServerLevel w, @NotNull String name, @NotNull net.minecraft.core.BlockPos pos) Create a colony and return it.voiddeleteColony(int id) Delete a colony with a certain id.Get a list of all colonies.getColony(int id) Get a colony with a certain id.intgetTopID()Get the top most id of all colonies.booleanisDirty()@NotNull net.minecraft.nbt.CompoundTagsave(@NotNull net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) setOverworld(boolean overworld) Set as overworld.Methods inherited from class net.minecraft.world.level.saveddata.SavedData
save, setDirty, setDirty
-
Field Details
-
NAME
World save data name. -
FACTORY
public static final net.minecraft.world.level.saveddata.SavedData.Factory<ServerColonySaveData> FACTORYWorldsavedata factory.
-
-
Method Details
-
save
@NotNull public @NotNull net.minecraft.nbt.CompoundTag save(@NotNull @NotNull net.minecraft.nbt.CompoundTag tag, @NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
savein classnet.minecraft.world.level.saveddata.SavedData
-
createColony
public IColony createColony(@NotNull @NotNull net.minecraft.server.level.ServerLevel w, @NotNull @NotNull String name, @NotNull @NotNull net.minecraft.core.BlockPos pos) Description copied from interface:IServerColonySaveDataCreate a colony and return it.- Specified by:
createColonyin interfaceIServerColonySaveData- Parameters:
w- the world the colony is in.name- the name of the colony.pos- the position of the colony.- Returns:
- the created colony.
-
deleteColony
public void deleteColony(int id) Description copied from interface:IServerColonySaveDataDelete a colony with a certain id.- Specified by:
deleteColonyin interfaceIServerColonySaveData- Parameters:
id- the id of the colony.
-
getColony
Description copied from interface:IServerColonySaveDataGet a colony with a certain id.- Specified by:
getColonyin interfaceIServerColonySaveData- Parameters:
id- the id of the colony.- Returns:
- the colony or null.
-
getColonies
Description copied from interface:IServerColonySaveDataGet a list of all colonies.- Specified by:
getColoniesin interfaceIServerColonySaveData- Returns:
- a complete list.
-
addColony
Description copied from interface:IServerColonySaveDataadd a new colony to the capability.- Specified by:
addColonyin interfaceIServerColonySaveData- Parameters:
colony- the colony to add.
-
getTopID
public int getTopID()Description copied from interface:IServerColonySaveDataGet the top most id of all colonies.- Specified by:
getTopIDin interfaceIServerColonySaveData- Returns:
- the top most id.
-
isDirty
public boolean isDirty()- Overrides:
isDirtyin classnet.minecraft.world.level.saveddata.SavedData
-
setOverworld
Description copied from interface:IServerColonySaveDataSet as overworld.- Specified by:
setOverworldin interfaceIServerColonySaveData- Parameters:
overworld- if overworld.- Returns:
- itself.
-