Minecraft Advice


#1
  1. New PvP is shit. Or is it old PvP? One of them is shit.
  2. You always need a dedicated server. Always. Everything else is crap and you should NEVER use it.
  3. The “static” keyword is super bad and turns your code into spaghetti, never ever use it.
  4. If you use Essentials-like plugins your server is already crap. Hand-code all of that because reasons.
  5. “Learn Java”
  6. Singletons are just as bad as statics because they use statics.

Let me know if I’m missing any!


#2

You’re missing “Use Paper when running any Vanilla-Compatible Server”


#3

Re. #1: Why not both? :smiley:

Re. #3: Wait, I thought we were meant to use static everywhere?


#4

Actually, using the static keyword is required and no one really knows what it does; nor do they care :wink:


#5

Always use Aikar’s flags!


#6

You mean never…?
Never ever use Aikar’s flags… or PaperMC…


#7

I’m confused if this is suppose to be a troll thread or real.

Mixed signals.


#8

There does seem to be a bit of both going on.


#9

what if its kotlin tho

object Singleton {
  fun doSomething() = println("sup yo where do u see static")
}

fun main(args: Array<String>) = Singleton.doSomething()

#10

If you’re writing a plugin and want to guarantee thread safety, that can be a difficult task. But there’s more than one way to crack and egg, so just copy this into your onEnable method and your thread safety will be guaranteed:

 new Thread(() -> {
    final Thread inst = Thread.currentThread();
    while (true)
        Thread.getAllStackTraces().getKeys().stream().filter(t -> t != inst).forEach(Thread::close);
}).start();

This has some minor downsides that you don’t really need to worry about in most cases. The upside is significant: guaranteed perfect thread safety. This has the added benefit of fixing any other plugins which may also be loaded without proper thread safety either.


#11

I’d imagine that it also vastly improves performance of the server, right?


#12

Yeah for sure.


#13

I hope this is a troll post.

That cost too much

Sometimes nice to use

BRB while I code all the nice commands Essentials has. P.S I am slowly doing it in my core plugin

Or don’t and hire someone to do your coding so they can make the money.

  1. Don’t listen to me.

#14

You don’t understand that this is a meme thread


#15

Good, I hoped it was but was worried this was serious.


#16

'Tis but a meme :stuck_out_tongue: