Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Namespace help

Comments in 'Plugin Development' started by Tethered_, Jul 6, 2015.

  1. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    I can't get this plugin to register for some reason and I keep getting this error
    PHP:
    RuntimeException"Couldn't load source plugin Infected: main class not found" (E_USER_WARNINGin "/DevTools_v1.10.0.phar/src/FolderPluginLoader/FolderPluginLoader" at line 70
    Here are my files
    PHP:
    //plugin.yml
    nameInfected
    author
    Tethered
    description
    Infected Gametype
    version
    1.1
    main
    infected/InfectedMain
    api
    : [1.5.0]

    //InfectedMain
    namespace infected;

    class 
    InfectedMain extends PluginBase implements Listener
    {
    File structure is this:

    Infected
    src
    infected
    InfectedMain.php
  2. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    I believe the main's slash needs to be \ and not / .

    If the folder after the src (/src/PluginName) is the same as plugin name originally, then state the main as:
    Code:
     main: infected\infected 
    Also, make sure that the main class is right after the name statement. This really makes a big difference.
    Code:
    //plugin.yml
    name: Infected
    main: infected\InfectedMain
    description: Infected Gametype
    author: Tethered
    api: [1.5.0]
    PEMapModder and Tethered_ like this.
  3. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    Thank you so much, this gave me such a headache...
    HotFireyDeath likes this.
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    There is no difference...
    Lambo and RekkuzaRage like this.

Share This Page

Advertisement