org.bukkit.Bukkit: Server Singleton???

Discussion in 'Plugin Development' started by RcExtract, Apr 1, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    RcExtract

    What is Server Singleton? Why does it require Bukkit class? (Can't bukkit simply add a static getInstance method in Server interface?) Can i use it on my plugin? Thanks.

    So i have read something here, but it is different from the singleton design pattern of org.bukkit.Server.
     
  2. You don't NEED to use Bukkit.*, as it's just a wrapper for Bukkit.getServer().*

    I believe it's simply to shorten the length of the method.

    Sent from my SM-G903F using Tapatalk
     
  3. Offline

    RcExtract

    Sorry. I mean should i use it in my plugin by should i use the singleton design pattern in my plugin for my JavaPlugin class? Instead of using Bukkit.*
     
  4. It doesn't really matter. It's the same Server instance. If you're really OOP obsessed, then use Dependency Injection or something similar, but people aren't going to get annoyed if you use Bukkit.* sorry if I still haven't understood

    Sent from my SM-G903F using Tapatalk
     
Thread Status:
Not open for further replies.

Share This Page