feat: true classic worldgen
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
Timo Ley 2022-10-23 15:09:57 +02:00
parent d46b131574
commit c78649ca89
25 changed files with 1358 additions and 8 deletions

View file

@ -1,5 +1,13 @@
# Classic Worldgen
Classic Worldgen is a 1.7.10 mod aiming to bring back 1.6 worldgen.
It currently only brings back 1.6 cavegen ("swiss cheese cavegen")
but more is planned.
Features:
- classic cavegen
- classic worldgen layers
- classic extreme hills
- no snow on mountains
- no 1.7 biomes
- no 1.7 plants
- all configurable
Requires Mixinbooter Legacy

View file

@ -17,8 +17,12 @@ buildscript {
}
apply plugin: 'forge'
apply plugin: 'maven-publish'
version = "1.0"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
version = "1.1.0"
group= "dev.tilera.modding"
archivesBaseName = "cwg"
@ -41,9 +45,8 @@ repositories {
}
dependencies {
// Mixins currently not needed, maybe later when changing other worldgen
// compile "com.github.tox1cozZ:mixin-booter-legacy:1.1.2"
// annotationProcessor "com.github.tox1cozZ:mixin-booter-legacy:1.1.2:processor"
compile "com.github.tox1cozZ:mixin-booter-legacy:1.1.2"
annotationProcessor "com.github.tox1cozZ:mixin-booter-legacy:1.1.2:processor"
}
processResources
@ -62,6 +65,15 @@ processResources
}
}
jar {
manifest {
attributes([
"FMLCorePlugin" : "dev.tilera.cwg.core.CWGCorePlugin",
"FMLCorePluginContainsFMLMod": "true"
])
}
}
sourceSets {
main {
java {
@ -71,4 +83,42 @@ sourceSets {
srcDir 'src/main/resources'
}
}
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
publishing {
tasks.publish.dependsOn 'build'
publications {
mavenJava(MavenPublication) {
artifactId = project.archivesBaseName
artifact deobfJar
artifact sourcesJar
artifact jar
}
}
repositories {
if (project.hasProperty('mvnURL')) {
maven {
credentials {
username findProperty("mvnUsername")
password findProperty("mvnPassword")
}
url = findProperty("mvnURL")
}
}
else {
mavenLocal()
}
}
}

View file

@ -3,6 +3,7 @@ package dev.tilera.cwg;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import dev.tilera.cwg.caves.MapGenCavesSwiss;
import net.minecraftforge.common.MinecraftForge;
@ -14,16 +15,21 @@ public class ClassicWorldgen {
@Mod.Instance
public static ClassicWorldgen INSTANCE;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
Config.initConfig();
}
@EventHandler
public void init(FMLInitializationEvent event)
{
MinecraftForge.TERRAIN_GEN_BUS.register(this);
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
public void onInitMapGen(InitMapGenEvent event) {
if (event.type == InitMapGenEvent.EventType.CAVE) {
if (event.type == InitMapGenEvent.EventType.CAVE && Config.enableSwissCheeseCaves) {
event.newGen = new MapGenCavesSwiss();
}
}

View file

@ -0,0 +1,38 @@
package dev.tilera.cwg;
import java.io.File;
import cpw.mods.fml.common.Loader;
import net.minecraftforge.common.config.Configuration;
public class Config {
static Configuration conf;
public static boolean enableJungleMelons = false;
public static boolean enableHeightSnow = false;
public static boolean classicExtremeHills = true;
public static boolean enableDoublePlants = false;
public static boolean enableNewFlowers = false;
public static boolean enableSwissCheeseCaves = true;
public static boolean classicWorldGen = true;
public static boolean blockNewVanillaBiomes = true;
public static boolean addNewVanillaBiomes = false;
public static boolean respectBiomeWeight = false;
public static void initConfig() {
conf = new Configuration(new File(Loader.instance().getConfigDir(), "ClassicWorldgen.cfg"));
conf.load();
enableJungleMelons = conf.getBoolean("enableJungleMelons", "plants", enableJungleMelons, "Enable melons generating in jungle biomes");
enableHeightSnow = conf.getBoolean("enableHeightSnow", "hills", enableHeightSnow, "Enable snow on mountains");
classicExtremeHills = conf.getBoolean("classicExtremeHills", "hills", classicExtremeHills, "Enable classic extreme hills (grass instread of stone of top)");
enableDoublePlants = conf.getBoolean("enableDoublePlants", "plants", enableDoublePlants, "Enable double plants");
enableNewFlowers = conf.getBoolean("enableNewFlowers", "plants", enableNewFlowers, "Enable new 1.7 flowers");
enableSwissCheeseCaves = conf.getBoolean("enableSwissCheeseCaves", "caves", enableSwissCheeseCaves, "Enable classic cavegen");
classicWorldGen = conf.getBoolean("classicWorldGen", "worldgen", classicWorldGen, "Enable the classic genlayer stack");
blockNewVanillaBiomes = conf.getBoolean("blockNewVanillaBiomes", "worldgen", blockNewVanillaBiomes, "prevent new 1.7 vanilla biomes from generating with classicWorldGen");
addNewVanillaBiomes = conf.getBoolean("addNewVanillaBiomes", "worldgen", addNewVanillaBiomes, "generate new 1.7 vanilla biomes with classicWorldGen");
respectBiomeWeight = conf.getBoolean("respectBiomeWeight", "worldgen", respectBiomeWeight, "respect the biome weight with classicWorldGen");
conf.save();
}
}

View file

@ -0,0 +1,60 @@
package dev.tilera.cwg.core;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import cpw.mods.fml.common.DummyModContainer;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.Name;
import io.github.tox1cozz.mixinbooterlegacy.IEarlyMixinLoader;
@Name("CWG Core Plugin")
public class CWGCorePlugin implements IFMLLoadingPlugin, IEarlyMixinLoader {
@Override
public List<String> getMixinConfigs() {
List<String> mixins = new ArrayList<>();
mixins.add("cwg.mixins.json");
return mixins;
}
@Override
public String[] getASMTransformerClass() {
return new String[0];
}
@Override
public String getAccessTransformerClass() {
return null;
}
@Override
public String getModContainerClass() {
return "dev.tilera.cwg.core.CWGCorePlugin$Container";
}
@Override
public String getSetupClass() {
return null;
}
@Override
public void injectData(Map<String, Object> arg0) {
}
public static class Container extends DummyModContainer {
public Container() {
super(new ModMetadata());
ModMetadata meta = getMetadata();
meta.modId = "cwgcore";
meta.name = "CWG Core Plugin";
meta.version = "1.0.0";
}
}
}

View file

@ -0,0 +1,75 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerAddIslandClassic extends GenLayer {
public GenLayerAddIslandClassic(long arg0, GenLayer parent) {
super(arg0);
super.parent = parent;
}
public int[] getInts(int var1, int var2, int var3, int var4) {
int var5 = var1 - 1;
int var6 = var2 - 1;
int var7 = var3 + 2;
int var8 = var4 + 2;
int[] var9 = this.parent.getInts(var5, var6, var7, var8);
int[] var10 = IntCache.getIntCache(var3 * var4);
for(int var11 = 0; var11 < var4; ++var11) {
for(int var12 = 0; var12 < var3; ++var12) {
int var13 = var9[var12 + 0 + (var11 + 0) * var7];
int var14 = var9[var12 + 2 + (var11 + 0) * var7];
int var15 = var9[var12 + 0 + (var11 + 2) * var7];
int var16 = var9[var12 + 2 + (var11 + 2) * var7];
int var17 = var9[var12 + 1 + (var11 + 1) * var7];
this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2));
if (var17 == 0 && (var13 != 0 || var14 != 0 || var15 != 0 || var16 != 0)) {
int var18 = 1;
int var19 = 1;
if (var13 != 0 && this.nextInt(var18++) == 0) {
var19 = var13;
}
if (var14 != 0 && this.nextInt(var18++) == 0) {
var19 = var14;
}
if (var15 != 0 && this.nextInt(var18++) == 0) {
var19 = var15;
}
if (var16 != 0 && this.nextInt(var18++) == 0) {
var19 = var16;
}
if (this.nextInt(3) == 0) {
var10[var12 + var11 * var3] = var19;
} else if (var19 == BiomeGenBase.icePlains.biomeID) {
var10[var12 + var11 * var3] = BiomeGenBase.frozenOcean.biomeID;
} else {
var10[var12 + var11 * var3] = 0;
}
} else if (var17 > 0 && (var13 == 0 || var14 == 0 || var15 == 0 || var16 == 0)) {
if (this.nextInt(5) == 0) {
if (var17 == BiomeGenBase.icePlains.biomeID) {
var10[var12 + var11 * var3] = BiomeGenBase.frozenOcean.biomeID;
} else {
var10[var12 + var11 * var3] = 0;
}
} else {
var10[var12 + var11 * var3] = var17;
}
} else {
var10[var12 + var11 * var3] = var17;
}
}
}
return var10;
}
}

View file

@ -0,0 +1,42 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerAddSnowClassic extends GenLayer {
public GenLayerAddSnowClassic(long p_i2121_1_, GenLayer p_i2121_3_) {
super(p_i2121_1_);
this.parent = p_i2121_3_;
}
public int[] getInts(int var1, int var2, int var3, int var4) {
int var5 = var1 - 1;
int var6 = var2 - 1;
int var7 = var3 + 2;
int var8 = var4 + 2;
int[] var9 = this.parent.getInts(var5, var6, var7, var8);
int[] var10 = IntCache.getIntCache(var3 * var4);
for(int var11 = 0; var11 < var4; ++var11) {
for(int var12 = 0; var12 < var3; ++var12) {
int var13 = var9[var12 + 1 + (var11 + 1) * var7];
this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2));
if (var13 == 0) {
var10[var12 + var11 * var3] = 0;
} else {
int var14 = this.nextInt(5);
if (var14 == 0) {
var14 = BiomeGenBase.icePlains.biomeID;
} else {
var14 = 1;
}
var10[var12 + var11 * var3] = var14;
}
}
}
return var10;
}
}

View file

@ -0,0 +1,107 @@
package dev.tilera.cwg.genlayer;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import com.google.common.collect.ImmutableList;
import dev.tilera.cwg.Config;
import net.minecraft.util.WeightedRandom;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.common.BiomeManager.BiomeEntry;
import net.minecraftforge.common.BiomeManager.BiomeType;
public class GenLayerBiomeClassic extends GenLayer {
private BiomeEntry[] allowedBiomes;
public GenLayerBiomeClassic(long arg0, GenLayer parent, WorldType type) {
super(arg0);
super.parent = parent;
BiomeGenBase[] vanillaBiomes = new BiomeGenBase[]{BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.coldTaiga, BiomeGenBase.jungle};
Set<BiomeGenBase> addedBiomes = new HashSet<>();
ArrayList<BiomeEntry> biomeEntries = new ArrayList<>();
for (BiomeGenBase b : vanillaBiomes) {
addedBiomes.add(b);
biomeEntries.add(new BiomeEntry(b, 10));
}
if (Config.addNewVanillaBiomes) {
biomeEntries.add(new BiomeEntry(BiomeGenBase.birchForest, 10));
addedBiomes.add(BiomeGenBase.birchForest);
biomeEntries.add(new BiomeEntry(BiomeGenBase.taiga, 10));
addedBiomes.add(BiomeGenBase.taiga);
biomeEntries.add(new BiomeEntry(BiomeGenBase.roofedForest, 10));
addedBiomes.add(BiomeGenBase.roofedForest);
biomeEntries.add(new BiomeEntry(BiomeGenBase.mesa, 10));
addedBiomes.add(BiomeGenBase.mesa);
biomeEntries.add(new BiomeEntry(BiomeGenBase.mesaPlateau, 10));
addedBiomes.add(BiomeGenBase.mesaPlateau);
biomeEntries.add(new BiomeEntry(BiomeGenBase.savanna, 10));
addedBiomes.add(BiomeGenBase.savanna);
biomeEntries.add(new BiomeEntry(BiomeGenBase.savannaPlateau, 10));
addedBiomes.add(BiomeGenBase.savannaPlateau);
}
for (BiomeType t : BiomeType.values()) {
ImmutableList<BiomeEntry> biomesToAdd = BiomeManager.getBiomes(t);
for (BiomeEntry biome : biomesToAdd) {
if ((biome.biome.biomeID < 40 && Config.blockNewVanillaBiomes) || addedBiomes.contains(biome.biome)) continue;
addedBiomes.add(biome.biome);
biomeEntries.add(biome);
}
}
allowedBiomes = biomeEntries.toArray(new BiomeEntry[biomeEntries.size()]);
}
@Override
public int[] getInts(int par1, int par2, int par3, int par4) {
int[] aint = this.parent.getInts(par1, par2, par3, par4);
int[] aint1 = IntCache.getIntCache(par3 * par4);
for(int i1 = 0; i1 < par4; ++i1) {
for(int j1 = 0; j1 < par3; ++j1) {
this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2));
int k1 = aint[j1 + i1 * par3];
if (k1 == 0) {
aint1[j1 + i1 * par3] = 0;
} else if (k1 == BiomeGenBase.mushroomIsland.biomeID) {
aint1[j1 + i1 * par3] = k1;
} else if (k1 == 1) {
aint1[j1 + i1 * par3] = getBiomeID();
} else {
int l1 = getBiomeID();
if (l1 == BiomeGenBase.taiga.biomeID) {
aint1[j1 + i1 * par3] = l1;
} else {
aint1[j1 + i1 * par3] = BiomeGenBase.icePlains.biomeID;
}
}
}
}
return aint1;
}
protected int getBiomeID() {
if (Config.respectBiomeWeight) {
return getWeightedBiomeEntry().biome.biomeID;
} else {
return this.allowedBiomes[this.nextInt(this.allowedBiomes.length)].biome.biomeID;
}
}
protected BiomeEntry getWeightedBiomeEntry() {
int totalWeight = WeightedRandom.getTotalWeight(allowedBiomes);
int weight = this.nextInt(totalWeight);
return (BiomeEntry)WeightedRandom.getItem(allowedBiomes, weight);
}
}

View file

@ -0,0 +1,64 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerFuzzyZoomClassic extends GenLayer {
public GenLayerFuzzyZoomClassic(long p_i2123_1_, GenLayer p_i2123_3_) {
super(p_i2123_1_);
super.parent = p_i2123_3_;
}
public int[] getInts(int var1, int var2, int var3, int var4) {
int var5 = var1 >> 1;
int var6 = var2 >> 1;
int var7 = (var3 >> 1) + 3;
int var8 = (var4 >> 1) + 3;
int[] var9 = this.parent.getInts(var5, var6, var7, var8);
int[] var10 = IntCache.getIntCache(var7 * 2 * var8 * 2);
int var11 = var7 << 1;
int var13;
for(int var12 = 0; var12 < var8 - 1; ++var12) {
var13 = var12 << 1;
int var14 = var13 * var11;
int var15 = var9[0 + (var12 + 0) * var7];
int var16 = var9[0 + (var12 + 1) * var7];
for(int var17 = 0; var17 < var7 - 1; ++var17) {
this.initChunkSeed((long)(var17 + var5 << 1), (long)(var12 + var6 << 1));
int var18 = var9[var17 + 1 + (var12 + 0) * var7];
int var19 = var9[var17 + 1 + (var12 + 1) * var7];
var10[var14] = var15;
var10[var14++ + var11] = this.choose(var15, var16);
var10[var14] = this.choose(var15, var18);
var10[var14++ + var11] = this.choose(var15, var18, var16, var19);
var15 = var18;
var16 = var19;
}
}
int[] var20 = IntCache.getIntCache(var3 * var4);
for(var13 = 0; var13 < var4; ++var13) {
System.arraycopy(var10, (var13 + (var2 & 1)) * (var7 << 1) + (var1 & 1), var20, var13 * var3, var3);
}
return var20;
}
protected int choose(int var1, int var2) {
return this.nextInt(2) == 0 ? var1 : var2;
}
protected int choose(int var1, int var2, int var3, int var4) {
int var5 = this.nextInt(4);
if (var5 == 0) {
return var1;
} else if (var5 == 1) {
return var2;
} else {
return var5 == 2 ? var3 : var4;
}
}
}

View file

@ -0,0 +1,58 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerHillsClassic extends GenLayer {
public GenLayerHillsClassic(long p_i2126_1_, GenLayer p_i2126_3_) {
super(p_i2126_1_);
this.parent = p_i2126_3_;
}
public int[] getInts(int var1, int var2, int var3, int var4) {
int[] var5 = this.parent.getInts(var1 - 1, var2 - 1, var3 + 2, var4 + 2);
int[] var6 = IntCache.getIntCache(var3 * var4);
for(int var7 = 0; var7 < var4; ++var7) {
for(int var8 = 0; var8 < var3; ++var8) {
this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2));
int var9 = var5[var8 + 1 + (var7 + 1) * (var3 + 2)];
if (this.nextInt(3) == 0) {
int var10 = var9;
if (var9 == BiomeGenBase.desert.biomeID) {
var10 = BiomeGenBase.desertHills.biomeID;
} else if (var9 == BiomeGenBase.forest.biomeID) {
var10 = BiomeGenBase.forestHills.biomeID;
} else if (var9 == BiomeGenBase.taiga.biomeID) {
var10 = BiomeGenBase.taigaHills.biomeID;
} else if (var9 == BiomeGenBase.plains.biomeID) {
var10 = BiomeGenBase.forest.biomeID;
} else if (var9 == BiomeGenBase.icePlains.biomeID) {
var10 = BiomeGenBase.iceMountains.biomeID;
} else if (var9 == BiomeGenBase.jungle.biomeID) {
var10 = BiomeGenBase.jungleHills.biomeID;
}
if (var10 == var9) {
var6[var8 + var7 * var3] = var9;
} else {
int var11 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)];
int var12 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)];
int var13 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)];
int var14 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)];
if (var11 == var9 && var12 == var9 && var13 == var9 && var14 == var9) {
var6[var8 + var7 * var3] = var10;
} else {
var6[var8 + var7 * var3] = var9;
}
}
} else {
var6[var8 + var7 * var3] = var9;
}
}
}
return var6;
}
}

View file

