From ae3ac08b75a5f13d29ffb2c2f897a88e491230f6 Mon Sep 17 00:00:00 2001 From: faketruth Date: Tue, 27 Dec 2011 23:05:50 +0000 Subject: [PATCH] Fixed some things in Core to work for multiple worlds git-svn-id: http://mc-server.googlecode.com/svn/trunk@139 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- Plugins/Core.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Plugins/Core.lua b/Plugins/Core.lua index 517b48394..cd87182bf 100644 --- a/Plugins/Core.lua +++ b/Plugins/Core.lua @@ -136,7 +136,7 @@ function HandleKickCommand( Split, Player ) return true end - local World = cRoot:Get():GetWorld() + local World = Player:GetWorld() local OtherPlayer = World:GetPlayer( Split[2] ) if( OtherPlayer == nil ) then Player:SendMessage( cChatColor.Green .. "Could not find player " .. Split[2] ) @@ -164,7 +164,7 @@ function HandleBanCommand( Split, Player ) return true end - local World = cRoot:Get():GetWorld() + local World = Player:GetWorld() local OtherPlayer = World:GetPlayer( Split[2] ) if( OtherPlayer == nil ) then Player:SendMessage( cChatColor.Green .. "Could not find player " .. Split[2] ) @@ -255,7 +255,7 @@ function HandleReloadCommand( Split, Player ) end function HandlePlayerListCommand( Split, Player ) - local World = cRoot:Get():GetWorld() + local World = Player:GetWorld() local PlayerList = World:GetAllPlayers() local Message = cChatColor.Green .. "Connected players: (".. cChatColor.White.. #PlayerList .. cChatColor.Green .. ")" @@ -398,7 +398,7 @@ function HandleTPCommand( Split, Player ) Player:SendMessage( cChatColor.Green .. "Usage: /tp [PlayerName]" ) return true end - local World = cRoot:Get():GetWorld() + local World = Player:GetWorld() local OtherPlayer = World:GetPlayer( Split[2] ) if( OtherPlayer == nil ) then Player:SendMessage( cChatColor.Green .. "Can't find player " .. Split[2] ) @@ -422,6 +422,7 @@ function HandleChangeGMCommand( Split, Player ) return true end + function HandleGotoWorldCommand( Split, Player ) if( #Split ~= 2 ) then Player:SendMessage( cChatColor.Green .. "Usage: /gotoworld [WorldName]" ) @@ -457,7 +458,7 @@ function CorePlugin:OnBlockPlace( Block, Player ) end local collision = false - local World = cRoot:Get():GetWorld() + local World = Player:GetWorld() local PlayerList = World:GetAllPlayers() -- check if a player occupies the placement location @@ -602,7 +603,6 @@ function ReloadWeb:new() end function ReloadWeb:HandleRequest( Request ) - local World = cRoot:Get():GetWorld() local Content = "" if( Request.Params:get("reload") ~= "" ) then @@ -641,8 +641,6 @@ local function HTMLDeleteButton( name ) end function WhiteListWeb:HandleRequest( Request ) - local World = cRoot:Get():GetWorld() - local UpdateMessage = "" if( Request.Params:get("whitelist-add") ~= "" ) then local PlayerName = Request.Params:get("whitelist-add")