summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/ChunkWorx
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-30 14:37:55 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-30 14:37:55 +0200
commitd2469d857ab345961e7991339de490ddafebf4a8 (patch)
tree8c0d0decd39e3cceaa9317af0c9f4d0b02ede7a7 /MCServer/Plugins/ChunkWorx
parentAdded a basic protocol recognizer and the base for 1.3.2 protocol. (diff)
downloadcuberite-d2469d857ab345961e7991339de490ddafebf4a8.tar
cuberite-d2469d857ab345961e7991339de490ddafebf4a8.tar.gz
cuberite-d2469d857ab345961e7991339de490ddafebf4a8.tar.bz2
cuberite-d2469d857ab345961e7991339de490ddafebf4a8.tar.lz
cuberite-d2469d857ab345961e7991339de490ddafebf4a8.tar.xz
cuberite-d2469d857ab345961e7991339de490ddafebf4a8.tar.zst
cuberite-d2469d857ab345961e7991339de490ddafebf4a8.zip
Diffstat (limited to 'MCServer/Plugins/ChunkWorx')
-rw-r--r--MCServer/Plugins/ChunkWorx/chunkworx_main.lua2
-rw-r--r--MCServer/Plugins/ChunkWorx/chunkworx_web.lua14
2 files changed, 11 insertions, 5 deletions
diff --git a/MCServer/Plugins/ChunkWorx/chunkworx_main.lua b/MCServer/Plugins/ChunkWorx/chunkworx_main.lua
index 26f9ca624..87702ff79 100644
--- a/MCServer/Plugins/ChunkWorx/chunkworx_main.lua
+++ b/MCServer/Plugins/ChunkWorx/chunkworx_main.lua
@@ -23,7 +23,7 @@ function Initialize(Plugin)
PLUGIN = Plugin
PLUGIN:SetName("ChunkWorx")
- PLUGIN:SetVersion(4)
+ PLUGIN:SetVersion(5)
PluginManager = cRoot:Get():GetPluginManager()
PluginManager:AddHook(PLUGIN, cPluginManager.E_PLUGIN_TICK)
diff --git a/MCServer/Plugins/ChunkWorx/chunkworx_web.lua b/MCServer/Plugins/ChunkWorx/chunkworx_web.lua
index 7bc4bc4e9..cc577bbbe 100644
--- a/MCServer/Plugins/ChunkWorx/chunkworx_web.lua
+++ b/MCServer/Plugins/ChunkWorx/chunkworx_web.lua
@@ -102,19 +102,25 @@ function HandleRequest_Generation( Request )
GENERATION_STATE = 3
end
end
+
+ local GetAreaByPlayer = function(Player)
+ -- Player is valid only within this function, it cannot be stord and used later!
+ AreaStartX = Player:GetChunkX()
+ AreaStartZ = Player:GetChunkZ()
+ end
-- PLAYERS REGEN!
if( Request.PostParams["PlayerExact"] ~= nil
and Request.PostParams["PlayerName"] ~= nil ) then -- Making BOOM! I meant, regenereate...
- AreaStartX = cRoot:Get():GetWorld(WORK_WORLD):GetPlayer(Request.PostParams["PlayerName"]):GetChunkX()
- AreaStartZ = cRoot:Get():GetWorld(WORK_WORLD):GetPlayer(Request.PostParams["PlayerName"]):GetChunkZ()
+ cRoot:Get():GetWorld(WORK_WORLD):DoWithPlayer(Request.PostParams["PlayerName"],GetAreaByPlayer)
AreaEndX = AreaStartX
AreaEndZ = AreaStartZ
GENERATION_STATE = 3
end
if( Request.PostParams["Player3x3"] ~= nil
and Request.PostParams["PlayerName"] ~= nil ) then -- Making BOOM! I meant, regenereate...
- AreaStartX = cRoot:Get():GetWorld(WORK_WORLD):GetPlayer(Request.PostParams["PlayerName"]):GetChunkX() - 1
- AreaStartZ = cRoot:Get():GetWorld(WORK_WORLD):GetPlayer(Request.PostParams["PlayerName"]):GetChunkZ() - 1
+ cRoot:Get():GetWorld(WORK_WORLD):DoWithPlayer(Request.PostParams["PlayerName"],GetAreaByPlayer)
+ AreaStartX = AreaStartX - 1
+ AreaStartZ = AreaStartZ - 1
AreaEndX = AreaStartX + 2
AreaEndZ = AreaStartZ + 2
GENERATION_STATE = 3