Resource Spigot Plugin Template For Beginners

Discussion in 'Spigot Plugin Development' started by creepinson, Jul 10, 2018.

  1. Hey everyone. Recently, I made a simple plugin template for complete beginners. It contains a bunch of comments for understanding the basics. This template is made for beginners. Feel free to use it anywhere, as long as you credit me.
    Here is the link to the GitHub page:
    I recommend you go to the 1.12 branch, as the master one isn't fully updated.
    - Creepinson
     
    #1 creepinson, Jul 10, 2018
    Last edited by a moderator: Jul 10, 2018
    • Like Like x 1
  2. Oof literally distributing the entire spigot jar
     
    #2 xTrollxDudex, Jul 10, 2018
    Last edited by a moderator: Jul 10, 2018
    • Agree Agree x 3
  3. Reported for illegal software distribution.
     
    • Funny Funny x 1
  4. Choco

    Moderator

    • Template#L24: Explicit declaration of private is recommended, though either way, there is literally no purpose to this field. You're effectively cloning a reference to the already existing "description" field retrievable by JavaPlugin#getDescription(). Remove the field all together.
    • Template#L27: Ever heard of "this"? Either way... why are the fields being set onDisable()?
    • Template#L26 & 40: Should have @Override annotations over all methods you override from super classes. It's a useful compiler hint
    • PathfinderUtil: Doesn't this seem a bit excessive for a "template for begginers"? We're talking about people who hardly understand what onEnable() is and you're throwing them into the deep end with obfuscated NMS and reflection
    • ExampleCommand#L27: There are more than just console senders. Every single entity in the game (and command blocks) are also command senders that may be passed to that function. You should ensure that !(sender instanceof Player) instead to guarantee that a player is sending.
    I have everything unliked because I've since redacted your GitHub link as it is redistributing the server jar (which is against Mojang's ToS and the reason we have BuildTools in the first place). Remove the server jar from your repository and rebase to ensure the commit history has been overwritten and your link will once again be permitted. Also, consider the notes I made above.
     
    • Agree Agree x 2
    • Winner Winner x 1
  5. I'm actually confused... I thought you needed the jar to develop with. So are you saying you just can't give it to others?
    Also thanks for the helpful information, I'll fix some stuff up.
    Edit: The onDisable() part was a mistake XD.
     
  6. Choco

    Moderator

    You do need the jar to develop, yes, but you cannot distribute the server jar as per Mojang's ToS. If you were permitted to distribute the jar, Spigot would have a simple button that downloads the jar for you, but we do not. We use a legal loop hole, BuildTools, to build the jar on your client. You still cannot, however, distribute it. Hosting it on GitHub for anyone to download is considered distributing. Add the jar to your classpath and instead direct people to the BuildTools wiki. Or, consult Maven.

    And before it's brought up out of confusion, yes, any website hosting the server jar is illegal and you should avoid them as the jars may be tampered with.
     
    • Winner Winner x 1
  7. now thats a mojor oof
     
  8. Ok, thanks. That cleared things up lol.
     
    • Like Like x 1
  9. I never really understood this thing. A bukkit developer got mad because he discovered that all of his work was considered as a part of Mojang's, so he filled a DMCA takedown to Bukkit. Now my question is why didn't bukkit developers just rewrite what that developer did?
     
  10. Because it's too much. He was the 3rd largest contributor to the project. Rewriting his code would literally be rewriting most of the project from scratch. This is why things like Sponge became a thing.
     
  11. MiniDigger

    Supporter

    the DMCA has nothing to do with this.
    its against Mojangs tos to distribute the server jar. since spigot does include the server jar, you can't distribute spigot. its that simple.
     
  12. I guess there's no way around. Or you can rewrite the server jar but that would take so mutch time
     
    • Agree Agree x 1
  13. MiniDigger

    Supporter

    let me introduce you to glowstone, bukkit without the internal server :D
    https://glowstone.net/
     
    • Agree Agree x 1
  14. These guys are genius
     
  15. MiniDigger

    Supporter

    yeah, but their decisions to start from scratch instead of using minecrafts source (unlike all other major server platforms) comes at the cost of speed. they are missing many minecraft features and don't implement many bukkit apis yet, just take a look at this issue for example https://github.com/GlowstoneMC/Glowstone/issues/922
     
  16. IIRC, its all about the dmca. Last I heard Bukkit is owned by Mojang. Dinnerbone himself said he'd never let Bukkit die. The only reason we're all in this mess is because a salty wolf said "Its my ball, and I don't want to play anymore" when he learned of this. His dmca holds water, not because of mojang tos, but because gpl disallows distribution of gpl code with non gpl code together. If bukkit was licensed under anything else (mit, bsd, Apache, etc) that dmca would have never happened. Thats the loophole patches and buildtools work within because that's the only validity the dmca has. Separation of gpl and non gpl code. At least that's what I saw went down with my own eyes.

    Holy crap, I thought those guys gave up years ago! I'll have to give them a closer look to see just how far they got. Last I looked they had world generation working, and that was it.
     
  17. MiniDigger

    Supporter

    the DMCA was only possible because bukkits broke its own licence, as you pointed out. but even without the dmca, it was never allowed to distribute the vanilla jar (and as such you weren't allowed to distribute a craftbukkit jar) but nobody cared till the dmca happened.
     
  18. MiniDigger

    Supporter

    use ~~~the power of google~~~ and you will find it