fix: mixin issues
This commit is contained in:
parent
c78649ca89
commit
044dde3451
|
@ -18,6 +18,7 @@ buildscript {
|
||||||
|
|
||||||
apply plugin: 'forge'
|
apply plugin: 'forge'
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
apply from: './gradle/scripts/mixins.gradle'
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
@ -121,4 +122,8 @@ publishing {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin {
|
||||||
|
mixinRefMapName = 'cwg.refmap.json'
|
||||||
}
|
}
|
78
gradle/scripts/mixins.gradle
Normal file
78
gradle/scripts/mixins.gradle
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -47,6 +47,8 @@ public class GenLayerBiomeClassic extends GenLayer {
|
||||||
addedBiomes.add(BiomeGenBase.savanna);
|
addedBiomes.add(BiomeGenBase.savanna);
|
||||||
biomeEntries.add(new BiomeEntry(BiomeGenBase.savannaPlateau, 10));
|
biomeEntries.add(new BiomeEntry(BiomeGenBase.savannaPlateau, 10));
|
||||||
addedBiomes.add(BiomeGenBase.savannaPlateau);
|
addedBiomes.add(BiomeGenBase.savannaPlateau);
|
||||||
|
biomeEntries.add(new BiomeEntry(BiomeGenBase.megaTaiga, 10));
|
||||||
|
addedBiomes.add(BiomeGenBase.megaTaiga);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (BiomeType t : BiomeType.values()) {
|
for (BiomeType t : BiomeType.values()) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ public abstract class MixinBiomeGenBase {
|
||||||
* @author tilera
|
* @author tilera
|
||||||
* @reason No snow on hills
|
* @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_) {
|
public final float getFloatTemperature(int p_150564_1_, int p_150564_2_, int p_150564_3_) {
|
||||||
if (p_150564_2_ > 64 && Config.enableHeightSnow) {
|
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;
|
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;
|
||||||
|
|
Loading…
Reference in a new issue