Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Bukkit plugin source code + release

Hello HF

I coded a simple but interesting plugin for bukkit a while ago.
It isn't amazingly well coded, and I'm sure that there are a lot of ways it can be improved, but I though I would release the code in case anyone learning to code for bukkit is interested. This is one of the only bukkit projects I have coded so I wouldn't call myself an expert on the subject but if you have questions feel free to ask me and I might be able to assist.

The project is called "Passagecraft". It is designed around a PvP maze theme with a time limit and a killscore. You can designate a lobby, hub, spawnpoints, "nukeroom" (the destination), protection regions. The plugin has many colorful broadcast messages, and everything is customizable. Kits (spawn and killstreak), signs and a scoreboard are also used. I don't want to write a long description about it, check out the demo video below or just type "help passagecraft" on bukkit to find out more 🙂

I hope you can learn something from this plugin or just even use it in your own servers. If you want to use my code, please at least give credit - I spent quite a lot of time coding this. I haven't bothered releasing it on bukkit at this point in time, but I might if i receive good feedback about it.

LINKS:
Source code: https://github.com/MeshCollider/Passagecraft
Demo video: https://www.youtube.com/watch?v=ukVmtEB4T10
Plugin JAR: http://www.mediafire.com/download/pb746z...Craft4.jar
Source code ZIP file: https://www.mediafire.com/?31o4bzbpl28p8b9

PROJECT ON BUKKIT: http://dev.bukkit.org/bukkit-plugins/passagecraft/

Enjoy! 🤝

I'd appreciate omnicoin donations if you are feeling generous: oNFM9xX1nU7op6EthRo583FytAZuD9VXEW
Coding tip : You really should stop using pubic for all methods.
Sounds like a neat idea, I'll check out the SRC in a bit.
(May 17, 2014 05:11 AM)Hubsch Wrote:  Coding tip : You really should stop using pubic for all methods.

I don't generally, but because this is a plugin I made most of them public to ensure bukkit could actually access the required methods.
The plugin has now been released on bukkit, if you are interested it can be found here:
http://dev.bukkit.org/bukkit-plugins/passagecraft/
Sounds pretty good mate.

I have coded things like this but I worked more on the actual gamemode. I also didn't have the same type of setup as yours.
(Jun 3, 2014 12:34 AM)Coobro Wrote:  Sounds pretty good mate.

I have coded things like this but I worked more on the actual gamemode. I also didn't have the same type of setup as yours.

Thanks man. This was actually coded for somebody who hired me, but they scammed me and never paid after i sent the plugin, so I may as well release it and the source for people to learn from.
thanks for replying, and happy good will monday! 🤝
The source hurts my eyes almost. The PassageCraft.java file is endless. It's alright but not very object oriented. You should practice object orientation and see where you can improve upon it.
(Jun 15, 2014 08:47 PM)-Base- Wrote:  The source hurts my eyes almost. The PassageCraft.java file is endless. It's alright but not very object oriented. You should practice object orientation and see where you can improve upon it.

Yeah, its very long. I can't really be bothered actually improving it, this was a project from long ago. I never code like this normally, but this was my first bukkit plugin, so i knew it would be bad 🙂.
Thanks for the suggestion though, but I'm only posting this so that beginners could look at it.
Use separate CommandExecutors for each command unless you have a reason to group them. This will help to avoid the case you have with the command 'pcdetails' currently. When this command is entered your plugin will do 24 (unneeded case-insensitive String comparisons). As it stands you have given a player the ability to grind the server to a halt. Spamming that command with a valid map name will result in 4 StringBuilders and a Map Object being initialized and then dumped to GC. This is combined with the 24 String comparisons from before.

Another thing of note is your use of class names that match existing interfaces from the JRE. This should be avoided as it introduces extra complexity and reduces code readability. Finally, 500 lines in a single if/else structure...

(Jun 15, 2014 08:52 PM)SIM-2015410 Wrote:  Thanks for the suggestion though, but I'm only posting this so that beginners could look at it.
Please do not teach newer coders worse habits than they will already learn.
I don't know how to Java.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by IcyModz420v2Dec 3, 2024 02:24 PM 0 101 Dec 3, 2024 02:24 PM
Last Post: IcyModz420v2
[Java] by Son of MorningAug 8, 2019 01:49 PM 2 220 Aug 8, 2019 01:49 PM
Last Post: LowSilver
[.NET] by BarretNov 11, 2017 09:53 AM 3 370 Nov 11, 2017 09:53 AM
Last Post: StaPol