mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-09-01 18:39:38 +02:00
Add version to stack traces, fix EnumWrappers in pre-1.8
This commit is contained in:
parent
3166241397
commit
e6c87129bd
|
@ -84,7 +84,12 @@
|
|||
<version>2.5</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
<manifestEntries>
|
||||
<Main-Class>com.comphenix.protocol.Application</Main-Class>
|
||||
<Implementation-Title>ProtocolLib</Implementation-Title>
|
||||
<Implementation-Version>${project.version}${project.build.number}</Implementation-Version>
|
||||
<Implementation-Vendor>dmulloy2</Implementation-Vendor>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
<finalName>ProtocolLib</finalName>
|
||||
</configuration>
|
||||
|
|
|
@ -330,8 +330,10 @@ public abstract class EnumWrappers {
|
|||
}
|
||||
|
||||
private static void associate(Class<?> nativeClass, Class<?> wrapperClass, EquivalentConverter<?> converter) {
|
||||
FROM_NATIVE.put(nativeClass, converter);
|
||||
FROM_WRAPPER.put(wrapperClass, converter);
|
||||
if (nativeClass != null) {
|
||||
FROM_NATIVE.put(nativeClass, converter);
|
||||
FROM_WRAPPER.put(wrapperClass, converter);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -341,7 +343,11 @@ public abstract class EnumWrappers {
|
|||
* @return The type of the enum field.
|
||||
*/
|
||||
private static Class<?> getEnum(Class<?> clazz, int index) {
|
||||
return FuzzyReflection.fromClass(clazz, true).getFieldListByType(Enum.class).get(index).getType();
|
||||
try {
|
||||
return FuzzyReflection.fromClass(clazz, true).getFieldListByType(Enum.class).get(index).getType();
|
||||
} catch (Throwable ex) {
|
||||
return null; // Unsupported in this version
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<Class<?>, EquivalentConverter<?>> getFromNativeMap() {
|
||||
|
|
|
@ -84,7 +84,12 @@
|
|||
<version>2.5</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
<manifestEntries>
|
||||
<Main-Class>com.comphenix.protocol.Application</Main-Class>
|
||||
<Implementation-Title>ProtocolLib</Implementation-Title>
|
||||
<Implementation-Version>${project.version}${project.build.number}</Implementation-Version>
|
||||
<Implementation-Vendor>dmulloy2</Implementation-Vendor>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
<finalName>ProtocolLib</finalName>
|
||||
<outputDirectory>../../target/</outputDirectory>
|
||||
|
|
Loading…
Reference in New Issue
Block a user