@ -0,0 +1,38 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerRiverClassic extends GenLayer {
public GenLayerRiverClassic(long p_i2128_1_, GenLayer p_i2128_3_) {
super(p_i2128_1_);
super.parent = p_i2128_3_;
}
public int[] getInts(int var1, int var2, int var3, int var4) {
int var5 = var1 - 1;
int var6 = var2 - 1;
int var7 = var3 + 2;
int var8 = var4 + 2;
int[] var9 = this.parent.getInts(var5, var6, var7, var8);
int[] var10 = IntCache.getIntCache(var3 * var4);
for(int var11 = 0; var11 < var4; ++var11) {
for(int var12 = 0; var12 < var3; ++var12) {
int var13 = var9[var12 + 0 + (var11 + 1) * var7];
int var14 = var9[var12 + 2 + (var11 + 1) * var7];
int var15 = var9[var12 + 1 + (var11 + 0) * var7];
int var16 = var9[var12 + 1 + (var11 + 2) * var7];
int var17 = var9[var12 + 1 + (var11 + 1) * var7];
if (var17 != 0 && var13 != 0 && var14 != 0 && var15 != 0 && var16 != 0 && var17 == var13 && var17 == var15 && var17 == var14 && var17 == var16) {
var10[var12 + var11 * var3] = -1;
} else {
var10[var12 + var11 * var3] = BiomeGenBase.river.biomeID;
}
}
}
return var10;
}
}

View file

@ -0,0 +1,25 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerRiverInitClassic extends GenLayer {
public GenLayerRiverInitClassic(long p_i2127_1_, GenLayer p_i2127_3_) {
super(p_i2127_1_);
this.parent = p_i2127_3_;
}
public int[] getInts(int var1, int var2, int var3, int var4) {
int[] var5 = this.parent.getInts(var1, var2, var3, var4);
int[] var6 = IntCache.getIntCache(var3 * var4);
for(int var7 = 0; var7 < var4; ++var7) {
for(int var8 = 0; var8 < var3; ++var8) {
this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2));
var6[var8 + var7 * var3] = var5[var8 + var7 * var3] > 0 ? this.nextInt(2) + 2 : 0;
}
}
return var6;
}
}

View file

@ -0,0 +1,46 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerRiverMixClassic extends GenLayer {
private GenLayer biomePatternGeneratorChain;
private GenLayer riverPatternGeneratorChain;
public GenLayerRiverMixClassic(long p_i2129_1_, GenLayer p_i2129_3_, GenLayer p_i2129_4_) {
super(p_i2129_1_);
this.biomePatternGeneratorChain = p_i2129_3_;
this.riverPatternGeneratorChain = p_i2129_4_;
}
public void initWorldGenSeed(long var1) {
this.biomePatternGeneratorChain.initWorldGenSeed(var1);
this.riverPatternGeneratorChain.initWorldGenSeed(var1);
super.initWorldGenSeed(var1);
}
public int[] getInts(int var1, int var2, int var3, int var4) {
int[] var5 = this.biomePatternGeneratorChain.getInts(var1, var2, var3, var4);
int[] var6 = this.riverPatternGeneratorChain.getInts(var1, var2, var3, var4);
int[] var7 = IntCache.getIntCache(var3 * var4);
for(int var8 = 0; var8 < var3 * var4; ++var8) {
if (var5[var8] == BiomeGenBase.ocean.biomeID) {
var7[var8] = var5[var8];
} else if (var6[var8] >= 0) {
if (var5[var8] == BiomeGenBase.icePlains.biomeID) {
var7[var8] = BiomeGenBase.frozenRiver.biomeID;
} else if (var5[var8] != BiomeGenBase.mushroomIsland.biomeID && var5[var8] != BiomeGenBase.mushroomIslandShore.biomeID) {
var7[var8] = var6[var8];
} else {
var7[var8] = BiomeGenBase.mushroomIslandShore.biomeID;
}
} else {
var7[var8] = var5[var8];
}
}
return var7;
}
}

View file

@ -0,0 +1,63 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerShoreClassic extends GenLayer {
public GenLayerShoreClassic(long p_i2130_1_, GenLayer p_i2130_3_) {
super(p_i2130_1_);
this.parent = p_i2130_3_;
}
public int[] getInts(int var1, int var2, int var3, int var4) {
int[] var5 = this.parent.getInts(var1 - 1, var2 - 1, var3 + 2, var4 + 2);
int[] var6 = IntCache.getIntCache(var3 * var4);
for(int var7 = 0; var7 < var4; ++var7) {
for(int var8 = 0; var8 < var3; ++var8) {
this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2));
int var9 = var5[var8 + 1 + (var7 + 1) * (var3 + 2)];
int var10;
int var11;
int var12;
int var13;
if (var9 == BiomeGenBase.mushroomIsland.biomeID) {
var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)];
var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)];
var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)];
var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)];
if (var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) {
var6[var8 + var7 * var3] = var9;
} else {
var6[var8 + var7 * var3] = BiomeGenBase.mushroomIslandShore.biomeID;
}
} else if (var9 != BiomeGenBase.ocean.biomeID && var9 != BiomeGenBase.river.biomeID && var9 != BiomeGenBase.swampland.biomeID && var9 != BiomeGenBase.extremeHills.biomeID) {
var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)];
var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)];
var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)];
var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)];
if (var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) {
var6[var8 + var7 * var3] = var9;
} else {
var6[var8 + var7 * var3] = BiomeGenBase.beach.biomeID;
}
} else if (var9 == BiomeGenBase.extremeHills.biomeID) {
var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)];
var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)];
var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)];
var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)];
if (var10 == BiomeGenBase.extremeHills.biomeID && var11 == BiomeGenBase.extremeHills.biomeID && var12 == BiomeGenBase.extremeHills.biomeID && var13 == BiomeGenBase.extremeHills.biomeID) {
var6[var8 + var7 * var3] = var9;
} else {
var6[var8 + var7 * var3] = BiomeGenBase.extremeHillsEdge.biomeID;
}
} else {
var6[var8 + var7 * var3] = var9;
}
}
}
return var6;
}
}

View file

@ -0,0 +1,31 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerSwampRivers extends GenLayer {
public GenLayerSwampRivers(long p_i2132_1_, GenLayer p_i2132_3_) {
super(p_i2132_1_);
this.parent = p_i2132_3_;
}
public int[] getInts(int var1, int var2, int var3, int var4) {
int[] var5 = this.parent.getInts(var1 - 1, var2 - 1, var3 + 2, var4 + 2);
int[] var6 = IntCache.getIntCache(var3 * var4);
for(int var7 = 0; var7 < var4; ++var7) {
for(int var8 = 0; var8 < var3; ++var8) {
this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2));
int var9 = var5[var8 + 1 + (var7 + 1) * (var3 + 2)];
if ((var9 != BiomeGenBase.swampland.biomeID || this.nextInt(6) != 0) && (var9 != BiomeGenBase.jungle.biomeID && var9 != BiomeGenBase.jungleHills.biomeID || this.nextInt(8) != 0)) {
var6[var8 + var7 * var3] = var9;
} else {
var6[var8 + var7 * var3] = BiomeGenBase.river.biomeID;
}
}
}
return var6;
}
}

