feat: WorldType instead of config
This commit is contained in:
parent
eeb40c3080
commit
8a5cb94ded
19 changed files with 194 additions and 218 deletions
|
@ -2,12 +2,7 @@
|
|||
|
||||
Classic Worldgen is a 1.7.10 mod aiming to bring back 1.6 worldgen.
|
||||
Features:
|
||||
- classic cavegen
|
||||
- classic worldgen layers
|
||||
- classic extreme hills
|
||||
- no snow on mountains
|
||||
- no 1.7 biomes
|
||||
- no 1.7 plants
|
||||
- all configurable
|
||||
- classic cavegen (configurable)
|
||||
- 1.6 worldgen WorldType
|
||||
|
||||
Requires Mixinbooter Legacy
|
24
build.gradle
24
build.gradle
|
@ -3,16 +3,17 @@ buildscript {
|
|||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "https://files.minecraftforge.net/maven"
|
||||
url = "https://maven.minecraftforge.net/"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.9'
|
||||
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') {
|
||||
changing = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,13 +24,15 @@ apply from: './gradle/scripts/mixins.gradle'
|
|||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
version = "1.1.1"
|
||||
version = "1.2.0"
|
||||
group= "dev.tilera.modding"
|
||||
archivesBaseName = "cwg"
|
||||
|
||||
minecraft {
|
||||
version = "1.7.10-10.13.4.1614-1.7.10"
|
||||
runDir = "run"
|
||||
replaceIn "dev/tilera/cwg/Constants.java"
|
||||
replace "{VERSION}", project.version
|
||||
}
|
||||
|
||||
|
||||
|
@ -46,24 +49,17 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compile "com.github.tox1cozZ:mixin-booter-legacy:1.1.2"
|
||||
implementation "com.github.tox1cozZ:mixin-booter-legacy:1.1.2"
|
||||
annotationProcessor "com.github.tox1cozZ:mixin-booter-legacy:1.1.2:processor"
|
||||
}
|
||||
|
||||
processResources
|
||||
{
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
filesMatching('mcmod.info') {
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
}
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
|
|
|
@ -4,14 +4,20 @@ 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.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import dev.tilera.cwg.caves.MapGenCavesSwiss;
|
||||
import dev.tilera.cwg.command.CommandChangeWorld;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.terraingen.InitMapGenEvent;
|
||||
|
||||
@Mod(modid = Constants.ID, name = Constants.NAME, version = Constants.VERSION)
|
||||
public class ClassicWorldgen {
|
||||
|
||||
public static final WorldType CLASSIC = new WorldTypeClassic("onesix");
|
||||
public static WorldType USED = null;
|
||||
|
||||
@Mod.Instance
|
||||
public static ClassicWorldgen INSTANCE;
|
||||
|
||||
|
@ -29,9 +35,16 @@ public class ClassicWorldgen {
|
|||
|
||||
@SubscribeEvent
|
||||
public void onInitMapGen(InitMapGenEvent event) {
|
||||
if (event.type == InitMapGenEvent.EventType.CAVE && Config.enableSwissCheeseCaves) {
|
||||
if (event.type == InitMapGenEvent.EventType.CAVE && (Config.enableSwissCheeseCaves || USED == CLASSIC)) {
|
||||
event.newGen = new MapGenCavesSwiss();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onServerLoad(FMLServerStartingEvent event) {
|
||||
USED = event.getServer().getEntityWorld().getWorldInfo().getTerrainType();
|
||||
if (Config.changeWorldTypeCommand)
|
||||
event.registerServerCommand(new CommandChangeWorld());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,30 +8,18 @@ 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 enableSwissCheeseCaves = false;
|
||||
public static boolean blockNewVanillaBiomes = true;
|
||||
public static boolean addNewVanillaBiomes = false;
|
||||
public static boolean respectBiomeWeight = false;
|
||||
public static boolean changeWorldTypeCommand = 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");
|
||||
enableSwissCheeseCaves = conf.getBoolean("enableSwissCheeseCaves", "caves", enableSwissCheeseCaves, "enable classic (1.6) cavegen");
|
||||
blockNewVanillaBiomes = conf.getBoolean("blockNewVanillaBiomes", "worldgen", blockNewVanillaBiomes, "prevent new 1.7 vanilla biomes from generating with classic/1.6 WorldType");
|
||||
addNewVanillaBiomes = conf.getBoolean("addNewVanillaBiomes", "worldgen", addNewVanillaBiomes, "generate new 1.7 vanilla biomes with classic/1.6 WorldType");
|
||||
changeWorldTypeCommand = conf.getBoolean("changeTypeCommand", "commands", changeWorldTypeCommand, "enable command to change the WorldType");
|
||||
conf.save();
|
||||
}
|
||||
|
||||
|
|
|
@ -3,5 +3,5 @@ package dev.tilera.cwg;
|
|||
public class Constants {
|
||||
public static final String ID = "cwg";
|
||||
public static final String NAME = "Classic Worldgen";
|
||||
public static final String VERSION = "1.0.0";
|
||||
public static final String VERSION = "{VERSION}";
|
||||
}
|
||||
|
|
86
src/main/java/dev/tilera/cwg/WorldChunkManagerClassic.java
Normal file
86
src/main/java/dev/tilera/cwg/WorldChunkManagerClassic.java
Normal file
|
@ -0,0 +1,86 @@
|
|||
package dev.tilera.cwg;
|
||||
|
||||
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 cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.biome.WorldChunkManager;
|
||||
import net.minecraft.world.gen.layer.GenLayer;
|
||||
import net.minecraft.world.gen.layer.GenLayerAddMushroomIsland;
|
||||
import net.minecraft.world.gen.layer.GenLayerIsland;
|
||||
import net.minecraft.world.gen.layer.GenLayerSmooth;
|
||||
|
||||
public class WorldChunkManagerClassic extends WorldChunkManager {
|
||||
|
||||
public WorldChunkManagerClassic(World world) {
|
||||
super();
|
||||
GenLayer[] agenlayer = initializeAllBiomeGenerators(world.getSeed(), world.getWorldInfo().getTerrainType());
|
||||
agenlayer = getModdedBiomeGenerators(world.getWorldInfo().getTerrainType(), world.getSeed(), agenlayer);
|
||||
ObfuscationReflectionHelper.setPrivateValue(WorldChunkManager.class, this, agenlayer[0], "genBiomes", "field_76944_d");
|
||||
ObfuscationReflectionHelper.setPrivateValue(WorldChunkManager.class, this, agenlayer[1], "biomeIndexLayer", "field_76945_e");
|
||||
}
|
||||
|
||||
public static GenLayer[] initializeAllBiomeGenerators(long p_75901_0_, WorldType p_75901_2_) {
|
||||
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};
|
||||
}
|
||||
|
||||
}
|
18
src/main/java/dev/tilera/cwg/WorldTypeClassic.java
Normal file
18
src/main/java/dev/tilera/cwg/WorldTypeClassic.java
Normal file
|
@ -0,0 +1,18 @@
|
|||
package dev.tilera.cwg;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.biome.WorldChunkManager;
|
||||
|
||||
public class WorldTypeClassic extends WorldType {
|
||||
|
||||
public WorldTypeClassic(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldChunkManager getChunkManager(World world) {
|
||||
return new WorldChunkManagerClassic(world);
|
||||
}
|
||||
|
||||
}
|
37
src/main/java/dev/tilera/cwg/command/CommandChangeWorld.java
Normal file
37
src/main/java/dev/tilera/cwg/command/CommandChangeWorld.java
Normal file
|
@ -0,0 +1,37 @@
|
|||
package dev.tilera.cwg.command;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
|
||||
public class CommandChangeWorld extends CommandBase {
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "cwg";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender arg0) {
|
||||
return "Change WorldType of current world";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender arg0, String[] arg1) {
|
||||
if (arg1.length == 1) {
|
||||
WorldType newType = WorldType.parseWorldType(arg1[0]);
|
||||
if (newType != null) {
|
||||
WorldInfo info = arg0.getEntityWorld().getWorldInfo();
|
||||
info.setTerrainType(newType);
|
||||
arg0.getEntityWorld().getSaveHandler().saveWorldInfo(info);
|
||||
} else {
|
||||
arg0.addChatMessage(new ChatComponentText(arg1[0] + " is not a valid WorldType"));
|
||||
}
|
||||
} else {
|
||||
arg0.addChatMessage(new ChatComponentText("You must pass a WorldType to use this command"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -8,6 +8,7 @@ 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 dev.tilera.cwg.Constants;
|
||||
import io.github.tox1cozz.mixinbooterlegacy.IEarlyMixinLoader;
|
||||
|
||||
@Name("CWG Core Plugin")
|
||||
|
@ -52,7 +53,7 @@ public class CWGCorePlugin implements IFMLLoadingPlugin, IEarlyMixinLoader {
|
|||
ModMetadata meta = getMetadata();
|
||||
meta.modId = "cwgcore";
|
||||
meta.name = "CWG Core Plugin";
|
||||
meta.version = "1.0.0";
|
||||
meta.version = Constants.VERSION;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,10 +19,12 @@ import net.minecraftforge.common.BiomeManager.BiomeType;
|
|||
public class GenLayerBiomeClassic extends GenLayer {
|
||||
|
||||
private BiomeEntry[] allowedBiomes;
|
||||
private boolean hasBiomeWeights;
|
||||
|
||||
public GenLayerBiomeClassic(long arg0, GenLayer parent, WorldType type) {
|
||||
super(arg0);
|
||||
super.parent = parent;
|
||||
hasBiomeWeights = false;
|
||||
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<>();
|
||||
|
@ -57,6 +59,7 @@ public class GenLayerBiomeClassic extends GenLayer {
|
|||
if ((biome.biome.biomeID < 40 && Config.blockNewVanillaBiomes) || addedBiomes.contains(biome.biome)) continue;
|
||||
addedBiomes.add(biome.biome);
|
||||
biomeEntries.add(biome);
|
||||
if (biome.itemWeight != 10) hasBiomeWeights = true;
|
||||
}
|
||||
}
|
||||
allowedBiomes = biomeEntries.toArray(new BiomeEntry[biomeEntries.size()]);
|
||||
|
@ -93,7 +96,7 @@ public class GenLayerBiomeClassic extends GenLayer {
|
|||
}
|
||||
|
||||
protected int getBiomeID() {
|
||||
if (Config.respectBiomeWeight) {
|
||||
if (hasBiomeWeights) {
|
||||
return getWeightedBiomeEntry().biome.biomeID;
|
||||
} else {
|
||||
return this.allowedBiomes[this.nextInt(this.allowedBiomes.length)].biome.biomeID;
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import dev.tilera.cwg.Config;
|
||||
import dev.tilera.cwg.ClassicWorldgen;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.gen.NoiseGeneratorPerlin;
|
||||
|
||||
|
@ -24,7 +24,7 @@ public abstract class MixinBiomeGenBase {
|
|||
*/
|
||||
@Overwrite
|
||||
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 && ClassicWorldgen.USED != ClassicWorldgen.CLASSIC) {
|
||||
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 {
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import dev.tilera.cwg.Config;
|
||||
import dev.tilera.cwg.ClassicWorldgen;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -37,7 +37,7 @@ public abstract class MixinBiomeGenHills extends BiomeGenBase {
|
|||
*/
|
||||
@Overwrite(remap = false)
|
||||
public WorldGenAbstractTree func_150567_a(Random p_150567_1_) {
|
||||
if (Config.classicExtremeHills)
|
||||
if (ClassicWorldgen.USED == ClassicWorldgen.CLASSIC)
|
||||
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_));
|
||||
|
@ -49,7 +49,7 @@ public abstract class MixinBiomeGenHills extends BiomeGenBase {
|
|||
*/
|
||||
@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) {
|
||||
if (p_150573_1_.getWorldInfo().getTerrainType() == ClassicWorldgen.CLASSIC) {
|
||||
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;
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Random;
|
|||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import dev.tilera.cwg.Config;
|
||||
import dev.tilera.cwg.ClassicWorldgen;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.BiomeGenJungle;
|
||||
|
@ -34,7 +34,7 @@ public abstract class MixinBiomeGenJungle extends BiomeGenBase {
|
|||
}
|
||||
|
||||
int i1 = p_76728_2_.nextInt(height);
|
||||
if (Config.enableJungleMelons)
|
||||
if (p_76728_1_.getWorldInfo().getTerrainType() != ClassicWorldgen.CLASSIC)
|
||||
(new WorldGenMelon()).generate(p_76728_1_, p_76728_2_, k, i1, l);
|
||||
WorldGenVines worldgenvines = new WorldGenVines();
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Random;
|
|||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import dev.tilera.cwg.Config;
|
||||
import dev.tilera.cwg.ClassicWorldgen;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.BiomeGenPlains;
|
||||
|
@ -23,7 +23,7 @@ public abstract class MixinBiomeGenPlains extends BiomeGenBase {
|
|||
*/
|
||||
@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) {
|
||||
if (ClassicWorldgen.USED != ClassicWorldgen.CLASSIC) {
|
||||
double d0 = plantNoise.func_151601_a((double)p_150572_2_ / 200.0D, (double)p_150572_4_ / 200.0D);
|
||||
int l;
|
||||
if (d0 < -0.8D) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Random;
|
|||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import dev.tilera.cwg.Config;
|
||||
import dev.tilera.cwg.ClassicWorldgen;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.BiomeGenSwamp;
|
||||
|
@ -23,7 +23,7 @@ public abstract class MixinBiomeGenSwamp extends BiomeGenBase {
|
|||
*/
|
||||
@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) {
|
||||
if (ClassicWorldgen.USED != ClassicWorldgen.CLASSIC) {
|
||||
return BlockFlower.field_149859_a[1];
|
||||
}
|
||||
return super.func_150572_a(p_150572_1_, p_150572_2_, p_150572_3_, p_150572_4_);
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import dev.tilera.cwg.Config;
|
||||
import dev.tilera.cwg.ClassicWorldgen;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenDoublePlant;
|
||||
|
@ -26,7 +26,7 @@ public abstract class MixinGenDoublePlant extends WorldGenerator{
|
|||
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) {
|
||||
if (p_generate_1_.getWorldInfo().getTerrainType() != ClassicWorldgen.CLASSIC) {
|
||||
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);
|
||||
|
|
|
@ -1,161 +0,0 @@
|
|||
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};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
1
src/main/resources/assets/cwg/lang/en_US.lang
Normal file
1
src/main/resources/assets/cwg/lang/en_US.lang
Normal file
|
@ -0,0 +1 @@
|
|||
generator.onesix=Classic (1.6)
|
|
@ -4,7 +4,6 @@
|
|||
"minVersion": "0.8",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"mixins": [
|
||||
"MixinGenLayer",
|
||||
"MixinBiomeGenBase",
|
||||
"MixinBiomeGenJungle",
|
||||
"MixinBiomeGenHills",
|
||||
|
|
Loading…
Reference in a new issue