Exception in thread "main" java.lang.NumberFormatException: radix 482 greater than Character.MAX_RADIX -
lately have been having issue game, this:
@override public tile getplace(list args) { return new craftingtabletile(integer.valueof((string)args.get(0), integer.valueof((string)args.get(1)).intvalue()).intvalue(), this.healthrep); }
as as:
s.map[selectedx][selectedy] = s.mp.inven.i[s.mp.invsel].getplace(args);
gives error:
exception in thread "main" java.lang.numberformatexception: radix 482 greater character.max_radix @ java.lang.integer.parseint(unknown source) @ java.lang.integer.valueof(unknown source) @ net.spideynn.miner2d.craftingtableitem.getplace(craftingtableitem.java:21) @ net.spideynn.miner2d.maingame.mousepressed(maingame.java:851) @ org.newdawn.slick.input.poll(input.java:1217) @ org.newdawn.slick.gamecontainer.updateandrender(gamecontainer.java:641) @ org.newdawn.slick.appgamecontainer.gameloop(appgamecontainer.java:411) @ org.newdawn.slick.appgamecontainer.start(appgamecontainer.java:321) @ net.spideynn.miner2d.maingame.main(maingame.java:2074)
any ideas?
(sorry if answer easy, couldn't find solution.)
it appears attempting pass 3 values craftingtabletile
constructor, because of mistake in parentheses, passing 2 arguments:
// v parenthesis... integer.valueof((string)args.get(0), // balanced parenthesis v integer.valueof((string)args.get(1)).intvalue()).intvalue()
and
this.healthrep
because of parentheses mixup, 2 arguments being passed integer.valueof
, second being interpreted radix. exception comes 482
being greater maximum possible radix.
you meant pass these 3 arguments:
integer.valueof((string)args.get(0))
and
integer.valueof((string)args.get(1)).intvalue()
and
this.healthrep
like this:
return new craftingtabletile( integer.valueof((string)args.get(0)), integer.valueof((string)args.get(1)).intvalue(), this.healthrep);
incidentally, constructor taking int
s, in case can use parseint
. difference between parseint
, valueof
parseint
returns int
, valueof
returns integer
.
return new craftingtabletile( integer.parseint((string)args.get(0)), integer.parseint((string)args.get(1)), this.healthrep);
Comments
Post a Comment