Merge pull request #151 from DJtheRedstoner/patch-mixin-ap

Fix mixin annotation processor issues
This commit is contained in:
dfsek
2021-05-02 15:47:32 -07:00
committed by GitHub
5 changed files with 8 additions and 21 deletions

View File

@@ -19,7 +19,7 @@ fun Project.configureCompilation() {
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
doFirst {
options.compilerArgs = mutableListOf("-Xlint:all")
options.compilerArgs.add("-Xlint:all")
}
}

View File

@@ -33,6 +33,7 @@ dependencies {
configure<LoomGradleExtension> {
accessWidener("src/main/resources/terra.accesswidener")
refmapName = "terra.refmap.json"
}
val remapped = tasks.register<RemapJarTask>("remapShadedJar") {

View File

@@ -13,16 +13,17 @@ import net.minecraft.world.dimension.DimensionOptions;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.gen.GeneratorOptions;
import net.minecraft.world.gen.chunk.ChunkGeneratorSettings;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Properties;
import java.util.Random;
// Mixins commented out until loom fixes multi-project builds.
//@Mixin(GeneratorOptions.class)
@Mixin(GeneratorOptions.class)
public class MixinGeneratorOptions {
//@Inject(method = "fromProperties(Lnet/minecraft/util/registry/DynamicRegistryManager;Ljava/util/Properties;)Lnet/minecraft/world/gen/GeneratorOptions;", at = @At("HEAD"), cancellable = true)
@Inject(method = "fromProperties(Lnet/minecraft/util/registry/DynamicRegistryManager;Ljava/util/Properties;)Lnet/minecraft/world/gen/GeneratorOptions;", at = @At("HEAD"), cancellable = true)
private static void fromProperties(DynamicRegistryManager dynamicRegistryManager, Properties properties, CallbackInfoReturnable<GeneratorOptions> cir) {
if(properties.get("level-type") == null) {
return;

View File

@@ -1,16 +0,0 @@
{
"mappings": {
"com/dfsek/terra/fabric/mixin/GeneratorTypeAccessor": {
"VALUES": "field_25052:Ljava/util/List;",
"translationKey": "field_25060:Lnet/minecraft/class_2561;"
}
},
"data": {
"named:intermediary": {
"com/dfsek/terra/fabric/mixin/GeneratorTypeAccessor": {
"VALUES": "field_25052:Ljava/util/List;",
"translationKey": "field_25060:Lnet/minecraft/class_2561;"
}
}
}
}

View File

@@ -4,6 +4,7 @@
"package": "com.dfsek.terra.fabric.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": [
"MixinGeneratorOptions"
],
"client": [
"GeneratorTypeAccessor"