最近我一直在和我的比賽的問題,這一點:異常線程 「main」 java.lang.NumberFormatException:沙蔘482大於Character.MAX_RADIX
@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);
}
還有:
s.map[selectedx][selectedy] = s.mp.inven.i[s.mp.invsel].getPlace(args);
給出了一個錯誤:
Exception in thread "main" java.lang.NumberFormatException: radix 482 greater than Character.MAX_RADIX
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.valueOf(Unknown Source)
at net.spideynn.miner2d.CraftingTableItem.getPlace(CraftingTableItem.java:21)
at net.spideynn.miner2d.MainGame.mousePressed(MainGame.java:851)
at org.newdawn.slick.Input.poll(Input.java:1217)
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:641)
at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:411)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:321)
at net.spideynn.miner2d.MainGame.main(MainGame.java:2074)
什麼想法?
(很抱歉,如果答案很簡單,我無法找到一個解決方案。)
有多少個參數要傳遞到你的'CraftingTableTile'構造函數中:2還是3? – rgettman
顯然'args.get(1)'是'「482」'大於'Character.MAX_RADIX'。 Java無法解析base 482.你需要什麼幫助? – Radiodef