mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
Merge pull request #151 from DJtheRedstoner/patch-mixin-ap
Fix mixin annotation processor issues
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ dependencies {
|
||||
|
||||
configure<LoomGradleExtension> {
|
||||
accessWidener("src/main/resources/terra.accesswidener")
|
||||
refmapName = "terra.refmap.json"
|
||||
}
|
||||
|
||||
val remapped = tasks.register<RemapJarTask>("remapShadedJar") {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
"package": "com.dfsek.terra.fabric.mixin",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"mixins": [
|
||||
"MixinGeneratorOptions"
|
||||
],
|
||||
"client": [
|
||||
"GeneratorTypeAccessor"
|
||||
|
||||
Reference in New Issue
Block a user