Hello forum members, I have a question: how to separate plugin listeners per world without heavy load and small lags? I will glad to see your answers. Thanks!
Yes. It is. For example, WorldListener.java, NetherListener.java, EndListener.java, MyCustomWorldListener.java, etc. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
just compare the world type within the event: Code:java public void onEvent(YourWorldRelatedEvent event) { World w = /* get world from event */; if (w.getEnvironment() == World.Environment.NETHER) { //for example //do rest of event }}
I think you could do that. Define the listeners like public WorldListener wl = new WorldListener(); public NetherListener nl = new NetherListener(); public EndListener el = new EndListener(); And then register the events and in each listener make sure the event takes place in the right world. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
I make server with own mini-games and I don't understand how to do it with less CPU/RAM usage. How I can do this? This is what I came up with: 1. BungeeCord/LilyPad:you're able to make a server with plugin for each mini-game with no problems, but it requires to run too much Bukkits 2. Separated worlds for each mini-game 3. All mini-games in one world:
In the end a separate server is much better and ends up being infinitely more scaleable than trying to put all your games onto one server. It is easier to do, so might as well do it. If your computer can't handle a few server instances then you may not want to be hosting a server anyways.
why not just keep it in one listener rather than making three the same but checking the world and running something in it. but like RingOfStorms said seperate servers for different games is alot better than trying to make plugins only work on a certain world
Okay, but: 1. How many RAM/CPU requires every game on every server? 2. How many RAM/CPU requires every game in one server? Then we can talk about what is better.