(12-17-2016, 10:42 PM)xoft Wrote: - keep a copy of the world and copy from there
The second is a perfect example of using multiworld as an advantage - make Cuberite load both worlds, but don't let players into the "backup" world. Then simply copy any area from the backup to the main world.
At first i think the second option is the best.
How i can log if a entity has modify a chunk?
How i can copy the chunk from backup world to main world?
Okay, i looked in the WorldEdit Plugin, is this the best way?
PHP Code:
function copy(World,chX,chZ)
print("Start Copy for:",chX,chZ)
local startX = math.floor(chX * 16)
local endX = math.floor(chX * 16) + 16
local startZ = math.floor(chZ * 16)
local endZ = math.floor(chZ * 16) + 16
print(startX,endX,startZ,endZ)
for X = startX, endX do
for Y = 0, 255 do
for Z = startZ, endZ do
local BlockType = World:GetBlock(X, Y, Z)
if(BlockType ~= 0) then
local BlockMeta = World:GetBlockMeta(X, Y, Z)
print("Copy Block",X,Y,Z,"BlockID;", BlockType)
-- Test Copy to the next X Chunk
World:SetBlock(X+16, Y, Z, BlockType, BlockMeta, false)
end
end
end
end
end
I doesnt find a function and hook in wiki.