View file

@ -0,0 +1,81 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerVoronoiZoomClassic extends GenLayer {
public GenLayerVoronoiZoomClassic(long p_i2133_1_, GenLayer p_i2133_3_) {
super(p_i2133_1_);
super.parent = p_i2133_3_;
}
public int[] getInts(int var1, int var2, int var3, int var4) {
var1 -= 2;
var2 -= 2;
byte var5 = 2;
int var6 = 1 << var5;
int var7 = var1 >> var5;
int var8 = var2 >> var5;
int var9 = (var3 >> var5) + 3;
int var10 = (var4 >> var5) + 3;
int[] var11 = this.parent.getInts(var7, var8, var9, var10);
int var12 = var9 << var5;
int var13 = var10 << var5;
int[] var14 = IntCache.getIntCache(var12 * var13);
int var16;
for(int var15 = 0; var15 < var10 - 1; ++var15) {
var16 = var11[0 + (var15 + 0) * var9];
int var17 = var11[0 + (var15 + 1) * var9];
for(int var18 = 0; var18 < var9 - 1; ++var18) {
double var19 = (double)var6 * 0.9D;
this.initChunkSeed((long)(var18 + var7 << var5), (long)(var15 + var8 << var5));
double var21 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
double var23 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
this.initChunkSeed((long)(var18 + var7 + 1 << var5), (long)(var15 + var8 << var5));
double var25 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
double var27 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
this.initChunkSeed((long)(var18 + var7 << var5), (long)(var15 + var8 + 1 << var5));
double var29 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
double var31 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
this.initChunkSeed((long)(var18 + var7 + 1 << var5), (long)(var15 + var8 + 1 << var5));
double var33 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
double var35 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
int var37 = var11[var18 + 1 + (var15 + 0) * var9];
int var38 = var11[var18 + 1 + (var15 + 1) * var9];
for(int var39 = 0; var39 < var6; ++var39) {
int var40 = ((var15 << var5) + var39) * var12 + (var18 << var5);
for(int var41 = 0; var41 < var6; ++var41) {
double var42 = ((double)var39 - var23) * ((double)var39 - var23) + ((double)var41 - var21) * ((double)var41 - var21);
double var44 = ((double)var39 - var27) * ((double)var39 - var27) + ((double)var41 - var25) * ((double)var41 - var25);
double var46 = ((double)var39 - var31) * ((double)var39 - var31) + ((double)var41 - var29) * ((double)var41 - var29);
double var48 = ((double)var39 - var35) * ((double)var39 - var35) + ((double)var41 - var33) * ((double)var41 - var33);
if (var42 < var44 && var42 < var46 && var42 < var48) {
var14[var40++] = var16;
} else if (var44 < var42 && var44 < var46 && var44 < var48) {
var14[var40++] = var37;
} else if (var46 < var42 && var46 < var44 && var46 < var48) {
var14[var40++] = var17;
} else {
var14[var40++] = var38;
}
}
}
var16 = var37;
var17 = var38;
}
}
int[] var50 = IntCache.getIntCache(var3 * var4);
for(var16 = 0; var16 < var4; ++var16) {
System.arraycopy(var14, (var16 + (var2 & var6 - 1)) * (var9 << var5) + (var1 & var6 - 1), var50, var16 * var3, var3);
}
return var50;
}
}

View file

@ -0,0 +1,108 @@
package dev.tilera.cwg.genlayer;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerZoomClassic extends GenLayer {
public GenLayerZoomClassic(long p_i2134_1_, GenLayer p_i2134_3_) {
super(p_i2134_1_);
super.parent = p_i2134_3_;
}
public int[] getInts(int var1, int var2, int var3, int var4) {
int var5 = var1 >> 1;
int var6 = var2 >> 1;
int var7 = (var3 >> 1) + 3;
int var8 = (var4 >> 1) + 3;
int[] var9 = this.parent.getInts(var5, var6, var7, var8);
int[] var10 = IntCache.getIntCache(var7 * 2 * var8 * 2);
int var11 = var7 << 1;
int var13;
for(int var12 = 0; var12 < var8 - 1; ++var12) {
var13 = var12 << 1;
int var14 = var13 * var11;
int var15 = var9[0 + (var12 + 0) * var7];
int var16 = var9[0 + (var12 + 1) * var7];
for(int var17 = 0; var17 < var7 - 1; ++var17) {
this.initChunkSeed((long)(var17 + var5 << 1), (long)(var12 + var6 << 1));
int var18 = var9[var17 + 1 + (var12 + 0) * var7];
int var19 = var9[var17 + 1 + (var12 + 1) * var7];
var10[var14] = var15;
var10[var14++ + var11] = this.choose(var15, var16);
var10[var14] = this.choose(var15, var18);
var10[var14++ + var11] = this.modeOrRandom(var15, var18, var16, var19);
var15 = var18;
var16 = var19;
}
}
int[] var20 = IntCache.getIntCache(var3 * var4);
for(var13 = 0; var13 < var4; ++var13) {
System.arraycopy(var10, (var13 + (var2 & 1)) * (var7 << 1) + (var1 & 1), var20, var13 * var3, var3);
}
return var20;
}
protected int choose(int var1, int var2) {
return this.nextInt(2) == 0 ? var1 : var2;
}
protected int modeOrRandom(int var1, int var2, int var3, int var4) {
if (var2 == var3 && var3 == var4) {
return var2;
} else if (var1 == var2 && var1 == var3) {
return var1;
} else if (var1 == var2 && var1 == var4) {
return var1;
} else if (var1 == var3 && var1 == var4) {
return var1;
} else if (var1 == var2 && var3 != var4) {
return var1;
} else if (var1 == var3 && var2 != var4) {
return var1;
} else if (var1 == var4 && var2 != var3) {
return var1;
} else if (var2 == var1 && var3 != var4) {
return var2;
} else if (var2 == var3 && var1 != var4) {
return var2;
} else if (var2 == var4 && var1 != var3) {
return var2;
} else if (var3 == var1 && var2 != var4) {
return var3;
} else if (var3 == var2 && var1 != var4) {
return var3;
} else if (var3 == var4 && var1 != var2) {
return var3;
} else if (var4 == var1 && var2 != var3) {
return var3;
} else if (var4 == var2 && var1 != var3) {
return var3;
} else if (var4 == var3 && var1 != var2) {
return var3;
} else {
int var5 = this.nextInt(4);
if (var5 == 0) {
return var1;
} else if (var5 == 1) {
return var2;
} else {
return var5 == 2 ? var3 : var4;
}
}
}
public static GenLayer magnify(long var0, GenLayer var2, int var3) {
Object var4 = var2;
for(int var5 = 0; var5 < var3; ++var5) {
var4 = new GenLayerZoomClassic(var0 + (long)var5, (GenLayer)var4);
}
return (GenLayer)var4;
}
}

