Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("rotutil")
- local mX,mY,mZ=commands.getBlockPosition()
- local r=rotutil.opposite[rotutil.fromMeta(commands.getBlockInfo(mX,mY,mZ).metadata)]
- mX,mY,mZ=rotutil.addDir(r,mX,mY,mZ)
- local size = fs.open("disk/.dat/size","r")
- local MX,MY,MZ=tonumber(size.readLine()),tonumber(size.readLine()),tonumber(size.readLine())
- size.close()
- size=nil
- MX,MY,MZ=rotutil.bound(r,mX,mY,mZ,MX,MY,MZ)
- if mX>MX then mX,MX=MX,mX end
- if mY>MY then mY,MY=MY,mY end
- if mZ>MZ then mZ,MZ=MZ,mZ end
- local ids={}
- local nId=0
- local idsF=fs.open("disk/.dat/ids","r")
- local name=idsF.readLine()
- while name do
- ids[nId]=name
- nId=nId+1
- name=idsF.readLine()
- end
- local hasManyIds
- if nId>256 then hasManyIds=true end
- idsF.close()
- idsF=nil
- local idPack=fs.open("disk/.dat/idPack","rb")
- local meta=fs.open("disk/.dat/meta","rb")
- local function readBlock()
- local id=idPack.read()
- if hasManyIds then id=id+256*idPack.read() end
- return ids[id],meta.read()
- end
- for y=mY,MY do
- for z=mZ,MZ do
- for x=mX,MX do
- commands.async.setblock(x,y,z,readBlock())
- end
- end
- end
- idPack.close()
- meta.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement