summaryrefslogtreecommitdiffstats
path: root/MCServer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua49
1 files changed, 49 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 179935c08..ca764c959 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -65,6 +65,8 @@ function Initialize(Plugin)
PM:BindCommand("/sb", "debuggers", HandleSetBiome, "- Sets the biome around you to the specified one");
PM:BindCommand("/wesel", "debuggers", HandleWESel, "- Expands the current WE selection by 1 block in X/Z");
PM:BindCommand("/rmitem", "debuggers", HandleRMItem, "- Remove the specified item from the inventory.");
+ PM:BindCommand("/pickups", "debuggers", HandlePickups, "- Spawns random pickups around you");
+ PM:BindCommand("/poof", "debuggers", HandlePoof, "- Nudges pickups close to you away from you");
Plugin:AddWebTab("Debuggers", HandleRequest_Debuggers)
Plugin:AddWebTab("StressTest", HandleRequest_StressTest)
@@ -1558,3 +1560,50 @@ end
+
+local PossibleItems =
+{
+ cItem(E_ITEM_DIAMOND),
+ cItem(E_ITEM_GOLD),
+ cItem(E_ITEM_IRON),
+ cItem(E_ITEM_DYE, E_META_DYE_BLUE), -- Lapis lazuli
+ cItem(E_ITEM_COAL),
+}
+
+
+
+
+
+function HandlePickups(a_Split, a_Player)
+ local PlayerX = a_Player:GetPosX()
+ local PlayerY = a_Player:GetPosY()
+ local PlayerZ = a_Player:GetPosZ()
+ local World = a_Player:GetWorld()
+ local Range = 15
+ for x = 0, Range do for z = 0, Range do
+ local x = PlayerX + x - Range / 2
+ local z = PlayerZ + z - Range / 2
+ local Items = cItems()
+ Items:Add(PossibleItems[math.random(#PossibleItems)])
+ World:SpawnItemPickups(Items, x, PlayerY, z, 0)
+ end end -- for z, for x
+end
+
+
+
+
+function HandlePoof(a_Split, a_Player)
+ local PlayerPos = a_Player:GetPos()
+ local Box = cBoundingBox(PlayerPos, a_Player:GetWidth() / 2, a_Player:GetHeight())
+ a_Player:GetWorld():ForEachEntityInBox(Box,
+ function (a_Entity)
+ local AddSpeed = PlayerPos - a_Entity:GetPosition() -- Speed away from the player
+ a_Entity:AddSpeed(AddSpeed / AddSpeed:SqrLength()) -- The further away, the less speed to add
+ end
+ )
+ a_Player:SendMessage("Poof!")
+end
+
+
+
+