View file

@ -0,0 +1,35 @@
package dev.tilera.cwg.mixins;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import dev.tilera.cwg.Config;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.NoiseGeneratorPerlin;
@Mixin(BiomeGenBase.class)
public abstract class MixinBiomeGenBase {
@Shadow
public float temperature;
@Shadow
@Final
protected static NoiseGeneratorPerlin temperatureNoise;
/**
* @author tilera
* @reason No snow on hills
*/
@Overwrite(remap = false)
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;
return this.temperature - (f + (float)p_150564_2_ - 64.0F) * 0.05F / 30.0F;
} else {
return this.temperature;
}
}
}

View file

@ -0,0 +1,70 @@
package dev.tilera.cwg.mixins;
import java.util.Random;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import dev.tilera.cwg.Config;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenHills;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenTaiga2;
@Mixin(BiomeGenHills.class)
public abstract class MixinBiomeGenHills extends BiomeGenBase {
@Shadow(remap = false)
private WorldGenTaiga2 field_150634_aD;
@Shadow(remap = false)
private int field_150636_aF;
@Shadow(remap = false)
private int field_150637_aG;
@Shadow(remap = false)
private int field_150638_aH;
public MixinBiomeGenHills(int arg0) {
super(arg0);
}
/**
* @author tilera
* @reason old tree generation
*/
@Overwrite(remap = false)
public WorldGenAbstractTree func_150567_a(Random p_150567_1_) {
if (Config.classicExtremeHills)
return super.func_150567_a(p_150567_1_);
else
return (WorldGenAbstractTree)(p_150567_1_.nextInt(3) > 0 ? this.field_150634_aD : super.func_150567_a(p_150567_1_));
}
/**
* @author tilera
* @reason old terrain generation
*/
@Overwrite(remap = false)
public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) {
if (Config.classicExtremeHills) {
super.genTerrainBlocks(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_);
} else {
this.topBlock = Blocks.grass;
this.field_150604_aj = 0;
this.fillerBlock = Blocks.dirt;
if ((p_150573_7_ < -1.0D || p_150573_7_ > 2.0D) && this.field_150638_aH == this.field_150637_aG) {
this.topBlock = Blocks.gravel;
this.fillerBlock = Blocks.gravel;
} else if (p_150573_7_ > 1.0D && this.field_150638_aH != this.field_150636_aF) {
this.topBlock = Blocks.stone;
this.fillerBlock = Blocks.stone;
}
this.genBiomeTerrain(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_);
}
}
}

View file

@ -0,0 +1,49 @@
package dev.tilera.cwg.mixins;
import java.util.Random;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import dev.tilera.cwg.Config;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenJungle;
import net.minecraft.world.gen.feature.WorldGenMelon;
import net.minecraft.world.gen.feature.WorldGenVines;
@Mixin(BiomeGenJungle.class)
public abstract class MixinBiomeGenJungle extends BiomeGenBase {
public MixinBiomeGenJungle(int arg0) {
super(arg0);
}
/**
* @author tilera
* @reason Remove melons
*/
@Overwrite(remap = false)
public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) {
super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_);
int k = p_76728_3_ + p_76728_2_.nextInt(16) + 8;
int l = p_76728_4_ + p_76728_2_.nextInt(16) + 8;
int height = p_76728_1_.getHeightValue(k, l) * 2;
if (height < 1) {
height = 1;
}
int i1 = p_76728_2_.nextInt(height);
if (Config.enableJungleMelons)
(new WorldGenMelon()).generate(p_76728_1_, p_76728_2_, k, i1, l);
WorldGenVines worldgenvines = new WorldGenVines();
for(l = 0; l < 50; ++l) {
i1 = p_76728_3_ + p_76728_2_.nextInt(16) + 8;
short short1 = 128;
int j1 = p_76728_4_ + p_76728_2_.nextInt(16) + 8;
worldgenvines.generate(p_76728_1_, p_76728_2_, i1, short1, j1);
}
}
}

View file

@ -0,0 +1,42 @@
package dev.tilera.cwg.mixins;
import java.util.Random;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import dev.tilera.cwg.Config;
import net.minecraft.block.BlockFlower;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenPlains;
@Mixin(BiomeGenPlains.class)
public abstract class MixinBiomeGenPlains extends BiomeGenBase {
public MixinBiomeGenPlains(int arg0) {
super(arg0);
}
/**
* @author tilera
* @reason disable new flowers
*/
@Overwrite(remap = false)
public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) {
if (Config.enableNewFlowers) {
double d0 = plantNoise.func_151601_a((double)p_150572_2_ / 200.0D, (double)p_150572_4_ / 200.0D);
int l;
if (d0 < -0.8D) {
l = p_150572_1_.nextInt(4);
return BlockFlower.field_149859_a[4 + l];
} else if (p_150572_1_.nextInt(3) > 0) {
l = p_150572_1_.nextInt(3);
return l == 0 ? BlockFlower.field_149859_a[0] : (l == 1 ? BlockFlower.field_149859_a[3] : BlockFlower.field_149859_a[8]);
} else {
return BlockFlower.field_149858_b[0];
}
}
return super.func_150572_a(p_150572_1_, p_150572_2_, p_150572_3_, p_150572_4_);
}
}

View file

