Interface IServerWorldAccessor
- Namespace
- Vintagestory.API.Server
- Assembly
- VintagestoryAPI.dll
The world accessor implemented by the server
public interface IServerWorldAccessor : IWorldAccessor
- Inherited Members
- Extension Methods
Properties
LoadedEntities
The internal cache of all currently loaded entities. Warning: You should not set or remove anything from this dic unless you really know what you're doing. Use SpawnEntity/DespawnEntity instead.
Intended to be used, for example, to search for an entity's presence, or to iterate through all loaded entities.
Please leave it to the game engine to add and remove entities from this dictionary. From 1.18.2 onwards, if you really need to add or remove anything directly to/from this dictionary in your own code - which is strongly not recommended - then you should cast this to (CachingConcurrentDictionary) first.
ConcurrentDictionary<long, Entity> LoadedEntities { get; }
Property Value
RemappedEntities
Dictionary of entity codes to remap, old codes (which may be present in save files or schematics) as keys
Dictionary<string, string> RemappedEntities { get; }
Property Value
SeedWorldgen
The world generation seed. Accessible only on the server Used for generating all tarrein, placing blocks, structures, and world features
int SeedWorldgen { get; }
Property Value
TreeGenerators
List of all loaded tree generators
OrderedDictionary<AssetLocation, ITreeGenerator> TreeGenerators { get; }
Property Value
WorldName
Gets the WorldName from the save game
string WorldName { get; }
Property Value
Methods
CreateExplosion(BlockPos, EnumBlastType, double, double, float, string)
Creates an explosion at given position.
void CreateExplosion(BlockPos pos, EnumBlastType blastType, double destructionRadius, double injureRadius, float blockDropChanceMultiplier = 1, string ignitedByPlayerUid = null)
Parameters
posBlockPosblastTypeEnumBlastTypedestructionRadiusdoubleinjureRadiusdoubleblockDropChanceMultiplierfloatignitedByPlayerUidstring
DespawnEntity(Entity, EntityDespawnData)
Removes an entity from the game and the chunk it resides in
void DespawnEntity(Entity entity, EntityDespawnData reason)
Parameters
entityEntityreasonEntityDespawnData
GetTotalUnpausedTimeMs()
Gets the world's total time elapsed while unpaused in milliseconds
long GetTotalUnpausedTimeMs()
Returns
GetTotalUptimeMs()
Gets the world's total time elapsed in milliseconds
long GetTotalUptimeMs()
Returns
IsFullyLoadedChunk(BlockPos)
bool IsFullyLoadedChunk(BlockPos pos)
Parameters
posBlockPos
Returns
TriggerDidBreakBlock(IPlayer, int, BlockSelection)
Trigger the block break event manually, current purpose 1. to Log it in BlockLogger and 2. to record it in the Anti Abuse Monitor
void TriggerDidBreakBlock(IPlayer player, int oldBlockId, BlockSelection blockSelection)
Parameters
playerIPlayeroldBlockIdintblockSelectionBlockSelection
TriggerDidPlaceBlock(IPlayer, int, BlockSelection, ItemStack)
Trigger the block place event manually, current purpose 1. to Log it in BlockLogger and 2. to record it in the Anti Abuse Monitor
void TriggerDidPlaceBlock(IPlayer player, int oldBlockId, BlockSelection blockSelection, ItemStack withItemStack)
Parameters
playerIPlayeroldBlockIdintblockSelectionBlockSelectionwithItemStackItemStack