summaryrefslogtreecommitdiffstats
path: root/MCServer
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-21 22:03:50 +0200
committermadmaxoft <github@xoft.cz>2013-08-21 22:03:50 +0200
commit268661990dbfde430383ce21d9684e37ee2135d9 (patch)
treeb9961de605d657fa89f5a5e6a3d2a7df8113c101 /MCServer
parentUpdated the Debuggers plugin to the #121 API. (diff)
downloadcuberite-268661990dbfde430383ce21d9684e37ee2135d9.tar
cuberite-268661990dbfde430383ce21d9684e37ee2135d9.tar.gz
cuberite-268661990dbfde430383ce21d9684e37ee2135d9.tar.bz2
cuberite-268661990dbfde430383ce21d9684e37ee2135d9.tar.lz
cuberite-268661990dbfde430383ce21d9684e37ee2135d9.tar.xz
cuberite-268661990dbfde430383ce21d9684e37ee2135d9.tar.zst
cuberite-268661990dbfde430383ce21d9684e37ee2135d9.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/ChatLog/plugin.lua3
-rw-r--r--MCServer/Plugins/ChunkWorx/chunkworx_main.lua3
-rw-r--r--MCServer/Plugins/DiamondMover/DiamondMover.lua12
-rw-r--r--MCServer/Plugins/HookNotify/HookNotify.lua82
-rw-r--r--MCServer/Plugins/MagicCarpet/plugin.lua5
5 files changed, 51 insertions, 54 deletions
diff --git a/MCServer/Plugins/ChatLog/plugin.lua b/MCServer/Plugins/ChatLog/plugin.lua
index c2f6fb81a..adbf986e0 100644
--- a/MCServer/Plugins/ChatLog/plugin.lua
+++ b/MCServer/Plugins/ChatLog/plugin.lua
@@ -13,8 +13,7 @@ function Initialize(Plugin)
Plugin:SetName("ChatLog")
Plugin:SetVersion(3)
- PluginManager = cRoot:Get():GetPluginManager()
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHAT)
+ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChat)
LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
return true
diff --git a/MCServer/Plugins/ChunkWorx/chunkworx_main.lua b/MCServer/Plugins/ChunkWorx/chunkworx_main.lua
index 66cf00b97..ab9962387 100644
--- a/MCServer/Plugins/ChunkWorx/chunkworx_main.lua
+++ b/MCServer/Plugins/ChunkWorx/chunkworx_main.lua
@@ -26,8 +26,7 @@ function Initialize(Plugin)
PLUGIN:SetName("ChunkWorx")
PLUGIN:SetVersion(6)
- PluginManager = cRoot:Get():GetPluginManager()
- PluginManager:AddHook(PLUGIN, cPluginManager.HOOK_TICK)
+ cPluginManager.AddHook(cPluginManager.HOOK_TICK, OnTick)
Plugin:AddWebTab("(Re)Generation", HandleRequest_Generation)
diff --git a/MCServer/Plugins/DiamondMover/DiamondMover.lua b/MCServer/Plugins/DiamondMover/DiamondMover.lua
index c89a3394f..0fdd32250 100644
--- a/MCServer/Plugins/DiamondMover/DiamondMover.lua
+++ b/MCServer/Plugins/DiamondMover/DiamondMover.lua
@@ -9,7 +9,6 @@
-- Global variables
-PLUGIN = {} -- Reference to own plugin object
MOVER_SIZE_X = 4;
MOVER_SIZE_Y = 4;
MOVER_SIZE_Z = 4;
@@ -19,13 +18,10 @@ MOVER_SIZE_Z = 4;
function Initialize(Plugin)
- PLUGIN = Plugin;
-
Plugin:SetName("DiamondMover");
Plugin:SetVersion(1);
- PluginManager = cRoot:Get():GetPluginManager();
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USED_ITEM);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_USED_ITEM, OnPlayerUsedItem);
return true;
end
@@ -80,4 +76,8 @@ function OnPlayerUsedItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, Cu
Area:Write(Player:GetWorld(), BlockX - MOVER_SIZE_X, BlockY - MOVER_SIZE_Y, BlockZ - MOVER_SIZE_Z);
return false;
end
-end \ No newline at end of file
+end
+
+
+
+
diff --git a/MCServer/Plugins/HookNotify/HookNotify.lua b/MCServer/Plugins/HookNotify/HookNotify.lua
index 6badc63e7..ed791090e 100644
--- a/MCServer/Plugins/HookNotify/HookNotify.lua
+++ b/MCServer/Plugins/HookNotify/HookNotify.lua
@@ -13,47 +13,47 @@ function Initialize(Plugin)
Plugin:SetVersion(1);
PluginManager = cPluginManager:Get();
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_BLOCK_TO_PICKUPS);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHAT);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_AVAILABLE);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATING);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_UNLOADED);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_UNLOADING);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_COLLECTING_PICKUP);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CRAFTING_NO_RECIPE);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_DISCONNECT);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_EXECUTE_COMMAND);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_HANDSHAKE);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_KILLING);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_LOGIN);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_BREAKING_BLOCK);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_BROKEN_BLOCK);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_EATING);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_JOINED);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_LEFT_CLICK);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_MOVING);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_PLACED_BLOCK);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_PLACING_BLOCK);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_RIGHT_CLICK);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_SHOOTING);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_SPAWNED);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_TOSSING_ITEM);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USED_BLOCK);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USED_ITEM);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USING_BLOCK);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USING_ITEM);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_POST_CRAFTING);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PRE_CRAFTING);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_SPAWNED_ENTITY);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_SPAWNED_MONSTER);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_SPAWNING_ENTITY);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_SPAWNING_MONSTER);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_TAKE_DAMAGE);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_UPDATED_SIGN);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_UPDATING_SIGN);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_WEATHER_CHANGED);
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_WEATHER_CHANGING);
+ cPluginManager.AddHook(cPluginManager.HOOK_BLOCK_TO_PICKUPS, OnBlockToPickups);
+ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChat);
+ cPluginManager.AddHook(cPluginManager.HOOK_CHUNK_AVAILABLE, OnChunkAvailable);
+ cPluginManager.AddHook(cPluginManager.HOOK_CHUNK_GENERATED, OnChunkGenerated);
+ cPluginManager.AddHook(cPluginManager.HOOK_CHUNK_GENERATING, OnChunkGenerating);
+ cPluginManager.AddHook(cPluginManager.HOOK_CHUNK_UNLOADED, OnChunkUnloaded);
+ cPluginManager.AddHook(cPluginManager.HOOK_CHUNK_UNLOADING, OnChunkUnloading);
+ cPluginManager.AddHook(cPluginManager.HOOK_COLLECTING_PICKUP, OnCollectingPickup);
+ cPluginManager.AddHook(cPluginManager.HOOK_CRAFTING_NO_RECIPE, OnCraftingNoRecipe);
+ cPluginManager.AddHook(cPluginManager.HOOK_DISCONNECT, OnDisconnect);
+ cPluginManager.AddHook(cPluginManager.HOOK_EXECUTE_COMMAND, OnExecuteCommand);
+ cPluginManager.AddHook(cPluginManager.HOOK_HANDSHAKE, OnHandshake);
+ cPluginManager.AddHook(cPluginManager.HOOK_KILLING, OnKilling);
+ cPluginManager.AddHook(cPluginManager.HOOK_LOGIN, OnLogin);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_BREAKING_BLOCK, OnPlayerBreakingBlock);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_BROKEN_BLOCK, OnPlayerBrokenBlock);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_EATING, OnPlayerEating);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_JOINED, OnPlayerJoined);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_LEFT_CLICK, OnPlayerLeftClick);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_MOVING, OnPlayerMoving);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_PLACED_BLOCK, OnPlayerPlacedBlock);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_PLACING_BLOCK, OnPlayerPlacingBlock);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_RIGHT_CLICK, OnPlayerRightClick);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_SHOOTING, OnPlayerShooting);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_SPAWNED, OnPlayerSpawned);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_TOSSING_ITEM, OnPlayerTossingItem);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_USED_BLOCK, OnPlayerUsedBlock);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_USED_ITEM, OnPlayerUsedItem);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_USING_BLOCK, OnPlayerUsingBlock);
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_USING_ITEM, OnPlayerUsingItem);
+ cPluginManager.AddHook(cPluginManager.HOOK_POST_CRAFTING, OnPostCrafting);
+ cPluginManager.AddHook(cPluginManager.HOOK_PRE_CRAFTING, OnPreCrafting);
+ cPluginManager.AddHook(cPluginManager.HOOK_SPAWNED_ENTITY, OnSpawnedEntity);
+ cPluginManager.AddHook(cPluginManager.HOOK_SPAWNED_MONSTER, OnSpawnedMonster);
+ cPluginManager.AddHook(cPluginManager.HOOK_SPAWNING_ENTITY, OnSpawningEntity);
+ cPluginManager.AddHook(cPluginManager.HOOK_SPAWNING_MONSTER, OnSpawningMonster);
+ cPluginManager.AddHook(cPluginManager.HOOK_TAKE_DAMAGE, OnTakeDamage);
+ cPluginManager.AddHook(cPluginManager.HOOK_UPDATED_SIGN, OnUpdatedSign);
+ cPluginManager.AddHook(cPluginManager.HOOK_UPDATING_SIGN, OnUpdatingSign);
+ cPluginManager.AddHook(cPluginManager.HOOK_WEATHER_CHANGED, OnWeatherChanged);
+ cPluginManager.AddHook(cPluginManager.HOOK_WEATHER_CHANGING, OnWeatherChanging);
LOGINFO("HookNotify plugin is installed, beware, the log output may be quite large!");
LOGINFO("You want this plugin enabled only when developing another plugin, not for regular gameplay.");
diff --git a/MCServer/Plugins/MagicCarpet/plugin.lua b/MCServer/Plugins/MagicCarpet/plugin.lua
index 3101866cd..27dcdf45d 100644
--- a/MCServer/Plugins/MagicCarpet/plugin.lua
+++ b/MCServer/Plugins/MagicCarpet/plugin.lua
@@ -7,9 +7,8 @@ function Initialize( Plugin )
Plugin:SetName( "MagicCarpet" )
Plugin:SetVersion( 1 )
- PluginManager = cRoot:Get():GetPluginManager()
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_MOVING)
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_DISCONNECT)
+ cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_MOVING, OnPlayerMoving)
+ cPluginManager.AddHook(cPluginManager.HOOK_DISCONNECT, OnDisconnect)
PluginManager:BindCommand("/mc", "magiccarpet", HandleCarpetCommand, " - Spawns a magical carpet");