Package org.spongepowered.api.world
Interface WorldType
- All Superinterfaces:
ContextSource
,DataHolder
,DefaultedRegistryValue
,ValueContainer
@CatalogedBy(WorldTypes.class)
public interface WorldType
extends DefaultedRegistryValue, ContextSource, DataHolder
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
-
Method Summary
Modifier and TypeMethodDescriptiondefault float
Gets the amount of lighting a client will play as an effect while traversing aworld
of this type.default boolean
default double
default boolean
default WorldTypeEffect
effect()
default Optional<MinecraftDayTime>
default int
floor()
Gets the minimumY
value that blocks can exist within a world of this type.default boolean
Gets if aworld
of this type is generated with a ceiling at some pre-determined y value composed ofBlockTypes.BEDROCK
.default boolean
hasRaids()
Gets ifplayers
who have thePotionEffectTypes.BAD_OMEN
effect could cause aRaid
while existing in aworld
of this type.default boolean
default int
height()
Gets the total height in which blocks can exist within a world of this type.Gets the tag for blocks that burn indefinitely in a world of this type.default int
Gets the maximum height that teleportation logic performed viaItemTypes.CHORUS_FRUIT
orportal types
may use to determine the exitlocation
of the teleport or the generation of a portal itself.default boolean
natural()
Gets if the world type is considered natural.default boolean
Gets if, whenFalse
, aPiglin
will transform into aZombifiedPiglin
, over time, while existing in aworld
of this type.default boolean
Gets ifplayers
can charge and useBlockTypes.RESPAWN_ANCHOR
while existing in aworld
of this type.default boolean
default int
Returns the light level needed to block monster spawning.Returns the light level range needed to block monster spawning.Methods inherited from interface org.spongepowered.api.service.context.ContextSource
context
Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
-
Method Details
-
effect
- Returns:
- The effect
-
scorching
default boolean scorching()Gets ifBlockTypes.WATER
will evaporate orBlockTypes.WET_SPONGE
will become aBlockTypes.SPONGE
. AdditionallyFluidTypes.FLOWING_LAVA
will spread faster and thinner.- Returns:
- True if scorching, false if not
-
natural
default boolean natural()Gets if the world type is considered natural.Natural worlds allow sleeping in beds and setting the respawn point,
PortalTypes.NETHER
portals to spawnZombifiedPiglin
andItemTypes.COMPASS
to work- Returns:
- True if natural, false if not
-
coordinateMultiplier
default double coordinateMultiplier()Gets the coordinate scale applied to the coordinates of aplayer
traveling in aworld
of this type.Best seen when transferring that player from one world to another (as the player's coordinates will adjust to the scale of the destination world's).
- Returns:
- The scale
-
hasSkylight
default boolean hasSkylight()Gets if aworld
of this type will have global lighting, used in game mechanics such asEntity
spawning.In Vanilla, used in weather, lighting engine, and respawning mechanics
- Returns:
- True if skylight, false if not
-
hasCeiling
default boolean hasCeiling()Gets if aworld
of this type is generated with a ceiling at some pre-determined y value composed ofBlockTypes.BEDROCK
. Most notable usage of this is for thetype
.In Vanilla, used in weather, map items, and respawning mechanics
- Returns:
- True if a ceiling is present, false if not
-
ambientLighting
default float ambientLighting()Gets the amount of lighting a client will play as an effect while traversing aworld
of this type.In Vanilla, the value will be between
0.0
and1.0
- Returns:
- The lighting value
-
fixedTime
- Returns:
- If present, a fixed day time. Otherwise, free flowing time
-
piglinSafe
default boolean piglinSafe()Gets if, whenFalse
, aPiglin
will transform into aZombifiedPiglin
, over time, while existing in aworld
of this type.- Returns:
- True if piglin are safe, false if they will zombify
-
bedsUsable
default boolean bedsUsable()Gets ifplayers
can sleep in a bed while existing in aworld
of this type.When bed usage is not allowed beds will instead explode.
- Returns:
- True if beds are usable, false if not
-
respawnAnchorsUsable
default boolean respawnAnchorsUsable()Gets ifplayers
can charge and useBlockTypes.RESPAWN_ANCHOR
while existing in aworld
of this type.- Returns:
- True if respawn anchors are usable, false if not
-
hasRaids
default boolean hasRaids()Gets ifplayers
who have thePotionEffectTypes.BAD_OMEN
effect could cause aRaid
while existing in aworld
of this type.- Returns:
- True if bad omens could case a raid, false if not
-
floor
default int floor()Gets the minimumY
value that blocks can exist within a world of this type.In vanilla this is a multiple of 16 between -2032 and 2016
- Returns:
- The minimum height
-
height
default int height()Gets the total height in which blocks can exist within a world of this type.In vanilla this is a multiple of 16 between 16 and 4064.
floor()
+height()
may not be more than 2032- Returns:
- The maximum height
-
logicalHeight
default int logicalHeight()Gets the maximum height that teleportation logic performed viaItemTypes.CHORUS_FRUIT
orportal types
may use to determine the exitlocation
of the teleport or the generation of a portal itself.- Returns:
- The logical height
-
infiniburn
Gets the tag for blocks that burn indefinitely in a world of this type.- Returns:
- The infiniburn tag
-
createDragonFight
default boolean createDragonFight()- Returns:
- True if dragon fight spawns, false if not
-
spawnLightLimit
default int spawnLightLimit()Returns the light level needed to block monster spawning.- Returns:
- spawn light limit
-
spawnLightRange
Returns the light level range needed to block monster spawning.- Returns:
- the spawn light range
-