|
Faucet Mod SDK 1.0.0
Modding API for Minecraft Legacy Console Edition
|
The server-side representation of a loaded dimension/world. More...
#include <SDK.h>
Public Member Functions | |
| shared_ptr< class Explosion > | explode (shared_ptr< Entity > source, double x, double y, double z, float radius, bool fire, bool destroyBlocks) |
| Spawn an explosion in the world. | |
| shared_ptr< Entity > | getEntity (int id) |
| Get an entity by its integer ID. | |
| virtual bool | addEntity (shared_ptr< Entity > entity) |
| Add an entity to this level. | |
| void | addToTickNextTick (int x, int y, int z, int tileId, int tickDelay) |
| Force a tile tick at a position on the next tick. | |
| void | queueSendTileUpdate (int x, int y, int z) |
| Broadcast a tile update to all nearby players. | |
| vector< shared_ptr< class TileEntity > > * | getTileEntitiesInRegion (int x0, int y0, int z0, int x1, int y1, int z1) |
| Get all tile entities in a rectangular region. | |
| void | save (bool force, class ProgressListener *listener, bool bAutosave=false) |
| Save the level to disk. | |
| void | sendParticles (const wstring &name, double x, double y, double z, int count) |
| Send a named particle effect to all players near a position. | |
| void | sendParticles (const wstring &name, double x, double y, double z, int count, double xDist, double yDist, double zDist, double speed) |
| Send a named particle effect with velocity spread. | |
| bool | mayInteract (shared_ptr< Player > player, int x, int y, int z, int content) |
| Check if a block position is under spawn protection. | |
| MinecraftServer * | getServer () |
| Get the server that owns this level. | |
| EntityTracker * | getTracker () |
| Get the EntityTracker for this level. | |
| void | setTimeAndAdjustTileTicks (__int64 newTime) |
| Set the world time (adjusting scheduled ticks). | |
Public Attributes | |
| bool | noSave |
| True if the level's save-on-exit flag is set to not save. | |
| bool | canEditSpawn |
| True if admins can edit the spawn area. | |
The server-side representation of a loaded dimension/world.
Obtain via SDK::GetServerLevel(dimension) or MinecraftServer::getLevel(dimension).
|
virtual |
Add an entity to this level.
| entity | Entity to add. |
| void ServerLevel::addToTickNextTick | ( | int | x, |
| int | y, | ||
| int | z, | ||
| int | tileId, | ||
| int | tickDelay ) |
Force a tile tick at a position on the next tick.
| x,y,z | Block coordinates. |
| tileId | ID of the tile to tick. |
| tickDelay | Delay in ticks. |
| shared_ptr< class Explosion > ServerLevel::explode | ( | shared_ptr< Entity > | source, |
| double | x, | ||
| double | y, | ||
| double | z, | ||
| float | radius, | ||
| bool | fire, | ||
| bool | destroyBlocks ) |
Spawn an explosion in the world.
| source | Entity that caused the explosion, or nullptr. |
| x,y,z | Centre of the explosion. |
| radius | Explosion radius in blocks. |
| fire | True to start fires. |
| destroyBlocks | True to destroy blocks. |
| shared_ptr< Entity > ServerLevel::getEntity | ( | int | id | ) |
Get an entity by its integer ID.
| id | Entity ID. |
| vector< shared_ptr< class TileEntity > > * ServerLevel::getTileEntitiesInRegion | ( | int | x0, |
| int | y0, | ||
| int | z0, | ||
| int | x1, | ||
| int | y1, | ||
| int | z1 ) |
Get all tile entities in a rectangular region.
| x0,y0,z0 | Min corner. |
| x1,y1,z1 | Max corner. |
| bool ServerLevel::mayInteract | ( | shared_ptr< Player > | player, |
| int | x, | ||
| int | y, | ||
| int | z, | ||
| int | content ) |
Check if a block position is under spawn protection.
| level | Level the position is in. |
| x,y,z | Block coordinates. |
| player | Player trying to modify the block. |
| void ServerLevel::queueSendTileUpdate | ( | int | x, |
| int | y, | ||
| int | z ) |
Broadcast a tile update to all nearby players.
| x,y,z | Block coordinates to update. |
| void ServerLevel::save | ( | bool | force, |
| class ProgressListener * | listener, | ||
| bool | bAutosave = false ) |
Save the level to disk.
| force | Force save even if nothing is dirty. |
| listener | Progress listener, or nullptr. |
| bAutosave | True if this is an auto-save. |
| void ServerLevel::sendParticles | ( | const wstring & | name, |
| double | x, | ||
| double | y, | ||
| double | z, | ||
| int | count ) |
Send a named particle effect to all players near a position.
| name | Particle name (e.g. L"explode", L"flame", L"smoke"). |
| x,y,z | Origin position. |
| count | Number of particles. |
| void ServerLevel::sendParticles | ( | const wstring & | name, |
| double | x, | ||
| double | y, | ||
| double | z, | ||
| int | count, | ||
| double | xDist, | ||
| double | yDist, | ||
| double | zDist, | ||
| double | speed ) |
Send a named particle effect with velocity spread.
| name | Particle name. |
| x,y,z | Origin position. |
| count | Number of particles. |
| xDist,yDist,zDist | Spread distance per axis. |
| speed | Particle speed. |