Rework platform detection logic again
This commit is contained in:
parent
81d30d595b
commit
47b614e0ef
|
|
@ -18,7 +18,6 @@ dependencies {
|
||||||
// Platform classes
|
// Platform classes
|
||||||
implementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
implementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||||
implementation "net.minecraftforge:mergetool:1.1.0"
|
implementation "net.minecraftforge:mergetool:1.1.0"
|
||||||
implementation "net.neoforged:mergetool:2.0.0"
|
|
||||||
implementation project(":annotations")
|
implementation project(":annotations")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,15 +98,13 @@ public class ClientMixinValidator {
|
||||||
|
|
||||||
private boolean isClientMarked(TypeElement te) {
|
private boolean isClientMarked(TypeElement te) {
|
||||||
for (var entry : getPlatformClasses(markers).entrySet()) {
|
for (var entry : getPlatformClasses(markers).entrySet()) {
|
||||||
Annotation marker = te.getAnnotation(entry.getKey());
|
IAnnotationHandle marker = getAnnotationHandle(te, entry.getKey());
|
||||||
if(marker == null) continue;
|
if(!marker.exists()) continue;
|
||||||
|
|
||||||
Optional<MethodHandle> accessor = getAccessor(entry.getKey(), entry.getValue());
|
String[] enumValue = marker.getValue("value");
|
||||||
Optional<String> enumValue = accessor.map((mh) -> this.invoke(mh, marker))
|
if(enumValue==null) continue;
|
||||||
.map(Object::toString);
|
|
||||||
if(enumValue.isPresent())
|
return enumValue[1].equals("CLIENT");
|
||||||
return enumValue.orElseThrow().equals("CLIENT");
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if(debug && unannotatedClasses.add(te.toString())) {
|
if(debug && unannotatedClasses.add(te.toString())) {
|
||||||
messager.printMessage(Diagnostic.Kind.WARNING,
|
messager.printMessage(Diagnostic.Kind.WARNING,
|
||||||
|
|
|
||||||
|
|
@ -78,5 +78,4 @@ repositories {
|
||||||
url 'https://maven.terraformersmc.com/releases'
|
url 'https://maven.terraformersmc.com/releases'
|
||||||
}
|
}
|
||||||
maven { url = "https://jitpack.io" }
|
maven { url = "https://jitpack.io" }
|
||||||
maven { url "https://maven.neoforged.net/releases" }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user