Class CustomDimension
java.lang.Object
com.github.imdabigboss.easydatapack.api.dimentions.CustomDimension
This class represents a custom dimension.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable org.bukkit.WorldcreateWorld(long seed)Creates the world for this dimension.abstract @NonNull org.bukkit.LocationdimensionToNormal(org.bukkit.Location location)Converts a location from the custom dimension to the overworld.abstract @NonNull StringgetBiomeName(org.bukkit.block.Biome biome)Gets the name of the given biome in this custom dimension.protected abstract @NonNull org.bukkit.generator.BiomeProviderGets the biome provider of the dimension.protected abstract @NonNull CustomChunkGeneratorGets the chunk generator of the dimension.abstract @NonNull org.bukkit.World.EnvironmentGets the world environment of the dimension: NETHER, THE_END, NORMAL, or CUSTOM.abstract @NonNull StringgetName()Gets the name of the dimension.abstract @NonNull org.bukkit.MaterialGets the material used as a portal frame block.abstract @NonNull org.bukkit.LocationnormalToDimension(org.bukkit.Location location)Converts a location from the overworld to the custom dimension.abstract booleanspawnEntity(@NonNull org.bukkit.Location location, @NonNull org.bukkit.entity.EntityType original, @NonNull org.bukkit.entity.Entity spawned)This function is called by the spawn entity event, when an entity is spawned naturally in the dimension.
-
Constructor Details
-
CustomDimension
public CustomDimension()
-
-
Method Details
-
getPortalFrameMaterial
public abstract @NonNull org.bukkit.Material getPortalFrameMaterial()Gets the material used as a portal frame block.- Returns:
- the material used as a portal frame block
-
getName
Gets the name of the dimension.- Returns:
- the name of the dimension
-
getEnvironment
public abstract @NonNull org.bukkit.World.Environment getEnvironment()Gets the world environment of the dimension: NETHER, THE_END, NORMAL, or CUSTOM.- Returns:
- the world environment of the dimension
-
dimensionToNormal
public abstract @NonNull org.bukkit.Location dimensionToNormal(org.bukkit.Location location)Converts a location from the custom dimension to the overworld.- Parameters:
location- the location in the custom dimension- Returns:
- the location in the overworld
-
normalToDimension
public abstract @NonNull org.bukkit.Location normalToDimension(org.bukkit.Location location)Converts a location from the overworld to the custom dimension.- Parameters:
location- the location in the overworld- Returns:
- the location in the custom dimension
-
getBiomeProvider
protected abstract @NonNull org.bukkit.generator.BiomeProvider getBiomeProvider()Gets the biome provider of the dimension.- Returns:
- the biome provider of the dimension
-
getChunkGenerator
Gets the chunk generator of the dimension.- Returns:
- the chunk generator of the dimension
-
getBiomeName
Gets the name of the given biome in this custom dimension.- Parameters:
biome- the biome- Returns:
- the name of the biome
-
spawnEntity
public abstract boolean spawnEntity(@NonNull org.bukkit.Location location, @NonNull org.bukkit.entity.EntityType original, @NonNull org.bukkit.entity.Entity spawned)This function is called by the spawn entity event, when an entity is spawned naturally in the dimension.- Parameters:
location- the location where the entity is spawnedoriginal- the original entity typespawned- the entity type that will be spawned- Returns:
- if the entity should be allowed to spawn
-
createWorld
public @Nullable org.bukkit.World createWorld(long seed)Creates the world for this dimension.- Parameters:
seed- the seed of the world- Returns:
- the world
-