Added command intercepter tool, used it for //calc #49

Closed
Dico200 wants to merge 8 commits from command-intercepter into dev
2 changed files with 8 additions and 5 deletions
Showing only changes of commit 8b5131f8ae - Show all commits

View File

@ -2,3 +2,6 @@ name: RedstonerUtils
main: main.py
version: 3.1.0
author: redstone_sheep
commands:
serversigns:

View File

@ -395,16 +395,16 @@ def can_build2(player, block):
def check_all_signs_and_intercept_command():
try:
CommandInterceptions = shared["modules"]["misc"].CommandInterceptions
rsutils_cmd = CommandInterceptions.cmd_map.get("redstonerutils:serversigns")
label = rsutils_cmd.getLabel()
#CommandInterceptions = shared["modules"]["misc"].CommandInterceptions
#rsutils_cmd = CommandInterceptions.cmd_map.get("redstonerutils:serversigns")
#label = rsutils_cmd.getLabel()
def interception(sender, args):
rsutils_cmd.execute(sender, label, args)
svs_command(sender, None, None, args)
return False
def tab_completion(original, sender, alias, args):
return rsutils_cmd.tabComplete(sender, alias, args)
return None
shared["modules"]["misc"].CommandInterceptions.register("serversigns", "serversigns", interception, tab_completion)
except: