summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Core/regen.lua
blob: e76f5cb5c9fbc66d767cb6e126b92256304c0b2c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function HandleRegenCommand(Split, Player)

	if #Split == 2 or #Split > 3 then
		SendMessage( Player, "Usage: '/regeneratechunk' or '/regeneratechunk [X] [Z]'" )
		return true
	end

	local X = Player:GetChunkX()
	local Z = Player:GetChunkZ()

	if #Split == 3 then
		X = Split[2]
		Z = Split[3]
	end

	SendMessageSuccess( Player, "Regenerating chunk ["..X..", "..Z.."]")
	Player:GetWorld():RegenerateChunk(X, Z)
	return true

end