public static void Register(Player.OnPlayerCommand method, Priority priority, Plugin plugin) { if (Find(plugin) != null) { throw new Exception("The user tried to register 2 of the same event!"); } events.Add(new OnPlayerCommandEvent(method, priority, plugin)); Organize(); }
/// <summary> /// This is the load method, the load method is called whenever the plugin is loaded /// this can be when the server starts up, or when using /pload /// </summary> /// <param name="startup">Is the plugin being loaded at server startup?</param> public override void Load(bool startup) { block = new Player.BlockchangeEventHandler2(blockuse); command = new Player.OnPlayerCommand(commanduse); Player.PlayerCommand += command; chat = new Player.OnPlayerChat(chatuse); disconnect = new Player.OnPlayerDisconnect(disconnectuse); Player.PlayerChat += chat; Player.PlayerBlockChange += block; Player.PlayerDisconnect += disconnect; }
internal OnPlayerCommandEvent(Player.OnPlayerCommand method, Priority priority, Plugin plugin) { this.plugin = plugin; this.priority = priority; this.method = method; }