public void LoadBlocks(IChunkLoader loader) { _world.RWLock.AcquireWriterLock(System.Threading.Timeout.Infinite); loader.LoadChunk(_key, _data); _world.RWLock.ReleaseWriterLock(); _world.ChunkModified(this); }
/// <summary> Default constructor. </summary> /// <param name="loader"> A factory which can load and save the chunks as needed. </param> public World(IChunkLoader loader) { _loader = loader; Chunks = new Chunk[NumberOfChunksWide * NumberOfChunksWide]; LoadChunks(); }
protected override IChunkProvider func_22086_b() { IChunkLoader ichunkloader = worldFile.func_22092_a(worldProvider); field_20911_y = new ChunkProviderServer(this, ichunkloader, worldProvider.getChunkProvider()); return(field_20911_y); }
protected void RegisterChunkEvents(IChunkLoader item) { item.OnChunkLoad += ChunksLoaded; item.OnChunksGenerated += ChunksGenerated; item.OnChunksUnavailable += ChunksUnavailable; ChunkProviders.Add(item); }
public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, IChunkProvider ichunkprovider) { field_725_a = new HashSet(); id2ChunkMap = new HashMap(); field_727_f = new ArrayList(); field_724_b = new EmptyChunk(worldserver, new byte[32768], 0, 0); world = worldserver; field_729_d = ichunkloader; field_730_c = ichunkprovider; }
public ChunkProviderLoadOrGenerate(World world, IChunkLoader ichunkloader, IChunkProvider ichunkprovider) { chunks = new Chunk[1024]; lastQueriedChunkXPos = unchecked((int) 0xc4653601); lastQueriedChunkZPos = unchecked((int) 0xc4653601); blankChunk = new EmptyChunk(world, new byte[32768], 0, 0); worldObj = world; chunkLoader = ichunkloader; chunkProvider = ichunkprovider; }
public ChunkProvider(World par1World, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider) { droppedChunksSet = new List <long>(); chunkMap = new LongHashMap(); chunkList = new List <Chunk>(); emptyChunk = new EmptyChunk(par1World, 0, 0); worldObj = par1World; chunkLoader = par2IChunkLoader; chunkProvider = par3IChunkProvider; }
public ChunkProviderLoadOrGenerate(World world, IChunkLoader ichunkloader, IChunkProvider ichunkprovider) { chunks = new Chunk[1024]; lastQueriedChunkXPos = unchecked ((int)0xc4653601); lastQueriedChunkZPos = unchecked ((int)0xc4653601); blankChunk = new EmptyChunk(world, new byte[32768], 0, 0); worldObj = world; chunkLoader = ichunkloader; chunkProvider = ichunkprovider; }
public ActorHost(Player player, IChunkLoader chunkLoader) { _chunkLoader = chunkLoader; Player = player; planet = ResourceManager.Instance.GetPlanet(Player.Position.Planet); _oldIndex = Player.Position.ChunkIndex; ActiveTool = null; State = WorldState.Loading; }
public ChunkProvider( ILogger logger, ChunkProviderOptions chunkProviderOptions, IChunkLoader chunkLoader, IChunkSaver chunkSaver, IChunkCreator chunkCreator) { _logger = logger.ForContext <ChunkProvider>(); _chunkProviderOptions = chunkProviderOptions; _chunkLoader = chunkLoader; _chunkSaver = chunkSaver; _chunkCreator = chunkCreator; _chunks = new Dictionary <Vector2i, Chunk>(8192); }
public Chunk CreateChunk(Vector3i key, IChunkLoader loader = null) { // TODO check that chunk doesn't exist yet // TODO check that chunk is within given size bounds var chunk = new Chunk(key, this); _chunks.Add(chunk.Key, chunk); if (loader != null) { BeginBatchUpdate(); chunk.LoadBlocks(loader); EndBatchUpdate(); } return(chunk); }
public void AddChunkLoader(IChunkLoader chunkLoader) { RegisterChunkEvents(chunkLoader); }
public ChunkCache(IChunkLoader loader) { _chunkLoader = loader; }
public TemplateComposer(TypePool types, IChunkLoader chunkLoader) { _types = types; _chunkLoader = chunkLoader; }
public Parsings(IChunkLoader chunkLoader) { _chunkLoader = chunkLoader; }
public TemplateComposer(ITemplateRegistry templateRegistry, IChunkLoader chunkLoader) { _templateRegistry = templateRegistry; _chunkLoader = chunkLoader; }
void Awake() { // If no instance has been set when this object awakened if (_instance == null) { _instance = this; }else{ Debug.LogWarning("An object with ZapLoader has been instantiated but an instance has been created already. The component will be removed from this object"); Destroy (this); } // Creates an instance of the ChunkLoader try { chunkLoader = (IChunkLoader)gameObject.AddComponent(chunkLoadingPlugin); }catch{ Debug.LogError("An error occured while loading the chunk plugin."); } }