for loop - Unknown error in java code -
okay, earlier posted this thread asking how make multiple values out of loop. after while ran problem, wich don't know how fix nor know why happend. code have:
for(int x = 0; x < con.length; x++) { maxs[x] = main.getconfig().getstring("areas." + con[x] + ".max").split(", ").tostring(); mins[x] = main.getconfig().getstring("areas." + con[x] + ".min").split(", ").tostring(); event.getplayer().sendmessage("1"); for(int y = 0; y < maxs.length; y++) { maxv[y] = new vector(integer.parseint(maxs[y]), integer.parseint(maxs[y+1]), integer.parseint(maxs[y+2])); minv[y] = new vector(integer.parseint(mins[y]), integer.parseint(mins[y+1]), integer.parseint(mins[y+2])); event.getplayer().sendmessage("2"); } }
the error message:
2013-07-29 20:32:12 [severe] not pass event playermoveevent factionplay v1.6.2 org.bukkit.event.eventexception @ org.bukkit.plugin.java.javapluginloader$1.execute(javapluginloader.java:427) @ org.bukkit.plugin.registeredlistener.callevent(registeredlistener.java:62) @ org.bukkit.plugin.simplepluginmanager.fireevent(simplepluginmanager.java:477) @ org.bukkit.plugin.simplepluginmanager.callevent(simplepluginmanager.java:462) @ net.minecraft.server.v1_6_r2.playerconnection.a(playerconnection.java:227) @ net.minecraft.server.v1_6_r2.packet10flying.handle(sourcefile:136) @ net.minecraft.server.v1_6_r2.networkmanager.b(networkmanager.java:296) @ net.minecraft.server.v1_6_r2.playerconnection.e(playerconnection.java:116) @ net.minecraft.server.v1_6_r2.serverconnection.b(sourcefile:37) @ net.minecraft.server.v1_6_r2.dedicatedserverconnection.b(sourcefile:30) @ net.minecraft.server.v1_6_r2.minecraftserver.t(minecraftserver.java:590) @ net.minecraft.server.v1_6_r2.dedicatedserver.t(dedicatedserver.java:226) @ net.minecraft.server.v1_6_r2.minecraftserver.s(minecraftserver.java:486) @ net.minecraft.server.v1_6_r2.minecraftserver.run(minecraftserver.java:419) @ net.minecraft.server.v1_6_r2.threadserverapplication.run(sourcefile:582) caused by: java.lang.numberformatexception: input string: " [ljava.lang.string;@af7327" @ java.lang.numberformatexception.forinputstring(unknown source) @ java.lang.integer.parseint(unknown source) @ java.lang.integer.parseint(unknown source) @ me.bluejelly.factionplay_sp.playerlistener.onplayermove(playerlistener.java:191) @ sun.reflect.generatedmethodaccessor89.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.bukkit.plugin.java.javapluginloader$1.execute(javapluginloader.java:425) ... 14 more
thanks help.
judging error message, looks calls integer.parseint
aren't getting string can parsed int.
instead they're getting string " [ljava.lang.string;@af7327"
.
you should re-evaluate how you're getting strings
the following line looks wrong.
maxs[x] = main.getconfig().getstring("areas." + con[x] + ".max").split(", ").tostring();
this might c# experience talking, expect .split()
call return array of string
rather single string
.
it's hard tell without looking @ rest of code, i'd expect see line looks more following
maxs = main.getconfig().getstring("areas." + con[x] + ".max").split(", ");
Comments
Post a Comment