mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-28 05:35:28 +01: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>
|
<version>2.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<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>
|
</archive>
|
||||||
<finalName>ProtocolLib</finalName>
|
<finalName>ProtocolLib</finalName>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -330,8 +330,10 @@ public abstract class EnumWrappers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void associate(Class<?> nativeClass, Class<?> wrapperClass, EquivalentConverter<?> converter) {
|
private static void associate(Class<?> nativeClass, Class<?> wrapperClass, EquivalentConverter<?> converter) {
|
||||||
FROM_NATIVE.put(nativeClass, converter);
|
if (nativeClass != null) {
|
||||||
FROM_WRAPPER.put(wrapperClass, converter);
|
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.
|
* @return The type of the enum field.
|
||||||
*/
|
*/
|
||||||
private static Class<?> getEnum(Class<?> clazz, int index) {
|
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() {
|
public static Map<Class<?>, EquivalentConverter<?>> getFromNativeMap() {
|
||||||
|
@ -84,7 +84,12 @@
|
|||||||
<version>2.5</version>
|
<version>2.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<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>
|
</archive>
|
||||||
<finalName>ProtocolLib</finalName>
|
<finalName>ProtocolLib</finalName>
|
||||||
<outputDirectory>../../target/</outputDirectory>
|
<outputDirectory>../../target/</outputDirectory>
|
||||||
|
Loading…
Reference in New Issue
Block a user