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

More than one class in the .php file

Comments in 'Plugin Development' started by Marcelo234, Dec 20, 2015.

  1. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Hello guys.
    I have more than one class in my Plugin. I have the class "statuscheck","SignUpdate" and "FallingBlocks"! All the classes are in one .php file.....But what of this classes I must write into the plugin.yml in the main: ?

    Thanks Marcelo234
  2. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    The Main class of the plugin, the one with onEnable function
    xiaoq and Marcelo234 like this.
  3. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    The class which extends PluginBase.
  4. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    I have

    use McKaff_FallingBlocks\SignUpdate;
    use McKaff_FallingBlocks\statuscheck;

    and in the onEnabl part this:


    $this->getServer()->getScheduler()->scheduleRepeatingTask(new SignUpdate($this), 40);$this->getServer()->getScheduler()->scheduleRepeatingTask(new statuscheck($this), 40);

    and than my classes!


    But the server crash!


    Fatal error: Cannot declare class FallingBlocks\statuscheck because the name is already in use in C:\Users\Marcelo\Desktop\McKaff_FallingBlocks\plugins\McKaff_FallingBlocks\src\McKaff_FallingBlocks\FallingBlocks.php on line 273
  5. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    it sayed it is too long...

Share This Page

Advertisement