diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-23 13:26:51 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-23 13:26:51 +0100 |
commit | 4dd5ecfc552819ad24557df75b441fab18c0c96a (patch) | |
tree | ab4fc5ae63945f2de5de9b6c8bee1b4eceed4396 /builtin/client/chatcommands.lua | |
parent | 128ac35a91c26ab0d7efa02e4827102ba4a91d1e (diff) | |
download | dragonfireclient-4dd5ecfc552819ad24557df75b441fab18c0c96a.tar.xz |
Added setpitch & setyaw commands; AutoSprint
Diffstat (limited to 'builtin/client/chatcommands.lua')
-rw-r--r-- | builtin/client/chatcommands.lua | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/builtin/client/chatcommands.lua b/builtin/client/chatcommands.lua index 8090b2bef..ec8fed652 100644 --- a/builtin/client/chatcommands.lua +++ b/builtin/client/chatcommands.lua @@ -134,21 +134,6 @@ core.register_chatcommand("set", { end, }) -core.register_chatcommand("findnodes", { - description = "Scan for one or multible nodes in a radius around you", - param = "<radius> <node1>[,<node2>...]", - func = function(param) - local radius = tonumber(param:split(" ")[1]) - local nodes = param:split(" ")[2]:split(",") - local pos = core.localplayer:get_pos() - local fpos = core.find_node_near(pos, radius, nodes, true) - if fpos then - return true, "Found " .. table.concat(nodes, " or ") .. " at " .. core.pos_to_string(fpos) - end - return false, "None of " .. table.concat(nodes, " or ") .. " found in a radius of " .. tostring(radius) - end, -}) - core.register_chatcommand("place", { params = "<X>,<Y>,<Z>", description = "Place wielded item", @@ -174,3 +159,31 @@ core.register_chatcommand("dig", { return false, pos end, }) + +core.register_chatcommand("setyaw", { + params = "<yaw>", + description = "Set your yaw", + func = function(param) + local yaw = tonumber(param) + if yaw then + core.localplayer:set_yaw(yaw) + return true + else + return false, "Invalid usage (See /help setyaw)" + end + end +}) + +core.register_chatcommand("setpitch", { + params = "<pitch>", + description = "Set your pitch", + func = function(param) + local pitch = tonumber(param) + if pitch then + core.localplayer:set_pitch(pitch) + return true + else + return false, "Invalid usage (See /help setpitch)" + end + end +}) |