While helping out someone through PM, I decided to look into it myself in which why Development v117 has issues for people using only 1 World. I knew I began implementing everything to be designed for multiple worlds, so never thought about just having one..
Turns out, it's actually a simple fix. While everyone here keeps pointing out the loop, the loop was never the problem. The real problem is that I was too stupid to fix my loops for Lithium's terrible Respawn system.
Anyways, to fix the IndexOutOfBounds issue (which is rather a simple fix if looking at bat tbh), the issue lies in src/handling/World/World.java.
Find the Respawn constructor:
and replace it with this one:PHP Code:public Respawn(Integer[] chs, int c) {
StringBuilder s = new StringBuilder("[Respawn Worker] Registered for channels ");
for (int i = 1; i <= CHANNELS_PER_THREAD && chs.length >= (c + i); i++) {
for (int z = 0; z < (WorldConstants.Worlds * WorldConstants.Channels) + 2; z++) {
switch(z) {
case 1:// do channels start from 0?
case 2:
case 3:
case 4:
case 5:
cservs.add(ChannelServer.getInstance(0, c + i));
break;
case 6:
case 7:
case 8:
case 9:
case 10:
cservs.add(ChannelServer.getInstance(1, c + i));
break;
}
}
s.append(c + i).append(" ");
}
System.out.println(s.toString());
}
I never actually finished coding the support for Multi-world here as you can see. Feel free to just re-write the loop and function in general yourself if you wish. This is just so people who only want one world can just run 1 world, as it will register only channels to hard-coded world 0.PHP Code:public Respawn(Integer[] chs, int c) {
StringBuilder s = new StringBuilder("[Respawn Worker] Registered for channels ");
for (int i = 1; i <= CHANNELS_PER_THREAD && chs.length >= (c + i); i++) {
cservs.add(ChannelServer.getInstance(0, c + i));
s.append(c + i).append(" ");
}
System.out.println(s.toString());
}


Reply With Quote![[Development v117] Multi-World Fix](http://ragezone.com/hyper728.png)

