# Path: twistedbot/plugins/base.py
# class PluginChatBase(PluginBase):
# 
#     def send_chat_message(self, msg):
#         self.world.chat.send_chat_message(msg)
# 
#     @abc.abstractproperty
#     def command_verb(self):
#         pass
# 
#     @property
#     def aliases(self):
#         return []
# 
#     @abc.abstractproperty
#     def help(self):
#         pass
# 
#     @abc.abstractmethod
#     def command(self, sender, command, args):
#         pass
# 
# Path: twistedbot/behavior_tree.py
# class ShowPlayerCursor(BTGoal):
#     def __init__(self, **kwargs):
#         super(ShowPlayerCursor, self).__init__(**kwargs)
#         self.name = 'show player %s cursor' % self.blackboard.commander_name
# 
#     def cleanup(self):
#         self.blackboard.last_look_at_block = None
# 
#     @property
#     def goal_reached(self):
#         return False
# 
#     def is_valid(self):
#         return self.blackboard.commander_in_game
# 
#     def choices(self):
#         while self.is_valid():
#             player = self.blackboard.get_entity(self.blackboard.commander_eid)
#             if player is None:
#                 yield None
#             else:
#                 yield self.make_behavior(ShowCursor, player=player)


from twistedbot.plugins.base import PluginChatBase
from twistedbot.behavior_tree import ShowPlayerCursor

    def command(self, sender, command, args):
        if args:
            what = args[0]
            if what == "sign":
                sign_name = " ".join(args[1:])
                if not sign_name:
                    self.send_chat_message("show which sign?")
                    return
                sign = self.world.sign_waypoints.get_namepoint(sign_name)
                if sign is not None:
                    self.send_chat_message(str(sign))
                    return
                sign = self.world.sign_waypoints.get_name_from_group(sign_name)
                if sign is not None:
                    self.send_chat_message(str(sign))
                    return
                if not self.world.sign_waypoints.has_group(sign_name):
                    self.send_chat_message("no group named %s" % sign_name)
                    return
                for sign in self.world.sign_waypoints.ordered_sign_groups[sign_name].iter():
                    self.send_chat_message(str(sign))
            elif what == "inventory":
                content = [i for i in self.world.inventories.player_inventory.slot_items()]
                if content:
                    for slot_id, item in content:
                        self.send_chat_message("slot %d %s" % (slot_id, item))
                else:
                    self.send_chat_message("inventory is empty")
            elif what == "cursor":

# Path: twistedbot/plugins/base.py
# class PluginChatBase(PluginBase):
# 
#     def send_chat_message(self, msg):
#         self.world.chat.send_chat_message(msg)
# 
#     @abc.abstractproperty
#     def command_verb(self):
#         pass
# 
#     @property
#     def aliases(self):
#         return []
# 
#     @abc.abstractproperty
#     def help(self):
#         pass
# 
#     @abc.abstractmethod
#     def command(self, sender, command, args):
#         pass
# 
# Path: twistedbot/behavior_tree.py
# class ShowPlayerCursor(BTGoal):
#     def __init__(self, **kwargs):
#         super(ShowPlayerCursor, self).__init__(**kwargs)
#         self.name = 'show player %s cursor' % self.blackboard.commander_name
# 
#     def cleanup(self):
#         self.blackboard.last_look_at_block = None
# 
#     @property
#     def goal_reached(self):
#         return False
# 
#     def is_valid(self):
#         return self.blackboard.commander_in_game
# 
#     def choices(self):
#         while self.is_valid():
#             player = self.blackboard.get_entity(self.blackboard.commander_eid)
#             if player is None:
#                 yield None
#             else:
#                 yield self.make_behavior(ShowCursor, player=player)


# Path: twistedbot/plugins/core/chat_show.py
from twistedbot.plugins.base import PluginChatBase
from twistedbot.behavior_tree import ShowPlayerCursor


    def command(self, sender, command, args):
        if args:
            what = args[0]
            if what == "sign":
                sign_name = " ".join(args[1:])
                if not sign_name:
                    self.send_chat_message("show which sign?")
                    return
                sign = self.world.sign_waypoints.get_namepoint(sign_name)
                if sign is not None:
                    self.send_chat_message(str(sign))
                    return
                sign = self.world.sign_waypoints.get_name_from_group(sign_name)
                if sign is not None:
                    self.send_chat_message(str(sign))
                    return
                if not self.world.sign_waypoints.has_group(sign_name):
                    self.send_chat_message("no group named %s" % sign_name)
                    return
                for sign in self.world.sign_waypoints.ordered_sign_groups[sign_name].iter():
                    self.send_chat_message(str(sign))
            elif what == "inventory":
                content = [i for i in self.world.inventories.player_inventory.slot_items()]
                if content:
                    for slot_id, item in content:
                        self.send_chat_message("slot %d %s" % (slot_id, item))
                else:
                    self.send_chat_message("inventory is empty")
            elif what == "cursor":

                self.world.bot.behavior_tree.new_command(ShowPlayerCursor)