Git Product home page Git Product logo

bukkit_coding_tutorial's Introduction

Bukkit_Coding_Tutorial

Hello all,

Thank you for taking the time to stop by my coding series. If you have not seen my coding series then click here. This series goes over some of the more basic concepts for Bukkit coding. Please refere to my advanced series to start learning some stuff. Click here for advanced series

bukkit_coding_tutorial's People

Contributors

the-sourcecode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bukkit_coding_tutorial's Issues

A few improvements to the classes

  • Don't statically fetch the plugin instance, use dependency injection instead (pass it through the constructor, as a parameter)
  • Do mind the random imports.
  • Don't use public on fields unless they're final & immutable (or at least, 99% of the time).
  • Do use == for enum comparison (the enum class does this in it's equals method anyway, but == is null safe).
  • Do prefer if (!statement) { return; } // rest of code over if (statement) { // rest of code } as it reduces nesting depth by a great deal (EDIT: some classes seem to use it, some don't).
  • Sometimes there's still section signs, try to stick to ChatColor.
  • Do avoid asynchronous tasks for small things, and absolutely do avoid them when Bukkit / Minecraft is involved and it's not guaranteed to be thread safe.
  • Do prefer Runnables over BukkitRunnable if you're not using the cancel() method. (this means you should probably use it in all cases of runTask and runTaskLater).
  • Liskov Substitution Principle! Program against abstractions rather than implementations (i.e. use List rather than ArrayList, Set rather than HashSet, Map rather than HashMap, etc, when choosing a type for a variable, parameter or field).
  • Sets are faster than Lists. Importing a List once and converting it to a Set will give you a nice performance boost if your List gets large.

And sometimes a few spelling errors which I cannot bother to link (but who cares about that, the compiler sure doesn't).

Still, probably one of the cleaner tutorials I've seen online.

[EDIT] Seems it doesn't like multiline codeblocks in lists :/

Stuff to improve on

Hey there!
nice to see that you want to help ppl to learn to code!
There seem to be some things you can improve on:

  1. upload the full projects here, not only weird files without extentions
  2. don't use illegally distribute spigot jars, only legal way to get spigot is via buildtools
  3. don't use bungees chatcolor if you don't need to
  4. don't log that your plugin was enabled, bukkit does that
  5. don't log multi line via \n, breaks formatting
  6. use @OverRide if you override methods from a superclass (to avoid typos ;))
  7. explain what deprecated means and why it is bad to use those methods
  8. use name() on enums to convert it to a readable string
  9. encourage DRY (you copy pasted the event listener for block place)
  10. you can access server stuff using the Bukkit class
  11. don't extend CommandExecute if you want to make commands....
  12. you can save locations directly, no need to save every coordinate

advanced stuff:

  1. suggest other IDEs
  2. suggest a proper build system

keep up the great work!

Exceeds in health (Causes an error)

Hi, I have currently been watching your tutorials and I love the detailed examples and explanation of your lessons. I have come up with a problem however and I hope you can help me fix it as soon as possible. The error (https://pastebin.com/LD2zL1gy) basically states that when I click the emerald block and I have full health, it is not possible to add more health to the player. I know I can ask this question on Spigot but I would like you to edit your episode 4 so others will not get this error as they are learning. Thank you so much and good luck on Youtube!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.