mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-23 19:16:14 +01:00
Fix WrappedRegistry for versions older than 1.19.4 (#2298)
This commit is contained in:
parent
fb2075b774
commit
a910edc16b
@ -104,20 +104,21 @@ public class WrappedRegistry {
|
||||
.returnTypeExact(MinecraftReflection.getMinecraftKeyClass())
|
||||
.build()));
|
||||
|
||||
MethodAccessor getHolder;
|
||||
MethodAccessor getHolder = null;
|
||||
|
||||
try {
|
||||
getHolder = Accessors.getMethodAccessor(fuzzy.getMethod(FuzzyMethodContract
|
||||
.newBuilder()
|
||||
.parameterCount(1)
|
||||
.banModifier(Modifier.STATIC)
|
||||
.returnTypeExact(MinecraftReflection.getHolderClass())
|
||||
.requireModifier(Modifier.PUBLIC)
|
||||
.build()));
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
getHolder = null;
|
||||
if (MinecraftVersion.FEATURE_PREVIEW_2.atOrAbove()) {
|
||||
try {
|
||||
getHolder = Accessors.getMethodAccessor(fuzzy.getMethod(FuzzyMethodContract
|
||||
.newBuilder()
|
||||
.parameterCount(1)
|
||||
.banModifier(Modifier.STATIC)
|
||||
.returnTypeExact(MinecraftReflection.getHolderClass())
|
||||
.requireModifier(Modifier.PUBLIC)
|
||||
.build()));
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GET_HOLDER = getHolder;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user