Solved Anyone think they can solve this? [WITH CODE]

Discussion in 'Plugin Development' started by mrgreen33gamer, May 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    mrgreen33gamer

  2. Offline

    RawCode

    where is debug messages?

    add some and try again.
     
  3. Offline

    MOMOTHEREAL

    What does All_Classes represent?
     
  4. Offline

    MrSparkzz

    mrgreen33gamer
    Are you calling the config before it's actually loaded?
     
  5. Offline

    mrgreen33gamer

    MrSparkzz
    In the onEnable it is calling the config by loading the credits, coins, kills, deaths, ETC ETC. In the onDisable it is saving the online players or just the players credits, coins, kills, deaths, ETC ETC ETC.
    Code:java
    1.  
    2. if(!plugin.getConfig().contains("deaths")) return;
    3.  



    MOMOTHEREAL
    All_Classes is the class that all the kit abilities, MOTD ping list, and some other events are listed. Basically all of the events are listed in that class. It also has the HashMap which contains the players name and the int amount of stuff they get, whenever the event/command is given.
     
  6. Offline

    Rocoty

    The thing is, the main part we should know is rarely nearly enough for us to be able to help you. You should probably post whole classes. Or at the very least declarations of variables used in the examples. But preferably entire classes.
     
    ZeusAllMighty11 and MrSparkzz like this.
  7. Offline

    mrgreen33gamer

    I am not posting my whole classes. Because of Copy Right issues. My code is private, I am only allowed, to my self, to give out the necessary amount of code that is needed.
     
  8. Offline

    ZeusAllMighty11

    mrgreen33gamer

    You really shouldn't ask for help if you're not open to helping yourself first.
     
    ShearsSheep likes this.
  9. Offline

    mrgreen33gamer

    That doesn't make any sense. First of all, I am trying to get help here, since when did I ever do anything to make you post such a thing? Second, do you really think this is helpful to me and what I am trying to solve this?
     
  10. Offline

    Plo124

    mrgreen33gamer
    The error looks like it is caused by the Scoreboard, possibly because getting from the config is returning null as a value when you try to put it in the scoreboard because you didnt initallise the config.

    In your onEnable put
    this.getConfig().options().copyDefaults(true);
     
  11. Offline

    xTigerRebornx

    mrgreen33gamer Copyright issues?....
    You are afraid to post your code to a community of developers, for what reason? Its not like we are going to walk up and take the code, we are developers, its not like we can't code things our self.

    Without your full classes, we aren't able to see the full context of things, having the full class allows us to look through and find the root of the problem. If you want help, you need to put yourself in a position to be helped, not expect us to magically know what the problem is without the full scope of your plugin.
     
  12. Offline

    mrgreen33gamer

    Thanks for post! I would like to say that the config is auto-generated. Here is the code:
    onEnable() <--- This puts the values in the config:
    Code:
    EconManager.loadDeaths();
    onDisable() <---- Saves the Death
    Code:
    EconManager.saveDeaths();
     
  13. Offline

    AoH_Ruthless

    Well try looking into setting up a localhost CB server to do your testing ... that way you don't affect anyone else. That's what I do to test my plugins, at least.
     
  14. Offline

    TheYamsMan

    You said it..
     
    Plo124 likes this.
  15. Offline

    mrgreen33gamer

    That's what I did.
     
  16. Offline

    AoH_Ruthless

    mrgreen33gamer
    Then your players wouldn't be super anxious because they couldn't join your server anyways..

    You don't need to be afraid of your code getting "stolen". We on Bukkit recognize intellectual property. If you want us to help you, you need to be willing to do what it takes to receive help. Also, most of the people on Bukkit could make an Economy if they wanted to. You don't need to be worried: we're here to help you.
     
  17. Offline

    mrgreen33gamer

    How do you suppose I solve the problem.. -_-. Of my coding?
     
  18. Offline

    AoH_Ruthless

    mrgreen33gamer
    I can't tell, you need to paste your full main and economy manager class.
     
  19. Offline

    itzrobotix

    saveDefaultConfig();
     
  20. Offline

    mrgreen33gamer

    AoH_Ruthless

    If I pasted my Economy code and my Main code, the code wouldn't fit. The plugin that I have is linked to the Bukkit.jar core. Meaning, that the plugin is almost 1 half of a GIG. The MAIN class is HALF a GIG.

    I got a lot of people saying that but, the config is auto-generated.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  21. Offline

    AoH_Ruthless

    What do you hope to accomplish in your kits plugin that makes that necessary?? :confused:
    I don't think anyone has ever made a plugin exceeding a few MB :p
     
    Gater12 likes this.
  22. Offline

    mrgreen33gamer

    Very. I am just trying to get my credits system working....
     
  23. Offline

    AoH_Ruthless

    mrgreen33gamer
    You don't need to do what you did, doesn't make any sense and you wasted your own time by doing that.
     
  24. Offline

    mrgreen33gamer

    AoH_Ruthless

    I posted all my codes that relate to this problem.
     
  25. Offline

    xTigerRebornx

    mrgreen33gamer You've deleted the problem that you have when you edited the post, what is the problem with your code?
     
  26. Offline

    mrgreen33gamer


    xTigerRebornx Posted in Post
     
  27. Offline

    CoderMusgrove

    Is that the full error, from beginning to end? Because it's not giving me a definite point. So far, it points to a few locations:
    Code:
    com.mrgreen33gamer.kits.Main.onEnable(Main.java:204)
    Code:java
    1. ShowScoreboard(players, players.getName());

    Code:
    com.mrgreen33gamer.kits.Main.ShowScoreboard(Main.java:95)
    Code:java
    1. Score worth = objective.getScore(Bukkit.getOfflinePlayer(ChatColor.WHITE+"Your Worth "+ ChatColor.RED));

    Code:
    com.mrgreen33gamer.kits.EconManager.getTotalDeaths(EconManager.java:114)
    Code:java
    1. return All_Classes.deaths.get(player);


    I have never seen a stack trace so high on meth.
     
  28. Offline

    xTigerRebornx

    mrgreen33gamer From what I can see, it looks like you aren't saving/loading your deaths properly, causing it to throw an NPE when you try to use the Map that you are putting your deaths in.

    And my god, why so much static. If you are going to use statics, at least use them properly, not just to make things easier. Your code is a mess, you are just throwing around a static instance of your plugin randomly and you have so many static Maps/Sets/Lists, you need to look into using a Singleton design.
     
  29. Offline

    Sabersamus


    No offense... really... but, even if we WERE interested in copying your code, as it is, it's broken anyways.

    Unless it's fixed, it's really worth nothing to us.

    So, let us HELP you fix it, obviously you aren't giving us enough information.

    Anyways, I'm like 62.9% sure I just solved it.

    in SLAPI.java you have

    Code:
    private static Main plugin = EconManager.getPlugin();
    Which is definitely before the plugin in EconManager is set.

    then you go on to have

    Code:
    public SLAPI(Main plugin){...}
    In on enable, call new SLAPI(this);

    It might not fix EVERYTHING, but I guarantee it'll fix something.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  30. Offline

    mrgreen33gamer

    Sabersamus

    Thanks for the post! But, this didn't make ANY changes to the plugin what so ever -_-.

    OMFG YES I SOLVE IT. THANK YOU ALL WHO HELPED!!!!!!!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
Thread Status:
Not open for further replies.

Share This Page