当前位置: 首页>>代码示例>>C#>>正文


C# MCForge.Plugin类代码示例

本文整理汇总了C#中MCForge.Plugin的典型用法代码示例。如果您正苦于以下问题:C# Plugin类的具体用法?C# Plugin怎么用?C# Plugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Plugin类属于MCForge命名空间,在下文中一共展示了Plugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Register

 /// <summary>
 /// Register this event
 /// </summary>
 /// <param name="method">This is the delegate that will get called when this event occurs</param>
 /// <param name="priority">The priority (imporantce) of this call</param>
 /// <param name="plugin">The plugin object that is registering the event</param>
 public static void Register(Group.GroupSave 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 OnGroupSaveEvent(method, priority, plugin));
     Organize();
 }
开发者ID:EricKilla,项目名称:MCForge-Vanilla,代码行数:13,代码来源:OnGroupSaveEvent.cs

示例2: Register

 /// <summary>
 /// Register this event
 /// This will call the method "method" everytime this event is triggered
 /// </summary>
 /// <param name="method">This is the delegate that will get called when this event occurs</param>
 /// <param name="priority">The priority (imporantce) of this call</param>
 /// <param name="plugin">The plugin object that is registering the event</param>
 public static void Register(Player.OnPlayerConnect 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 OnPlayerConnectEvent(method, priority, plugin));
     Organize();
 }
开发者ID:EricKilla,项目名称:MCForge-Vanilla,代码行数:14,代码来源:OnPlayerConnectEvent.cs

示例3: Register

 /// <summary>
 /// Register this event
 /// </summary>
 /// <param name="method">This is the delegate that will get called when this event occurs</param>
 /// <param name="priority">The priority (imporantce) of this call</param>
 /// <param name="plugin">The plugin object that is registering the event</param>
 public static void Register(Server.OnConsoleCommand 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 OnConsoleCommandEvent(method, priority, plugin));
     Organize();
 }
开发者ID:PinEvil,项目名称:MCForge-Vanilla,代码行数:13,代码来源:OnConsoleCommandEvent.cs

示例4: Register

 /// <summary>
 /// Register this event
 /// </summary>
 /// <param name="method">This is the delegate that will get called when this event occurs</param>
 /// <param name="priority">The priority (imporantce) of this call</param>
 /// <param name="plugin">The plugin object that is registering the event</param>
 public static void Register(Player.BlockchangeEventHandler 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 OnBlockChangeEvent(method, priority, plugin));
     Organize();
 }
开发者ID:EricKilla,项目名称:MCForge-Vanilla,代码行数:13,代码来源:OnBlockChangeEvent.cs

示例5: UnRegister

 /// <summary>
 /// UnRegister this event
 /// </summary>
 /// <param name="plugin">The plugin object that has this event registered</param>
 public static void UnRegister(Plugin plugin)
 {
     if (Find(plugin) == null)
         throw new Exception("This plugin doesnt have this event registered!");
     else
         events.Remove(Find(plugin));
 }
开发者ID:B00mX0r,项目名称:MCForge-MCLawl,代码行数:11,代码来源:OnMessageRecieveEvent.cs

示例6: Register

 /// <summary>
 /// Register this event
 /// </summary>
 /// <param name="method">This is the delegate that will get called when this event occurs</param>
 /// <param name="priority">The priority (imporantce) of this call</param>
 /// <param name="plugin">The plugin object that is registering the event</param>
 /// <param name="bypass">Register more than one of the same event</param>
 public static void Register(Level.OnLevelLoaded method, Priority priority, Plugin plugin, bool bypass = false)
 {
     if (Find(plugin) != null)
         if (!bypass)
         throw new Exception("The user tried to register 2 of the same event!");
     events.Add(new OnLevelLoadedEvent(method, priority, plugin));
     Organize();
 }
开发者ID:xShOtDoOdx,项目名称:MCForge-MCLawl,代码行数:15,代码来源:OnLevelLoadedEvent.cs

示例7: Register

 /// <summary>
 /// Register this event
 /// </summary>
 /// <param name="method">This is the delegate that will get called when this event occurs</param>
 /// <param name="priority">The priority (imporantce) of this call</param>
 /// <param name="plugin">The plugin object that is registering the event</param>
 /// <param name="bypass">Register more than one of the same event</param>
 public static void Register(Player.OnPlayerChat method, Priority priority, Plugin plugin, bool bypass = false)
 {
     if (Find(plugin) != null)
         if (!bypass)
         throw new Exception("The user tried to register 2 of the same event!");
     events.Add(new OnMessageRecieveEvent(method, priority, plugin));
     Organize();
 }
