Solved Cannot Seem to fix these errors

Discussion in 'Plugin Development' started by Rmarmorstein, Nov 2, 2012.

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

    Rmarmorstein

    Code:
    public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args){
    }
     
    if (cmd.getName().equalsIgnoreCase("ram")){
    memory(null);
    }
     
    else if (cmd.getname().equalsIgnoreCase("Lag")){
    memory(null);
    }
     
    protected void updateMemoryStats (){
    muse = ( Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory() ) / 1048576;
    mmax = Runtime.getRuntime().maxMemory() / 1048576;
    mfree = mmax - muse;
    pfree = ( 100 / mmax) * mfree;
     
    
    Ok, im getting a ton of errors right in here. If you need the rest of the code please let me know.
     
  2. Offline

    CarPet

    Will you post all of the code, kinda hard to edit something when you don't have it all...
     
  3. Offline

    Blir

    It's also helpful to include precisely what the errors are. Runtime errors (Exceptions) and compiling errors are very different.
     
  4. Offline

    Cirno

    Uh, exactly, what is going on here...? You're closing your onCommand method before you can even do the comparison, your UpdateMemoryStats function never closes, and where is memory() defined? Don't use null if you don't need a parameter. It loos like you just copied and pasted stuff together... But that's just my perspective on it.
     
  5. Offline

    CarPet

    Yeah that is what I thought... Was so confused XD
     
  6. Offline

    raGan.

    This is not about bukkit, you have to learn java first.
     
    Milkywayz and Blir like this.
  7. Offline

    Milkywayz

    Hey carpet :D
     
    gamerzap likes this.
  8. Offline

    Rmarmorstein

    Well, my perspective is, i needed help, and you guys really posted without doing that. Just my perspective.

    And i think it is REALLY immature of the bukkitdev staff to be "+1" a post like that, honestly?
     
  9. Offline

    Milkywayz

    The code you posted looks like it was copy and pasted, where is the memory() method? Your put null as a parameter and we can't see why. We would help if you provided something for us to work with other then the snip which doesn't show us much.
     
  10. Offline

    Blir

    Plenty of us have posted telling you we need more information to help you and you've given nothing. And what's wrong with their post? It's pretty clear from the code you have offered that you do need to learn some Java.
     
    gamerzap likes this.
  11. Offline

    gamerzap

    Yeah, I mean you can't expect to just look at some stuff and then make a bunch of guesses and expect it to work. So far I'm seeing that you have if statements just floating in the main class using variables that don't exist, a bucnh of empty methods, a method that never gets called that doesn't seem to actually do anything but define otherwise unused variables anyway and a method that doesn't exist that you're using null as an argument for.
     
  12. Offline

    Rmarmorstein

    I fixed it myself. Since bukkit does not seem to want to help.

    I have learned java, and i was getting errors that i needed help fixing,

    i was able to fix them myself, and that part of the code was not copied/ pasted.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  13. Offline

    gamerzap

    Don't be so sensitive about it. We tried to help you, but you refused to put in all the code and what you did put in didn't make sense, leading us to believe you needed to learn more java.
     
  14. Offline

    Njol

    CarPet, raGan., Milkywayz
    After two people have requested more information on the issue and the OP has not answered yet there's no need to post such useless comments.

    Rmarmorstein
    It would have been easier for both you and us if you indented your code (You can use crtl+I in eclipse to indent the selected line(s) automatically). I'm glad that you have been able to resolve the problem on your own though as this is the best way of learing in my opinion :)
     
    Rmarmorstein likes this.
  15. Offline

    raGan.

    Code:
    public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args){
    }
     
    if (cmd.getName().equalsIgnoreCase("ram")){
    memory(null);
    }
     
    else if (cmd.getname().equalsIgnoreCase("Lag")){
    memory(null);
    }
     
    ..another method
    Why was it useless ? He should be able to fix basic errors in this code if he is already familiar with java. I assumed it from what was already posted.
     
    Milkywayz and CarPet like this.
  16. Offline

    Rmarmorstein

    I am sorry, some of the later posts (after those asking for the rest of the code) and then the actions of staff (i thank them for editing it out) made me angry. i am sorry i got a little sensitive. and i understand that you tried to help
     
    bobacadodl likes this.
Thread Status:
Not open for further replies.

Share This Page