Package net.minestom.server.world
Class DimensionTypeManager
java.lang.Object
net.minestom.server.world.DimensionTypeManager
Allows servers to register custom dimensions. Also used during player login to send the list of all existing dimensions.
Contains DimensionType.OVERWORLD by default but can be removed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDimension(@NotNull DimensionType dimensionType) Adds a new dimension type.@Nullable DimensionTypegetDimension(@NotNull NamespaceID namespaceID) Return to a @DimensionTypeonly if present and registeredbooleanisRegistered(@NotNull NamespaceID namespaceID) booleanisRegistered(@Nullable DimensionType dimensionType) booleanremoveDimension(@NotNull DimensionType dimensionType) Removes a dimension type.@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompoundtoNBT()Creates theNBTCompoundcontaining all the registered dimensions.@NotNull List<DimensionType> Returns an immutable copy of the dimension types already registered.
-
Constructor Details
-
DimensionTypeManager
public DimensionTypeManager()
-
-
Method Details
-
addDimension
Adds a new dimension type. This does NOT send the new list to players.- Parameters:
dimensionType- the dimension to add
-
removeDimension
Removes a dimension type. This does NOT send the new list to players.- Parameters:
dimensionType- the dimension to remove- Returns:
- if the dimension type was removed, false if it was not present before
-
isRegistered
- Parameters:
namespaceID- The dimension name- Returns:
- true if the dimension is registered
-
isRegistered
- Parameters:
dimensionType- dimension to check if is registered- Returns:
- true if the dimension is registered
-
getDimension
Return to a @DimensionTypeonly if present and registered- Parameters:
namespaceID- The Dimension Name- Returns:
- a DimensionType if it is present and registered
-
unmodifiableList
Returns an immutable copy of the dimension types already registered.- Returns:
- an unmodifiable
Listcontaining all the added dimensions
-
toNBT
@NotNull public @NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound toNBT()Creates theNBTCompoundcontaining all the registered dimensions.Used when a player connects.
- Returns:
- an nbt compound containing the registered dimensions
-