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
TreeGenerators
List of all loaded tree generators
OrderedDictionary<AssetLocation, ITreeGenerator> TreeGenerators { get; }
Property Value
Methods
AddPhysicsTick(IServerPhysicsTicker)
Used for server-side entity physics ticking
void AddPhysicsTick(IServerPhysicsTicker entitybehavior)
Parameters
entitybehavior
IServerPhysicsTicker
CreateExplosion(BlockPos, EnumBlastType, double, double, float)
Creates an explosion at given position.
void CreateExplosion(BlockPos pos, EnumBlastType blastType, double destructionRadius, double injureRadius, float blockDropChanceMultiplier = 1)
Parameters
pos
BlockPosblastType
EnumBlastTypedestructionRadius
doubleinjureRadius
doubleblockDropChanceMultiplier
float
DespawnEntity(Entity, EntityDespawnData)
Removes an entity from the game and the chunk it resides in
void DespawnEntity(Entity entity, EntityDespawnData reason)
Parameters
entity
Entityreason
EntityDespawnData
IsFullyLoadedChunk(BlockPos)
bool IsFullyLoadedChunk(BlockPos pos)
Parameters
pos
BlockPos