File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/main/java/com/comphenix/protocol/wrappers Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 22
22
* @author Kristian
23
23
*/
24
24
public class WrappedAttributeModifier extends AbstractWrapper {
25
- private static final Class <?> OPERATION_CLASS = MinecraftReflection .getMinecraftClass ("AttributeModifier$Operation" );
26
25
private static final boolean OPERATION_ENUM = MinecraftVersion .atOrAbove (MinecraftVersion .VILLAGE_UPDATE );
27
- private static final EquivalentConverter <Operation > OPERATION_CONVERTER = new IndexedEnumConverter <>(Operation .class , OPERATION_CLASS );
26
+ private static final Class <?> OPERATION_CLASS ;
27
+ private static final EquivalentConverter <Operation > OPERATION_CONVERTER ;
28
28
29
29
private static class IndexedEnumConverter <T extends Enum <T >> implements EquivalentConverter <T > {
30
30
private Class <T > specificClass ;
@@ -65,6 +65,11 @@ public Class<T> getSpecificType() {
65
65
}
66
66
}
67
67
68
+ static {
69
+ OPERATION_CLASS = OPERATION_ENUM ? MinecraftReflection .getMinecraftClass ("AttributeModifier$Operation" ) : null ;
70
+ OPERATION_CONVERTER = OPERATION_ENUM ? new IndexedEnumConverter <>(Operation .class , OPERATION_CLASS ) : null ;
71
+ }
72
+
68
73
/**
69
74
* Represents the different modifier operations.
70
75
* <p>
You can’t perform that action at this time.
0 commit comments