Sign in to follow this  
AbsolutelyNobody

Anyone know how to fix this?

Recommended Posts

I'm trying to edit the Tiles.class file and keep getting an error on this part of the code and have no clue how to fix it.

Anyone know what to change here?

 

This is the error I get: The constructor Tiles.Flag(String, int) is undefined
 

private enum Flag    {        USESNEWDATA("USESNEWDATA", 0),         ALIGNED("ALIGNED", 1),         TREE("TREE", 2),         BUSH("BUSH", 3),         NORMAL("NORMAL", 4),         MYCELIUM("MYCELIUM", 5),         ENCHANTED("ENCHANTED", 6),         GRASS("GRASS", 7),         ROAD("ROAD", 8),         CAVE("CAVE", 9),         CAVEDOOR("CAVEDOOR", 10),         VISIBLE_CAVEDOOR("VISIBLE_CAVEDOOR", 11),         SOLIDCAVE("SOLIDCAVE", 12),         REINFORCEDCAVE("REINFORCEDCAVE", 13),         ORECAVE("ORECAVE", 14),         NW("NW", 15),         NE("NE", 16),         SW("SW", 17),         SE("SE", 18),         BOTANIZE("BOTANIZE", 19),         FORAGE("FORAGE", 20),         BIRCH("BIRCH", 21),         PINE("PINE", 22),         OAK("OAK", 23),         CEDAR("CEDAR", 24),         WILLOW("WILLOW", 25),         MAPLE("MAPLE", 26),         APPLE("APPLE", 27),         LEMON("LEMON", 28),         OLIVE("OLIVE", 29),         CHERRY("CHERRY", 30),         CHESTNUT("CHESTNUT", 31),         WALNUT("WALNUT", 32),         FIR("FIR", 33),         LINDEN("LINDEN", 34),         LAVENDER("LAVENDER", 35),         ROSE("ROSE", 36),         THORN("THORN", 37),         GRAPE("GRAPE", 38),         CAMELLIA("CAMELLIA", 39),         OLEANDER("OLEANDER", 40);    }

Thanks,

Share this post


Link to post
Share on other sites

The enum needs a constructor

protected Flag(String name, int number) {   this.name = name;   this.number = number;}
And probably also some methods to actually access those values

Share this post


Link to post
Share on other sites

Tried this and still having problems. Doesn't help that I have like no experience in coding :P

I might try again later

Share this post


Link to post
Share on other sites

I would need to see more of what you are doing to help.  

Ok, so I'm trying to make changes to the Tiles.class file in common.jar.

This forum won't let me post the code because its to long :/

 

 

I have decompiled the code with procyon and then copied it all into intellij. It won't even let me compile it without making a single change because of the error that is there. So I need to fix it somehow to even be able to do anything

Edited by AbsolutelyNobody

Share this post


Link to post
Share on other sites

hm. JD creates a simple enum for this type

/* */ private static enum Flag/* */ {/* 342 */ USESNEWDATA, ALIGNED, TREE, BUSH, NORMAL, MYCELIUM, ENCHANTED, GRASS, ROAD, CAVE, CAVEDOOR, VISIBLE_CAVEDOOR, SOLIDCAVE, REINFORCEDCAVE, ORECAVE, NW, NE, SW, SE, BOTANIZE, FORAGE, BIRCH, PINE, OAK, CEDAR, WILLOW, MAPLE, APPLE, LEMON, OLIVE, CHERRY, CHESTNUT, WALNUT, FIR, LINDEN, LAVENDER, ROSE, THORN, GRAPE, CAMELLIA, OLEANDER;/* */ }
you could manually fix the all the enums or add this constructor to the enum

 

private enum Flag{USESNEWDATA("USESNEWDATA", 0),...OLEANDER("OLEANDER", 40);Flag(String name, int id) {};}
This essentially ignores the extra stuffon the enum since those are the default values anyway.

Which decompiler created that code?

Edited by ago

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this