quick fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pylint: disable=F0401
|
||||
from helpers import *
|
||||
from re import compile as reg_compile
|
||||
from traceback import format_exc as print_traceback
|
||||
|
||||
arrow = colorify(u"&r&7\u2192&r")
|
||||
regex = reg_compile(u"\u00A7[\\da-fk-or]")
|
||||
@@ -8,6 +9,7 @@ regex = reg_compile(u"\u00A7[\\da-fk-or]")
|
||||
|
||||
@hook.event("player.AsyncPlayerChatEvent", "normal")
|
||||
def onChat(event):
|
||||
try:
|
||||
if not event.isCancelled():
|
||||
sender = event.getPlayer()
|
||||
words = event.getMessage().split(" ")
|
||||
@@ -30,3 +32,6 @@ def onChat(event):
|
||||
message = " ".join([sender.getDisplayName(), arrow] + rec_words)
|
||||
msg(recipient, message, usecolor = False)
|
||||
recipient.playSound(recipient.getLocation(), "mob.chicken.plop", 1, 0)
|
||||
except Exception, e:
|
||||
error("Failed to handle PlayerChatEvent: %s" % e)
|
||||
error(print_traceback())
|
||||
Reference in New Issue
Block a user