[FREE] StaffMode plugin (feedback appreciated)

Status
This thread has been locked.

Miniaturization

Banned
Feedback score
0
Posts
5
Reactions
2
Resources
0
I just came back to developing after around 12 months.

I've spent a couple hours on this, but I think it's too trash to sell and there's lots of alternatives. Feel free to use this code, modify it but please don't sell it off as your own :)

Can any more experienced developers please check this out and say where I did something bad/something which isn't optimal. Thank you!

I built this using 'spigot-1.7.10-SNAPSHOT-b1657', which is also included in the download.

Thank you again!
 

Attachments

  • StaffMode.zip
    17.7 MB · Views: 60
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

NA

I do stuffs ¯\_°□°_/¯
Supreme
Feedback score
13
Posts
204
Reactions
88
Resources
0
Suggestion 1; Do not name your main class Main, Go with the name of whatever plugin you are creating (Example: StaffMode plugin > StaffMode would be the main class name instead of Main).
Suggestion 2; Switch to intellij (It is a lot more user friendly and has more features) this is just a personal suggestion not really something that is required.
Suggestion 3; Use setter and getter methods (Via manually making the method getExample() or via the lombok plugin using @Getter ontop of your class [Remember that you will have to set a @Getter or @Setter ontop of any static / final methods inside your class or it will not work], [Also remember to enable annotation processing example on how todo so: here ]).
Suggestion 4; Don't abuse static methods a lot.

That concludes my review of your some-what clean staffmode plugin :) hope you can learn from this! <3
 

Miniaturization

Banned
Feedback score
0
Posts
5
Reactions
2
Resources
0
Thank you NA & Rasturize


When you say getting & setters is this what it is?
I don't see how you can't abuse static though to be able get your instance in other classes.

private static instance;

public static Main getInstance(){
return instance;

or whatever is? I don't see how you can do it without using public static. Thanks again for the help
 
Banned forever. Reason: Alt account (PockedMC)

PTech

Feedback score
6
Posts
422
Reactions
261
Resources
0
Thank you NA & Rasturize


When you say getting & setters is this what it is?
I don't see how you can't abuse static though to be able get your instance in other classes.

private static instance;

public static Main getInstance(){
return instance;

or whatever is? I don't see how you can do it without using public static. Thanks again for the help
It's called the singleton pattern, you can also utilize the dependency injection pattern if you want to, there's nothing wrong with either or.
 

Ambrosia

Premium
Feedback score
22
Posts
2,340
Reactions
1,384
Resources
0
It's called the singleton pattern, you can also utilize the dependency injection pattern if you want to, there's nothing wrong with either or.
but DI is more OOP

My suggestions are; switch to IntelliJ, I personally believe you'll have a better experience and it offers a lot more. Use gradle/maven. If there is no description under the desc line in the plugin.yml, just don't add a description lol. I personally don't like naming my Main class main, but that's up to you. too lazy too continue, gl
 

Deleted User

Deactivated
Feedback score
18
Posts
218
Reactions
344
Resources
0
explain the JVM entry point to me please
The JVM entry point is in the server jar itself, not sure on the exact class in Minecraft but when you run "java -jar .." you're invoking the static main method. This is where a class named "Main" would be applicable, thus being "the JVM entry point". Plugins shouldn't have their "enabling classes" named as "Main" as they are loaded through the server jar.

Hope this clears things up.
 
Last edited:

Miniaturization

Banned
Feedback score
0
Posts
5
Reactions
2
Resources
0
but DI is more OOP

My suggestions are; switch to IntelliJ, I personally believe you'll have a better experience and it offers a lot more. Use gradle/maven. If there is no description under the desc line in the plugin.yml, just don't add a description lol. I personally don't like naming my Main class main, but that's up to you. too lazy too continue, gl
I've tried to switch to IntelliJ multiple times but I just always come back to eclipse. I find it a lot easier to use. Thank you :)
 
Banned forever. Reason: Alt account (PockedMC)

pcranaway

Premium
Feedback score
4
Posts
508
Reactions
148
Resources
0
I've tried to switch to IntelliJ multiple times but I just always come back to eclipse. I find it a lot easier to use. Thank you :)
Same thing happened to me. But I only switched to IntelliJ because it's more maven friendly. I actually switched to intellij about a month ago and I'm really enjoying it so far.
 
Status
This thread has been locked.
Top