summaryrefslogtreecommitdiffstats
path: root/MCServer
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-09-07 22:06:30 +0200
committermadmaxoft <github@xoft.cz>2013-09-07 22:06:30 +0200
commitd31142811db9073b7b01b834ca3bf82f6bceb4a9 (patch)
tree9988b872e675a082253126b9ff292070e913b1cd /MCServer
parentFixed a missing initialization in cMonster. (diff)
parentAdded a (disabled) block logging to projectile path-tracing. (diff)
downloadcuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar.gz
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar.bz2
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar.lz
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar.xz
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar.zst
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.zip
Diffstat (limited to 'MCServer')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua22
1 files changed, 18 insertions, 4 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index be16e3465..b895da05e 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -1,6 +1,5 @@
--- Global variables
-PLUGIN = {}; -- Reference to own plugin object
+-- Global variables
g_DropSpensersToActivate = {}; -- A list of dispensers and droppers (as {World, X, Y Z} quadruplets) that are to be activated every tick
g_HungerReportTick = 10;
g_ShowFoodStats = false; -- When true, each player's food stats are sent to them every 10 ticks
@@ -11,8 +10,6 @@ g_ShowFoodStats = false; -- When true, each player's food stats are sent to the
function Initialize(Plugin)
- PLUGIN = Plugin
-
Plugin:SetName("Debuggers")
Plugin:SetVersion(1)
@@ -46,6 +43,7 @@ function Initialize(Plugin)
PluginManager:BindCommand("/ench", "debuggers", HandleEnchCmd, "- Provides an instant dummy enchantment window");
PluginManager:BindCommand("/fs", "debuggers", HandleFoodStatsCmd, "- Turns regular foodstats message on or off");
PluginManager:BindCommand("/arr", "debuggers", HandleArrowCmd, "- Creates an arrow going away from the player");
+ PluginManager:BindCommand("/fb", "debuggers", HandleFireballCmd, "- Creates a ghast fireball as if shot by the player");
-- Enable the following line for BlockArea / Generator interface testing:
-- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED);
@@ -480,6 +478,7 @@ end
function OnWorldTick(a_World, a_Dt)
+ -- Report food stats, if switched on:
local Tick = a_World:GetWorldAge();
if (not(g_ShowFoodStats) or (math.mod(Tick, 10) ~= 0)) then
return false;
@@ -825,3 +824,18 @@ end
+
+function HandleFireballCmd(a_Split, a_Player)
+ local World = a_Player:GetWorld();
+ local Pos = a_Player:GetEyePosition();
+ local Speed = a_Player:GetLookVector();
+ Speed:Normalize();
+ Pos = Pos + Speed * 2;
+
+ World:CreateProjectile(Pos.x, Pos.y, Pos.z, cProjectileEntity.pkGhastFireball, a_Player, Speed * 10);
+ return true;
+end
+
+
+
+