summaryrefslogtreecommitdiffstats
path: root/Plugins
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-26 22:54:08 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-26 22:54:08 +0100
commiteb942797b8a1321f7460cea7763bb6891affd475 (patch)
tree89d2c6c4724bda06f0d8779a6ab3e02636c968ce /Plugins
parent- improved Simulator system (diff)
downloadcuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar
cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar.gz
cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar.bz2
cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar.lz
cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar.xz
cuberite-eb942797b8a1321f7460cea7763bb6891affd475.tar.zst
cuberite-eb942797b8a1321f7460cea7763bb6891affd475.zip
Diffstat (limited to '')
-rw-r--r--Plugins/Core.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/Plugins/Core.lua b/Plugins/Core.lua
index 5090dcf95..517b48394 100644
--- a/Plugins/Core.lua
+++ b/Plugins/Core.lua
@@ -46,6 +46,7 @@ function CorePlugin:Initialize()
self:AddCommand("/unban", " - [Player] - Unban a player", "core.unban")
self:AddCommand("/top", " - Teleport yourself to the top most block", "core.top")
self:AddCommand("/gm", " - [Gamemode (0|1)] - Change your gamemode", "core.changegm")
+ self:AddCommand("/gotoworld", " - Move to a different world!", "core.gotoworld")
self:BindCommand( "/help", "core.help", HandleHelpCommand )
self:BindCommand( "/pluginlist","core.pluginlist", HandlePluginListCommand )
@@ -65,6 +66,7 @@ function CorePlugin:Initialize()
self:BindCommand( "/unban", "core.unban", HandleUnbanCommand )
self:BindCommand( "/top", "core.top", HandleTopCommand )
self:BindCommand( "/gm", "core.changegm", HandleChangeGMCommand )
+ self:BindCommand( "/gotoworld", "core.gotoworld", HandleGotoWorldCommand )
local IniFile = cIniFile("settings.ini")
if ( IniFile:ReadFile() == true ) then
@@ -347,7 +349,7 @@ function HandleItemCommand( Split, Player )
foundItem = false
ItemID = tonumber( Split[2] )
- if( ItemID == nil or not isValidItem( ItemID ) ) then
+ if( ItemID == nil or not IsValidItem( ItemID ) ) then
-- nothing
else
foundItem = true
@@ -358,7 +360,7 @@ function HandleItemCommand( Split, Player )
itemValue = itemsINI:GetValueI('Items', ''..Split[2]..'', 0)
if itemValue ~= 0 then
ItemID = itemValue
- if( ItemID == nil or not isValidItem( tonumber(itemValue) ) ) then
+ if( ItemID == nil or not IsValidItem( tonumber(itemValue) ) ) then
-- nothing
else
foundItem = true
@@ -420,6 +422,21 @@ function HandleChangeGMCommand( Split, Player )
return true
end
+function HandleGotoWorldCommand( Split, Player )
+ if( #Split ~= 2 ) then
+ Player:SendMessage( cChatColor.Green .. "Usage: /gotoworld [WorldName]" )
+ return true
+ end
+
+ if( Player:MoveToWorld(Split[2]) == false ) then
+ Player:SendMessage( cChatColor.Green .. "Could not move to world '" .. Split[2] .. "'!" )
+ return true
+ end
+
+
+ Player:SendMessage( cChatColor.Green .. "Moved successfully to '" .. Split[2] .. "'! :D" )
+ return true
+end
function CorePlugin:OnPlayerJoin( Player )
ShowMOTDTo( Player )