开发者ID:B00mX0r,项目名称:MCForge-MCLawl,代码行数:15,代码来源:OnMessageRecieveEvent.cs

示例8: Find

 /// <summary>
 /// Find a event
 /// </summary>
 /// <param name="plugin">The plugin that registered this event</param>
 /// <returns>The event</returns>
 public static OnPhysicsUpdateEvent Find(Plugin plugin)
 {
     foreach (OnPhysicsUpdateEvent p in events.ToArray())
     {
         if (p.plugin == plugin)
             return p;
     }
     return null;
 }
开发者ID:NorthPL,项目名称:MCForge-Vanilla-Redux,代码行数:14,代码来源:OnPhysicsUpdate.cs

示例9: Find

 public static OnBlockChangeEvent Find(Plugin plugin)
 {
     foreach (OnBlockChangeEvent p in events.ToArray())
     {
         if (p.plugin == plugin)
             return p;
     }
     return null;
 }
开发者ID:Goodlyay,项目名称:MCForge-Vanilla-Redux,代码行数:9,代码来源:OnBlockChangeEvent.cs

示例10: Find

 /// <summary>
 /// Find a event
 /// </summary>
 /// <param name="plugin">The plugin that registered this event</param>
 /// <returns>The event</returns>
 public static OnConsoleCommandEvent Find(Plugin plugin)
 {
     foreach (OnConsoleCommandEvent p in events.ToArray())
     {
         if (p.plugin == plugin)
             return p;
     }
     return null;
 }
开发者ID:PinEvil,项目名称:MCForge-Vanilla,代码行数:14,代码来源:OnConsoleCommandEvent.cs

示例11: Find

 /// <summary>
 /// Find a event
 /// </summary>
 /// <param name="plugin">The plugin that registered this event</param>
 /// <returns>The event</returns>
 public static OnServerErrorEvent Find(Plugin plugin)
 {
     foreach (OnServerErrorEvent p in events.ToArray())
         {
             if (p.plugin == plugin)
                 return p;
             }
             return null;
 }
开发者ID:Cazzar,项目名称:MCForge-MCLawl,代码行数:14,代码来源:OnServerErrorEvent.cs

示例12: Find

 public static OnMessageRecieveEvent Find(Plugin plugin)
 {
     foreach (OnMessageRecieveEvent p in events.ToArray())
     {
         if (p.plugin == plugin)
             return p;
     }
     return null;
 }
开发者ID:B00mX0r,项目名称:MCForge-MCLawl,代码行数:9,代码来源:OnMessageRecieveEvent.cs

示例13: Config

 /// <summary>
 /// Create a new config object
 /// </summary>
 /// <param name="p">The plugin that is using the config object</param>
 /// <param name="c">The config type you want</param>
 /// <param name="filename">The file name (DONT INCLUDE EXTENTION)</param>
 public Config(Plugin p, ConfigType c, string filename)
 {
     this.filename = filename;
     if (!Directory.Exists("plugins/" + p.name)) Directory.CreateDirectory("plugins/" + p.name);
     if (!File.Exists("plugins/" + p.name + "/" + filename + ".config") && c == ConfigType.Setting) File.Create("plugins/" + p.name + "/" + filename + ".config");
     if (!File.Exists("plugins/" + p.name + "/" + filename + ".file") && c == ConfigType.SaveFile) File.Create("plugins/" + p.name + "/" + filename + ".file");
     this.p = p;
     this.c = c;
 }
开发者ID:WanX,项目名称:MCaznowl-Build,代码行数:15,代码来源:Config.cs

示例14: Find

 /// <summary>
 /// Find a event
 /// </summary>
 /// <param name="plugin">The plugin that registered this event</param>
 /// <returns>The event</returns>
 public static OnLevelLoadedEvent Find(Plugin plugin)
 {
     foreach (OnLevelLoadedEvent p in events.ToArray())
     {
         if (p.plugin == plugin)
             return p;
     }
     return null;
 }
开发者ID:xShOtDoOdx,项目名称:MCForge-MCLawl,代码行数:14,代码来源:OnLevelLoadedEvent.cs

示例15: Find

 public static OnPlayerChatEvent Find(Plugin plugin)
 {
     foreach (OnPlayerChatEvent p in events.ToArray())
     {
         if (p.plugin == plugin)
             return p;
     }
     return null;
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla,代码行数:9,代码来源:OnPlayerChatEvent.cs


注:本文中的MCForge.Plugin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。