Documentation ¶
Index ¶
- type Chunk
- func (chunk *Chunk) AddActiveBlock(blockXyz *BlockXyz)
- func (chunk *Chunk) AddActiveBlockIndex(blockIndex BlockIndex)
- func (chunk *Chunk) AddEntity(s gamerules.INonPlayerEntity)
- func (chunk *Chunk) AddOnUnsubscribe(entityId EntityId, observer gamerules.IUnsubscribed)
- func (chunk *Chunk) BlockQuery(blockLoc BlockXyz) (isSolid bool, isWithinChunk bool)
- func (chunk *Chunk) ItemType(itemTypeId ItemTypeId) (itemType *gamerules.ItemType, ok bool)
- func (chunk *Chunk) Rand() *rand.Rand
- func (chunk *Chunk) RemoveOnUnsubscribe(entityId EntityId, observer gamerules.IUnsubscribed)
- func (chunk *Chunk) SetBlockByIndex(blockIndex BlockIndex, blockId BlockId, blockData byte)
- func (chunk *Chunk) SetTileEntity(index BlockIndex, tileEntity gamerules.ITileEntity)
- func (chunk *Chunk) String() string
- func (chunk *Chunk) TileEntity(index BlockIndex) gamerules.ITileEntity
- type ChunkShard
- type LocalShardManager
- func (mgr *LocalShardManager) EnqueueAllChunks(fn func(chunk *Chunk))
- func (mgr *LocalShardManager) EnqueueOnChunk(loc ChunkXz, fn func(chunk *Chunk))
- func (mgr *LocalShardManager) PlayerShardConnect(entityId EntityId, player gamerules.IPlayerClient, shardLoc ShardXz) gamerules.IPlayerShardClient
- func (mgr *LocalShardManager) ShardShardConnect(shardLoc ShardXz) gamerules.IShardShardClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type Chunk struct {
// contains filtered or unexported fields
}
A chunk is slice of the world map.
func (*Chunk) AddActiveBlock ¶
func (chunk *Chunk) AddActiveBlock(blockXyz *BlockXyz)
func (*Chunk) AddActiveBlockIndex ¶
func (chunk *Chunk) AddActiveBlockIndex(blockIndex BlockIndex)
func (*Chunk) AddEntity ¶
func (chunk *Chunk) AddEntity(s gamerules.INonPlayerEntity)
AddEntity creates a mob or item in this chunk and notifies all chunk subscribers of the new entity
func (*Chunk) AddOnUnsubscribe ¶
func (chunk *Chunk) AddOnUnsubscribe(entityId EntityId, observer gamerules.IUnsubscribed)
AddOnUnsubscribe registers a function to be called when the given subscriber unsubscribes.
func (*Chunk) BlockQuery ¶
Used to read the BlockId of a block that's either in the chunk, or immediately adjoining it in a neighbouring chunk. In cases where the block type can't be determined we assume that the block asked about is solid (this way objects don't fly off the side of the map needlessly).
func (*Chunk) RemoveOnUnsubscribe ¶
func (chunk *Chunk) RemoveOnUnsubscribe(entityId EntityId, observer gamerules.IUnsubscribed)
RemoveOnUnsubscribe removes a function previously registered
func (*Chunk) SetBlockByIndex ¶
func (*Chunk) SetTileEntity ¶
func (chunk *Chunk) SetTileEntity(index BlockIndex, tileEntity gamerules.ITileEntity)
func (*Chunk) TileEntity ¶
func (chunk *Chunk) TileEntity(index BlockIndex) gamerules.ITileEntity
type ChunkShard ¶
type ChunkShard struct {
// contains filtered or unexported fields
}
ChunkShard represents a square shard of chunks that share a master goroutine.
func NewChunkShard ¶
func NewChunkShard(shardConnecter gamerules.IShardConnecter, chunkStore chunkstore.IChunkStore, entityMgr *entity.EntityManager, loc ShardXz) (shard *ChunkShard)
func (*ChunkShard) String ¶
func (shard *ChunkShard) String() string
type LocalShardManager ¶
type LocalShardManager struct {
// contains filtered or unexported fields
}
LocalShardManager contains all chunk shards and can look them up. It implements IShardConnecter and is for use in hosting all shards in the local process.
func NewLocalShardManager ¶
func NewLocalShardManager(chunkStore chunkstore.IChunkStore, entityMgr *entity.EntityManager) *LocalShardManager
func (*LocalShardManager) EnqueueAllChunks ¶
func (mgr *LocalShardManager) EnqueueAllChunks(fn func(chunk *Chunk))
EnqueueAllChunks runs a given function on all loaded chunks.
func (*LocalShardManager) EnqueueOnChunk ¶
func (mgr *LocalShardManager) EnqueueOnChunk(loc ChunkXz, fn func(chunk *Chunk))
EnqueueOnChunk runs a function on the chunk at the given location. If the chunk does not exist, it does nothing.
func (*LocalShardManager) PlayerShardConnect ¶
func (mgr *LocalShardManager) PlayerShardConnect(entityId EntityId, player gamerules.IPlayerClient, shardLoc ShardXz) gamerules.IPlayerShardClient
func (*LocalShardManager) ShardShardConnect ¶
func (mgr *LocalShardManager) ShardShardConnect(shardLoc ShardXz) gamerules.IShardShardClient