protected override void DeleteRegionCore(IRegion region) { AnvilRegion r = region as AnvilRegion; if (r != null) { r.Dispose(); } }
public override IRegion GetRegion(string filename) { int rx, rz; if (!AnvilRegion.ParseFileName(filename, out rx, out rz)) { throw new ArgumentException("Malformed region file name: " + filename, "filename"); } return(GetRegion(rx, rz)); }
private static void loadLayers() { AlphaBlockCollection blk = null; int x, z, cx, cz, mx, mz, id; if( needSave ) saveLayers(); reg = (( AnvilRegion ) lvl.GetRegionManager().GetRegion( region[ 0 ], region[ 1 ])); mnuStatus.Text = "Loading Block Data"; needSave = false; y = mnuHeight.SelectedIndex; for( cx = 0; cx < cxd; cx++ ) { for( cz = 0; cz < czd; cz++ ) { if( reg.ChunkExists( cx, cz )) blk = reg.GetChunkRef( cx, cz ).Blocks; else blk = null; for( x = 0; x < xd; x++ ) { for( z = 0; z < zd; z++ ) { mx = cx * xd + x; mz = cz * zd + z; if( blk != null ) { id = Tools.Tool.Map[ mx ][ mz ].ID = blk.GetID( x, y, z ); Tools.Tool.Map[ mx ][ mz ].Data = blk.GetData( x, y, z ); Tools.Tool.Map[ mx ][ mz ].ent = blk.GetTileEntity( x, y, z ); } else id = Tools.Tool.Map[ mx ][ mz ].ID = -1; Tools.Tool.Clr[ mx ][ mz ] = BlockColor.getBlockColor( id ); } } mnuLoad.Increment( xd * zd ); } } mnuLoad.Increment( -hgt * wid ); loadImage(); }