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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDimension
(@NotNull DimensionType dimensionType) Adds a new dimension type.@Nullable DimensionType
getDimension
(@NotNull NamespaceID namespaceID) Return to a @DimensionType
only if present and registeredboolean
isRegistered
(@NotNull NamespaceID namespaceID) boolean
isRegistered
(@Nullable DimensionType dimensionType) boolean
removeDimension
(@NotNull DimensionType dimensionType) Removes a dimension type.@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound
toNBT()
Creates theNBTCompound
containing 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 @DimensionType
only 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
List
containing all the added dimensions
-
toNBT
@NotNull public @NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound toNBT()Creates theNBTCompound
containing all the registered dimensions.Used when a player connects.
- Returns:
- an nbt compound containing the registered dimensions
-