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

Solved Cannot redeclare class?

Comments in 'Plugin Development' started by TheKillerTacos, Mar 31, 2016.

  1. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    So, since I have been Fixing Linuzo Skyblock plugin, Again, i have seen a lot of erros from old API, and fix them on the way to get it to Work, now Im really stuck, Cannot redeclare class, is the first time that this happends to me, Am i missing something? here the error:




    Error: Cannot redeclare class SkyBlock\Main
    File: myzip:///plugins/SkyBlockXT-master.zip#SkyBlockXT-master/src/SkyBlockXT/Main
    Line: 29
    Type: E_COMPILE_ERROR

    THIS CRASH WAS CAUSED BY A PLUGIN

    Code:
    PHP:
    [20] use pocketmine\block\Sand;
    [
    21] use pocketmine\block\Grass;
    [
    22] use pocketmine\block\Wood;
    [
    23] use pocketmine\level\generator\object\Tree;
    [
    24] use pocketmine\tile\Tile;
    [
    25] use pocketmine\tile\Chest;
    [
    26] use pocketmine\block\Sapling;
    [
    27] use pocketmine\utils\Random;
    [
    28
    [
    29] class Main extends Base implements Listener{
    [
    30]     public function onEnable(){
    [
    31]         $this->saveDefaultConfig();
    [
    32]         $this->getServer()->getPluginManager()->registerEvents($this$this);
    [
    33]         if(!(is_dir($this->getDataFolder()."Players/"))){
    [
    34]             @mkdir($this->getDataFolder()."Players/");
    [
    35]         }
    [
    36]         if(!(is_dir($this->getDataFolder()."Islands/"))){
    [
    37]             @mkdir($this->getDataFolder()."Islands/");
    [
    38]         }
    [
    39]         $this->getLogger()->info(TextFormat::GREEN "Done!");
    and here is Plugin.yml:

    Code:
    name: SkyBlockXT
    version: 0.0.1
    api: [1.12.0, 1.13.0, 1.3.1, 1.4.0]
    main: SkyBlockXT\Main
    author: TKRT CC & XenoNova Team
    load: STARTUP
    website: http://thekillertacos.tk/index.php/skyblockxt
    commands:
    
    NOTE: I removed the Permissions since they are unneeded for this error,

    Here is my whole Repo at github: https://github.com/XenoNova/SkyBlockXT
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Change the namespace to SkyBlockXT.
    applqpak and Vaivez66 like this.
  3. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    whoops, thx! going to test it, I should pay more attention to what i do!
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Because you already have a plugin called SkyBlock, which uses the same namespace?
    applqpak likes this.
  5. ItzJavaCraft
    Offline

    ItzJavaCraft New Member

    Joined:
    Feb 19, 2016
    Posts:
    14
    Minecraft User:
    ItzJavaCraft
    Well, I think it's about time I learned PHP! XD
    applqpak likes this.
  6. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    No, just didnt checked that namespace wasnt "namespace SkyBlockXT;" but actually "namespace SkybolckXT;" yes, SkybolckXT...

Share This Page

Advertisement