manually create terra-refmap.json because loom is dumb

This commit is contained in:
dfsek
2021-03-06 22:26:13 -07:00
11 changed files with 72 additions and 49 deletions

View File

@@ -2,6 +2,7 @@ package com.dfsek.terra.bukkit.generator;
import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.platform.world.Chunk;
import com.dfsek.terra.api.platform.world.generator.GeneratorWrapper;
import com.dfsek.terra.api.world.generation.TerraBlockPopulator;
import com.dfsek.terra.api.world.generation.TerraChunkGenerator;
import com.dfsek.terra.bukkit.population.PopulationManager;
@@ -29,7 +30,7 @@ import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;
public class BukkitChunkGeneratorWrapper extends ChunkGenerator implements com.dfsek.terra.api.platform.world.generator.ChunkGenerator {
public class BukkitChunkGeneratorWrapper extends ChunkGenerator implements GeneratorWrapper {
private static final Map<com.dfsek.terra.api.platform.world.World, PopulationManager> popMap = new HashMap<>();

View File

@@ -3,44 +3,30 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.fabricmc.loom.LoomGradleExtension
import net.fabricmc.loom.task.RemapJarTask
buildscript {
repositories {
mavenCentral()
maven {
name = "Fabric"
url = uri("https://maven.fabricmc.net/")
}
}
dependencies {
classpath("net.fabricmc:fabric-loom:0.6-SNAPSHOT")
}
plugins {
`java-library`
id("fabric-loom").version("0.6-SNAPSHOT")
}
apply(plugin = "fabric-loom")
apply(plugin = "java-library")
configureCommon()
val mixinVersion = "0.8.1+build.21"
val loomVersion = "0.6-SNAPSHOT"
tasks.named<ShadowJar>("shadowJar") {
relocate("org.json", "com.dfsek.terra.lib.json")
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
}
group = "com.dfsek.terra.fabric"
dependencies {
"shadedApi"(project(":common"))
"shadedImplementation"("org.yaml:snakeyaml:1.27")
"shadedImplementation"("com.googlecode.json-simple:json-simple:1.1.1")
// To change the versions see the gradle.properties file
"minecraft"("com.mojang:minecraft:1.16.5")
"mappings"("net.fabricmc:yarn:1.16.5+build.5:v2")
"modImplementation"("net.fabricmc:fabric-loader:0.11.2")
// Fabric API. This is technically optional, but you probably want it anyway.
"modImplementation"("net.fabricmc.fabric-api:fabric-api:0.31.0+1.16")
"compileOnly"("net.fabricmc:sponge-mixin:${mixinVersion}")
"annotationProcessor"("net.fabricmc:sponge-mixin:${mixinVersion}")
"annotationProcessor"("net.fabricmc:fabric-loom:${loomVersion}")
}
tasks.named<ShadowJar>("shadowJar") {

View File

@@ -0,0 +1 @@
org.gradle.jvmargs=-Xmx4G

View File

@@ -1,6 +1,8 @@
package com.dfsek.terra.fabric.world.generator;
import com.dfsek.terra.api.platform.world.generator.GeneratorWrapper;
import com.dfsek.terra.api.util.FastRandom;
import com.dfsek.terra.api.world.generation.TerraChunkGenerator;
import com.dfsek.terra.config.pack.ConfigPack;
import com.dfsek.terra.fabric.TerraFabricPlugin;
import com.dfsek.terra.fabric.world.TerraBiomeSource;
@@ -30,7 +32,7 @@ import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.chunk.StructuresConfig;
import net.minecraft.world.gen.chunk.VerticalBlockSample;
public class FabricChunkGeneratorWrapper extends ChunkGenerator implements com.dfsek.terra.api.platform.world.generator.ChunkGenerator {
public class FabricChunkGeneratorWrapper extends ChunkGenerator implements GeneratorWrapper {
private final long seed;
private final DefaultChunkGenerator3D delegate;
private final TerraBiomeSource biomeSource;
@@ -85,10 +87,6 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements com.d
this.seed = seed;
}
@Override
public DefaultChunkGenerator3D getHandle() {
return delegate;
}
@Override
protected Codec<? extends ChunkGenerator> getCodec() {
@@ -149,4 +147,9 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements com.d
return new VerticalBlockSample(array);
}
@Override
public TerraChunkGenerator getHandle() {
return delegate;
}
}

View File

@@ -0,0 +1,16 @@
{
"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

@@ -11,5 +11,6 @@
"server": [],
"injectors": {
"defaultRequire": 1
}
},
"refmap": "terra-refmap.json"
}