@ -0,0 +1,32 @@
package dev.tilera.cwg.mixins;
import java.util.Random;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import dev.tilera.cwg.Config;
import net.minecraft.block.BlockFlower;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenSwamp;
@Mixin(BiomeGenSwamp.class)
public abstract class MixinBiomeGenSwamp extends BiomeGenBase {
public MixinBiomeGenSwamp(int arg0) {
super(arg0);
}
/**
* @author tilera
* @reason disable new flowers
*/
@Overwrite(remap = false)
public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) {
if (Config.enableNewFlowers) {
return BlockFlower.field_149859_a[1];
}
return super.func_150572_a(p_150572_1_, p_150572_2_, p_150572_3_, p_150572_4_);
}
}

View file

@ -0,0 +1,44 @@
package dev.tilera.cwg.mixins;
import java.util.Random;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import dev.tilera.cwg.Config;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenDoublePlant;
import net.minecraft.world.gen.feature.WorldGenerator;
@Mixin(WorldGenDoublePlant.class)
public abstract class MixinGenDoublePlant extends WorldGenerator{
@Shadow(remap = false)
private int field_150549_a;
/**
* @author tilera
* @reason disable doule plants
*/
@Overwrite(remap = false)
public boolean generate(World p_generate_1_, Random p_generate_2_, int p_generate_3_, int p_generate_4_, int p_generate_5_) {
boolean var6 = false;
if (Config.enableDoublePlants) {
for(int var7 = 0; var7 < 64; ++var7) {
int var8 = p_generate_3_ + p_generate_2_.nextInt(8) - p_generate_2_.nextInt(8);
int var9 = p_generate_4_ + p_generate_2_.nextInt(4) - p_generate_2_.nextInt(4);
int var10 = p_generate_5_ + p_generate_2_.nextInt(8) - p_generate_2_.nextInt(8);
if (p_generate_1_.isAirBlock(var8, var9, var10) && (!p_generate_1_.provider.hasNoSky || var9 < 254) && Blocks.double_plant.canPlaceBlockAt(p_generate_1_, var8, var9, var10)) {
Blocks.double_plant.func_149889_c(p_generate_1_, var8, var9, var10, this.field_150549_a, 2);
var6 = true;
}
}
}
return var6;
}
}

View file

