Tutorial Blockhead's Bukkit Coding (Written Tutorials)

Discussion in 'Resources' started by Blockhead7360, Jun 15, 2015.

?

Are my Tutorials good?

  1. Yes!

    3 vote(s)
    25.0%
  2. Yes, and I have a few suggestions too!

    0 vote(s)
    0.0%
  3. Yes, but I think you should change a few things/you have a few problems on the site

    1 vote(s)
    8.3%
  4. There okay... I have a few suggestions to make your site better

    0 vote(s)
    0.0%
  5. There okay.

    2 vote(s)
    16.7%
  6. No, but I can help you make them better!

    1 vote(s)
    8.3%
  7. Nope.

    5 vote(s)
    41.7%
Thread Status:
Not open for further replies.
  1. Offline

    Blockhead7360

    Hello all!

    If you are a beginner (but have some basic Java knowledge) and want to get into coding, check out Blockhead's Bukkit Coding Written Tutorials! I have a few links on the site if you do not know anything about Java, so you can learn a few things.

    The tutorials start of easy (having 1 command or adding arguments) and get more advanced as time progresses. You can also suggest a coding tutorial (something you may want to learn) on the website in the comment section (or on the sidebar).

    Thanks to @Zombie_Striker @Konato_K @justin_393 @nverdier and a BUNCH of other people on these forums for helping me learn more about Bukkit coding, and for helping me with things on my site.

    If there are any problems with my tutorials, or if you have any suggestions for future tutorials, feel free to reply to this thread or comment on the website.

    I also plan to make tutorials at the rate of 1-2 per day. On busy days (or travel), it might be 1 per 2 or 3 days.

     
  2. Offline

    Zombie_Striker

    @Blockhead7360
    First tutorial, you said to return true, even when you do not know it's the right command. That will then prevent any other command from being activated, only your commands will be activated. (Tried it, I was wrong.)Also, you say nothing about creating packages. This might be something that you should add.

    Second Tutorial, same problem with returning true. Its interesting that you show both options, but one is better then the other. Why do you have backwards if statements? Checking for one thing and hoping for the other is bad practice, uses more space/physical memory as well as RAM memory. You should check if the player exists before creating the object (also a bad practice). Although it is easier to understand creating new instances within methods, it's better practice to have one public instance and reset it (e.g. String message)

    Besides the fact that there were these mistakes in the tutorials, this seems like this could be a great place to link new Plugin-Devs to.

    Off-Topic-Though, how did you get the name? BL?
     
    Last edited: Jun 15, 2015
  3. Offline

    nverdier

    That is not specific is Bukkit, and is actually from Java. So it's a prerequisite.
    The onCommand method is only called when a command in that plugin's plugin.yml is used by a player, so there's not issue with other plugins' commands. Also, returning true in that method will make it so the usage from the command in the plugin.yml isn't sent, false will have it be sent.

    Nope. Read above.
    I don't understand how an if statement can be 'backwards'.
    He's doing something either way, it's dependant on what the user inputs. So no, it doesn't. What do you mean by 'physical memory', like disk space?
     
    _Filip likes this.
  4. Offline

    Blockhead7360


    @Zombie_Striker @nverdier Yes, I know. I stated that in my tutorial. I also said that since in the tutorial, we are not going to let that happen, I just did "return true;


    @Zombie_Striker what do you mean by "backwards if statements"? Also what do you mean by "better practice to have one public instance and reset it (e.g. String message)? I also showed both options, because I wanted to show them how another way could be. And when you said to check if the player exists before creating the object, it works the way I did it, too!
    And in the First Tutorial section of your comment, you said that when I return true, it will prevent any other command from being activated? If that is what you meant, then that is not true. In my plugins (made like 20 for my server), they all are returned true (no return falses at all), and everything works fine.

    Oh and which name? (you said "how did you get the name? BL?)


     
  5. Offline

    Zombie_Striker

    @nverdier @Blockhead7360
    Crossed out things that were wrong in the above comment.

    By backwards statements I mean something like this:
    Code:
    If(somethingIsTrue){
    // leave this blank
    }else{
    //Actually do the thing you want instead of just inverting the boolean
    }
    MoreLines = Larger file size.

    Each time you create a new instance (E.G. String message) that String does not get deleted, having your program hold on to a instance that can ever be accessed again. If you were to have a method such as this:
    Code:
    for(int i = 0; i < 100; i++)}{
    String mess = "Hello";
    Player#sendMessage(mess);
    }
    You would be creating one hundred Strings that are the same thing. You did not put the instance in a loop, but every time that method would be called in you tutorial there would be a new String (which if used 100 times would create 100 instances that the memory would hold on to)
    This is the way it should be done:
    Code:
    String mess = "";
    public void method(){
    mess = "Hello";
    Player#sendMessage(mess);
    mess = null;
    }
    Also, if you highlight the text you want to quote there will be an option to "quote", and then when you want to reply you hit the InsertQuote button to put the quote into your reply.
     
  6. Offline

    nverdier

    Except he's not leaving it blank. And why do a few bytes matter?!
     
  7. @Blockhead7360Very well made, sir! Great for getting eager developers started! I give it:

    * * * * * 4.5 Stars!
     
  8. Offline

    Blockhead7360

    Thanks for this. It helps!

    @Zombie_Striker I guess you're right, it does take up more space. But I agree with @nverdier . Why do a few bytes matter?

    @Zombie_Striker exactly. I'm not leaving it blank (as @nverdier said). I am using it for usage.

    Thanks @Minecraft Server Network ! A good review helps!
     
  9. Offline

    Blockhead7360

    @Zombie_Striker @Minecraft Server Network @nverdier

    I also made a subscribe feature and a suggestion form on my website. You will see it along side my tutorials.

    Subscribe > Get emailed whenever a new episode comes out
    Suggest > Suggest either a way to make the website better or an idea for a future tutorial
     
  10. Great! I will make sure to subscribe!
     
  11. I don't know if it has been said already, but don't log when the plugin loads/enables/disables. You're just spamming the console with it because bukkit already logs this information for every plugin
     
  12. Offline

    Blockhead7360

    I know, I said in my tutorial that Bukkit/Spigot provides their own load messages. I just did it just to show them how to log stuff in the console in general
     
  13. Offline

    Zombie_Striker

    @Blockhead7360
    I have a question; do you have an "outline" for when certain topics should be uploaded? Do you know when you would cover events or setting blocks?
     
  14. Offline

    Blockhead7360

    No I do not, it's just something I like to do in my free time, and whenever I get the chance, I do it. I am working on an episode right now (configuration file).

    When it goes about covering events, they will most likely be all in separate episodes (ex. chat, then death, then something else, and so on)

    Setting Blocks: I don't know when I would do that, but I will do a tutorial on that.

    @Zombie_Striker oh and also, I won't be able to upload the tutorial today, because I am working on another plugin.

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

    MCMatters

    I think that idea is good and could be made better but at least not use weebly
     
  16. Offline

    xTrollxDudex

    There isn't necessarily anything wrong with that other than unoriginality
     
  17. Offline

    MCMatters

    @xTrollxDudex If lm learning shit from someone and see they use free website builders I will freak out.
     
  18. Offline

    xTrollxDudex

    Not every Java developer knows how to HTML :)
     
    ChipDev and Hawktasard like this.
  19. Offline

    Hawktasard

    @MCMatters
    A lot of the features some of the website builders give you easy access to require so much more than just basic html and css (php, javascript, etc) and would take a lot of time to write up by your self. Not everybody has the spare time to write the (possibly) thousands of lines your website builder can make for you in just a couple of clicks.

    I think the website looks all right anyway, and as @xTrollxDudex pointed out not everybody knows HTML .
     
  20. Offline

    mrCookieSlime

    This Thread is about a Tutorial about coding Bukkit Plugins, not a debate about Free Website Builders and HTML.
    So please get the Discussion back on the original track.
     
    ChipDev and bwfcwalshy like this.
Thread Status:
Not open for further replies.

Share This Page