[Tutorial] SurvivalGames MiniGame

Discussion in 'Resources' started by XxZHALO13Xx, Oct 25, 2014.

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

    XxZHALO13Xx

    Hey there! I am doing a Bukkit Survival-Games tutorial on my channel (https://www.youtube.com/channel/UCqXb4WDxK26oWViaF7Dxf9A) I will upload every Friday or Saturday! Maybe on both if it gets enough comments! I would appreciate liking, commenting, and subscribing! Its a very cool survival games plugin. World Edit... Vault... BarAPI... Scoreboards... DeathMatches...Stats... and PermissionsEx! Very nice and easy to use! Thank you

    -Zach (XxZHALO13Xx)
     
  2. Offline

    xTrollxDudex

    What the...? What are you doing with a field list going past the 80 char line?
     
  3. Offline

    teej107

    Stop using static the wrong way. On another note, I accidentally turned on the captions and they were quite entertaining!
     
  4. Offline

    XxZHALO13Xx

    teej107 static means it stays the same. I am using it correctly. I have coded and tested the plugin a week ago and it works fine. Trust me, I know it will work.

    xTrollxDudex What do you mean?

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

    mrCookieSlime

    *facepalm*
    static does not mean it stays the same, thats final
    static means the variable is not defined in the instance, so it can be accessed everywhere.
    Nobody says its not going to work. But it is inefficient, causes memory leaks etc.
    Only use static when you really need it...
     
    Totom3 likes this.
  6. Offline

    teej107

    It's terrible coding style (I wouldn't even call it a style) and is not how OOP is intended, if you even understand fully what OOP is, you wouldn't abuse static.
     
  7. Offline

    Hawktasard

    You shouldn't abuse static like that.
     
  8. Offline

    XxZHALO13Xx

  9. Offline

    XxZHALO13Xx

  10. Offline

    teej107

    XxZHALO13Xx None of them are needed for getters. Just take out all of static fields because you aren't using them the way they should be used. You should really get used to programming the Object Oriented way.
     
  11. XxZHALO13Xx Alright, well people tell me I complain about video tutorials but never point out what sort of things they do wrong, so here we go. The static abuse does not appear on this list as it's already been covered.
    1. What's with the package name? I know it's how you style your username, but it goes against Java's naming conventions for pacakges. I style my name as AdamQpzm, but my package names use adamqpzm.
    2. Why are you building against PEX? I don't see a point that you'll need this, and if there is, it's probably wrong.
    3. Where's all the encapsulation?
    4. Why does the version field exist? Firstly, the plugin.yml's version is just a String, if you really want it different to the 1.2.3 format, then don't use that format. Secondly, I'm not sure what your intended use is anyway.
    5. Why does the PluginManager field exist? This is almost always only used in onEnable() anyway, and you don't even use the field, you just end up calling Bukkit.getPluginManager()
    6. Why are you using Integer for the allowed blocks? Block IDs are deprecated for a reason.
    7. Why are you using a Material and an int for the material and the data? Firstly, it should really be a byte not an int. And secondly, have you heard of MaterialData?
    8. Why are you initialising the votes field to 0? It's a field, so it is automatically initialised with its default value - in this case, 0.
    9. That constructor though...
     
    AGC-Intra, Monkey_Swag and Hawktasard like this.
  12. Offline

    Hawktasard

    ^^^^^^^^
     
    AdamQpzm likes this.
  13. Offline

    Dragonphase

    I was going to refrain from replying to this topic in regards to everything you are doing wrong, but AdamQpzm already did that.

    I like how ironic the fact is that you're linking to your own YouTube tutorial videos, when everybody here with a brain cell knows YouTube tutorial videos for Bukkit are completely unreliable and frowned upon.
     
    GermanCoding likes this.
  14. Offline

    XxZHALO13Xx

    Dragonphase AdamQpzm Hawktasard Tutorials are very useful.... videos are how I learn. Im a visual learner. Orther people are too. There is a reason for pex. Everything I have has a very good reason. That was the first video. I'm not coding a whole plugin in one video. And, instead of static because I have always seen static used. What should I do. For example. Public Economy econ; what do I add after that? Taking static out throws errors in my project
     
  15. Offline

    Twistt

    Go watch some NewBoston videos on Java and then come back and start learning how to use the Bukkit API.
     
    AGC-Intra likes this.
  16. XxZHALO13Xx Encapsulation & passing an instance. Most fields that are static should not be.
     
    Hawktasard likes this.
  17. Offline

    teej107

    XxZHALO13Xx Here is a good rule about using static fields: They should be constants. They should only be primitives or the String object.
     
  18. Offline

    Hawktasard

    Well, I see no reason for removing static making an error, except you're probably using SomeClass.econ.something() somewhere in your code.
     
  19. Offline

    Dragonphase

    XxZHALO13Xx

    YouTube tutorials are good if you actually teach correctly, using good programming practices. AdamQpzm points out clearly what would be considered bad programming practices in your tutorial videos. There is no point in teaching people something which you do not fully understand yourself, as it will cause those who watch your videos to grow accustomed to using bad programming practices.

    You should learn about the principles of Object Oriented Programming if you want to learn more about Java and share your knowledge.
     
    AGC-Intra, Hawktasard and AdamQpzm like this.
  20. XxZHALO13Xx Okay, I noticed you uploaded a new video so I went through it. Here are the things I noticed in the order that I noticed them:
    • Storing the instance when it's static is just wrong, but storing it when it's not static doesn't make any sense at all, since to access the instance you'd need the instance in the first place. You should just remove it altogether.
    • Why are you making the main class constructors? You don't need those, and shouldn't have them.
    • I see your package naming still isn't following convention, although you did start to use it in parts.
    • You're still using public plugins in places you shouldn't be.
    • You use HashMap<whatever> map = new HashMap - this is wrong, as you should be programming to an interface, not an implementation - see the relevant section in garbagemule's post here
    • No no no, not static again :(
    Okay, at the end, I noticed you were wondering what you should be doing in order to access the messages. In truth, static is fine for this, as it's a great way to store constants and for utility classes. However, my recommendation would be not to try to make tutorials until you have learned more Java - ideally, for any teaching, you need to know much more than you're trying to teach. I seriously recommend you look up on the topics of when static should and shouldn't be used (tip one: static instances are a no no, but constants can be fine) and encapsulation. :)
     
  21. Offline

    XxZHALO13Xx

    AdamQpzm Okay... Thank u for the tips.. Thank u btw for ur help and for watching the videos :D I will do alot of research and next week will fix the previous things.. when you refractor will it rename my classes package files too?
     
    AdamQpzm likes this.
Thread Status:
Not open for further replies.

Share This Page