@ -0,0 +1,161 @@
package dev.tilera.cwg.mixins;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import dev.tilera.cwg.Config;
import dev.tilera.cwg.genlayer.GenLayerAddIslandClassic;
import dev.tilera.cwg.genlayer.GenLayerAddSnowClassic;
import dev.tilera.cwg.genlayer.GenLayerBiomeClassic;
import dev.tilera.cwg.genlayer.GenLayerFuzzyZoomClassic;
import dev.tilera.cwg.genlayer.GenLayerHillsClassic;
import dev.tilera.cwg.genlayer.GenLayerRiverClassic;
import dev.tilera.cwg.genlayer.GenLayerRiverInitClassic;
import dev.tilera.cwg.genlayer.GenLayerRiverMixClassic;
import dev.tilera.cwg.genlayer.GenLayerShoreClassic;
import dev.tilera.cwg.genlayer.GenLayerSwampRivers;
import dev.tilera.cwg.genlayer.GenLayerVoronoiZoomClassic;
import dev.tilera.cwg.genlayer.GenLayerZoomClassic;
import net.minecraft.world.WorldType;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.GenLayerAddIsland;
import net.minecraft.world.gen.layer.GenLayerAddMushroomIsland;
import net.minecraft.world.gen.layer.GenLayerAddSnow;
import net.minecraft.world.gen.layer.GenLayerDeepOcean;
import net.minecraft.world.gen.layer.GenLayerEdge;
import net.minecraft.world.gen.layer.GenLayerFuzzyZoom;
import net.minecraft.world.gen.layer.GenLayerHills;
import net.minecraft.world.gen.layer.GenLayerIsland;
import net.minecraft.world.gen.layer.GenLayerRareBiome;
import net.minecraft.world.gen.layer.GenLayerRemoveTooMuchOcean;
import net.minecraft.world.gen.layer.GenLayerRiver;
import net.minecraft.world.gen.layer.GenLayerRiverInit;
import net.minecraft.world.gen.layer.GenLayerRiverMix;
import net.minecraft.world.gen.layer.GenLayerShore;
import net.minecraft.world.gen.layer.GenLayerSmooth;
import net.minecraft.world.gen.layer.GenLayerVoronoiZoom;
import net.minecraft.world.gen.layer.GenLayerZoom;
import net.minecraft.world.gen.layer.GenLayerEdge.Mode;
@Mixin(GenLayer.class)
public abstract class MixinGenLayer {
/**
* @author tilera
* @reason legacy gen layers
*/
@Overwrite
public static GenLayer[] initializeAllBiomeGenerators(long p_75901_0_, WorldType p_75901_2_) {
if (Config.classicWorldGen) {
GenLayerIsland genlayerisland = new GenLayerIsland(1L);
GenLayerFuzzyZoomClassic genlayerfuzzyzoom = new GenLayerFuzzyZoomClassic(2000L, genlayerisland);
GenLayerAddIslandClassic genlayeraddisland = new GenLayerAddIslandClassic(1L, genlayerfuzzyzoom);
GenLayerZoomClassic genlayerzoom = new GenLayerZoomClassic(2001L, genlayeraddisland);
genlayeraddisland = new GenLayerAddIslandClassic(2L, genlayerzoom);
GenLayerAddSnowClassic genlayeraddsnow = new GenLayerAddSnowClassic(2L, genlayeraddisland);
genlayerzoom = new GenLayerZoomClassic(2002L, genlayeraddsnow);
genlayeraddisland = new GenLayerAddIslandClassic(3L, genlayerzoom);
genlayerzoom = new GenLayerZoomClassic(2003L, genlayeraddisland);
genlayeraddisland = new GenLayerAddIslandClassic(4L, genlayerzoom);
GenLayerAddMushroomIsland genlayeraddmushroomisland = new GenLayerAddMushroomIsland(5L, genlayeraddisland);
byte b0 = 4;
if (p_75901_2_ == WorldType.LARGE_BIOMES) {
b0 = 6;
}
b0 = GenLayer.getModdedBiomeSize(p_75901_2_, b0);
GenLayer genlayer = GenLayerZoomClassic.magnify(1000L, genlayeraddmushroomisland, 0);
GenLayerRiverInitClassic genlayerriverinit = new GenLayerRiverInitClassic(100L, genlayer);
genlayer = GenLayerZoomClassic.magnify(1000L, genlayerriverinit, b0 + 2);
GenLayerRiverClassic genlayerriver = new GenLayerRiverClassic(1L, genlayer);
GenLayerSmooth genlayersmooth = new GenLayerSmooth(1000L, genlayerriver);
GenLayer genlayer1 = GenLayerZoomClassic.magnify(1000L, genlayeraddmushroomisland, 0);
GenLayerBiomeClassic genlayerbiome = new GenLayerBiomeClassic(200L, genlayer1, p_75901_2_);
genlayer1 = GenLayerZoomClassic.magnify(1000L, genlayerbiome, 2);
GenLayer object = new GenLayerHillsClassic(1000L, genlayer1);
for(int j = 0; j < b0; ++j) {
object = new GenLayerZoomClassic((long)(1000 + j), object);
if (j == 0) {
object = new GenLayerAddIslandClassic(3L, object);
}
if (j == 1) {
object = new GenLayerShoreClassic(1000L, object);
}
if (j == 1) {
object = new GenLayerSwampRivers(1000L, object);
}
}
GenLayerSmooth genlayersmooth1 = new GenLayerSmooth(1000L, (GenLayer)object);
GenLayerRiverMixClassic genlayerrivermix = new GenLayerRiverMixClassic(100L, genlayersmooth1, genlayersmooth);
GenLayerVoronoiZoomClassic genlayervoronoizoom = new GenLayerVoronoiZoomClassic(10L, genlayerrivermix);
genlayerrivermix.initWorldGenSeed(p_75901_0_);
genlayervoronoizoom.initWorldGenSeed(p_75901_0_);
return new GenLayer[]{genlayerrivermix, genlayervoronoizoom, genlayerrivermix};
} else {
boolean flag = false;
GenLayerIsland genlayerisland = new GenLayerIsland(1L);
GenLayerFuzzyZoom genlayerfuzzyzoom = new GenLayerFuzzyZoom(2000L, genlayerisland);
GenLayerAddIsland genlayeraddisland = new GenLayerAddIsland(1L, genlayerfuzzyzoom);
GenLayerZoom genlayerzoom = new GenLayerZoom(2001L, genlayeraddisland);
genlayeraddisland = new GenLayerAddIsland(2L, genlayerzoom);
genlayeraddisland = new GenLayerAddIsland(50L, genlayeraddisland);
genlayeraddisland = new GenLayerAddIsland(70L, genlayeraddisland);
GenLayerRemoveTooMuchOcean genlayerremovetoomuchocean = new GenLayerRemoveTooMuchOcean(2L, genlayeraddisland);
GenLayerAddSnow genlayeraddsnow = new GenLayerAddSnow(2L, genlayerremovetoomuchocean);
genlayeraddisland = new GenLayerAddIsland(3L, genlayeraddsnow);
GenLayerEdge genlayeredge = new GenLayerEdge(2L, genlayeraddisland, Mode.COOL_WARM);
genlayeredge = new GenLayerEdge(2L, genlayeredge, Mode.HEAT_ICE);
genlayeredge = new GenLayerEdge(3L, genlayeredge, Mode.SPECIAL);
genlayerzoom = new GenLayerZoom(2002L, genlayeredge);
genlayerzoom = new GenLayerZoom(2003L, genlayerzoom);
genlayeraddisland = new GenLayerAddIsland(4L, genlayerzoom);
GenLayerAddMushroomIsland genlayeraddmushroomisland = new GenLayerAddMushroomIsland(5L, genlayeraddisland);
GenLayerDeepOcean genlayerdeepocean = new GenLayerDeepOcean(4L, genlayeraddmushroomisland);
GenLayer genlayer2 = GenLayerZoom.magnify(1000L, genlayerdeepocean, 0);
byte b0 = 4;
if (p_75901_2_ == WorldType.LARGE_BIOMES) {
b0 = 6;
}
if (flag) {
b0 = 4;
}
b0 = GenLayer.getModdedBiomeSize(p_75901_2_, b0);
GenLayer genlayer = GenLayerZoom.magnify(1000L, genlayer2, 0);
GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, genlayer);
Object object = p_75901_2_.getBiomeLayer(p_75901_0_, genlayer2);
GenLayer genlayer1 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2);
GenLayerHills genlayerhills = new GenLayerHills(1000L, (GenLayer)object, genlayer1);
genlayer = GenLayerZoom.magnify(1000L, genlayerriverinit, 2);
genlayer = GenLayerZoom.magnify(1000L, genlayer, b0);
GenLayerRiver genlayerriver = new GenLayerRiver(1L, genlayer);
GenLayerSmooth genlayersmooth = new GenLayerSmooth(1000L, genlayerriver);
object = new GenLayerRareBiome(1001L, genlayerhills);
for(int j = 0; j < b0; ++j) {
object = new GenLayerZoom((long)(1000 + j), (GenLayer)object);
if (j == 0) {
object = new GenLayerAddIsland(3L, (GenLayer)object);
}
if (j == 1) {
object = new GenLayerShore(1000L, (GenLayer)object);
}
}
GenLayerSmooth genlayersmooth1 = new GenLayerSmooth(1000L, (GenLayer)object);
GenLayerRiverMix genlayerrivermix = new GenLayerRiverMix(100L, genlayersmooth1, genlayersmooth);
GenLayerVoronoiZoom genlayervoronoizoom = new GenLayerVoronoiZoom(10L, genlayerrivermix);
genlayerrivermix.initWorldGenSeed(p_75901_0_);
genlayervoronoizoom.initWorldGenSeed(p_75901_0_);
return new GenLayer[]{genlayerrivermix, genlayervoronoizoom, genlayerrivermix};
}
}
}

View file

@ -0,0 +1,17 @@
{
"package": "dev.tilera.cwg.mixins",
"refmap": "cwg.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": [
"MixinGenLayer",
"MixinBiomeGenBase",
"MixinBiomeGenJungle",
"MixinBiomeGenHills",
"MixinBiomeGenPlains",
"MixinBiomeGenSwamp",
"MixinGenDoublePlant"],
"injectors": {
"defaultRequire": 1
}
}