Package org.spongepowered.api.world
Interface WorldType
- All Superinterfaces:
ContextSource
,DefaultedRegistryValue
@CatalogedBy(WorldTypes.class)
public interface WorldType
extends DefaultedRegistryValue, ContextSource
-
Method Summary
Modifier and TypeMethodDescriptionfloat
Gets the amount of lighting a client will play as an effect while traversing aworld
of this type.boolean
double
boolean
effect()
boolean
Gets if aworld
of this type is generated with a ceiling at some pre-determined y value composed ofBlockTypes.BEDROCK
.boolean
hasRaids()
Gets ifplayers
who have thePotionEffectTypes.BAD_OMEN
effect could cause aRaid
while existing in aworld
of this type.boolean
int
Gets the maximumY
value 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.boolean
natural()
Gets if portals created via the standardPortalTypes.NETHER
, both via the API or game mechanics, will spawnZombifiedPiglin
randomly.boolean
Gets if, whenFalse
, aPiglin
will transform into aZombifiedPiglin
, over time, while existing in aworld
of this type.boolean
Gets ifplayers
can charge and useBlockTypes.RESPAWN_ANCHOR
while existing in aworld
of this type.boolean
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
WorldTypeEffect effect()- Returns:
- The effect
-
scorching
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
boolean natural()Gets if portals created via the standardPortalTypes.NETHER
, both via the API or game mechanics, will spawnZombifiedPiglin
randomly. Otherwise, theItemTypes.COMPASS
will not function and spin randomly.- Returns:
- True if natural, false if not
-
coordinateMultiplier
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
boolean hasSkylight()Gets if aworld
of this type will have lighting 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
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
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
Optional<MinecraftDayTime> fixedTime()- Returns:
- If present, a fixed day time. Otherwise, free flowing time
-
piglinSafe
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
boolean bedsUsable()- Returns:
- True if beds are usable, false if not
-
respawnAnchorsUsable
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
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
-
logicalHeight
int logicalHeight()Gets the maximumY
value 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
-
createDragonFight
boolean createDragonFight()- Returns:
- True if dragon fight spawns, false if not
-
asTemplate
WorldTypeTemplate asTemplate()
-