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