Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$SwitchMap$ error after decompile

I need to decompile a jar file and when I do I get these weird things inside of switch statements.

private String getRawToolName()

switch (1.$SwitchMap$org$bukkit$Material[getItem().getType().ordinal()])
{
case 1: 
  return "Diamond Axe";
case 2: 
  return "Diamond Pickaxe";
case 3: 
  return "Diamond Hoe";
case 4: 
  return "Diamond Shovel";
case 5: 
  return "Diamond Sword";
case 6: 
  return "Golden Axe";
case 7: 

If anyone knows a decompiler that does not do this or a way to get around this, it would be greatly appreciated. Thanks!

like image 475
user2977659 Avatar asked Oct 16 '25 04:10

user2977659


1 Answers

Simply changing switch (1.$SwitchMap$org$bukkit$Material[getItem().getType().ordinal()]) to getItem().getType().ordinal() fixes it in the similar cases I've encountered. Seems to be something about the way it decompiles switches, but you can figure out what the original was.

like image 123
Perkins Avatar answered Oct 17 '25 21:10

Perkins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!