mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Disable more broken useLegacyMixinAp checks on Forge
This commit is contained in:
@@ -74,9 +74,20 @@ public abstract class MixinExtensionApiImpl implements MixinExtensionAPI {
|
||||
return useMixinAp;
|
||||
}
|
||||
|
||||
protected void checkMixinApEnabled() {
|
||||
if (LoomGradleExtension.get(project).isForge()) {
|
||||
// Arch: We need to access afterEvaluate state in useLegacyMixinAp's convention, so let's not query it.
|
||||
// Otherwise, this extension can't be used in a buildscript without afterEvaluate.
|
||||
// https://github.com/architectury/architectury-loom/issues/242
|
||||
return;
|
||||
}
|
||||
|
||||
if (!getUseLegacyMixinAp().get()) throw new IllegalStateException("You need to set useLegacyMixinAp = true to configure Mixin annotation processor.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property<String> getRefmapTargetNamespace() {
|
||||
if (!getUseLegacyMixinAp().get()) throw new IllegalStateException("You need to set useLegacyMixinAp = true to configure Mixin annotation processor.");
|
||||
checkMixinApEnabled();
|
||||
|
||||
return refmapTargetNamespace;
|
||||
}
|
||||
|
||||
@@ -61,10 +61,7 @@ public class MixinExtensionImpl extends MixinExtensionApiImpl implements MixinEx
|
||||
|
||||
@Override
|
||||
public Property<String> getDefaultRefmapName() {
|
||||
// Arch: We need to access afterEvaluate state in useLegacyMixinAp's convention, so let's not query it.
|
||||
// Otherwise, this property can't be set in a buildscript without afterEvaluate.
|
||||
// https://github.com/architectury/architectury-loom/issues/242
|
||||
// if (!super.getUseLegacyMixinAp().get()) throw new IllegalStateException("You need to set useLegacyMixinAp = true to configure Mixin annotation processor.");
|
||||
checkMixinApEnabled();
|
||||
|
||||
return defaultRefmapName;
|
||||
}
|
||||
@@ -84,7 +81,7 @@ public class MixinExtensionImpl extends MixinExtensionApiImpl implements MixinEx
|
||||
|
||||
@Override
|
||||
protected PatternSet add0(SourceSet sourceSet, Provider<String> refmapName) {
|
||||
if (!super.getUseLegacyMixinAp().get()) throw new IllegalStateException("You need to set useLegacyMixinAp = true to configure Mixin annotation processor.");
|
||||
checkMixinApEnabled();
|
||||
|
||||
PatternSet pattern = new PatternSet().setIncludes(Collections.singletonList("**/*.json"));
|
||||
MixinExtension.setMixinInformationContainer(sourceSet, new MixinExtension.MixinInformationContainer(sourceSet, refmapName, pattern));
|
||||
|
||||
Reference in New Issue
Block a user