fix: mixin issues
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing

This commit is contained in:
Timo Ley 2022-10-23 21:28:14 +02:00
parent c78649ca89
commit 044dde3451
4 changed files with 86 additions and 1 deletions

View file

@ -18,6 +18,7 @@ buildscript {
apply plugin: 'forge'
apply plugin: 'maven-publish'
apply from: './gradle/scripts/mixins.gradle'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@ -121,4 +122,8 @@ publishing {
mavenLocal()
}
}
}
mixin {
mixinRefMapName = 'cwg.refmap.json'
}

View file

@ -0,0 +1,78 @@
abstract class MixinTask extends DefaultTask {
@Input
abstract Property<String> getMixinRefMapName()
private File mixinSrg
private File mixinRefMap
MixinTask() {
mixinRefMapName.convention("mixin.${project.name.replaceAll('[_\\-.]', '').toLowerCase()}.refmap.json")
}
@TaskAction
void action() {
def mixinDir = new File(project.buildDir, 'mixins')
if (!mixinDir.exists()) {
mixinDir.mkdirs()
}
def srgFile = new File(project.buildDir, 'srgs/mcp-srg.srg')
mixinSrg = new File(mixinDir, "${mixinRefMapName.get()}.srg")
mixinRefMap = new File(mixinDir, mixinRefMapName.get())
if (!mixinSrg.exists()) {
mixinSrg.createNewFile()
}
project.tasks.reobf.configure {
addExtraSrgFile mixinSrg
}
def compileJava = project.tasks.compileJava
compileJava.configure {
options.compilerArgs += [
'-Xlint:-processing',
"-AoutSrgFile=${mixinSrg.canonicalPath}",
"-AoutRefMapFile=${mixinRefMap.canonicalPath}",
"-AreobfSrgFile=${srgFile.canonicalPath}"
]
}
project.tasks.jar.configure {
from mixinRefMap
}
}
@Internal
File getMixinSrg() {
return mixinSrg
}
@Internal
File getMixinRefMap() {
return mixinRefMap
}
}
tasks.register('mixin', MixinTask)
task copySrgs(type: Copy, dependsOn: 'genSrgs') {
from plugins.getPlugin('forge').delayedFile('{SRG_DIR}')
include '**/*.srg'
into layout.buildDirectory.file('srgs')
}
compileJava.dependsOn(copySrgs, mixin)
tasks.findByPath(":prepareKotlinBuildScriptModel")?.dependsOn(copySrgs, mixin)
processResources {
afterEvaluate {
def refmap = tasks.mixin.mixinRefMapName.get()
inputs.property 'mixin_refmap', refmap
from(sourceSets.main.resources.srcDirs) {
include '*.json'
expand 'mixin_refmap': refmap
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
}
}

View file

@ -47,6 +47,8 @@ public class GenLayerBiomeClassic extends GenLayer {
addedBiomes.add(BiomeGenBase.savanna);
biomeEntries.add(new BiomeEntry(BiomeGenBase.savannaPlateau, 10));
addedBiomes.add(BiomeGenBase.savannaPlateau);
biomeEntries.add(new BiomeEntry(BiomeGenBase.megaTaiga, 10));
addedBiomes.add(BiomeGenBase.megaTaiga);
}
for (BiomeType t : BiomeType.values()) {

View file

@ -22,7 +22,7 @@ public abstract class MixinBiomeGenBase {
* @author tilera
* @reason No snow on hills
*/
@Overwrite(remap = false)
@Overwrite
public final float getFloatTemperature(int p_150564_1_, int p_150564_2_, int p_150564_3_) {
if (p_150564_2_ > 64 && Config.enableHeightSnow) {
float f = (float)temperatureNoise.func_151601_a((double)p_150564_1_ * 1.0D / 8.0D, (double)p_150564_3_ * 1.0D / 8.0D) * 4.0F;