hollow-cube / minestom-ce

1.20.4 Lightweight Minecraft server
https://minestom.net
Apache License 2.0
106 stars 35 forks source link

Add more Object-oriented programming API. #119

Open Rollczi opened 10 months ago

Rollczi commented 10 months ago

Static API is a poor solution if someone wants to run two server instances. I want to be able to get an object of a started process with all services.

for example:

MinecraftServer minecraftServer = MinecraftServer.init();
InstanceManager instanceManager = minecraftServer.getInstanceManager();
Server server = minecraftServer.getServer();
CommandManager commandManager = minecraftServer.getCommandManager();
GlobalEventHandler eventHandler = minecraftServer.getGlobalEventHandler();
Rollczi commented 10 months ago

Related: #70

Rollczi commented 10 months ago

In my case: Recently, when I started extending support to LiteCommands, I noticed that more and more parameters were needed in the builder method.

image if it continues like this, I will have to get all the services/managers etc.

I want LiteCommands users to be able to use the framework conveniently, but I also don't want to use Minestom statics :/

Also, I use minestom community edition in my project

mworzala commented 10 months ago

I think you should just use the static MinecraftServer for now, although I am not opposed to this change in the future.