Fix InitializerError during ReflectWrapper classes registration
This commit is contained in:
parent
b6104a76c1
commit
3fd853f2a6
@ -14,7 +14,9 @@ public class ClientboundCustomPayloadPacket extends ReflectWrapper implements Pa
|
||||
private static final Reflect.ReflectConstructor<?> CONSTRUCTOR = wrapEx(() -> MAPPING.runtimeReflect().constructor(ResourceLocation.MAPPING.runtimeClass(), FriendlyByteBuf.MAPPING.runtimeClass()));
|
||||
private static final Reflect.ReflectField<?> FIELD_BRAND = wrapEx(() -> MAPPING.mojField("BRAND"));
|
||||
|
||||
public static final ResourceLocation BRAND = wrap(wrapReflectEx(FIELD_BRAND::getStaticValue), ResourceLocation.class);
|
||||
public static ResourceLocation BRAND() {
|
||||
return wrap(wrapReflectEx(FIELD_BRAND::getStaticValue), ResourceLocation.class);
|
||||
}
|
||||
|
||||
protected ClientboundCustomPayloadPacket(Object obj) {
|
||||
super(obj);
|
||||
|
@ -13,8 +13,12 @@ public class ClientboundGameEventPacket extends ReflectWrapper implements Packet
|
||||
private static final Reflect.ReflectField<?> FIELD_RAIN_LEVEL_CHANGE = wrapEx(() -> MAPPING.mojField("RAIN_LEVEL_CHANGE"));
|
||||
private static final Reflect.ReflectField<?> FIELD_THUNDER_LEVEL_CHANGE = wrapEx(() -> MAPPING.mojField("THUNDER_LEVEL_CHANGE"));
|
||||
|
||||
public static final Type RAIN_LEVEL_CHANGE = wrap(wrapReflectEx(FIELD_RAIN_LEVEL_CHANGE::getStaticValue), Type.class);
|
||||
public static final Type THUNDER_LEVEL_CHANGE = wrap(wrapReflectEx(FIELD_THUNDER_LEVEL_CHANGE::getStaticValue), Type.class);
|
||||
public static Type RAIN_LEVEL_CHANGE() {
|
||||
return wrap(wrapReflectEx(FIELD_RAIN_LEVEL_CHANGE::getStaticValue), Type.class);
|
||||
}
|
||||
public static Type THUNDER_LEVEL_CHANGE() {
|
||||
return wrap(wrapReflectEx(FIELD_THUNDER_LEVEL_CHANGE::getStaticValue), Type.class);
|
||||
}
|
||||
|
||||
public ClientboundGameEventPacket(Type type, float value) {
|
||||
this(wrapReflectEx(() -> CONSTRUCTOR.instanciate(unwrap(type), value)));
|
||||
|
@ -11,7 +11,9 @@ public class DamageSource extends ReflectWrapper {
|
||||
public static final NMSReflect.ClassMapping MAPPING = wrapEx(() -> NMSReflect.mojClass("net.minecraft.world.damagesource.DamageSource"));
|
||||
private static final Reflect.ReflectField<?> FIELD_OUT_OF_WORLD = wrapEx(() -> MAPPING.mojField("OUT_OF_WORLD"));
|
||||
|
||||
public static final DamageSource OUT_OF_WORLD = wrap(wrapReflectEx(FIELD_OUT_OF_WORLD::getStaticValue), DamageSource.class);
|
||||
public static DamageSource OUT_OF_WORLD() {
|
||||
return wrap(wrapReflectEx(FIELD_OUT_OF_WORLD::getStaticValue), DamageSource.class);
|
||||
}
|
||||
|
||||
protected DamageSource(Object obj) {
|
||||
super(obj);
|
||||
|
Loading…
Reference in New Issue
Block a user