Try to fix runtime errors in libworld

This commit is contained in:
Kirigaya Kazuto 2018-03-13 17:11:41 +08:00
parent 8bc2bd66b6
commit a73439c722

View File

@ -191,6 +191,9 @@ function PasteArea(box,ax,ay,az)
if(debugcard==nil) then
error("This program require debug card.")
end
if(computer.getArchitecture()~="Lua 5.2") then
print("Warning: Without Lua 5.2 architecture, NBT may cause fatal error.")
end
local cnt=0
local world=debugcard.getWorld()
@ -198,7 +201,7 @@ function PasteArea(box,ax,ay,az)
print("Pasting to (" .. ax+v.x .. "," .. ay+v.y .. "," .. az+v.z .. ")")
world.setBlock(ax+v.x,ay+v.y,az+v.z,v.id,v.meta)
if(v.nbt~=nil) then
world.setTileNBT(x,y,z,v.nbt)
world.setTileNBT(ax+v.x,ay+v.y,az+v.z,v.nbt)
end
cnt=cnt+1
end