summaryrefslogtreecommitdiffstats
path: root/Server/Plugins
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2020-04-09 22:25:20 +0200
committerGitHub <noreply@github.com>2020-04-09 22:25:20 +0200
commitbdedab15c94956cbc74045ab242fd300d25f39e7 (patch)
tree900c4e7f662388e29405ccf059fcab767bbd8046 /Server/Plugins
parentWolves and mooshrooms are passive mobs (diff)
downloadcuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar.gz
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar.bz2
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar.lz
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar.xz
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar.zst
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.zip
Diffstat (limited to '')
-rw-r--r--Server/Plugins/APIDump/Classes/World.lua86
-rw-r--r--Server/Plugins/Debuggers/Debuggers.lua19
-rw-r--r--Server/Plugins/Debuggers/Info.lua7
3 files changed, 95 insertions, 17 deletions
diff --git a/Server/Plugins/APIDump/Classes/World.lua b/Server/Plugins/APIDump/Classes/World.lua
index c35733b4a..fffb8fa73 100644
--- a/Server/Plugins/APIDump/Classes/World.lua
+++ b/Server/Plugins/APIDump/Classes/World.lua
@@ -3319,37 +3319,89 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i
},
SpawnFallingBlock =
{
- Params =
{
+ Params =
{
- Name = "X",
- Type = "number",
- },
- {
- Name = "Y",
- Type = "number",
+ {
+ Name = "X",
+ Type = "number",
+ },
+ {
+ Name = "Y",
+ Type = "number",
+ },
+ {
+ Name = "Z",
+ Type = "number",
+ },
+ {
+ Name = "BlockType",
+ Type = "number",
+ },
+ {
+ Name = "BlockMeta",
+ Type = "number",
+ },
},
+ Returns =
{
- Name = "Z",
- Type = "number",
+ {
+ Name = "EntityID",
+ Type = "number",
+ },
},
+ Notes = "OBSOLETE, use the Vector3-based overloads instead. Spawns a {{cFallingBlock|Falling Block}} entity at the specified coords with the given block type/meta. Returns the EntityID of the new falling block, or {{cEntity#INVALID_ID|cEntity#INVALID_ID}} if no falling block was created.",
+ },
+ {
+ Params =
{
- Name = "BlockType",
- Type = "number",
+ {
+ Name = "BlockPos",
+ Type = "Vector3i",
+ },
+ {
+ Name = "BlockType",
+ Type = "number",
+ },
+ {
+ Name = "BlockMeta",
+ Type = "number",
+ },
},
+ Returns =
{
- Name = "BlockMeta",
- Type = "number",
+ {
+ Name = "EntityID",
+ Type = "number",
+ },
},
+ Notes = "Spawns a {{cFallingBlock|Falling Block}} entity in the middle of the specified block, with the given block type/meta. Returns the EntityID of the new falling block, or {{cEntity#INVALID_ID|cEntity#INVALID_ID}} if no falling block was created.",
},
- Returns =
{
+ Params =
{
- Name = "EntityID",
- Type = "number",
+ {
+ Name = "Pos",
+ Type = "Vector3d",
+ },
+ {
+ Name = "BlockType",
+ Type = "number",
+ },
+ {
+ Name = "BlockMeta",
+ Type = "number",
+ },
+ },
+ Returns =
+ {
+ {
+ Name = "EntityID",
+ Type = "number",
+ },
},
+ Notes = "Spawns a {{cFallingBlock|Falling Block}} entity at exactly the specified coords, with the given block type/meta. Returns the EntityID of the new falling block, or {{cEntity#INVALID_ID|cEntity#INVALID_ID}} if no falling block was created.",
},
- Notes = "Spawns a {{cFallingBlock|Falling Block}} entity at the specified coords with the given block type/meta. Returns the EntityID of the new falling block, or {{cEntity#INVALID_ID|cEntity#INVALID_ID}} if no falling block was created.",
},
SpawnItemPickup =
{
diff --git a/Server/Plugins/Debuggers/Debuggers.lua b/Server/Plugins/Debuggers/Debuggers.lua
index 7d12e130a..4cf825f12 100644
--- a/Server/Plugins/Debuggers/Debuggers.lua
+++ b/Server/Plugins/Debuggers/Debuggers.lua
@@ -1567,6 +1567,25 @@ end
+function HandleCakeCmd(a_Split, a_Player)
+ local lookVector = a_Player:GetLookVector()
+ local pos = a_Player:GetEyePosition() + lookVector
+ local world = a_Player:GetWorld()
+ local speed = lookVector * 10
+ local cakeID = world:SpawnFallingBlock(pos, E_BLOCK_CAKE, 0)
+ world:DoWithEntityByID(cakeID,
+ function(a_CBCake)
+ a_CBCake:SetSpeed(speed)
+ end
+ )
+ a_Player:SendMessage("Your cake is served")
+ return true
+end
+
+
+
+
+
function HandleClientVersionCmd(a_Split, a_Player)
a_Player:SendMessage("Your client version number is " .. a_Player:GetClientHandle():GetProtocolVersion() ..".")
return true
diff --git a/Server/Plugins/Debuggers/Info.lua b/Server/Plugins/Debuggers/Info.lua
index 30dfd8528..734b27e97 100644
--- a/Server/Plugins/Debuggers/Info.lua
+++ b/Server/Plugins/Debuggers/Info.lua
@@ -37,6 +37,13 @@ g_PluginInfo =
HelpString = "Playes a sound and displays an effect at the player's position",
},
+ ["/cake"] =
+ {
+ Permission = "debuggers",
+ Handler = HandleCakeCmd,
+ HelpString = "Throws a cake in the direction the player's looking, in a slow arc.",
+ },
+
["/clientversion"] =
{
Permission = "debuggers",