Class World
java.lang.Object
fr.hytale.loader.api.World
Represents a Hytale world.
- Since:
- 1.0.4
- Version:
- 1.0.6
- Author:
- HytaleLoader
-
Constructor Summary
ConstructorsConstructorDescriptionWorld(com.hypixel.hytale.server.core.universe.world.World nativeWorld) Constructs a new World wrapper. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBlockAt(int x, int y, int z) Gets the Block object at the specified coordinates.getBlockAt(Location location) Gets the Block object at the specified location.getBlockIdentifier(int x, int y, int z) Gets the identifier of the block at the specified coordinates.getBlockIdentifier(Location location) Gets the identifier of the block at the specified location.getEntity(int id) Gets an entity by its network ID.Gets an entity by its UUID.getName()Gets the world name.com.hypixel.hytale.server.core.universe.world.WorldGets the native Hytale world object.intGets the current hour of the day (0-23).Gets the current forced weather type for this world.Gets the current forced weather name for this world.inthashCode()booleanisDay()Checks if it is currently day time (between 06:00 and 18:00).voidplayParticle(Location location, String particleName) Plays a particle effect at a specific location for all nearby players.voidPlays a sound at a specific location for all nearby players.voidplaySound(Location location, String sound, SoundCategory category, float volume, float pitch) Plays a sound at a specific location for all nearby players.voidSets the block at the specified coordinates.voidSets the block at the specified location in the block arguments.voidSets the block at the specified location.voidsetTime(float percent) Sets the time of day as a percentage (0.0 to 1.0). 0.0 is Midnight, 0.5 is Noon.voidSets the time of day using a convenient enum.voidsetTimePaused(boolean paused) Sets whether the daylight cycle is paused.voidsetWeather(WeatherType weather) Sets the weather for this world.voidsetWeather(String weatherName) Sets the weather for this world.spawnEntity(Location location, String entityType) Spawns an entity at the specified location.toString()
-
Constructor Details
-
World
public World(com.hypixel.hytale.server.core.universe.world.World nativeWorld) Constructs a new World wrapper.- Parameters:
nativeWorld- the native Hytale world
-
-
Method Details
-
getNative
public com.hypixel.hytale.server.core.universe.world.World getNative()Gets the native Hytale world object.- Returns:
- the native world
-
getName
-
toString
-
equals
-
getBlockIdentifier
Gets the identifier of the block at the specified coordinates.- Parameters:
x- The X coordinatey- The Y coordinatez- The Z coordinate- Returns:
- The block identifier (e.g., "hytale:stone"), or "hytale:air" if not found
-
getBlockIdentifier
-
setBlock
Sets the block at the specified coordinates.- Parameters:
x- The X coordinatey- The Y coordinatez- The Z coordinateblockId- The block identifier (e.g., "hytale:stone")
-
setBlock
-
setBlock
Sets the block at the specified location in the block arguments.- Parameters:
block- The block to set
-
getBlockAt
Gets the Block object at the specified coordinates.- Parameters:
x- The X coordinatey- The Y coordinatez- The Z coordinate- Returns:
- The Block object
-
getBlockAt
-
getEntity
Gets an entity by its network ID.- Parameters:
id- The entity's network ID- Returns:
- The Entity, or null if not found
-
getEntity
-
spawnEntity
-
hashCode
-
playSound
Plays a sound at a specific location for all nearby players.- Parameters:
location- The location to play the sound atsound- The sound identifier (e.g. "my.sound.effect")volume- The volume (1.0 is normal)pitch- The pitch (1.0 is normal)
-
playSound
public void playSound(Location location, String sound, SoundCategory category, float volume, float pitch) Plays a sound at a specific location for all nearby players.- Parameters:
location- The location to play the sound atsound- The sound identifiercategory- The sound categoryvolume- The volumepitch- The pitch
-
playParticle
-
setWeather
Sets the weather for this world.- Parameters:
weather- The weather type to set (e.g. WeatherType.CLEAR). Pass null to reset to dynamic weather.
-
setWeather
Sets the weather for this world.- Parameters:
weatherName- The name of the weather asset (e.g. "Zone1_Sunny", "Zone1_Rain"). Pass null to reset to dynamic weather.
-
getWeatherName
Gets the current forced weather name for this world.- Returns:
- The weather name, or null if dynamic weather is active.
-
getWeather
Gets the current forced weather type for this world.- Returns:
- The WeatherType, or null if dynamic weather is active or the type is unknown to the API.
-
setTime
Sets the time of day using a convenient enum.- Parameters:
time- The time preset to set (e.g. Time.NOON)
-
setTime
public void setTime(float percent) Sets the time of day as a percentage (0.0 to 1.0). 0.0 is Midnight, 0.5 is Noon.- Parameters:
percent- The percentage of the day passed
-
setTimePaused
public void setTimePaused(boolean paused) Sets whether the daylight cycle is paused.- Parameters:
paused- true to pause time, false to resume
-
getTimeHour
public int getTimeHour()Gets the current hour of the day (0-23).- Returns:
- the current hour
-
isDay
public boolean isDay()Checks if it is currently day time (between 06:00 and 18:00).- Returns:
- true if it is day, false if it is night.
-