Fix serversigns derp

This commit is contained in:
Dico200
2016-06-26 05:48:36 +02:00
parent cffa3e27c8
commit 3c7bd7409d
2 changed files with 20 additions and 19 deletions

View File

@@ -22,7 +22,7 @@ def on_enable():
if "blockplacemods" in shared["modules"]:
shared["modules"]["blockplacemods"].schedule_torch_breaker()
if "serversigns" in shared["modules"]:
shared["modules"]["serversigns"].check_all_signs()
shared["modules"]["serversigns"].check_all_signs_and_intercept_command()
info("RedstonerUtils enabled!")

View File

@@ -392,17 +392,7 @@ def can_build2(player, block):
return not event.isCancelled()
def check_all_signs():
"""
Check if all registered signs have an associated sign block in the world.
WorldEdit commands could remove them without notification.
Pistons might also be able to achieve the same thing.
A sign missing from the world won't affect the world so it only checks on start.
"""
for loc in signs:
if server.getWorld(loc[0]).getBlockAt(loc[1], loc[2], loc[3]).getType() not in (Material.WALL_SIGN, Material.SIGN_POST):
del signs[loc]
def check_all_signs_and_intercept_command():
try:
CommandInterceptions = shared["modules"]["misc"].CommandInterceptions
@@ -413,10 +403,21 @@ try:
rsutils_cmd.execute(sender, label, args)
return False
def tab_completetion(original, sender, alias, args):
def tab_completion(original, sender, alias, args):
return rsutils_cmd.tabComplete(sender, alias, args)
shared["modules"]["misc"].CommandInterceptions.register("serversigns", "serversigns", interception, tab_completion)
except:
error("[Serversigns] failed to force commands")
error(trace())
"""
Check if all registered signs have an associated sign block in the world.
WorldEdit commands could remove them without notification.
Pistons might also be able to achieve the same thing.
A sign missing from the world won't affect the world so it only checks on start.
"""
for loc in signs:
if server.getWorld(loc[0]).getBlockAt(loc[1], loc[2], loc[3]).getType() not in (Material.WALL_SIGN, Material.SIGN_POST):
del signs[loc]