Posts: 4,636
Threads: 115
Joined: Dec 2011
Thanks: 697
Given 496 thank(s) in 424 post(s)
10-10-2015, 01:40 AM
(This post was last modified: 10-10-2015, 01:41 AM by NiLSPACE.)
I just had an idea for a WECUI replacement. In Minecraft 1.9 particles will barely lag your computer. This is because they aren't seen as entities anymore. We could try to use these particles as a replacement for WECUI. Of course once WECUI is updated for 1.9 it is favorable to use that.
or we could create a separate plugin that would implement this behavior.
Posts: 66
Threads: 12
Joined: Oct 2015
Thanks: 0
Given 10 thank(s) in 8 post(s)
Just got through looking at your API file. Is there a simple way I am missing to get coordinate points of a cuboid selection, or would I have to use the ExecuteString function? If the latter, does this look correct?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | local playerName = cPlayer:GetName()
local fnString = [[ function (a_Player)
local Sel = cRoot:Get():FindAndDoWithPlayer(a_Player,GetPlayerState).selection
local ret = {}
assert (Sel:IsValid(), "No cuboid selection found!" )
ret.X1, ret.X2 = Sel:GetXCoordsSorted()
ret.Y1, ret.Y2 = Sel:GetYCoordsSorted()
ret.Z1, ret.Z2 = Sel:GetZCoordsSorted()
return ret
end ]]
local sel, msg = cRoot:Get():GetPluginManager():CallPlugin( "WorldEdit" , "ExecuteString" ,fnString,playerName)
|
Posts: 4,636
Threads: 115
Joined: Dec 2011
Thanks: 697
Given 496 thank(s) in 424 post(s)
11-11-2015, 10:31 PM
(This post was last modified: 11-17-2015, 09:03 PM by NiLSPACE.)
It's pretty easy:
1 2 3 4 5 6 | local SelectedCuboid = cCuboid()
cPluginManager:CallPlugin( "WorldEdit" , "GetPlayerCuboidSelection" , Player, SelectedCuboid)
|
Also, your previous code would've given an error. You're returning a table to a different plugin. You can only pass numbers, booleans, strings and usertypes (cPlayer, cEntity, cCuboid, etc.). This means NO tables, arrays, lists, etc. You could've returned all the other variables.
1 2 3 4 5 | return Sel:GetXCoordsSorted(), Sel:GetYCoordsSorted(), Sel:GetZCoordsSorted()
local MinX, MaxX, MinY, MaxY, MinZ, MaxZ = cRoot:Get():GetPluginManager():CallPlug...
|
And no, the FindAndDoWithPlayer part wouldn't work. The syntax is still valid, but it would crash because you would try to get the selection member of a bool value.
What would've worked is this:
1 2 3 4 5 6 | local Sel;
cRoot:Get():FindAndDoWithPlayer(a_Player,
function (a_Player)
Sel = GetPlayerState(a_Player).Selection
end
)
|
Posts: 66
Threads: 12
Joined: Oct 2015
Thanks: 0
Given 10 thank(s) in 8 post(s)
Thanks much. I even said it wouldn't work sending tables, and then I made a table.. lol oops. And good to know about the FindAndDo. TMYK.
What I don't get is how I missed the cCuboid bit. Thanks!
Posts: 6
Threads: 1
Joined: Nov 2015
Thanks: 0
Given 0 thank(s) in 0 post(s)
(05-03-2013, 10:48 PM)NiLSPACE Wrote: Fun fact: This plugin can crash your minecraft client if you use a region that is too large.
OK! That's why...! :-)
Posts: 4,636
Threads: 115
Joined: Dec 2011
Thanks: 697
Given 496 thank(s) in 424 post(s)
I thought Mojang fixed it already though.
Posts: 166
Threads: 14
Joined: Nov 2015
Thanks: 13
Given 14 thank(s) in 12 post(s)
I just want to say: I'm impressed. While on Spigot, if I made a block of stone of 1.5m blocks, the server would just stop for ~10 seconds.
Using this plugin, it's done within 2 seconds. Keep going like this! This is awesome!
Posts: 513
Threads: 10
Joined: May 2014
Thanks: 138
Given 89 thank(s) in 75 post(s)
11-20-2015, 03:22 AM
(This post was last modified: 11-20-2015, 03:23 AM by Seadragon91.)
(11-20-2015, 03:17 AM)PureTryOut Wrote: I just want to say: I'm impressed. While on Spigot, if I made a block of stone of 1.5m blocks, the server would just stop for ~10 seconds.
Using this plugin, it's done within 2 seconds. Keep going like this! This is awesome!
The reason why it's that quick is that the content of a schematic file are copied directly into the chunk(s). The class for this is named cBlockArea.
One problem still exists. No content of any block entities are copied and no block entites are created (example a chest, that you can open it). There is a open issue for that on github
Posts: 4,636
Threads: 115
Joined: Dec 2011
Thanks: 697
Given 496 thank(s) in 424 post(s)
Spigot only stopped for 10 seconds? When I tried to paste the structure in the AsyncWorldEdit demo (that's 2 million blocks) my spigot server froze for a whole minute and then crashed. Cuberite was only blocked for 3.84 seconds.
Posts: 166
Threads: 14
Joined: Nov 2015
Thanks: 13
Given 14 thank(s) in 12 post(s)
I'm guessing you were the one commenting there (NiLSPACE), your name sounds Dutch. Altijd mooi landgenoten te vinden op het internet
Anyways the only issue that I had was that //undo did not fully undo the //set command. A part of the block was set in the water, and that part was not undone, so a layer of stone was left behind.
|