Posts: 1,162
Threads: 68
Joined: Mar 2013
Thanks: 245
Given 125 thank(s) in 100 post(s)
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
I received my first job offer related to my work on MCServer ))
A friend of mine has a few public MC servers and wants me to write a tool for server admins to help recover worlds that somehow got bugged (bad block ID); and he's offered a paypal "motivation" for that tool
That's how open-source should be done. It's free, but if you like it, use it or want something extra, motivate
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
aaah i'm stuck :S i am trying to make copy and paste work but i keep getting an error: Quote:[16:06:45] cChunk::WriteBlockArea(): unsupported datatype request, can write only types + metas (0x3), requested 0x0. Ignoring
i use this code to load a schematic: 1 | BlockArea:LoadFromSchematicFile( "Schematics/" .. Split[3] .. ".Schematic" )
|
this to copy: 1 | BlockArea:Read( World, OneX, TwoX, OneY, TwoY, OneZ, TwoZ )
|
and this to paste it: 1 | BlockArea:Write( Player:GetWorld(), Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() )
|
but i can still use the schematics file i create in MCEdit.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
05-02-2013, 12:41 AM
(This post was last modified: 05-02-2013, 12:42 AM by xoft.)
you need a fifth parameter to Write():
1 | BlockArea:Write(Player:GetWorld(), Player:GetPosX(), Player:GetPosY(), Player:GetPosZ(), baTypes or baMetas);
|
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
05-02-2013, 12:43 AM
(This post was last modified: 05-02-2013, 12:46 AM by NiLSPACE.)
Realy? for my //set command i didn't need that ;O
now i get: Quote:LUA: Plugins/WorldEdit/main.lua:39: error in function 'Write'. argument #6 is 'nil'; '[no object]' expected
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Hmm, really, the extra parameter is not needed, because when missing, it should default to "baTypes or baMetas". The error you were getting was because it should've been "cBlockArea.baTypes or cBlockArea.baMetas", my mistake, sorry.
Anyway, the original error is caused by the BlockArea not containing the proper datatypes. After loading or reading the area, try to see what datatypes it is holding (cBlockArea:GetDataTypes()), it should be equal to 3, which means blocktypes and blockmetas. If not, there's an error either in your loading or reading code, or in MCServer's handling of those. Try to pinpoint where the datatypes value gets lost.
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
when i do "print(BlockArea:GetDataTypes())" it says 0 but when i do "print(BlockArea:GetDataTypes())" after BlockArea:LoadFromSchematicFile(....) it says 3
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
So when exactly does it go from 0 to 3?
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
05-02-2013, 02:26 AM
(This post was last modified: 05-02-2013, 02:26 AM by NiLSPACE.)
i can only think of one thing, before the //paste command it does BlockArea = cBlockArea()
EDIT:
YEA it works i put the BlockArea = cBlockArea() in the initialize function only now
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
05-02-2013, 05:28 AM
(This post was last modified: 05-02-2013, 05:33 AM by NiLSPACE.)
|