Hello, everyone.
I just registered today;
For the past couple of days I've been trying to modify a .class file which is part of a mod for a game I've been playing.
It doesn't seem to find any errors in the modifications I've made, but it seems to have issues with lines from the original class file.
(I've tried compiling both my modified version and the original)
I'm brand new to java so I'm not sure exactly how to fix the errors.
Here's the code, highlighted in blue are the modifications I made.
public final class EnumFaces extends Enum
{
public static final EnumFaces Normal;
public static final EnumFaces Angry;
public static final EnumFaces Sad;
public static final EnumFaces Happy;
public static final EnumFaces Tired;
public static final EnumFaces Shy;
public static final EnumFaces Custom1;
private static final EnumFaces $VALUES[];
public static EnumFaces[] values()
{
return (EnumFaces[])$VALUES.clone();
}
public static EnumFaces valueOf(String name)
{
return (EnumFaces)Enum.valueOf(EnumFaces, name);
}
private EnumFaces(String s, int i)
{
super(s, i);
}
static
{
Normal = new EnumFaces("Normal", 0);
Angry = new EnumFaces("Angry", 1);
Sad = new EnumFaces("Sad", 2);
Happy = new EnumFaces("Happy", 3);
Tired = new EnumFaces("Tired", 4);
Shy = new EnumFaces("Shy", 5);
Custom1 = new EnumFaces("Custom1", 6);
$VALUES = (new EnumFaces[] {
Normal, Angry, Sad, Happy, Tired, Shy, Custom 1
});
}
}
Here are the errors that javac found:
EnumFaces.java:2: error: classes cannot directly extend java.lang.Enum
public final class EnumFaces extends Enum
EnumFaces.java:20: error: cannot find symbol
return (EnumFaces)Enum.valueOf(EnumFaces, name);
symbol: variable EnumFaces
location: class EnumFaces
EnumFaces.java:25: error: contructor Enum in class Enum(E) cannot be applied to given types:
super(s, i);
required: String, int
found: String, int, String, int
reason: actual and formal argument lists differ in length
where E is a type-variable:
E extends Enum(E) declared in class Enum
3 errors
Thanks in advance