├── lib └── guava-17.0.jar ├── seed.sh ├── src ├── minecraft │ ├── biome │ │ ├── BiomeGenEnd.java │ │ ├── BiomeGenBeach.java │ │ ├── BiomeGenHell.java │ │ ├── BiomeGenRiver.java │ │ ├── BiomeGenDesert.java │ │ ├── BiomeGenSwamp.java │ │ ├── BiomeGenStoneBeach.java │ │ ├── BiomeGenJungle.java │ │ ├── BiomeGenMushroomIsland.java │ │ ├── BiomeGenOcean.java │ │ ├── BiomeGenTaiga.java │ │ ├── BiomeGenPlains.java │ │ ├── BiomeGenSnow.java │ │ ├── BiomeGenSavanna.java │ │ ├── BiomeGenMesa.java │ │ ├── BiomeGenHills.java │ │ ├── BiomeGenMutated.java │ │ ├── BiomeGenForest.java │ │ └── BiomeGenBase.java │ └── layer │ │ ├── GenLayerFuzzyZoom.java │ │ ├── GenLayerIsland.java │ │ ├── GenLayerRiverInit.java │ │ ├── GenLayerRareBiome.java │ │ ├── GenLayerRemoveTooMuchOcean.java │ │ ├── GenLayerAddMushroomIsland.java │ │ ├── GenLayerAddSnow.java │ │ ├── GenLayerRiver.java │ │ ├── GenLayerSmooth.java │ │ ├── GenLayerDeepOcean.java │ │ ├── GenLayerZoom.java │ │ ├── GenLayerRiverMix.java │ │ ├── IntCache.java │ │ ├── GenLayerAddIsland.java │ │ ├── GenLayerBiome.java │ │ ├── GenLayerVoronoiZoom.java │ │ ├── GenLayerEdge.java │ │ ├── GenLayerHills.java │ │ ├── GenLayerBiomeEdge.java │ │ ├── GenLayerShore.java │ │ └── GenLayer.java ├── com │ └── scicraft │ │ └── seedfinder │ │ ├── xzPair.java │ │ ├── structure.java │ │ ├── bitIterator.java │ │ ├── biomeGenerator.java │ │ ├── structureHut.java │ │ ├── spawnFinder.java │ │ ├── strongholdFinder.java │ │ ├── structureMonument.java │ │ └── Biome.java ├── QuadHutFinder.java ├── QuadHutMonFinder.java └── HutandMonumentFinder.java └── README.md /lib/guava-17.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egut/SciCraftSeedFinder/HEAD/lib/guava-17.0.jar -------------------------------------------------------------------------------- /seed.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | ant 3 | java -jar dist/seedfinder.jar >> seeds.log & 4 | java -jar dist/seedfinder.jar >> seeds.log & 5 | java -jar dist/seedfinder.jar >> seeds.log & 6 | java -jar dist/seedfinder.jar >> seeds.log & 7 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenEnd.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenEnd extends BiomeGenBase 4 | { 5 | public BiomeGenEnd(int p_i1990_1_) 6 | { 7 | super(p_i1990_1_); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenBeach.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenBeach extends BiomeGenBase 4 | { 5 | public BiomeGenBeach(int p_i1969_1_) 6 | { 7 | super(p_i1969_1_); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenHell.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenHell extends BiomeGenBase 4 | { 5 | public BiomeGenHell(int p_i1981_1_) 6 | { 7 | super(p_i1981_1_); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenRiver.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenRiver extends BiomeGenBase 4 | { 5 | public BiomeGenRiver(int p_i1987_1_) 6 | { 7 | super(p_i1987_1_); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenDesert.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenDesert extends BiomeGenBase 4 | { 5 | public BiomeGenDesert(int p_i1977_1_) 6 | { 7 | super(p_i1977_1_); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenSwamp.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenSwamp extends BiomeGenBase 4 | { 5 | protected BiomeGenSwamp(int p_i1988_1_) 6 | { 7 | super(p_i1988_1_); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenStoneBeach.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenStoneBeach extends BiomeGenBase 4 | { 5 | public BiomeGenStoneBeach(int p_i45384_1_) 6 | { 7 | super(p_i45384_1_); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenJungle.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenJungle extends BiomeGenBase 4 | { 5 | public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_) 6 | { 7 | super(p_i45379_1_); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenMushroomIsland.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenMushroomIsland extends BiomeGenBase 4 | { 5 | public BiomeGenMushroomIsland(int p_i1984_1_) 6 | { 7 | super(p_i1984_1_); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/com/scicraft/seedfinder/xzPair.java: -------------------------------------------------------------------------------- 1 | package com.scicraft.seedfinder; 2 | 3 | public class xzPair { 4 | private int x, z; 5 | public xzPair(int x, int z){ 6 | this.x = x; 7 | this.z = z; 8 | } 9 | 10 | public int getX(){ 11 | return x; 12 | } 13 | 14 | public int getZ(){ 15 | return z; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenOcean.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenOcean extends BiomeGenBase 4 | { 5 | public BiomeGenOcean(int p_i1985_1_) 6 | { 7 | super(p_i1985_1_); 8 | } 9 | 10 | public BiomeGenBase.TempCategory getTempCategory() 11 | { 12 | return BiomeGenBase.TempCategory.OCEAN; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerFuzzyZoom.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | public class GenLayerFuzzyZoom extends GenLayerZoom 4 | { 5 | public GenLayerFuzzyZoom(long p_i2123_1_, GenLayer p_i2123_3_) 6 | { 7 | super(p_i2123_1_, p_i2123_3_); 8 | } 9 | 10 | /** 11 | * returns the most frequently occurring number of the set, or a random number from those provided 12 | */ 13 | protected int selectModeOrRandom(int p_151617_1_, int p_151617_2_, int p_151617_3_, int p_151617_4_) 14 | { 15 | return this.selectRandom(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_}); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenTaiga.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenTaiga extends BiomeGenBase 4 | { 5 | public BiomeGenTaiga(int p_i45385_1_, int p_i45385_2_) 6 | { 7 | super(p_i45385_1_); 8 | } 9 | 10 | protected BiomeGenBase createMutatedBiome(int p_180277_1_) 11 | { 12 | return this.biomeID == BiomeGenBase.megaTaiga.biomeID ? (new BiomeGenTaiga(p_180277_1_, 2)).func_150557_a(5858897, true).setBiomeName("Mega Spruce Taiga").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(new BiomeGenBase.Height(this.minHeight, this.maxHeight)) : super.createMutatedBiome(p_180277_1_); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/com/scicraft/seedfinder/structure.java: -------------------------------------------------------------------------------- 1 | package com.scicraft.seedfinder; 2 | 3 | public abstract class structure { 4 | /* 5 | * generate the xpart of the equation 6 | */ 7 | public long xPart(int x){ 8 | return (long) x * 341873128712L; 9 | } 10 | 11 | /* 12 | * generate the zpart of the equation 13 | */ 14 | public long zPart(int z){ 15 | return (long) z * 132897987541L; 16 | } 17 | 18 | public abstract xzPair structurePosInRegion(long x, long z, long seed); 19 | public abstract xzPair structurePosInRegionFast(long xPart, long zPart, long seed, int lowerThen, int higherThen); 20 | public abstract boolean structureWillSpawn(int xRegion, int zRegion, int xRandom, int zRandom, biomeGenerator generator); 21 | } -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenPlains.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenPlains extends BiomeGenBase 4 | { 5 | protected boolean field_150628_aC; 6 | 7 | protected BiomeGenPlains(int p_i1986_1_) 8 | { 9 | super(p_i1986_1_); 10 | this.setTemperatureRainfall(0.8F, 0.4F); 11 | this.setHeight(height_LowPlains); 12 | } 13 | 14 | protected BiomeGenBase createMutatedBiome(int p_180277_1_) 15 | { 16 | BiomeGenPlains var2 = new BiomeGenPlains(p_180277_1_); 17 | var2.setBiomeName("Sunflower Plains"); 18 | var2.field_150628_aC = true; 19 | var2.setColor(9286496); 20 | var2.field_150609_ah = 14273354; 21 | return var2; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenSnow.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenSnow extends BiomeGenBase 4 | { 5 | public BiomeGenSnow(int p_i45378_1_, boolean p_i45378_2_) 6 | { 7 | super(p_i45378_1_); 8 | } 9 | 10 | protected BiomeGenBase createMutatedBiome(int p_180277_1_) 11 | { 12 | BiomeGenBase var2 = (new BiomeGenSnow(p_180277_1_, true)).func_150557_a(13828095, true).setBiomeName(this.biomeName + " Spikes").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F).setHeight(new BiomeGenBase.Height(this.minHeight + 0.1F, this.maxHeight + 0.1F)); 13 | var2.minHeight = this.minHeight + 0.3F; 14 | var2.maxHeight = this.maxHeight + 0.4F; 15 | return var2; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenSavanna.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenSavanna extends BiomeGenBase 4 | { 5 | protected BiomeGenSavanna(int p_i45383_1_) 6 | { 7 | super(p_i45383_1_); 8 | } 9 | 10 | protected BiomeGenBase createMutatedBiome(int p_180277_1_) 11 | { 12 | BiomeGenSavanna.Mutated var2 = new BiomeGenSavanna.Mutated(p_180277_1_, this); 13 | var2.temperature = (this.temperature + 1.0F) * 0.5F; 14 | var2.minHeight = this.minHeight * 0.5F + 0.3F; 15 | var2.maxHeight = this.maxHeight * 0.5F + 1.2F; 16 | return var2; 17 | } 18 | 19 | public static class Mutated extends BiomeGenMutated 20 | { 21 | public Mutated(int p_i45382_1_, BiomeGenBase p_i45382_2_) 22 | { 23 | super(p_i45382_1_, p_i45382_2_); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/com/scicraft/seedfinder/bitIterator.java: -------------------------------------------------------------------------------- 1 | package com.scicraft.seedfinder; 2 | 3 | public class bitIterator { 4 | private long baseSeed, current; 5 | private long baseEnd = 65536; 6 | 7 | /* 8 | * insert potential seed to do whatever with first 16 bits this class iterates over all of them 9 | * use this class to for example to check biomes 10 | * use this as a normal iterator: while(hasNext()){bitIterator.next()} 11 | */ 12 | public bitIterator(long baseSeed){ 13 | this.baseSeed = baseSeed & 281474976710655L; //magic number check it in binary this removes the first 16 bits 14 | this.current = 0; 15 | } 16 | 17 | public boolean hasNext(){ 18 | return this.current < this.baseEnd; 19 | } 20 | 21 | /* 22 | * return the next modified seed 23 | */ 24 | @SuppressWarnings("null") 25 | public long next(){ 26 | if(hasNext()){ 27 | current++; 28 | return (long)baseSeed ^ ((long)current << 48); 29 | } else 30 | return (Long) null; 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenMesa.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenMesa extends BiomeGenBase 4 | { 5 | private boolean field_150620_aI; 6 | 7 | public BiomeGenMesa(int p_i45380_1_, boolean p_i45380_2_, boolean p_i45380_3_) 8 | { 9 | super(p_i45380_1_); 10 | this.field_150620_aI = p_i45380_3_; 11 | this.setDisableRain(); 12 | this.setTemperatureRainfall(2.0F, 0.0F); 13 | } 14 | 15 | protected BiomeGenBase createMutatedBiome(int p_180277_1_) 16 | { 17 | boolean var2 = this.biomeID == BiomeGenBase.mesa.biomeID; 18 | BiomeGenMesa var3 = new BiomeGenMesa(p_180277_1_, var2, this.field_150620_aI); 19 | 20 | if (!var2) 21 | { 22 | var3.setHeight(height_LowHills); 23 | var3.setBiomeName(this.biomeName + " M"); 24 | } 25 | else 26 | { 27 | var3.setBiomeName(this.biomeName + " (Bryce)"); 28 | } 29 | 30 | var3.func_150557_a(this.color, true); 31 | return var3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerIsland.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | public class GenLayerIsland extends GenLayer 4 | { 5 | public GenLayerIsland(long p_i2124_1_) 6 | { 7 | super(p_i2124_1_); 8 | } 9 | 10 | /** 11 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 12 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 13 | */ 14 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 15 | { 16 | int[] var5 = IntCache.getIntCache(areaWidth * areaHeight); 17 | 18 | for (int var6 = 0; var6 < areaHeight; ++var6) 19 | { 20 | for (int var7 = 0; var7 < areaWidth; ++var7) 21 | { 22 | this.initChunkSeed((long)(areaX + var7), (long)(areaY + var6)); 23 | var5[var7 + var6 * areaWidth] = this.nextInt(10) == 0 ? 1 : 0; 24 | } 25 | } 26 | 27 | if (areaX > -areaWidth && areaX <= 0 && areaY > -areaHeight && areaY <= 0) 28 | { 29 | var5[-areaX + -areaY * areaWidth] = 1; 30 | } 31 | 32 | return var5; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerRiverInit.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | public class GenLayerRiverInit extends GenLayer 4 | { 5 | public GenLayerRiverInit(long p_i2127_1_, GenLayer p_i2127_3_) 6 | { 7 | super(p_i2127_1_); 8 | this.parent = p_i2127_3_; 9 | } 10 | 11 | /** 12 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 13 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 14 | */ 15 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 16 | { 17 | int[] var5 = this.parent.getInts(areaX, areaY, areaWidth, areaHeight); 18 | int[] var6 = IntCache.getIntCache(areaWidth * areaHeight); 19 | 20 | for (int var7 = 0; var7 < areaHeight; ++var7) 21 | { 22 | for (int var8 = 0; var8 < areaWidth; ++var8) 23 | { 24 | this.initChunkSeed((long)(var8 + areaX), (long)(var7 + areaY)); 25 | var6[var8 + var7 * areaWidth] = var5[var8 + var7 * areaWidth] > 0 ? this.nextInt(299999) + 2 : 0; 26 | } 27 | } 28 | 29 | return var6; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/com/scicraft/seedfinder/biomeGenerator.java: -------------------------------------------------------------------------------- 1 | package com.scicraft.seedfinder; 2 | 3 | import minecraft.layer.*; 4 | 5 | public class biomeGenerator { 6 | public GenLayer biomeIndexLayer; 7 | public GenLayer biomeIndexLayerquarter; 8 | public biomeGenerator(long seed, int quarter) 9 | { 10 | if(quarter == 0) 11 | biomeIndexLayer = GenLayer.func_180781_a(seed, "")[1]; //1:1 resolution 12 | else if(quarter == 1) 13 | biomeIndexLayerquarter = GenLayer.func_180781_a(seed, "")[0]; // 1:4 fourth resolution less calculations 14 | else 15 | { 16 | biomeIndexLayer = GenLayer.func_180781_a(seed, null)[1]; 17 | biomeIndexLayerquarter = GenLayer.func_180781_a(seed, "")[0]; // 1:4 fourth resolution less calculations 18 | } 19 | 20 | } 21 | 22 | public int getBiomeAt(int x, int y) 23 | { 24 | IntCache.resetIntCache(); 25 | return biomeIndexLayer.getInts(x, y, 1, 1)[0]; 26 | } 27 | 28 | public int[] getBiomeData(int x, int y, int width, int height, boolean quarter) 29 | { 30 | IntCache.resetIntCache(); 31 | if(quarter) 32 | return biomeIndexLayerquarter.getInts(x, y, width, height); 33 | else 34 | return biomeIndexLayer.getInts(x, y, width, height); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/com/scicraft/seedfinder/structureHut.java: -------------------------------------------------------------------------------- 1 | package com.scicraft.seedfinder; 2 | 3 | import java.util.Random;; 4 | 5 | public class structureHut extends structure{ 6 | private Random rnd = new Random(); 7 | 8 | /* 9 | * return the chunk position in the region of the possible structure 10 | */ 11 | public xzPair structurePosInRegion(long x, long z, long seed){ 12 | rnd.setSeed((long) x * 341873128712L + (long)z * 132897987541L + seed + 14357617); 13 | return new xzPair(rnd.nextInt(24), rnd.nextInt(24)); 14 | } 15 | 16 | /* 17 | * first check if the x pos is valid else return null 18 | */ 19 | public xzPair structurePosInRegionFast(long xPart, long zPart, long seed, int lowerThen, int higherThen){ 20 | rnd.setSeed(xPart + zPart + seed + 14357617); 21 | int xRand = rnd.nextInt(24); 22 | if(xRand <= lowerThen || xRand >= higherThen) 23 | return new xzPair(xRand, rnd.nextInt(24)); 24 | else 25 | return null; 26 | } 27 | /* 28 | * checks if it will spawn 29 | * @see com.scicraft.seedfinder.structure#structureWillSpawn(int xRegion, int zRegion, int xRandom, int zRandom, com.scicraft.seedfinder.biomeGenerator) 30 | */ 31 | public boolean structureWillSpawn(int xRegion, int zRegion, int xRandom, int zRandom, biomeGenerator generator){ 32 | if(generator.getBiomeAt(xRegion * 512 + xRandom * 16 + 8, zRegion * 512 +zRandom * 16 + 8) == 6) 33 | return true; 34 | return false; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenHills.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenHills extends BiomeGenBase 4 | { 5 | private int field_150635_aE; 6 | private int field_150636_aF; 7 | private int field_150637_aG; 8 | private int field_150638_aH; 9 | 10 | protected BiomeGenHills(int p_i45373_1_, boolean p_i45373_2_) 11 | { 12 | super(p_i45373_1_); 13 | this.field_150635_aE = 0; 14 | this.field_150636_aF = 1; 15 | this.field_150637_aG = 2; 16 | this.field_150638_aH = this.field_150635_aE; 17 | 18 | if (p_i45373_2_) 19 | { 20 | this.field_150638_aH = this.field_150636_aF; 21 | } 22 | } 23 | 24 | /** 25 | * this creates a mutation specific to Hills biomes 26 | */ 27 | private BiomeGenHills mutateHills(BiomeGenBase p_150633_1_) 28 | { 29 | this.field_150638_aH = this.field_150637_aG; 30 | this.func_150557_a(p_150633_1_.color, true); 31 | this.setBiomeName(p_150633_1_.biomeName + " M"); 32 | this.setHeight(new BiomeGenBase.Height(p_150633_1_.minHeight, p_150633_1_.maxHeight)); 33 | this.setTemperatureRainfall(p_150633_1_.temperature, p_150633_1_.rainfall); 34 | return this; 35 | } 36 | 37 | protected BiomeGenBase createMutatedBiome(int p_180277_1_) 38 | { 39 | return (new BiomeGenHills(p_180277_1_, false)).mutateHills(this); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SciCraftSeedFinder 2 | 3 | 4 | Mr L64 started this library after he figured out an new way to find quad-witch huts and monuments. I added two new parts for finding interesting worlds. L64 also added this video https://www.youtube.com/watch?v=97OdqeiUfHw explaining the 5 | principle behind the program. 6 | 7 | QuadHutFinder: Finds quad witch huts, by L64. 8 | 9 | HutandMonumentFinder: The first looks for a quad huts/monuments combination. So the four is ether huts or monuments. What you most likely are looking for are 3 huts and one monument. But that's up to you. By EgU. 10 | 11 | QuadHutMonFinder: This one first looks for a quad witch huts and if the monument would spawn in x-chunk higher then 16 and z-chunk higher then 16 around top left hut it will also check where and it the conditions are correct. If you are lucky it will spawn higher then 24,24 and be in the middle of the quad huts. By EgU. 12 | 13 | 14 | # To build 15 | 16 | There are also a small build script using ant. To choose what job you want to run change line 49 in build.xml. 17 | 18 | # To run 19 | 20 | java -jar dist/seedfinder.jar > seeds.txt 21 | 22 | You can run as many copies as you have cores in your computer, more is pointless. 23 | 24 | 25 | 26 | # Disclaimer 27 | 28 | I'm not a java developer but I know how you should write java code. So if you are looking for nice well formed java-code. Please run away!! It you are looking for a program that finds cool seeds, this is the place to be, and if you do know how to write java code please do so and I will accept the pull request :) 29 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenMutated.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenMutated extends BiomeGenBase 4 | { 5 | protected BiomeGenBase baseBiome; 6 | 7 | public BiomeGenMutated(int p_i45381_1_, BiomeGenBase p_i45381_2_) 8 | { 9 | super(p_i45381_1_); 10 | this.baseBiome = p_i45381_2_; 11 | this.func_150557_a(p_i45381_2_.color, true); 12 | this.biomeName = p_i45381_2_.biomeName + " M"; 13 | this.fillerBlockMetadata = p_i45381_2_.fillerBlockMetadata; 14 | this.minHeight = p_i45381_2_.minHeight; 15 | this.maxHeight = p_i45381_2_.maxHeight; 16 | this.temperature = p_i45381_2_.temperature; 17 | this.rainfall = p_i45381_2_.rainfall; 18 | this.waterColorMultiplier = p_i45381_2_.waterColorMultiplier; 19 | this.enableSnow = p_i45381_2_.enableSnow; 20 | this.enableRain = p_i45381_2_.enableRain; 21 | this.temperature = p_i45381_2_.temperature; 22 | this.rainfall = p_i45381_2_.rainfall; 23 | this.minHeight = p_i45381_2_.minHeight + 0.1F; 24 | this.maxHeight = p_i45381_2_.maxHeight + 0.2F; 25 | } 26 | 27 | /** 28 | * returns the chance a creature has to spawn. 29 | */ 30 | public float getSpawningChance() 31 | { 32 | return this.baseBiome.getSpawningChance(); 33 | } 34 | 35 | /** 36 | * returns true if the biome specified is equal to this biome 37 | */ 38 | public boolean isEqualTo(BiomeGenBase p_150569_1_) 39 | { 40 | return this.baseBiome.isEqualTo(p_150569_1_); 41 | } 42 | 43 | public BiomeGenBase.TempCategory getTempCategory() 44 | { 45 | return this.baseBiome.getTempCategory(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerRareBiome.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import minecraft.biome.BiomeGenBase; 4 | 5 | public class GenLayerRareBiome extends GenLayer 6 | { 7 | public GenLayerRareBiome(long p_i45478_1_, GenLayer p_i45478_3_) 8 | { 9 | super(p_i45478_1_); 10 | this.parent = p_i45478_3_; 11 | } 12 | 13 | /** 14 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 15 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 16 | */ 17 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 18 | { 19 | int[] var5 = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); 20 | int[] var6 = IntCache.getIntCache(areaWidth * areaHeight); 21 | 22 | for (int var7 = 0; var7 < areaHeight; ++var7) 23 | { 24 | for (int var8 = 0; var8 < areaWidth; ++var8) 25 | { 26 | this.initChunkSeed((long)(var8 + areaX), (long)(var7 + areaY)); 27 | int var9 = var5[var8 + 1 + (var7 + 1) * (areaWidth + 2)]; 28 | 29 | if (this.nextInt(57) == 0) 30 | { 31 | if (var9 == BiomeGenBase.plains.biomeID) 32 | { 33 | var6[var8 + var7 * areaWidth] = BiomeGenBase.plains.biomeID + 128; 34 | } 35 | else 36 | { 37 | var6[var8 + var7 * areaWidth] = var9; 38 | } 39 | } 40 | else 41 | { 42 | var6[var8 + var7 * areaWidth] = var9; 43 | } 44 | } 45 | } 46 | 47 | return var6; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenForest.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | public class BiomeGenForest extends BiomeGenBase 4 | { 5 | private int field_150632_aF; 6 | 7 | public BiomeGenForest(int p_i45377_1_, int p_i45377_2_) 8 | { 9 | super(p_i45377_1_); 10 | this.field_150632_aF = p_i45377_2_; 11 | 12 | this.setFillerBlockMetadata(5159473); 13 | this.setTemperatureRainfall(0.7F, 0.8F); 14 | 15 | if (this.field_150632_aF == 2) 16 | { 17 | this.field_150609_ah = 353825; 18 | this.color = 3175492; 19 | this.setTemperatureRainfall(0.6F, 0.6F); 20 | } 21 | } 22 | 23 | protected BiomeGenBase func_150557_a(int p_150557_1_, boolean p_150557_2_) 24 | { 25 | if (this.field_150632_aF == 2) 26 | { 27 | this.field_150609_ah = 353825; 28 | this.color = p_150557_1_; 29 | 30 | if (p_150557_2_) 31 | { 32 | this.field_150609_ah = (this.field_150609_ah & 16711422) >> 1; 33 | } 34 | 35 | return this; 36 | } 37 | else 38 | { 39 | return super.func_150557_a(p_150557_1_, p_150557_2_); 40 | } 41 | } 42 | 43 | protected BiomeGenBase createMutatedBiome(final int p_180277_1_) 44 | { 45 | if (this.biomeID == BiomeGenBase.forest.biomeID) 46 | { 47 | BiomeGenForest var2 = new BiomeGenForest(p_180277_1_, 1); 48 | var2.setHeight(new BiomeGenBase.Height(this.minHeight, this.maxHeight + 0.2F)); 49 | var2.setBiomeName("Flower Forest"); 50 | var2.func_150557_a(6976549, true); 51 | var2.setFillerBlockMetadata(8233509); 52 | return var2; 53 | } 54 | else 55 | { 56 | return new BiomeGenMutated(p_180277_1_, this); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerRemoveTooMuchOcean.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | public class GenLayerRemoveTooMuchOcean extends GenLayer 4 | { 5 | public GenLayerRemoveTooMuchOcean(long p_i45480_1_, GenLayer p_i45480_3_) 6 | { 7 | super(p_i45480_1_); 8 | this.parent = p_i45480_3_; 9 | } 10 | 11 | /** 12 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 13 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 14 | */ 15 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 16 | { 17 | int var5 = areaX - 1; 18 | int var6 = areaY - 1; 19 | int var7 = areaWidth + 2; 20 | int var8 = areaHeight + 2; 21 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 22 | int[] var10 = IntCache.getIntCache(areaWidth * areaHeight); 23 | 24 | for (int var11 = 0; var11 < areaHeight; ++var11) 25 | { 26 | for (int var12 = 0; var12 < areaWidth; ++var12) 27 | { 28 | int var13 = var9[var12 + 1 + (var11 + 1 - 1) * (areaWidth + 2)]; 29 | int var14 = var9[var12 + 1 + 1 + (var11 + 1) * (areaWidth + 2)]; 30 | int var15 = var9[var12 + 1 - 1 + (var11 + 1) * (areaWidth + 2)]; 31 | int var16 = var9[var12 + 1 + (var11 + 1 + 1) * (areaWidth + 2)]; 32 | int var17 = var9[var12 + 1 + (var11 + 1) * var7]; 33 | var10[var12 + var11 * areaWidth] = var17; 34 | this.initChunkSeed((long)(var12 + areaX), (long)(var11 + areaY)); 35 | 36 | if (var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(2) == 0) 37 | { 38 | var10[var12 + var11 * areaWidth] = 1; 39 | } 40 | } 41 | } 42 | 43 | return var10; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/com/scicraft/seedfinder/spawnFinder.java: -------------------------------------------------------------------------------- 1 | package com.scicraft.seedfinder; 2 | 3 | import java.util.Random; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | import java.util.ArrayList; 7 | 8 | public class spawnFinder { 9 | 10 | public static final ArrayList validBiomes = new ArrayList(Arrays.asList( 11 | Biome.forest, 12 | Biome.plains, 13 | Biome.taiga, 14 | Biome.taigaHills, 15 | Biome.forestHills, 16 | Biome.jungle, 17 | Biome.jungleHills 18 | )); 19 | 20 | public static xzPair findValidLocation(int searchX, int searchY, int size, List paramList, Random random, biomeGenerator generator) { 21 | // TODO: Find out if we should useQuarterResolutionMap or not 22 | int x1 = searchX - size >> 2; 23 | int y1 = searchY - size >> 2; 24 | int x2 = searchX + size >> 2; 25 | int y2 = searchY + size >> 2; 26 | 27 | int width = x2 - x1 + 1; 28 | int height = y2 - y1 + 1; 29 | int[] arrayOfInt = generator.getBiomeData(x1, y1, width, height, true); 30 | xzPair location = null; 31 | int numberOfValidFound = 0; 32 | for (int i = 0; i < width*height; i++) { 33 | int x = x1 + i % width << 2; 34 | int y = y1 + i / width << 2; 35 | if (arrayOfInt[i] > Biome.biomes.length) 36 | return null; 37 | Biome localBiome = Biome.biomes[arrayOfInt[i]]; 38 | if ((!paramList.contains(localBiome)) || ((location != null) && (random.nextInt(numberOfValidFound + 1) != 0))) 39 | continue; 40 | location = new xzPair(x, y); 41 | numberOfValidFound++; 42 | } 43 | 44 | return location; 45 | } 46 | 47 | public xzPair getSpawnPosition(long seed, biomeGenerator generator) { 48 | Random random = new Random(seed); 49 | xzPair location = findValidLocation(0, 0, 256, validBiomes, random, generator); 50 | int x = 0; 51 | int z = 0; 52 | if (location != null) { 53 | x = location.getX(); 54 | z = location.getZ(); 55 | } else { 56 | return null; 57 | } 58 | 59 | return new xzPair(x, z); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerAddMushroomIsland.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import minecraft.biome.BiomeGenBase; 4 | 5 | public class GenLayerAddMushroomIsland extends GenLayer 6 | { 7 | public GenLayerAddMushroomIsland(long p_i2120_1_, GenLayer p_i2120_3_) 8 | { 9 | super(p_i2120_1_); 10 | this.parent = p_i2120_3_; 11 | } 12 | 13 | /** 14 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 15 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 16 | */ 17 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 18 | { 19 | int var5 = areaX - 1; 20 | int var6 = areaY - 1; 21 | int var7 = areaWidth + 2; 22 | int var8 = areaHeight + 2; 23 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 24 | int[] var10 = IntCache.getIntCache(areaWidth * areaHeight); 25 | 26 | for (int var11 = 0; var11 < areaHeight; ++var11) 27 | { 28 | for (int var12 = 0; var12 < areaWidth; ++var12) 29 | { 30 | int var13 = var9[var12 + 0 + (var11 + 0) * var7]; 31 | int var14 = var9[var12 + 2 + (var11 + 0) * var7]; 32 | int var15 = var9[var12 + 0 + (var11 + 2) * var7]; 33 | int var16 = var9[var12 + 2 + (var11 + 2) * var7]; 34 | int var17 = var9[var12 + 1 + (var11 + 1) * var7]; 35 | this.initChunkSeed((long)(var12 + areaX), (long)(var11 + areaY)); 36 | 37 | if (var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(100) == 0) 38 | { 39 | var10[var12 + var11 * areaWidth] = BiomeGenBase.mushroomIsland.biomeID; 40 | } 41 | else 42 | { 43 | var10[var12 + var11 * areaWidth] = var17; 44 | } 45 | } 46 | } 47 | 48 | return var10; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerAddSnow.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | public class GenLayerAddSnow extends GenLayer 4 | { 5 | public GenLayerAddSnow(long p_i2121_1_, GenLayer p_i2121_3_) 6 | { 7 | super(p_i2121_1_); 8 | this.parent = p_i2121_3_; 9 | } 10 | 11 | /** 12 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 13 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 14 | */ 15 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 16 | { 17 | int var5 = areaX - 1; 18 | int var6 = areaY - 1; 19 | int var7 = areaWidth + 2; 20 | int var8 = areaHeight + 2; 21 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 22 | int[] var10 = IntCache.getIntCache(areaWidth * areaHeight); 23 | 24 | for (int var11 = 0; var11 < areaHeight; ++var11) 25 | { 26 | for (int var12 = 0; var12 < areaWidth; ++var12) 27 | { 28 | int var13 = var9[var12 + 1 + (var11 + 1) * var7]; 29 | this.initChunkSeed((long)(var12 + areaX), (long)(var11 + areaY)); 30 | 31 | if (var13 == 0) 32 | { 33 | var10[var12 + var11 * areaWidth] = 0; 34 | } 35 | else 36 | { 37 | int var14 = this.nextInt(6); 38 | byte var15; 39 | 40 | if (var14 == 0) 41 | { 42 | var15 = 4; 43 | } 44 | else if (var14 <= 1) 45 | { 46 | var15 = 3; 47 | } 48 | else 49 | { 50 | var15 = 1; 51 | } 52 | 53 | var10[var12 + var11 * areaWidth] = var15; 54 | } 55 | } 56 | } 57 | 58 | return var10; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerRiver.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import minecraft.biome.BiomeGenBase; 4 | 5 | public class GenLayerRiver extends GenLayer 6 | { 7 | public GenLayerRiver(long p_i2128_1_, GenLayer p_i2128_3_) 8 | { 9 | super(p_i2128_1_); 10 | super.parent = p_i2128_3_; 11 | } 12 | 13 | /** 14 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 15 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 16 | */ 17 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 18 | { 19 | int var5 = areaX - 1; 20 | int var6 = areaY - 1; 21 | int var7 = areaWidth + 2; 22 | int var8 = areaHeight + 2; 23 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 24 | int[] var10 = IntCache.getIntCache(areaWidth * areaHeight); 25 | 26 | for (int var11 = 0; var11 < areaHeight; ++var11) 27 | { 28 | for (int var12 = 0; var12 < areaWidth; ++var12) 29 | { 30 | int var13 = this.func_151630_c(var9[var12 + 0 + (var11 + 1) * var7]); 31 | int var14 = this.func_151630_c(var9[var12 + 2 + (var11 + 1) * var7]); 32 | int var15 = this.func_151630_c(var9[var12 + 1 + (var11 + 0) * var7]); 33 | int var16 = this.func_151630_c(var9[var12 + 1 + (var11 + 2) * var7]); 34 | int var17 = this.func_151630_c(var9[var12 + 1 + (var11 + 1) * var7]); 35 | 36 | if (var17 == var13 && var17 == var15 && var17 == var14 && var17 == var16) 37 | { 38 | var10[var12 + var11 * areaWidth] = -1; 39 | } 40 | else 41 | { 42 | var10[var12 + var11 * areaWidth] = BiomeGenBase.river.biomeID; 43 | } 44 | } 45 | } 46 | 47 | return var10; 48 | } 49 | 50 | private int func_151630_c(int p_151630_1_) 51 | { 52 | return p_151630_1_ >= 2 ? 2 + (p_151630_1_ & 1) : p_151630_1_; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerSmooth.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | public class GenLayerSmooth extends GenLayer 4 | { 5 | public GenLayerSmooth(long p_i2131_1_, GenLayer p_i2131_3_) 6 | { 7 | super(p_i2131_1_); 8 | super.parent = p_i2131_3_; 9 | } 10 | 11 | /** 12 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 13 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 14 | */ 15 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 16 | { 17 | int var5 = areaX - 1; 18 | int var6 = areaY - 1; 19 | int var7 = areaWidth + 2; 20 | int var8 = areaHeight + 2; 21 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 22 | int[] var10 = IntCache.getIntCache(areaWidth * areaHeight); 23 | 24 | for (int var11 = 0; var11 < areaHeight; ++var11) 25 | { 26 | for (int var12 = 0; var12 < areaWidth; ++var12) 27 | { 28 | int var13 = var9[var12 + 0 + (var11 + 1) * var7]; 29 | int var14 = var9[var12 + 2 + (var11 + 1) * var7]; 30 | int var15 = var9[var12 + 1 + (var11 + 0) * var7]; 31 | int var16 = var9[var12 + 1 + (var11 + 2) * var7]; 32 | int var17 = var9[var12 + 1 + (var11 + 1) * var7]; 33 | 34 | if (var13 == var14 && var15 == var16) 35 | { 36 | this.initChunkSeed((long)(var12 + areaX), (long)(var11 + areaY)); 37 | 38 | if (this.nextInt(2) == 0) 39 | { 40 | var17 = var13; 41 | } 42 | else 43 | { 44 | var17 = var15; 45 | } 46 | } 47 | else 48 | { 49 | if (var13 == var14) 50 | { 51 | var17 = var13; 52 | } 53 | 54 | if (var15 == var16) 55 | { 56 | var17 = var15; 57 | } 58 | } 59 | 60 | var10[var12 + var11 * areaWidth] = var17; 61 | } 62 | } 63 | 64 | return var10; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerDeepOcean.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import minecraft.biome.BiomeGenBase; 4 | 5 | public class GenLayerDeepOcean extends GenLayer 6 | { 7 | public GenLayerDeepOcean(long p_i45472_1_, GenLayer p_i45472_3_) 8 | { 9 | super(p_i45472_1_); 10 | this.parent = p_i45472_3_; 11 | } 12 | 13 | /** 14 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 15 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 16 | */ 17 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 18 | { 19 | int var5 = areaX - 1; 20 | int var6 = areaY - 1; 21 | int var7 = areaWidth + 2; 22 | int var8 = areaHeight + 2; 23 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 24 | int[] var10 = IntCache.getIntCache(areaWidth * areaHeight); 25 | 26 | for (int var11 = 0; var11 < areaHeight; ++var11) 27 | { 28 | for (int var12 = 0; var12 < areaWidth; ++var12) 29 | { 30 | int var13 = var9[var12 + 1 + (var11 + 1 - 1) * (areaWidth + 2)]; 31 | int var14 = var9[var12 + 1 + 1 + (var11 + 1) * (areaWidth + 2)]; 32 | int var15 = var9[var12 + 1 - 1 + (var11 + 1) * (areaWidth + 2)]; 33 | int var16 = var9[var12 + 1 + (var11 + 1 + 1) * (areaWidth + 2)]; 34 | int var17 = var9[var12 + 1 + (var11 + 1) * var7]; 35 | int var18 = 0; 36 | 37 | if (var13 == 0) 38 | { 39 | ++var18; 40 | } 41 | 42 | if (var14 == 0) 43 | { 44 | ++var18; 45 | } 46 | 47 | if (var15 == 0) 48 | { 49 | ++var18; 50 | } 51 | 52 | if (var16 == 0) 53 | { 54 | ++var18; 55 | } 56 | 57 | if (var17 == 0 && var18 > 3) 58 | { 59 | var10[var12 + var11 * areaWidth] = BiomeGenBase.deepOcean.biomeID; 60 | } 61 | else 62 | { 63 | var10[var12 + var11 * areaWidth] = var17; 64 | } 65 | } 66 | } 67 | 68 | return var10; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/com/scicraft/seedfinder/strongholdFinder.java: -------------------------------------------------------------------------------- 1 | package com.scicraft.seedfinder; 2 | 3 | import java.util.List; 4 | import java.util.Random; 5 | import java.util.ArrayList; 6 | 7 | public class strongholdFinder { 8 | 9 | 10 | public static xzPair findValidLocation(int searchX, int searchY, int size, List paramList, Random random, biomeGenerator generator) { 11 | // TODO: Find out if we should useQuarterResolutionMap or not 12 | int x1 = searchX - size >> 2; 13 | int y1 = searchY - size >> 2; 14 | int x2 = searchX + size >> 2; 15 | int y2 = searchY + size >> 2; 16 | 17 | int width = x2 - x1 + 1; 18 | int height = y2 - y1 + 1; 19 | int[] arrayOfInt = generator.getBiomeData(x1, y1, width, height, true); 20 | xzPair location = null; 21 | int numberOfValidFound = 0; 22 | for (int i = 0; i < width*height; i++) { 23 | int x = x1 + i % width << 2; 24 | int y = y1 + i / width << 2; 25 | if (arrayOfInt[i] > Biome.biomes.length) 26 | return null; 27 | Biome localBiome = Biome.biomes[arrayOfInt[i]]; 28 | if ((!paramList.contains(localBiome)) || ((location != null) && (random.nextInt(numberOfValidFound + 1) != 0))) 29 | continue; 30 | location = new xzPair(x, y); 31 | numberOfValidFound++; 32 | } 33 | 34 | return location; 35 | } 36 | 37 | public xzPair[] findStrongholds(long seed, biomeGenerator generator) { 38 | xzPair[] strongholds = new xzPair[3]; 39 | Random random = new Random(); 40 | random.setSeed(seed); 41 | 42 | List biomeArrayList = new ArrayList(); 43 | 44 | //TODO: don't be lazy and put them in a list 45 | for (int i = 0; i < Biome.biomes.length; i++) { 46 | if ((Biome.biomes[i] != null) && (Biome.biomes[i].type.value1 > 0f)) { 47 | biomeArrayList.add(Biome.biomes[i]); 48 | } 49 | } 50 | 51 | double angle = random.nextDouble() * 3.141592653589793D * 2.0D; 52 | for (int i = 0; i < 3; i++) { 53 | double distance = (1.25D + random.nextDouble()) * 32.0D; 54 | int x = (int)Math.round(Math.cos(angle) * distance); 55 | int z = (int)Math.round(Math.sin(angle) * distance); 56 | 57 | 58 | xzPair location = findValidLocation((x << 4) + 8, (z << 4) + 8, 112, biomeArrayList,random , generator); 59 | if(location != null){ 60 | x = location.getX() >> 4; 61 | z = location.getZ() >> 4; 62 | } 63 | 64 | 65 | strongholds[i] = new xzPair((x << 4), (z << 4)); 66 | angle += 6.283185307179586D / 3.0D; 67 | } 68 | return strongholds; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/com/scicraft/seedfinder/structureMonument.java: -------------------------------------------------------------------------------- 1 | package com.scicraft.seedfinder; 2 | 3 | import java.util.Random; 4 | import java.util.List; 5 | import java.util.Arrays; 6 | 7 | public class structureMonument extends structure{ 8 | private Random rnd = new Random(); 9 | 10 | /* 11 | * return the chunk position in the region of the possible structure 12 | */ 13 | public xzPair structurePosInRegion(long x, long z, long seed){ 14 | rnd.setSeed((long) x * 341873128712L + (long)z * 132897987541L + seed + 10387313); 15 | return new xzPair((rnd.nextInt(27) + rnd.nextInt(27)) / 2 , (rnd.nextInt(27) + rnd.nextInt(27)) / 2); 16 | } 17 | 18 | /* 19 | * first check if the x pos is valid else return null 20 | */ 21 | public xzPair structurePosInRegionFast(long xPart, long zPart, long seed, int lowerThen, int higherThen){ 22 | rnd.setSeed(xPart + zPart + seed + 10387313); 23 | int xRand = (rnd.nextInt(27) + rnd.nextInt(27)) / 2; 24 | if(xRand <= lowerThen || xRand >= higherThen) 25 | return new xzPair(xRand, (rnd.nextInt(27) + rnd.nextInt(27)) / 2); 26 | else 27 | return null; 28 | } 29 | 30 | public static List validSurroundingBiomes = Arrays.asList( 31 | new Biome[] { 32 | Biome.ocean, 33 | Biome.deepOcean, 34 | Biome.frozenOcean, 35 | Biome.river, 36 | Biome.frozenRiver, 37 | // Not sure if the extended biomes count 38 | Biome.oceanM, 39 | Biome.deepOceanM, 40 | Biome.frozenOceanM, 41 | Biome.riverM, 42 | Biome.frozenRiverM, 43 | } 44 | ); 45 | 46 | public static boolean isValidBiome(int x, int y, int size, List validBiomes, biomeGenerator generator) { 47 | int x1 = x - size >> 2; 48 | int y1 = y - size >> 2; 49 | int x2 = x + size >> 2; 50 | int y2 = y + size >> 2; 51 | 52 | int width = x2 - x1 + 1; 53 | int height = y2 - y1 + 1; 54 | 55 | int[] arrayOfInt = generator.getBiomeData(x1, y1, width, height, true); 56 | for (int i = 0; i < width * height; i++) { 57 | Biome localBiome = Biome.biomes[arrayOfInt[i]]; 58 | if (!validBiomes.contains(localBiome)) return false; 59 | } 60 | return true; 61 | } 62 | 63 | 64 | /* 65 | * checks if it will spawn 66 | * @see com.scicraft.seedfinder.structure#structureWillSpawn(int xRegion, int zRegion, int xRandom, int zRandom, com.scicraft.seedfinder.biomeGenerator) 67 | */ 68 | public boolean structureWillSpawn(int xRegion, int zRegion, int xRandom, int zRandom, biomeGenerator generator){ 69 | if( generator.getBiomeAt(xRegion * 512 + xRandom * 16 + 8, zRegion * 512 +zRandom * 16 + 8) == 24 && 70 | isValidBiome(xRegion * 512 + xRandom * 16 + 8, zRegion * 512 +zRandom * 16 + 8, 29, validSurroundingBiomes, generator)) 71 | return true; 72 | return false; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerZoom.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | public class GenLayerZoom extends GenLayer 4 | { 5 | public GenLayerZoom(long p_i2134_1_, GenLayer p_i2134_3_) 6 | { 7 | super(p_i2134_1_); 8 | super.parent = p_i2134_3_; 9 | } 10 | 11 | /** 12 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 13 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 14 | */ 15 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 16 | { 17 | int var5 = areaX >> 1; 18 | int var6 = areaY >> 1; 19 | int var7 = (areaWidth >> 1) + 2; 20 | int var8 = (areaHeight >> 1) + 2; 21 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 22 | int var10 = var7 - 1 << 1; 23 | int var11 = var8 - 1 << 1; 24 | int[] var12 = IntCache.getIntCache(var10 * var11); 25 | int var14; 26 | 27 | for (int var13 = 0; var13 < var8 - 1; ++var13) 28 | { 29 | var14 = (var13 << 1) * var10; 30 | int var15 = 0; 31 | int var16 = var9[var15 + 0 + (var13 + 0) * var7]; 32 | 33 | for (int var17 = var9[var15 + 0 + (var13 + 1) * var7]; var15 < var7 - 1; ++var15) 34 | { 35 | this.initChunkSeed((long)(var15 + var5 << 1), (long)(var13 + var6 << 1)); 36 | int var18 = var9[var15 + 1 + (var13 + 0) * var7]; 37 | int var19 = var9[var15 + 1 + (var13 + 1) * var7]; 38 | var12[var14] = var16; 39 | var12[var14++ + var10] = this.selectRandom(new int[] {var16, var17}); 40 | var12[var14] = this.selectRandom(new int[] {var16, var18}); 41 | var12[var14++ + var10] = this.selectModeOrRandom(var16, var18, var17, var19); 42 | var16 = var18; 43 | var17 = var19; 44 | } 45 | } 46 | 47 | int[] var20 = IntCache.getIntCache(areaWidth * areaHeight); 48 | 49 | for (var14 = 0; var14 < areaHeight; ++var14) 50 | { 51 | System.arraycopy(var12, (var14 + (areaY & 1)) * var10 + (areaX & 1), var20, var14 * areaWidth, areaWidth); 52 | } 53 | 54 | return var20; 55 | } 56 | 57 | /** 58 | * Magnify a layer. Parms are seed adjustment, layer, number of times to magnify 59 | */ 60 | public static GenLayer magnify(long p_75915_0_, GenLayer p_75915_2_, int p_75915_3_) 61 | { 62 | Object var4 = p_75915_2_; 63 | 64 | for (int var5 = 0; var5 < p_75915_3_; ++var5) 65 | { 66 | var4 = new GenLayerZoom(p_75915_0_ + (long)var5, (GenLayer)var4); 67 | } 68 | 69 | return (GenLayer)var4; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerRiverMix.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import minecraft.biome.BiomeGenBase; 4 | 5 | public class GenLayerRiverMix extends GenLayer 6 | { 7 | private GenLayer biomePatternGeneratorChain; 8 | private GenLayer riverPatternGeneratorChain; 9 | 10 | public GenLayerRiverMix(long p_i2129_1_, GenLayer p_i2129_3_, GenLayer p_i2129_4_) 11 | { 12 | super(p_i2129_1_); 13 | this.biomePatternGeneratorChain = p_i2129_3_; 14 | this.riverPatternGeneratorChain = p_i2129_4_; 15 | } 16 | 17 | /** 18 | * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an 19 | * argument). 20 | */ 21 | public void initWorldGenSeed(long p_75905_1_) 22 | { 23 | this.biomePatternGeneratorChain.initWorldGenSeed(p_75905_1_); 24 | this.riverPatternGeneratorChain.initWorldGenSeed(p_75905_1_); 25 | super.initWorldGenSeed(p_75905_1_); 26 | } 27 | 28 | /** 29 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 30 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 31 | */ 32 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 33 | { 34 | int[] var5 = this.biomePatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight); 35 | int[] var6 = this.riverPatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight); 36 | int[] var7 = IntCache.getIntCache(areaWidth * areaHeight); 37 | 38 | for (int var8 = 0; var8 < areaWidth * areaHeight; ++var8) 39 | { 40 | if (var5[var8] != BiomeGenBase.ocean.biomeID && var5[var8] != BiomeGenBase.deepOcean.biomeID) 41 | { 42 | if (var6[var8] == BiomeGenBase.river.biomeID) 43 | { 44 | if (var5[var8] == BiomeGenBase.icePlains.biomeID) 45 | { 46 | var7[var8] = BiomeGenBase.frozenRiver.biomeID; 47 | } 48 | else if (var5[var8] != BiomeGenBase.mushroomIsland.biomeID && var5[var8] != BiomeGenBase.mushroomIslandShore.biomeID) 49 | { 50 | var7[var8] = var6[var8] & 255; 51 | } 52 | else 53 | { 54 | var7[var8] = BiomeGenBase.mushroomIslandShore.biomeID; 55 | } 56 | } 57 | else 58 | { 59 | var7[var8] = var5[var8]; 60 | } 61 | } 62 | else 63 | { 64 | var7[var8] = var5[var8]; 65 | } 66 | } 67 | 68 | return var7; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/minecraft/layer/IntCache.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import com.google.common.collect.Lists; 4 | import java.util.List; 5 | 6 | public class IntCache 7 | { 8 | private static int intCacheSize = 256; 9 | 10 | /** 11 | * A list of pre-allocated int[256] arrays that are currently unused and can be returned by getIntCache() 12 | */ 13 | private static List freeSmallArrays = Lists.newArrayList(); 14 | 15 | /** 16 | * A list of pre-allocated int[256] arrays that were previously returned by getIntCache() and which will not be re- 17 | * used again until resetIntCache() is called. 18 | */ 19 | private static List inUseSmallArrays = Lists.newArrayList(); 20 | 21 | /** 22 | * A list of pre-allocated int[cacheSize] arrays that are currently unused and can be returned by getIntCache() 23 | */ 24 | private static List freeLargeArrays = Lists.newArrayList(); 25 | 26 | /** 27 | * A list of pre-allocated int[cacheSize] arrays that were previously returned by getIntCache() and which will not 28 | * be re-used again until resetIntCache() is called. 29 | */ 30 | private static List inUseLargeArrays = Lists.newArrayList(); 31 | 32 | public static synchronized int[] getIntCache(int p_76445_0_) 33 | { 34 | int[] var1; 35 | 36 | if (p_76445_0_ <= 256) 37 | { 38 | if (freeSmallArrays.isEmpty()) 39 | { 40 | var1 = new int[256]; 41 | inUseSmallArrays.add(var1); 42 | return var1; 43 | } 44 | else 45 | { 46 | var1 = (int[])freeSmallArrays.remove(freeSmallArrays.size() - 1); 47 | inUseSmallArrays.add(var1); 48 | return var1; 49 | } 50 | } 51 | else if (p_76445_0_ > intCacheSize) 52 | { 53 | intCacheSize = p_76445_0_; 54 | freeLargeArrays.clear(); 55 | inUseLargeArrays.clear(); 56 | var1 = new int[intCacheSize]; 57 | inUseLargeArrays.add(var1); 58 | return var1; 59 | } 60 | else if (freeLargeArrays.isEmpty()) 61 | { 62 | var1 = new int[intCacheSize]; 63 | inUseLargeArrays.add(var1); 64 | return var1; 65 | } 66 | else 67 | { 68 | var1 = (int[])freeLargeArrays.remove(freeLargeArrays.size() - 1); 69 | inUseLargeArrays.add(var1); 70 | return var1; 71 | } 72 | } 73 | 74 | /** 75 | * Mark all pre-allocated arrays as available for re-use by moving them to the appropriate free lists. 76 | */ 77 | public static synchronized void resetIntCache() 78 | { 79 | if (!freeLargeArrays.isEmpty()) 80 | { 81 | freeLargeArrays.remove(freeLargeArrays.size() - 1); 82 | } 83 | 84 | if (!freeSmallArrays.isEmpty()) 85 | { 86 | freeSmallArrays.remove(freeSmallArrays.size() - 1); 87 | } 88 | 89 | freeLargeArrays.addAll(inUseLargeArrays); 90 | freeSmallArrays.addAll(inUseSmallArrays); 91 | inUseLargeArrays.clear(); 92 | inUseSmallArrays.clear(); 93 | } 94 | 95 | /** 96 | * Gets a human-readable string that indicates the sizes of all the cache fields. Basically a synchronized static 97 | * toString. 98 | */ 99 | public static synchronized String getCacheSizes() 100 | { 101 | return "cache: " + freeLargeArrays.size() + ", tcache: " + freeSmallArrays.size() + ", allocated: " + inUseLargeArrays.size() + ", tallocated: " + inUseSmallArrays.size(); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerAddIsland.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | public class GenLayerAddIsland extends GenLayer 4 | { 5 | public GenLayerAddIsland(long p_i2119_1_, GenLayer p_i2119_3_) 6 | { 7 | super(p_i2119_1_); 8 | this.parent = p_i2119_3_; 9 | } 10 | 11 | /** 12 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 13 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 14 | */ 15 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 16 | { 17 | int var5 = areaX - 1; 18 | int var6 = areaY - 1; 19 | int var7 = areaWidth + 2; 20 | int var8 = areaHeight + 2; 21 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 22 | int[] var10 = IntCache.getIntCache(areaWidth * areaHeight); 23 | 24 | for (int var11 = 0; var11 < areaHeight; ++var11) 25 | { 26 | for (int var12 = 0; var12 < areaWidth; ++var12) 27 | { 28 | int var13 = var9[var12 + 0 + (var11 + 0) * var7]; 29 | int var14 = var9[var12 + 2 + (var11 + 0) * var7]; 30 | int var15 = var9[var12 + 0 + (var11 + 2) * var7]; 31 | int var16 = var9[var12 + 2 + (var11 + 2) * var7]; 32 | int var17 = var9[var12 + 1 + (var11 + 1) * var7]; 33 | this.initChunkSeed((long)(var12 + areaX), (long)(var11 + areaY)); 34 | 35 | if (var17 == 0 && (var13 != 0 || var14 != 0 || var15 != 0 || var16 != 0)) 36 | { 37 | int var18 = 1; 38 | int var19 = 1; 39 | 40 | if (var13 != 0 && this.nextInt(var18++) == 0) 41 | { 42 | var19 = var13; 43 | } 44 | 45 | if (var14 != 0 && this.nextInt(var18++) == 0) 46 | { 47 | var19 = var14; 48 | } 49 | 50 | if (var15 != 0 && this.nextInt(var18++) == 0) 51 | { 52 | var19 = var15; 53 | } 54 | 55 | if (var16 != 0 && this.nextInt(var18++) == 0) 56 | { 57 | var19 = var16; 58 | } 59 | 60 | if (this.nextInt(3) == 0) 61 | { 62 | var10[var12 + var11 * areaWidth] = var19; 63 | } 64 | else if (var19 == 4) 65 | { 66 | var10[var12 + var11 * areaWidth] = 4; 67 | } 68 | else 69 | { 70 | var10[var12 + var11 * areaWidth] = 0; 71 | } 72 | } 73 | else if (var17 > 0 && (var13 == 0 || var14 == 0 || var15 == 0 || var16 == 0)) 74 | { 75 | if (this.nextInt(5) == 0) 76 | { 77 | if (var17 == 4) 78 | { 79 | var10[var12 + var11 * areaWidth] = 4; 80 | } 81 | else 82 | { 83 | var10[var12 + var11 * areaWidth] = 0; 84 | } 85 | } 86 | else 87 | { 88 | var10[var12 + var11 * areaWidth] = var17; 89 | } 90 | } 91 | else 92 | { 93 | var10[var12 + var11 * areaWidth] = var17; 94 | } 95 | } 96 | } 97 | 98 | return var10; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerBiome.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import minecraft.biome.BiomeGenBase; 4 | 5 | public class GenLayerBiome extends GenLayer 6 | { 7 | private BiomeGenBase[] field_151623_c; 8 | private BiomeGenBase[] field_151621_d; 9 | private BiomeGenBase[] field_151622_e; 10 | private BiomeGenBase[] field_151620_f; 11 | 12 | public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, String p_i45560_5_) 13 | { 14 | super(p_i45560_1_); 15 | this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.savanna, BiomeGenBase.savanna, BiomeGenBase.plains}; 16 | this.field_151621_d = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.roofedForest, BiomeGenBase.extremeHills, BiomeGenBase.plains, BiomeGenBase.birchForest, BiomeGenBase.swampland}; 17 | this.field_151622_e = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.taiga, BiomeGenBase.plains}; 18 | this.field_151620_f = new BiomeGenBase[] {BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.coldTaiga}; 19 | this.parent = p_i45560_3_; 20 | } 21 | 22 | /** 23 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 24 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 25 | */ 26 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 27 | { 28 | int[] var5 = this.parent.getInts(areaX, areaY, areaWidth, areaHeight); 29 | int[] var6 = IntCache.getIntCache(areaWidth * areaHeight); 30 | 31 | for (int var7 = 0; var7 < areaHeight; ++var7) 32 | { 33 | for (int var8 = 0; var8 < areaWidth; ++var8) 34 | { 35 | this.initChunkSeed((long)(var8 + areaX), (long)(var7 + areaY)); 36 | int var9 = var5[var8 + var7 * areaWidth]; 37 | int var10 = (var9 & 3840) >> 8; 38 | var9 &= -3841; 39 | 40 | if (isBiomeOceanic(var9)) 41 | { 42 | var6[var8 + var7 * areaWidth] = var9; 43 | } 44 | else if (var9 == BiomeGenBase.mushroomIsland.biomeID) 45 | { 46 | var6[var8 + var7 * areaWidth] = var9; 47 | } 48 | else if (var9 == 1) 49 | { 50 | if (var10 > 0) 51 | { 52 | if (this.nextInt(3) == 0) 53 | { 54 | var6[var8 + var7 * areaWidth] = BiomeGenBase.mesaPlateau.biomeID; 55 | } 56 | else 57 | { 58 | var6[var8 + var7 * areaWidth] = BiomeGenBase.mesaPlateau_F.biomeID; 59 | } 60 | } 61 | else 62 | { 63 | var6[var8 + var7 * areaWidth] = this.field_151623_c[this.nextInt(this.field_151623_c.length)].biomeID; 64 | } 65 | } 66 | else if (var9 == 2) 67 | { 68 | if (var10 > 0) 69 | { 70 | var6[var8 + var7 * areaWidth] = BiomeGenBase.jungle.biomeID; 71 | } 72 | else 73 | { 74 | var6[var8 + var7 * areaWidth] = this.field_151621_d[this.nextInt(this.field_151621_d.length)].biomeID; 75 | } 76 | } 77 | else if (var9 == 3) 78 | { 79 | if (var10 > 0) 80 | { 81 | var6[var8 + var7 * areaWidth] = BiomeGenBase.megaTaiga.biomeID; 82 | } 83 | else 84 | { 85 | var6[var8 + var7 * areaWidth] = this.field_151622_e[this.nextInt(this.field_151622_e.length)].biomeID; 86 | } 87 | } 88 | else if (var9 == 4) 89 | { 90 | var6[var8 + var7 * areaWidth] = this.field_151620_f[this.nextInt(this.field_151620_f.length)].biomeID; 91 | } 92 | else 93 | { 94 | var6[var8 + var7 * areaWidth] = BiomeGenBase.mushroomIsland.biomeID; 95 | } 96 | } 97 | } 98 | 99 | return var6; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerVoronoiZoom.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | public class GenLayerVoronoiZoom extends GenLayer 4 | { 5 | public GenLayerVoronoiZoom(long p_i2133_1_, GenLayer p_i2133_3_) 6 | { 7 | super(p_i2133_1_); 8 | super.parent = p_i2133_3_; 9 | } 10 | 11 | /** 12 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 13 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 14 | */ 15 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 16 | { 17 | areaX -= 2; 18 | areaY -= 2; 19 | int var5 = areaX >> 2; 20 | int var6 = areaY >> 2; 21 | int var7 = (areaWidth >> 2) + 2; 22 | int var8 = (areaHeight >> 2) + 2; 23 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 24 | int var10 = var7 - 1 << 2; 25 | int var11 = var8 - 1 << 2; 26 | int[] var12 = IntCache.getIntCache(var10 * var11); 27 | int var14; 28 | 29 | for (int var13 = 0; var13 < var8 - 1; ++var13) 30 | { 31 | var14 = 0; 32 | int var15 = var9[var14 + 0 + (var13 + 0) * var7]; 33 | 34 | for (int var16 = var9[var14 + 0 + (var13 + 1) * var7]; var14 < var7 - 1; ++var14) 35 | { 36 | double var17 = 3.6D; 37 | this.initChunkSeed((long)(var14 + var5 << 2), (long)(var13 + var6 << 2)); 38 | double var19 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; 39 | double var21 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; 40 | this.initChunkSeed((long)(var14 + var5 + 1 << 2), (long)(var13 + var6 << 2)); 41 | double var23 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; 42 | double var25 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; 43 | this.initChunkSeed((long)(var14 + var5 << 2), (long)(var13 + var6 + 1 << 2)); 44 | double var27 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; 45 | double var29 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; 46 | this.initChunkSeed((long)(var14 + var5 + 1 << 2), (long)(var13 + var6 + 1 << 2)); 47 | double var31 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; 48 | double var33 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; 49 | int var35 = var9[var14 + 1 + (var13 + 0) * var7] & 255; 50 | int var36 = var9[var14 + 1 + (var13 + 1) * var7] & 255; 51 | 52 | for (int var37 = 0; var37 < 4; ++var37) 53 | { 54 | int var38 = ((var13 << 2) + var37) * var10 + (var14 << 2); 55 | 56 | for (int var39 = 0; var39 < 4; ++var39) 57 | { 58 | double var40 = ((double)var37 - var21) * ((double)var37 - var21) + ((double)var39 - var19) * ((double)var39 - var19); 59 | double var42 = ((double)var37 - var25) * ((double)var37 - var25) + ((double)var39 - var23) * ((double)var39 - var23); 60 | double var44 = ((double)var37 - var29) * ((double)var37 - var29) + ((double)var39 - var27) * ((double)var39 - var27); 61 | double var46 = ((double)var37 - var33) * ((double)var37 - var33) + ((double)var39 - var31) * ((double)var39 - var31); 62 | 63 | if (var40 < var42 && var40 < var44 && var40 < var46) 64 | { 65 | var12[var38++] = var15; 66 | } 67 | else if (var42 < var40 && var42 < var44 && var42 < var46) 68 | { 69 | var12[var38++] = var35; 70 | } 71 | else if (var44 < var40 && var44 < var42 && var44 < var46) 72 | { 73 | var12[var38++] = var16; 74 | } 75 | else 76 | { 77 | var12[var38++] = var36; 78 | } 79 | } 80 | } 81 | 82 | var15 = var35; 83 | var16 = var36; 84 | } 85 | } 86 | 87 | int[] var48 = IntCache.getIntCache(areaWidth * areaHeight); 88 | 89 | for (var14 = 0; var14 < areaHeight; ++var14) 90 | { 91 | System.arraycopy(var12, (var14 + (areaY & 3)) * var10 + (areaX & 3), var48, var14 * areaWidth, areaWidth); 92 | } 93 | 94 | return var48; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/QuadHutFinder.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | import java.util.Random; 4 | 5 | import com.scicraft.seedfinder.*; 6 | 7 | public class QuadHutFinder { 8 | public final static int TOPRIGHT = 0; 9 | public final static int BOTTOMRIGHT = 1; 10 | public final static int BOTTOMLEFT = 2; 11 | public final static int TOPLEFT = 3; 12 | public static Random rnd = new Random(); 13 | public static int[] xpos = new int[4]; 14 | public static int[] zpos = new int[4]; 15 | public static int xmon, zmon; 16 | public static structureHut hut; 17 | public static bitIterator bitIt; 18 | 19 | 20 | public static boolean allSwamp(int[] x, int[] z, biomeGenerator generate) 21 | { 22 | for(int i = 0; i < 4; i++) 23 | { 24 | if(generate.getBiomeAt(x[i] * 16 + 8, z[i] * 16 + 8) != 6) 25 | return false; 26 | } 27 | return true; 28 | } 29 | 30 | private static boolean checkForStructureBR(int x, int z, long seed) { 31 | xzPair coords = hut.structurePosInRegion(x, z, seed); 32 | int xrand = coords.getX(); 33 | int zrand = coords.getZ(); 34 | xpos[TOPLEFT] = x * 32 + xrand; 35 | zpos[TOPLEFT] = z * 32 + zrand; 36 | 37 | 38 | return xrand >= 22 && zrand >= 22; 39 | } 40 | 41 | private static boolean checkForStructureBL(int x, int z, long seed) { 42 | xzPair coords = hut.structurePosInRegion(x, z, seed); 43 | int xrand = coords.getX(); 44 | int zrand = coords.getZ(); 45 | xpos[TOPRIGHT] = x * 32 + xrand; 46 | zpos[TOPRIGHT] = z * 32 + zrand; 47 | 48 | return xrand <=1 && zrand >= 22; 49 | } 50 | 51 | private static boolean checkForStructureTR(int x, int z, long seed) { 52 | xzPair coords = hut.structurePosInRegion(x, z, seed); 53 | int xrand = coords.getX(); 54 | int zrand = coords.getZ(); 55 | xpos[BOTTOMLEFT] = x * 32 + xrand; 56 | zpos[BOTTOMLEFT] = z * 32 + zrand; 57 | 58 | return xrand >=22 && zrand <= 1; 59 | } 60 | 61 | private static boolean checkForStructureTL(int x, int z, long seed) { 62 | xzPair coords = hut.structurePosInRegion(x, z, seed); 63 | int xrand = coords.getX(); 64 | int zrand = coords.getZ(); 65 | xpos[BOTTOMRIGHT] = x * 32 + xrand; 66 | zpos[BOTTOMRIGHT] = z * 32 + zrand; 67 | 68 | return xrand <=1 && zrand <= 1; 69 | } 70 | 71 | 72 | public static void checkBits(long seed) { 73 | long seedBit = seed & 281474976710655L; //magic number 74 | bitIt = new bitIterator(seedBit); 75 | 76 | 77 | System.out.println("checking bits of base " + seedBit); 78 | System.out.println((xpos[0] * 16) + " " + (zpos[0] * 16)); 79 | System.out.println((xpos[1] * 16) + " " + (zpos[1] * 16)); 80 | System.out.println((xpos[2] * 16) + " " + (zpos[2] * 16)); 81 | System.out.println((xpos[3] * 16) + " " + (zpos[3] * 16)); 82 | 83 | while(bitIt.hasNext()){ 84 | long seedFull = bitIt.next(); 85 | biomeGenerator generate = new biomeGenerator(seedFull, 2); 86 | if(allSwamp(xpos, zpos, generate)) 87 | System.out.println(seedFull); 88 | } 89 | 90 | } 91 | 92 | 93 | public static void main(String[] args) { 94 | long startSeed = 278827814000L; //Long.parseLong(args[0]); 95 | System.out.println(startSeed); 96 | long endSeed = 281474976710656L; //higher than 2^48 will be useless 97 | int radius = 4; 98 | long currentSeed; 99 | int xr, zr; 100 | hut = new structureHut(); 101 | for(currentSeed = startSeed; currentSeed <= endSeed; currentSeed++){ 102 | 103 | for(int x=-radius; x= 22 ){ 134 | // candidate witch hut, is in the bottom left of the 32x32 chunk array 135 | // this means that to be in a quad it would be in top right of the quad 136 | 137 | // check the 32x32 chunk area neighbors to the left and below 138 | if ( checkForStructureTL(x, z+1, currentSeed) && 139 | checkForStructureTR(x-1, z+1, currentSeed) && 140 | checkForStructureBR(x-1, z, currentSeed)) { 141 | xpos[TOPRIGHT] = x * 32 + xr; 142 | zpos[TOPRIGHT] = z * 32 + zr; 143 | checkBits(currentSeed); 144 | } 145 | } 146 | 147 | } else{ 148 | if( zr <= 1 ) { 149 | // candidate witch hut, is in the top right of the 32x32 chunk array 150 | // this means that to be in a quad it would be in bottom left of the quad 151 | 152 | // check the 32x32 chunk area neighbors to the right and above 153 | if ( checkForStructureBR(x, z-1, currentSeed) && 154 | checkForStructureBL(x+1, z-1, currentSeed) && 155 | checkForStructureTL(x+1, z, currentSeed)) { 156 | xpos[BOTTOMLEFT] = x * 32 + xr; 157 | zpos[BOTTOMLEFT] = z * 32 + zr; 158 | checkBits(currentSeed); 159 | 160 | } 161 | } 162 | else if( zr >= 22 ){ 163 | // candidate witch hut, is in the bottom right of the 32x32 chunk array 164 | // this means that to be in a quad it would be in top left of the quad 165 | 166 | // check the 32x32 chunk area neighbors to the right and below 167 | if ( checkForStructureBL(x+1, z, currentSeed) && 168 | checkForStructureTL(x+1, z+1, currentSeed) && 169 | checkForStructureTR(x, z+1, currentSeed)) { 170 | xpos[TOPLEFT] = x * 32 + xr; 171 | zpos[TOPLEFT] = z * 32 + zr; 172 | checkBits(currentSeed); 173 | } 174 | } 175 | } 176 | } 177 | } 178 | } 179 | } 180 | } 181 | } -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerEdge.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | public class GenLayerEdge extends GenLayer 4 | { 5 | private final GenLayerEdge.Mode field_151627_c; 6 | 7 | public GenLayerEdge(long p_i45474_1_, GenLayer p_i45474_3_, GenLayerEdge.Mode p_i45474_4_) 8 | { 9 | super(p_i45474_1_); 10 | this.parent = p_i45474_3_; 11 | this.field_151627_c = p_i45474_4_; 12 | } 13 | 14 | /** 15 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 16 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 17 | */ 18 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 19 | { 20 | switch (GenLayerEdge.SwitchMode.field_151642_a[this.field_151627_c.ordinal()]) 21 | { 22 | case 1: 23 | default: 24 | return this.getIntsCoolWarm(areaX, areaY, areaWidth, areaHeight); 25 | 26 | case 2: 27 | return this.getIntsHeatIce(areaX, areaY, areaWidth, areaHeight); 28 | 29 | case 3: 30 | return this.getIntsSpecial(areaX, areaY, areaWidth, areaHeight); 31 | } 32 | } 33 | 34 | private int[] getIntsCoolWarm(int p_151626_1_, int p_151626_2_, int p_151626_3_, int p_151626_4_) 35 | { 36 | int var5 = p_151626_1_ - 1; 37 | int var6 = p_151626_2_ - 1; 38 | int var7 = 1 + p_151626_3_ + 1; 39 | int var8 = 1 + p_151626_4_ + 1; 40 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 41 | int[] var10 = IntCache.getIntCache(p_151626_3_ * p_151626_4_); 42 | 43 | for (int var11 = 0; var11 < p_151626_4_; ++var11) 44 | { 45 | for (int var12 = 0; var12 < p_151626_3_; ++var12) 46 | { 47 | this.initChunkSeed((long)(var12 + p_151626_1_), (long)(var11 + p_151626_2_)); 48 | int var13 = var9[var12 + 1 + (var11 + 1) * var7]; 49 | 50 | if (var13 == 1) 51 | { 52 | int var14 = var9[var12 + 1 + (var11 + 1 - 1) * var7]; 53 | int var15 = var9[var12 + 1 + 1 + (var11 + 1) * var7]; 54 | int var16 = var9[var12 + 1 - 1 + (var11 + 1) * var7]; 55 | int var17 = var9[var12 + 1 + (var11 + 1 + 1) * var7]; 56 | boolean var18 = var14 == 3 || var15 == 3 || var16 == 3 || var17 == 3; 57 | boolean var19 = var14 == 4 || var15 == 4 || var16 == 4 || var17 == 4; 58 | 59 | if (var18 || var19) 60 | { 61 | var13 = 2; 62 | } 63 | } 64 | 65 | var10[var12 + var11 * p_151626_3_] = var13; 66 | } 67 | } 68 | 69 | return var10; 70 | } 71 | 72 | private int[] getIntsHeatIce(int p_151624_1_, int p_151624_2_, int p_151624_3_, int p_151624_4_) 73 | { 74 | int var5 = p_151624_1_ - 1; 75 | int var6 = p_151624_2_ - 1; 76 | int var7 = 1 + p_151624_3_ + 1; 77 | int var8 = 1 + p_151624_4_ + 1; 78 | int[] var9 = this.parent.getInts(var5, var6, var7, var8); 79 | int[] var10 = IntCache.getIntCache(p_151624_3_ * p_151624_4_); 80 | 81 | for (int var11 = 0; var11 < p_151624_4_; ++var11) 82 | { 83 | for (int var12 = 0; var12 < p_151624_3_; ++var12) 84 | { 85 | int var13 = var9[var12 + 1 + (var11 + 1) * var7]; 86 | 87 | if (var13 == 4) 88 | { 89 | int var14 = var9[var12 + 1 + (var11 + 1 - 1) * var7]; 90 | int var15 = var9[var12 + 1 + 1 + (var11 + 1) * var7]; 91 | int var16 = var9[var12 + 1 - 1 + (var11 + 1) * var7]; 92 | int var17 = var9[var12 + 1 + (var11 + 1 + 1) * var7]; 93 | boolean var18 = var14 == 2 || var15 == 2 || var16 == 2 || var17 == 2; 94 | boolean var19 = var14 == 1 || var15 == 1 || var16 == 1 || var17 == 1; 95 | 96 | if (var19 || var18) 97 | { 98 | var13 = 3; 99 | } 100 | } 101 | 102 | var10[var12 + var11 * p_151624_3_] = var13; 103 | } 104 | } 105 | 106 | return var10; 107 | } 108 | 109 | private int[] getIntsSpecial(int p_151625_1_, int p_151625_2_, int p_151625_3_, int p_151625_4_) 110 | { 111 | int[] var5 = this.parent.getInts(p_151625_1_, p_151625_2_, p_151625_3_, p_151625_4_); 112 | int[] var6 = IntCache.getIntCache(p_151625_3_ * p_151625_4_); 113 | 114 | for (int var7 = 0; var7 < p_151625_4_; ++var7) 115 | { 116 | for (int var8 = 0; var8 < p_151625_3_; ++var8) 117 | { 118 | this.initChunkSeed((long)(var8 + p_151625_1_), (long)(var7 + p_151625_2_)); 119 | int var9 = var5[var8 + var7 * p_151625_3_]; 120 | 121 | if (var9 != 0 && this.nextInt(13) == 0) 122 | { 123 | var9 |= 1 + this.nextInt(15) << 8 & 3840; 124 | } 125 | 126 | var6[var8 + var7 * p_151625_3_] = var9; 127 | } 128 | } 129 | 130 | return var6; 131 | } 132 | 133 | public static enum Mode 134 | { 135 | COOL_WARM("COOL_WARM", 0), 136 | HEAT_ICE("HEAT_ICE", 1), 137 | SPECIAL("SPECIAL", 2); 138 | 139 | private static final GenLayerEdge.Mode[] $VALUES = new GenLayerEdge.Mode[]{COOL_WARM, HEAT_ICE, SPECIAL}; 140 | 141 | private Mode(String p_i45473_1_, int p_i45473_2_) {} 142 | } 143 | 144 | static final class SwitchMode 145 | { 146 | static final int[] field_151642_a = new int[GenLayerEdge.Mode.values().length]; 147 | static 148 | { 149 | try 150 | { 151 | field_151642_a[GenLayerEdge.Mode.COOL_WARM.ordinal()] = 1; 152 | } 153 | catch (NoSuchFieldError var3) 154 | { 155 | ; 156 | } 157 | 158 | try 159 | { 160 | field_151642_a[GenLayerEdge.Mode.HEAT_ICE.ordinal()] = 2; 161 | } 162 | catch (NoSuchFieldError var2) 163 | { 164 | ; 165 | } 166 | 167 | try 168 | { 169 | field_151642_a[GenLayerEdge.Mode.SPECIAL.ordinal()] = 3; 170 | } 171 | catch (NoSuchFieldError var1) 172 | { 173 | ; 174 | } 175 | } 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerHills.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import minecraft.biome.BiomeGenBase; 4 | 5 | public class GenLayerHills extends GenLayer 6 | { 7 | private GenLayer field_151628_d; 8 | 9 | public GenLayerHills(long p_i45479_1_, GenLayer p_i45479_3_, GenLayer p_i45479_4_) 10 | { 11 | super(p_i45479_1_); 12 | this.parent = p_i45479_3_; 13 | this.field_151628_d = p_i45479_4_; 14 | } 15 | 16 | /** 17 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 18 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 19 | */ 20 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 21 | { 22 | int[] var5 = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); 23 | int[] var6 = this.field_151628_d.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); 24 | int[] var7 = IntCache.getIntCache(areaWidth * areaHeight); 25 | 26 | for (int var8 = 0; var8 < areaHeight; ++var8) 27 | { 28 | for (int var9 = 0; var9 < areaWidth; ++var9) 29 | { 30 | this.initChunkSeed((long)(var9 + areaX), (long)(var8 + areaY)); 31 | int var10 = var5[var9 + 1 + (var8 + 1) * (areaWidth + 2)]; 32 | int var11 = var6[var9 + 1 + (var8 + 1) * (areaWidth + 2)]; 33 | boolean var12 = (var11 - 2) % 29 == 0; 34 | 35 | if (var10 > 255) 36 | { 37 | System.err.println("Error: old! " + var10); 38 | } 39 | 40 | if (var10 != 0 && var11 >= 2 && (var11 - 2) % 29 == 1 && var10 < 128) 41 | { 42 | if (BiomeGenBase.getBiome(var10 + 128) != null) 43 | { 44 | var7[var9 + var8 * areaWidth] = var10 + 128; 45 | } 46 | else 47 | { 48 | var7[var9 + var8 * areaWidth] = var10; 49 | } 50 | } 51 | else if (this.nextInt(3) != 0 && !var12) 52 | { 53 | var7[var9 + var8 * areaWidth] = var10; 54 | } 55 | else 56 | { 57 | int var13 = var10; 58 | int var14; 59 | 60 | if (var10 == BiomeGenBase.desert.biomeID) 61 | { 62 | var13 = BiomeGenBase.desertHills.biomeID; 63 | } 64 | else if (var10 == BiomeGenBase.forest.biomeID) 65 | { 66 | var13 = BiomeGenBase.forestHills.biomeID; 67 | } 68 | else if (var10 == BiomeGenBase.birchForest.biomeID) 69 | { 70 | var13 = BiomeGenBase.birchForestHills.biomeID; 71 | } 72 | else if (var10 == BiomeGenBase.roofedForest.biomeID) 73 | { 74 | var13 = BiomeGenBase.plains.biomeID; 75 | } 76 | else if (var10 == BiomeGenBase.taiga.biomeID) 77 | { 78 | var13 = BiomeGenBase.taigaHills.biomeID; 79 | } 80 | else if (var10 == BiomeGenBase.megaTaiga.biomeID) 81 | { 82 | var13 = BiomeGenBase.megaTaigaHills.biomeID; 83 | } 84 | else if (var10 == BiomeGenBase.coldTaiga.biomeID) 85 | { 86 | var13 = BiomeGenBase.coldTaigaHills.biomeID; 87 | } 88 | else if (var10 == BiomeGenBase.plains.biomeID) 89 | { 90 | if (this.nextInt(3) == 0) 91 | { 92 | var13 = BiomeGenBase.forestHills.biomeID; 93 | } 94 | else 95 | { 96 | var13 = BiomeGenBase.forest.biomeID; 97 | } 98 | } 99 | else if (var10 == BiomeGenBase.icePlains.biomeID) 100 | { 101 | var13 = BiomeGenBase.iceMountains.biomeID; 102 | } 103 | else if (var10 == BiomeGenBase.jungle.biomeID) 104 | { 105 | var13 = BiomeGenBase.jungleHills.biomeID; 106 | } 107 | else if (var10 == BiomeGenBase.ocean.biomeID) 108 | { 109 | var13 = BiomeGenBase.deepOcean.biomeID; 110 | } 111 | else if (var10 == BiomeGenBase.extremeHills.biomeID) 112 | { 113 | var13 = BiomeGenBase.extremeHillsPlus.biomeID; 114 | } 115 | else if (var10 == BiomeGenBase.savanna.biomeID) 116 | { 117 | var13 = BiomeGenBase.savannaPlateau.biomeID; 118 | } 119 | else if (biomesEqualOrMesaPlateau(var10, BiomeGenBase.mesaPlateau_F.biomeID)) 120 | { 121 | var13 = BiomeGenBase.mesa.biomeID; 122 | } 123 | else if (var10 == BiomeGenBase.deepOcean.biomeID && this.nextInt(3) == 0) 124 | { 125 | var14 = this.nextInt(2); 126 | 127 | if (var14 == 0) 128 | { 129 | var13 = BiomeGenBase.plains.biomeID; 130 | } 131 | else 132 | { 133 | var13 = BiomeGenBase.forest.biomeID; 134 | } 135 | } 136 | 137 | if (var12 && var13 != var10) 138 | { 139 | if (BiomeGenBase.getBiome(var13 + 128) != null) 140 | { 141 | var13 += 128; 142 | } 143 | else 144 | { 145 | var13 = var10; 146 | } 147 | } 148 | 149 | if (var13 == var10) 150 | { 151 | var7[var9 + var8 * areaWidth] = var10; 152 | } 153 | else 154 | { 155 | var14 = var5[var9 + 1 + (var8 + 1 - 1) * (areaWidth + 2)]; 156 | int var15 = var5[var9 + 1 + 1 + (var8 + 1) * (areaWidth + 2)]; 157 | int var16 = var5[var9 + 1 - 1 + (var8 + 1) * (areaWidth + 2)]; 158 | int var17 = var5[var9 + 1 + (var8 + 1 + 1) * (areaWidth + 2)]; 159 | int var18 = 0; 160 | 161 | if (biomesEqualOrMesaPlateau(var14, var10)) 162 | { 163 | ++var18; 164 | } 165 | 166 | if (biomesEqualOrMesaPlateau(var15, var10)) 167 | { 168 | ++var18; 169 | } 170 | 171 | if (biomesEqualOrMesaPlateau(var16, var10)) 172 | { 173 | ++var18; 174 | } 175 | 176 | if (biomesEqualOrMesaPlateau(var17, var10)) 177 | { 178 | ++var18; 179 | } 180 | 181 | if (var18 >= 3) 182 | { 183 | var7[var9 + var8 * areaWidth] = var13; 184 | } 185 | else 186 | { 187 | var7[var9 + var8 * areaWidth] = var10; 188 | } 189 | } 190 | } 191 | } 192 | } 193 | 194 | return var7; 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerBiomeEdge.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import minecraft.biome.BiomeGenBase; 4 | 5 | public class GenLayerBiomeEdge extends GenLayer 6 | { 7 | public GenLayerBiomeEdge(long p_i45475_1_, GenLayer p_i45475_3_) 8 | { 9 | super(p_i45475_1_); 10 | this.parent = p_i45475_3_; 11 | } 12 | 13 | /** 14 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 15 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 16 | */ 17 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 18 | { 19 | int[] var5 = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); 20 | int[] var6 = IntCache.getIntCache(areaWidth * areaHeight); 21 | 22 | for (int var7 = 0; var7 < areaHeight; ++var7) 23 | { 24 | for (int var8 = 0; var8 < areaWidth; ++var8) 25 | { 26 | this.initChunkSeed((long)(var8 + areaX), (long)(var7 + areaY)); 27 | int var9 = var5[var8 + 1 + (var7 + 1) * (areaWidth + 2)]; 28 | 29 | if (!this.replaceBiomeEdgeIfNecessary(var5, var6, var8, var7, areaWidth, var9, BiomeGenBase.extremeHills.biomeID, BiomeGenBase.extremeHillsEdge.biomeID) && !this.replaceBiomeEdge(var5, var6, var8, var7, areaWidth, var9, BiomeGenBase.mesaPlateau_F.biomeID, BiomeGenBase.mesa.biomeID) && !this.replaceBiomeEdge(var5, var6, var8, var7, areaWidth, var9, BiomeGenBase.mesaPlateau.biomeID, BiomeGenBase.mesa.biomeID) && !this.replaceBiomeEdge(var5, var6, var8, var7, areaWidth, var9, BiomeGenBase.megaTaiga.biomeID, BiomeGenBase.taiga.biomeID)) 30 | { 31 | int var10; 32 | int var11; 33 | int var12; 34 | int var13; 35 | 36 | if (var9 == BiomeGenBase.desert.biomeID) 37 | { 38 | var10 = var5[var8 + 1 + (var7 + 1 - 1) * (areaWidth + 2)]; 39 | var11 = var5[var8 + 1 + 1 + (var7 + 1) * (areaWidth + 2)]; 40 | var12 = var5[var8 + 1 - 1 + (var7 + 1) * (areaWidth + 2)]; 41 | var13 = var5[var8 + 1 + (var7 + 1 + 1) * (areaWidth + 2)]; 42 | 43 | if (var10 != BiomeGenBase.icePlains.biomeID && var11 != BiomeGenBase.icePlains.biomeID && var12 != BiomeGenBase.icePlains.biomeID && var13 != BiomeGenBase.icePlains.biomeID) 44 | { 45 | var6[var8 + var7 * areaWidth] = var9; 46 | } 47 | else 48 | { 49 | var6[var8 + var7 * areaWidth] = BiomeGenBase.extremeHillsPlus.biomeID; 50 | } 51 | } 52 | else if (var9 == BiomeGenBase.swampland.biomeID) 53 | { 54 | var10 = var5[var8 + 1 + (var7 + 1 - 1) * (areaWidth + 2)]; 55 | var11 = var5[var8 + 1 + 1 + (var7 + 1) * (areaWidth + 2)]; 56 | var12 = var5[var8 + 1 - 1 + (var7 + 1) * (areaWidth + 2)]; 57 | var13 = var5[var8 + 1 + (var7 + 1 + 1) * (areaWidth + 2)]; 58 | 59 | if (var10 != BiomeGenBase.desert.biomeID && var11 != BiomeGenBase.desert.biomeID && var12 != BiomeGenBase.desert.biomeID && var13 != BiomeGenBase.desert.biomeID && var10 != BiomeGenBase.coldTaiga.biomeID && var11 != BiomeGenBase.coldTaiga.biomeID && var12 != BiomeGenBase.coldTaiga.biomeID && var13 != BiomeGenBase.coldTaiga.biomeID && var10 != BiomeGenBase.icePlains.biomeID && var11 != BiomeGenBase.icePlains.biomeID && var12 != BiomeGenBase.icePlains.biomeID && var13 != BiomeGenBase.icePlains.biomeID) 60 | { 61 | if (var10 != BiomeGenBase.jungle.biomeID && var13 != BiomeGenBase.jungle.biomeID && var11 != BiomeGenBase.jungle.biomeID && var12 != BiomeGenBase.jungle.biomeID) 62 | { 63 | var6[var8 + var7 * areaWidth] = var9; 64 | } 65 | else 66 | { 67 | var6[var8 + var7 * areaWidth] = BiomeGenBase.jungleEdge.biomeID; 68 | } 69 | } 70 | else 71 | { 72 | var6[var8 + var7 * areaWidth] = BiomeGenBase.plains.biomeID; 73 | } 74 | } 75 | else 76 | { 77 | var6[var8 + var7 * areaWidth] = var9; 78 | } 79 | } 80 | } 81 | } 82 | 83 | return var6; 84 | } 85 | 86 | /** 87 | * Creates a border around a biome if necessary, e.g. A transition from hot to cold climates would otherwise occur. 88 | */ 89 | private boolean replaceBiomeEdgeIfNecessary(int[] p_151636_1_, int[] p_151636_2_, int p_151636_3_, int p_151636_4_, int p_151636_5_, int p_151636_6_, int p_151636_7_, int p_151636_8_) 90 | { 91 | if (!biomesEqualOrMesaPlateau(p_151636_6_, p_151636_7_)) 92 | { 93 | return false; 94 | } 95 | else 96 | { 97 | int var9 = p_151636_1_[p_151636_3_ + 1 + (p_151636_4_ + 1 - 1) * (p_151636_5_ + 2)]; 98 | int var10 = p_151636_1_[p_151636_3_ + 1 + 1 + (p_151636_4_ + 1) * (p_151636_5_ + 2)]; 99 | int var11 = p_151636_1_[p_151636_3_ + 1 - 1 + (p_151636_4_ + 1) * (p_151636_5_ + 2)]; 100 | int var12 = p_151636_1_[p_151636_3_ + 1 + (p_151636_4_ + 1 + 1) * (p_151636_5_ + 2)]; 101 | 102 | if (this.canBiomesBeNeighbors(var9, p_151636_7_) && this.canBiomesBeNeighbors(var10, p_151636_7_) && this.canBiomesBeNeighbors(var11, p_151636_7_) && this.canBiomesBeNeighbors(var12, p_151636_7_)) 103 | { 104 | p_151636_2_[p_151636_3_ + p_151636_4_ * p_151636_5_] = p_151636_6_; 105 | } 106 | else 107 | { 108 | p_151636_2_[p_151636_3_ + p_151636_4_ * p_151636_5_] = p_151636_8_; 109 | } 110 | 111 | return true; 112 | } 113 | } 114 | 115 | /** 116 | * Creates a border around a biome. 117 | */ 118 | private boolean replaceBiomeEdge(int[] p_151635_1_, int[] p_151635_2_, int p_151635_3_, int p_151635_4_, int p_151635_5_, int p_151635_6_, int p_151635_7_, int p_151635_8_) 119 | { 120 | if (p_151635_6_ != p_151635_7_) 121 | { 122 | return false; 123 | } 124 | else 125 | { 126 | int var9 = p_151635_1_[p_151635_3_ + 1 + (p_151635_4_ + 1 - 1) * (p_151635_5_ + 2)]; 127 | int var10 = p_151635_1_[p_151635_3_ + 1 + 1 + (p_151635_4_ + 1) * (p_151635_5_ + 2)]; 128 | int var11 = p_151635_1_[p_151635_3_ + 1 - 1 + (p_151635_4_ + 1) * (p_151635_5_ + 2)]; 129 | int var12 = p_151635_1_[p_151635_3_ + 1 + (p_151635_4_ + 1 + 1) * (p_151635_5_ + 2)]; 130 | 131 | if (biomesEqualOrMesaPlateau(var9, p_151635_7_) && biomesEqualOrMesaPlateau(var10, p_151635_7_) && biomesEqualOrMesaPlateau(var11, p_151635_7_) && biomesEqualOrMesaPlateau(var12, p_151635_7_)) 132 | { 133 | p_151635_2_[p_151635_3_ + p_151635_4_ * p_151635_5_] = p_151635_6_; 134 | } 135 | else 136 | { 137 | p_151635_2_[p_151635_3_ + p_151635_4_ * p_151635_5_] = p_151635_8_; 138 | } 139 | 140 | return true; 141 | } 142 | } 143 | 144 | /** 145 | * Returns if two biomes can logically be neighbors. If one is hot and the other cold, for example, it returns 146 | * false. 147 | */ 148 | private boolean canBiomesBeNeighbors(int p_151634_1_, int p_151634_2_) 149 | { 150 | if (biomesEqualOrMesaPlateau(p_151634_1_, p_151634_2_)) 151 | { 152 | return true; 153 | } 154 | else 155 | { 156 | BiomeGenBase var3 = BiomeGenBase.getBiome(p_151634_1_); 157 | BiomeGenBase var4 = BiomeGenBase.getBiome(p_151634_2_); 158 | 159 | if (var3 != null && var4 != null) 160 | { 161 | BiomeGenBase.TempCategory var5 = var3.getTempCategory(); 162 | BiomeGenBase.TempCategory var6 = var4.getTempCategory(); 163 | return var5 == var6 || var5 == BiomeGenBase.TempCategory.MEDIUM || var6 == BiomeGenBase.TempCategory.MEDIUM; 164 | } 165 | else 166 | { 167 | return false; 168 | } 169 | } 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayerShore.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import minecraft.biome.BiomeGenBase; 4 | import minecraft.biome.BiomeGenJungle; 5 | import minecraft.biome.BiomeGenMesa; 6 | 7 | public class GenLayerShore extends GenLayer 8 | { 9 | public GenLayerShore(long p_i2130_1_, GenLayer p_i2130_3_) 10 | { 11 | super(p_i2130_1_); 12 | this.parent = p_i2130_3_; 13 | } 14 | 15 | /** 16 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 17 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 18 | */ 19 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) 20 | { 21 | int[] var5 = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); 22 | int[] var6 = IntCache.getIntCache(areaWidth * areaHeight); 23 | 24 | for (int var7 = 0; var7 < areaHeight; ++var7) 25 | { 26 | for (int var8 = 0; var8 < areaWidth; ++var8) 27 | { 28 | this.initChunkSeed((long)(var8 + areaX), (long)(var7 + areaY)); 29 | int var9 = var5[var8 + 1 + (var7 + 1) * (areaWidth + 2)]; 30 | BiomeGenBase var10 = BiomeGenBase.getBiome(var9); 31 | int var11; 32 | int var12; 33 | int var13; 34 | int var14; 35 | 36 | if (var9 == BiomeGenBase.mushroomIsland.biomeID) 37 | { 38 | var11 = var5[var8 + 1 + (var7 + 1 - 1) * (areaWidth + 2)]; 39 | var12 = var5[var8 + 1 + 1 + (var7 + 1) * (areaWidth + 2)]; 40 | var13 = var5[var8 + 1 - 1 + (var7 + 1) * (areaWidth + 2)]; 41 | var14 = var5[var8 + 1 + (var7 + 1 + 1) * (areaWidth + 2)]; 42 | 43 | if (var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID && var14 != BiomeGenBase.ocean.biomeID) 44 | { 45 | var6[var8 + var7 * areaWidth] = var9; 46 | } 47 | else 48 | { 49 | var6[var8 + var7 * areaWidth] = BiomeGenBase.mushroomIslandShore.biomeID; 50 | } 51 | } 52 | else if (var10 != null && var10.getBiomeClass() == BiomeGenJungle.class) 53 | { 54 | var11 = var5[var8 + 1 + (var7 + 1 - 1) * (areaWidth + 2)]; 55 | var12 = var5[var8 + 1 + 1 + (var7 + 1) * (areaWidth + 2)]; 56 | var13 = var5[var8 + 1 - 1 + (var7 + 1) * (areaWidth + 2)]; 57 | var14 = var5[var8 + 1 + (var7 + 1 + 1) * (areaWidth + 2)]; 58 | 59 | if (this.func_151631_c(var11) && this.func_151631_c(var12) && this.func_151631_c(var13) && this.func_151631_c(var14)) 60 | { 61 | if (!isBiomeOceanic(var11) && !isBiomeOceanic(var12) && !isBiomeOceanic(var13) && !isBiomeOceanic(var14)) 62 | { 63 | var6[var8 + var7 * areaWidth] = var9; 64 | } 65 | else 66 | { 67 | var6[var8 + var7 * areaWidth] = BiomeGenBase.beach.biomeID; 68 | } 69 | } 70 | else 71 | { 72 | var6[var8 + var7 * areaWidth] = BiomeGenBase.jungleEdge.biomeID; 73 | } 74 | } 75 | else if (var9 != BiomeGenBase.extremeHills.biomeID && var9 != BiomeGenBase.extremeHillsPlus.biomeID && var9 != BiomeGenBase.extremeHillsEdge.biomeID) 76 | { 77 | if (var10 != null && var10.isSnowyBiome()) 78 | { 79 | this.func_151632_a(var5, var6, var8, var7, areaWidth, var9, BiomeGenBase.coldBeach.biomeID); 80 | } 81 | else if (var9 != BiomeGenBase.mesa.biomeID && var9 != BiomeGenBase.mesaPlateau_F.biomeID) 82 | { 83 | if (var9 != BiomeGenBase.ocean.biomeID && var9 != BiomeGenBase.deepOcean.biomeID && var9 != BiomeGenBase.river.biomeID && var9 != BiomeGenBase.swampland.biomeID) 84 | { 85 | var11 = var5[var8 + 1 + (var7 + 1 - 1) * (areaWidth + 2)]; 86 | var12 = var5[var8 + 1 + 1 + (var7 + 1) * (areaWidth + 2)]; 87 | var13 = var5[var8 + 1 - 1 + (var7 + 1) * (areaWidth + 2)]; 88 | var14 = var5[var8 + 1 + (var7 + 1 + 1) * (areaWidth + 2)]; 89 | 90 | if (!isBiomeOceanic(var11) && !isBiomeOceanic(var12) && !isBiomeOceanic(var13) && !isBiomeOceanic(var14)) 91 | { 92 | var6[var8 + var7 * areaWidth] = var9; 93 | } 94 | else 95 | { 96 | var6[var8 + var7 * areaWidth] = BiomeGenBase.beach.biomeID; 97 | } 98 | } 99 | else 100 | { 101 | var6[var8 + var7 * areaWidth] = var9; 102 | } 103 | } 104 | else 105 | { 106 | var11 = var5[var8 + 1 + (var7 + 1 - 1) * (areaWidth + 2)]; 107 | var12 = var5[var8 + 1 + 1 + (var7 + 1) * (areaWidth + 2)]; 108 | var13 = var5[var8 + 1 - 1 + (var7 + 1) * (areaWidth + 2)]; 109 | var14 = var5[var8 + 1 + (var7 + 1 + 1) * (areaWidth + 2)]; 110 | 111 | if (!isBiomeOceanic(var11) && !isBiomeOceanic(var12) && !isBiomeOceanic(var13) && !isBiomeOceanic(var14)) 112 | { 113 | if (this.func_151633_d(var11) && this.func_151633_d(var12) && this.func_151633_d(var13) && this.func_151633_d(var14)) 114 | { 115 | var6[var8 + var7 * areaWidth] = var9; 116 | } 117 | else 118 | { 119 | var6[var8 + var7 * areaWidth] = BiomeGenBase.desert.biomeID; 120 | } 121 | } 122 | else 123 | { 124 | var6[var8 + var7 * areaWidth] = var9; 125 | } 126 | } 127 | } 128 | else 129 | { 130 | this.func_151632_a(var5, var6, var8, var7, areaWidth, var9, BiomeGenBase.stoneBeach.biomeID); 131 | } 132 | } 133 | } 134 | 135 | return var6; 136 | } 137 | 138 | private void func_151632_a(int[] p_151632_1_, int[] p_151632_2_, int p_151632_3_, int p_151632_4_, int p_151632_5_, int p_151632_6_, int p_151632_7_) 139 | { 140 | if (isBiomeOceanic(p_151632_6_)) 141 | { 142 | p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_; 143 | } 144 | else 145 | { 146 | int var8 = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 - 1) * (p_151632_5_ + 2)]; 147 | int var9 = p_151632_1_[p_151632_3_ + 1 + 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)]; 148 | int var10 = p_151632_1_[p_151632_3_ + 1 - 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)]; 149 | int var11 = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 + 1) * (p_151632_5_ + 2)]; 150 | 151 | if (!isBiomeOceanic(var8) && !isBiomeOceanic(var9) && !isBiomeOceanic(var10) && !isBiomeOceanic(var11)) 152 | { 153 | p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_; 154 | } 155 | else 156 | { 157 | p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_7_; 158 | } 159 | } 160 | } 161 | 162 | private boolean func_151631_c(int p_151631_1_) 163 | { 164 | return BiomeGenBase.getBiome(p_151631_1_) != null && BiomeGenBase.getBiome(p_151631_1_).getBiomeClass() == BiomeGenJungle.class ? true : p_151631_1_ == BiomeGenBase.jungleEdge.biomeID || p_151631_1_ == BiomeGenBase.jungle.biomeID || p_151631_1_ == BiomeGenBase.jungleHills.biomeID || p_151631_1_ == BiomeGenBase.forest.biomeID || p_151631_1_ == BiomeGenBase.taiga.biomeID || isBiomeOceanic(p_151631_1_); 165 | } 166 | 167 | private boolean func_151633_d(int p_151633_1_) 168 | { 169 | return BiomeGenBase.getBiome(p_151633_1_) instanceof BiomeGenMesa; 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /src/com/scicraft/seedfinder/Biome.java: -------------------------------------------------------------------------------- 1 | package com.scicraft.seedfinder; 2 | 3 | import java.util.HashMap; 4 | 5 | 6 | 7 | public class Biome { 8 | public static final HashMap biomeMap = new HashMap(); 9 | public static final BiomeType typeA = new BiomeType(0.1F, 0.2F); 10 | public static final BiomeType typeB = new BiomeType(-0.5F, 0.0F); 11 | public static final BiomeType typeC = new BiomeType(-1.0F, 0.1F); 12 | public static final BiomeType typeD = new BiomeType(-1.8F, 0.1F); 13 | public static final BiomeType typeE = new BiomeType(0.125F, 0.05F); 14 | public static final BiomeType typeF = new BiomeType(0.2F, 0.2F); 15 | public static final BiomeType typeG = new BiomeType(0.45F, 0.3F); 16 | public static final BiomeType typeH = new BiomeType(1.5F, 0.025F); 17 | public static final BiomeType typeI = new BiomeType(1.0F, 0.5F); 18 | public static final BiomeType typeJ = new BiomeType(0.0F, 0.025F); 19 | public static final BiomeType typeK = new BiomeType(0.1F, 0.8F); 20 | public static final BiomeType typeL = new BiomeType(0.2F, 0.3F); 21 | public static final BiomeType typeM = new BiomeType(-0.2F, 0.1F); 22 | 23 | public static final Biome[] biomes = new Biome[256]; 24 | public static final Biome ocean = new Biome("Ocean", 0, typeC); 25 | public static final Biome plains = new Biome("Plains", 1, typeA); 26 | public static final Biome desert = new Biome("Desert", 2, typeE); 27 | public static final Biome extremeHills = new Biome("Extreme Hills", 3, typeI); 28 | public static final Biome forest = new Biome("Forest", 4, typeA); 29 | public static final Biome taiga = new Biome("Taiga", 5, typeF); 30 | public static final Biome swampland = new Biome("Swampland", 6, typeM); 31 | public static final Biome river = new Biome("River", 7, typeB); 32 | public static final Biome hell = new Biome("Hell", 8, typeA); 33 | public static final Biome sky = new Biome("Sky", 9, typeA); 34 | public static final Biome frozenOcean = new Biome("Frozen Ocean", 10, typeC); 35 | public static final Biome frozenRiver = new Biome("Frozen River", 11, typeB); 36 | public static final Biome icePlains = new Biome("Ice Plains", 12, typeE); 37 | public static final Biome iceMountains = new Biome("Ice Mountains", 13, typeG); 38 | public static final Biome mushroomIsland = new Biome("Mushroom Island", 14, typeL); 39 | public static final Biome mushroomIslandShore = new Biome("Mushroom Island Shore", 15, typeJ); 40 | public static final Biome beach = new Biome("Beach", 16, typeJ); 41 | public static final Biome desertHills = new Biome("Desert Hills", 17, typeG); 42 | public static final Biome forestHills = new Biome("Forest Hills", 18, typeG); 43 | public static final Biome taigaHills = new Biome("Taiga Hills", 19, typeG); 44 | public static final Biome extremeHillsEdge = new Biome("Extreme Hills Edge", 20, typeI.getExtreme()); 45 | public static final Biome jungle = new Biome("Jungle", 21, typeA); 46 | public static final Biome jungleHills = new Biome("Jungle Hills", 22, typeG); 47 | public static final Biome jungleEdge = new Biome("Jungle Edge", 23, typeA); 48 | public static final Biome deepOcean = new Biome("Deep Ocean", 24, typeD); 49 | public static final Biome stoneBeach = new Biome("Stone Beach", 25, typeK); 50 | public static final Biome coldBeach = new Biome("Cold Beach", 26, typeJ); 51 | public static final Biome birchForest = new Biome("Birch Forest", 27, typeA); 52 | public static final Biome birchForestHills = new Biome("Birch Forest Hills", 28, typeG); 53 | public static final Biome roofedForest = new Biome("Roofed Forest", 29, typeA); 54 | public static final Biome coldTaiga = new Biome("Cold Taiga", 30, typeF); 55 | public static final Biome coldTaigaHills = new Biome("Cold Taiga Hills", 31, typeG); 56 | public static final Biome megaTaiga = new Biome("Mega Taiga", 32, typeF); 57 | public static final Biome megaTaigaHills = new Biome("Mega Taiga Hills", 33, typeG); 58 | public static final Biome extremeHillsPlus = new Biome("Extreme Hills+", 34, typeI); 59 | public static final Biome savanna = new Biome("Savanna", 35, typeE); 60 | public static final Biome savannaPlateau = new Biome("Savanna Plateau", 36, typeH); 61 | public static final Biome mesa = new Biome("Mesa", 37, typeA); 62 | public static final Biome mesaPlateauF = new Biome("Mesa Plateau F", 38, typeH); 63 | public static final Biome mesaPlateau = new Biome("Mesa Plateau", 39, typeH); 64 | 65 | 66 | public static final Biome oceanM = new Biome("Ocean M", 128); 67 | public static final Biome sunflowerPlains = new Biome("Sunflower Plains", 129); 68 | public static final Biome desertM = new Biome("Desert M", 130); 69 | public static final Biome extremeHillsM = new Biome("Extreme Hills M", 131); 70 | public static final Biome flowerForest = new Biome("Flower Forest", 132); 71 | public static final Biome taigaM = new Biome("Taiga M", 133); 72 | public static final Biome swamplandM = new Biome("Swampland M", 134); 73 | public static final Biome riverM = new Biome("River M", 135); 74 | public static final Biome hellM = new Biome("Hell M", 136); 75 | public static final Biome skyM = new Biome("Sky M", 137); 76 | public static final Biome frozenOceanM = new Biome("Frozen Ocean M", 138); 77 | public static final Biome frozenRiverM = new Biome("Frozen River M", 139); 78 | public static final Biome icePlainsSpikes = new Biome("Ice Plains Spikes", 140); 79 | public static final Biome iceMountainsM = new Biome("Ice Mountains M", 141); 80 | public static final Biome mushroomIslandM = new Biome("Mushroom Island M", 142); 81 | public static final Biome mushroomIslandShoreM = new Biome("Mushroom Island Shore M", 143); 82 | public static final Biome beachM = new Biome("Beach M", 144); 83 | public static final Biome desertHillsM = new Biome("Desert Hills M", 145); 84 | public static final Biome forestHillsM = new Biome("Forest Hills M", 146); 85 | public static final Biome taigaHillsM = new Biome("Taiga Hills M", 147); 86 | public static final Biome extremeHillsEdgeM = new Biome("Extreme Hills Edge M", 148); 87 | public static final Biome jungleM = new Biome("Jungle M", 149); 88 | public static final Biome jungleHillsM = new Biome("Jungle Hills M", 150); 89 | public static final Biome jungleEdgeM = new Biome("Jungle Edge M", 151); 90 | public static final Biome deepOceanM = new Biome("Deep Ocean M", 152); 91 | public static final Biome stoneBeachM = new Biome("Stone Beach M", 153); 92 | public static final Biome coldBeachM = new Biome("Cold Beach M", 154); 93 | public static final Biome birchForestM = new Biome("Birch Forest M", 155); 94 | public static final Biome birchForestHillsM = new Biome("Birch Forest Hills M", 156); 95 | public static final Biome roofedForestM = new Biome("Roofed Forest M", 157); 96 | public static final Biome coldTaigaM = new Biome("Cold Taiga M", 158); 97 | public static final Biome coldTaigaHillsM = new Biome("Cold Taiga Hills M", 159); 98 | public static final Biome megaSpruceTaiga = new Biome("Mega Spruce Taiga", 160); 99 | public static final Biome megaSpurceTaigaHills = new Biome("Mega Spruce Taiga (Hills)",161); 100 | public static final Biome extremeHillsPlusM = new Biome("Extreme Hills+ M", 162); 101 | public static final Biome savannaM = new Biome("Savanna M", 163); 102 | public static final Biome savannaPlateauM = new Biome("Savanna Plateau M", 164); 103 | public static final Biome mesaBryce = new Biome("Mesa (Bryce)", 165); 104 | public static final Biome mesaPlateauFM = new Biome("Mesa Plateau F M", 166); 105 | public static final Biome mesaPlateauM = new Biome("Mesa Plateau M", 167); 106 | 107 | 108 | public String name; 109 | public int index; 110 | public int color; 111 | public BiomeType type; 112 | 113 | public Biome(String name, int index) { 114 | this(name, index, biomes[index - 128].type.getRare()); 115 | } 116 | 117 | public Biome(String name, int index, BiomeType type) { 118 | biomes[index] = this; 119 | this.name = name; 120 | this.index = index; 121 | this.type = type; 122 | biomeMap.put(name, this); 123 | } 124 | 125 | public String toString() { 126 | return "Biome."+ name; 127 | } 128 | 129 | public static int indexFromName(String name) { 130 | Biome biome = biomeMap.get(name); 131 | if (biome != null) 132 | return biome.index; 133 | return -1; 134 | } 135 | 136 | 137 | public static final class BiomeType { // TODO: Rename once we figure out what this actually is! 138 | public float value1, value2; 139 | public BiomeType(float value1, float value2) { 140 | this.value1 = value1; 141 | this.value2 = value2; 142 | } 143 | 144 | public BiomeType getExtreme() { 145 | return new BiomeType(value1 * 0.8F, value2 * 0.6F); 146 | } 147 | public BiomeType getRare(){ 148 | return new BiomeType(value1 + 0.1F, value2 + 0.2F); 149 | } 150 | } 151 | 152 | 153 | 154 | } 155 | -------------------------------------------------------------------------------- /src/minecraft/layer/GenLayer.java: -------------------------------------------------------------------------------- 1 | package minecraft.layer; 2 | 3 | import minecraft.biome.BiomeGenBase; 4 | 5 | public abstract class GenLayer 6 | { 7 | /** seed from World#getWorldSeed that is used in the LCG prng */ 8 | private long worldGenSeed; 9 | 10 | /** parent GenLayer that was provided via the constructor */ 11 | protected GenLayer parent; 12 | 13 | /** 14 | * final part of the LCG prng that uses the chunk X, Z coords along with the other two seeds to generate 15 | * pseudorandom numbers 16 | */ 17 | private long chunkSeed; 18 | 19 | /** base seed to the LCG prng provided via the constructor */ 20 | protected long baseSeed; 21 | 22 | public static GenLayer[] func_180781_a(long p_180781_0_, String p_180781_3_) 23 | { 24 | GenLayerIsland var4 = new GenLayerIsland(1L); 25 | GenLayerFuzzyZoom var13 = new GenLayerFuzzyZoom(2000L, var4); 26 | GenLayerAddIsland var14 = new GenLayerAddIsland(1L, var13); 27 | GenLayerZoom var15 = new GenLayerZoom(2001L, var14); 28 | var14 = new GenLayerAddIsland(2L, var15); 29 | var14 = new GenLayerAddIsland(50L, var14); 30 | var14 = new GenLayerAddIsland(70L, var14); 31 | GenLayerRemoveTooMuchOcean var16 = new GenLayerRemoveTooMuchOcean(2L, var14); 32 | GenLayerAddSnow var17 = new GenLayerAddSnow(2L, var16); 33 | var14 = new GenLayerAddIsland(3L, var17); 34 | GenLayerEdge var18 = new GenLayerEdge(2L, var14, GenLayerEdge.Mode.COOL_WARM); 35 | var18 = new GenLayerEdge(2L, var18, GenLayerEdge.Mode.HEAT_ICE); 36 | var18 = new GenLayerEdge(3L, var18, GenLayerEdge.Mode.SPECIAL); 37 | var15 = new GenLayerZoom(2002L, var18); 38 | var15 = new GenLayerZoom(2003L, var15); 39 | var14 = new GenLayerAddIsland(4L, var15); 40 | GenLayerAddMushroomIsland var19 = new GenLayerAddMushroomIsland(5L, var14); 41 | GenLayerDeepOcean var20 = new GenLayerDeepOcean(4L, var19); 42 | GenLayer var21 = GenLayerZoom.magnify(1000L, var20, 0); 43 | int var6 = 4; 44 | int var7 = var6; 45 | 46 | GenLayer var8 = GenLayerZoom.magnify(1000L, var21, 0); 47 | GenLayerRiverInit var22 = new GenLayerRiverInit(100L, var8); 48 | GenLayerBiome var9 = new GenLayerBiome(200L, var21, p_180781_3_); 49 | GenLayer var25 = GenLayerZoom.magnify(1000L, var9, 2); 50 | GenLayerBiomeEdge var26 = new GenLayerBiomeEdge(1000L, var25); 51 | GenLayer var10 = GenLayerZoom.magnify(1000L, var22, 2); 52 | GenLayerHills var27 = new GenLayerHills(1000L, var26, var10); 53 | var8 = GenLayerZoom.magnify(1000L, var22, 2); 54 | var8 = GenLayerZoom.magnify(1000L, var8, var7); 55 | GenLayerRiver var23 = new GenLayerRiver(1L, var8); 56 | GenLayerSmooth var24 = new GenLayerSmooth(1000L, var23); 57 | Object var28 = new GenLayerRareBiome(1001L, var27); 58 | 59 | for (int var11 = 0; var11 < var6; ++var11) 60 | { 61 | var28 = new GenLayerZoom((long)(1000 + var11), (GenLayer)var28); 62 | 63 | if (var11 == 0) 64 | { 65 | var28 = new GenLayerAddIsland(3L, (GenLayer)var28); 66 | } 67 | 68 | if (var11 == 1 || var6 == 1) 69 | { 70 | var28 = new GenLayerShore(1000L, (GenLayer)var28); 71 | } 72 | } 73 | 74 | GenLayerSmooth var29 = new GenLayerSmooth(1000L, (GenLayer)var28); 75 | GenLayerRiverMix var30 = new GenLayerRiverMix(100L, var29, var24); 76 | GenLayerVoronoiZoom var12 = new GenLayerVoronoiZoom(10L, var30); 77 | var30.initWorldGenSeed(p_180781_0_); 78 | var12.initWorldGenSeed(p_180781_0_); 79 | return new GenLayer[] {var30, var12, var30}; 80 | } 81 | 82 | public GenLayer(long p_i2125_1_) 83 | { 84 | this.baseSeed = p_i2125_1_; 85 | this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; 86 | this.baseSeed += p_i2125_1_; 87 | this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; 88 | this.baseSeed += p_i2125_1_; 89 | this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; 90 | this.baseSeed += p_i2125_1_; 91 | } 92 | 93 | /** 94 | * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an 95 | * argument). 96 | */ 97 | public void initWorldGenSeed(long p_75905_1_) 98 | { 99 | this.worldGenSeed = p_75905_1_; 100 | 101 | if (this.parent != null) 102 | { 103 | this.parent.initWorldGenSeed(p_75905_1_); 104 | } 105 | 106 | this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; 107 | this.worldGenSeed += this.baseSeed; 108 | this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; 109 | this.worldGenSeed += this.baseSeed; 110 | this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; 111 | this.worldGenSeed += this.baseSeed; 112 | } 113 | 114 | /** 115 | * Initialize layer's current chunkSeed based on the local worldGenSeed and the (x,z) chunk coordinates. 116 | */ 117 | public void initChunkSeed(long p_75903_1_, long p_75903_3_) 118 | { 119 | this.chunkSeed = this.worldGenSeed; 120 | this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; 121 | this.chunkSeed += p_75903_1_; 122 | this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; 123 | this.chunkSeed += p_75903_3_; 124 | this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; 125 | this.chunkSeed += p_75903_1_; 126 | this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; 127 | this.chunkSeed += p_75903_3_; 128 | } 129 | 130 | /** 131 | * returns a LCG pseudo random number from [0, x). Args: int x 132 | */ 133 | protected int nextInt(int p_75902_1_) 134 | { 135 | int var2 = (int)((this.chunkSeed >> 24) % (long)p_75902_1_); 136 | 137 | if (var2 < 0) 138 | { 139 | var2 += p_75902_1_; 140 | } 141 | 142 | this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; 143 | this.chunkSeed += this.worldGenSeed; 144 | return var2; 145 | } 146 | 147 | /** 148 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall 149 | * amounts, or biomeList[] indices based on the particular GenLayer subclass. 150 | */ 151 | public abstract int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight); 152 | 153 | protected static boolean biomesEqualOrMesaPlateau(int biomeIDA, int biomeIDB) 154 | { 155 | if (biomeIDA == biomeIDB) 156 | { 157 | return true; 158 | } 159 | else if (biomeIDA != BiomeGenBase.mesaPlateau_F.biomeID && biomeIDA != BiomeGenBase.mesaPlateau.biomeID) 160 | { 161 | final BiomeGenBase var2 = BiomeGenBase.getBiome(biomeIDA); 162 | final BiomeGenBase var3 = BiomeGenBase.getBiome(biomeIDB); 163 | 164 | try 165 | { 166 | return var2 != null && var3 != null ? var2.isEqualTo(var3) : false; 167 | } 168 | catch (Throwable var7) 169 | { 170 | System.err.println("Error in biomesEqualOrMesaPlateau()"); 171 | return false; 172 | } 173 | } 174 | else 175 | { 176 | return biomeIDB == BiomeGenBase.mesaPlateau_F.biomeID || biomeIDB == BiomeGenBase.mesaPlateau.biomeID; 177 | } 178 | } 179 | 180 | /** 181 | * returns true if the biomeId is one of the various ocean biomes. 182 | */ 183 | protected static boolean isBiomeOceanic(int p_151618_0_) 184 | { 185 | return p_151618_0_ == BiomeGenBase.ocean.biomeID || p_151618_0_ == BiomeGenBase.deepOcean.biomeID || p_151618_0_ == BiomeGenBase.frozenOcean.biomeID; 186 | } 187 | 188 | /** 189 | * selects a random integer from a set of provided integers 190 | */ 191 | protected int selectRandom(int ... p_151619_1_) 192 | { 193 | return p_151619_1_[this.nextInt(p_151619_1_.length)]; 194 | } 195 | 196 | /** 197 | * returns the most frequently occurring number of the set, or a random number from those provided 198 | */ 199 | protected int selectModeOrRandom(int p_151617_1_, int p_151617_2_, int p_151617_3_, int p_151617_4_) 200 | { 201 | return p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_ ? p_151617_2_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_ ? p_151617_1_ : (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_ ? p_151617_2_ : (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_ ? p_151617_2_ : (p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.selectRandom(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_})))))))))); 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /src/QuadHutMonFinder.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | import java.util.Random; 4 | import java.io.IOException; 5 | import java.nio.file.Files; 6 | import java.nio.file.Path; 7 | import java.nio.file.Paths; 8 | import java.util.stream.Stream; 9 | 10 | import com.scicraft.seedfinder.*; 11 | 12 | public class QuadHutMonFinder { 13 | public final static int TOPRIGHT = 0; 14 | public final static int BOTTOMRIGHT = 1; 15 | public final static int BOTTOMLEFT = 2; 16 | public final static int TOPLEFT = 3; 17 | public static Random rnd = new Random(); 18 | public static int[] xpos = new int[4]; 19 | public static int[] zpos = new int[4]; 20 | public static int xmon, zmon; 21 | public static structureHut hut; 22 | public static structureMonument monument; 23 | public static bitIterator bitIt; 24 | public final static boolean debug=false; 25 | public final static int monumnetLimitLo=16; 26 | public final static int monumnetLimitHi=24; 27 | 28 | public final static int xRegion = 0; 29 | public final static int zRegion = 0; 30 | 31 | public static boolean allSwamp(int[] x, int[] z, biomeGenerator generate) 32 | { 33 | for(int i = 0; i < 4; i++) 34 | { 35 | if(hut.structureWillSpawn(xRegion, zRegion, x[i], z[i], generate) == false) { 36 | return false; 37 | } 38 | } 39 | return true; 40 | } 41 | 42 | private static boolean checkForStructureBR(int x, int z, long seed) { 43 | xzPair coords = hut.structurePosInRegion(x, z, seed); 44 | int xrand = coords.getX(); 45 | int zrand = coords.getZ(); 46 | xpos[TOPLEFT] = x * 32 + xrand; 47 | zpos[TOPLEFT] = z * 32 + zrand; 48 | xmon = x; 49 | zmon = z; 50 | if(debug) System.out.println("Check hut in BR @(" + x +"," + z + ")"); 51 | return xrand >= 22 && zrand >= 22; 52 | } 53 | 54 | private static String checkForMonumnetinBR(int x, int z, long seed, biomeGenerator generate) { 55 | 56 | String ret = ""; 57 | if(debug) System.out.println("Check mon in BR @(" + x +"," + z + ")"); 58 | xzPair coords = monument.structurePosInRegion(x, z, seed); 59 | int mxpos = x * 32 + coords.getX(); 60 | int mzpos = z * 32 + coords.getZ(); 61 | if ( coords.getX() >= monumnetLimitHi && coords.getZ() >= monumnetLimitHi ) { 62 | ret = " Monument possible inside: @(" + coords.getX() + "," + coords.getZ() + ")"; 63 | ret += " possible: (" + (mxpos * 16) + "," + (mzpos * 16) +")"; 64 | if (monument.structureWillSpawn(xRegion, zRegion, mxpos, mzpos, generate)) { 65 | ret += " found MONUMNET: (" + (mxpos * 16) + "," + (mzpos * 16) +")"; 66 | } 67 | } else if ( coords.getX() >= monumnetLimitLo && coords.getZ() >= monumnetLimitLo ) { 68 | 69 | //System.out.print("debug" + mxpos + "," + mzpos + "," + coords.getX() + "," +coords.getZ() + "," +x+ ", " +z+ ", "); 70 | ret = " Monument possible outside: @(" + coords.getX() + "," + coords.getZ() + ")"; 71 | if (monument.structureWillSpawn(xRegion, zRegion, mxpos, mzpos, generate)) { 72 | ret += " found monument: (" + (mxpos * 16) + "," + (mzpos * 16) +") "; 73 | } 74 | } else { 75 | ret = " Monument skip: @(" + coords.getX() + "," + coords.getZ() + ") < @(" + monumnetLimitLo + "," + monumnetLimitLo + ") [" + (mxpos * 16) + "," + (mzpos * 16) +"]"; 76 | } 77 | return ret; 78 | 79 | } 80 | 81 | private static boolean checkForStructureBL(int x, int z, long seed) { 82 | xzPair coords = hut.structurePosInRegion(x, z, seed); 83 | int xrand = coords.getX(); 84 | int zrand = coords.getZ(); 85 | xpos[TOPRIGHT] = x * 32 + xrand; 86 | zpos[TOPRIGHT] = z * 32 + zrand; 87 | if(debug) System.out.println("Check hut in BL @(" + x +"," + z + ")"); 88 | return xrand <=1 && zrand >= 22; 89 | } 90 | 91 | private static boolean checkForStructureTR(int x, int z, long seed) { 92 | xzPair coords = hut.structurePosInRegion(x, z, seed); 93 | int xrand = coords.getX(); 94 | int zrand = coords.getZ(); 95 | xpos[BOTTOMLEFT] = x * 32 + xrand; 96 | zpos[BOTTOMLEFT] = z * 32 + zrand; 97 | if(debug) System.out.println("Check hut in TR @(" + x +"," + z + ")"); 98 | return xrand >=22 && zrand <= 1; 99 | } 100 | 101 | private static boolean checkForStructureTL(int x, int z, long seed) { 102 | xzPair coords = hut.structurePosInRegion(x, z, seed); 103 | int xrand = coords.getX(); 104 | int zrand = coords.getZ(); 105 | xpos[BOTTOMRIGHT] = x * 32 + xrand; 106 | zpos[BOTTOMRIGHT] = z * 32 + zrand; 107 | 108 | if(debug) System.out.println("Check hut in TL @(" + x +"," + z + ")"); 109 | return xrand <=1 && zrand <= 1; 110 | } 111 | 112 | 113 | private static int numberDiff(int x, int y) { 114 | int b=10000000; 115 | return Math.abs((x+b)-(y+b)); 116 | } 117 | 118 | private static int dist(int x1, int x2, int y1, int y2) { 119 | return (int) Math.sqrt((double) numberDiff(x1,x2)*numberDiff(x1,x2) + numberDiff(y1,y2)*numberDiff(y1,y2)); 120 | 121 | } 122 | 123 | public static void printQuadHut() { 124 | int minX = xpos[0]; 125 | int maxX = xpos[0]; 126 | int minZ = zpos[0]; 127 | int maxZ = zpos[0]; 128 | 129 | for(int i = 1; i < 4; i++) { 130 | if (xpos[i] > maxX) { 131 | maxX = xpos[i]; 132 | } else if (xpos[i] < minX) { 133 | minX = xpos[i]; 134 | } 135 | 136 | if (zpos[i] > maxZ) { 137 | maxZ = zpos[i]; 138 | } else if (zpos[i] < minZ) { 139 | minZ = zpos[i]; 140 | } 141 | } 142 | 143 | //Middle 144 | int midX = minX * 16 + numberDiff(maxX * 16, minX * 16)/2; 145 | int midZ = minZ * 16+ numberDiff(maxZ * 16, minZ * 16)/2; 146 | 147 | System.out.print(" Quad, Origo: (" + midX + "," + midZ + ")"); 148 | System.out.print(" hut: (" + (xpos[0] * 16) + "," + (zpos[0] * 16) + ") d:" + dist(midX, (xpos[0] * 16), midZ, (zpos[0] * 16)) + ""); 149 | System.out.print(" hut: (" + (xpos[1] * 16) + "," + (zpos[1] * 16) + ") d:" + dist(midX, (xpos[1] * 16), midZ, (zpos[1] * 16)) + ""); 150 | System.out.print(" hut: (" + (xpos[2] * 16) + "," + (zpos[2] * 16) + ") d:" + dist(midX, (xpos[2] * 16), midZ, (zpos[2] * 16)) + ""); 151 | System.out.print(" hut: (" + (xpos[3] * 16) + "," + (zpos[3] * 16) + ") d:" + dist(midX, (xpos[3] * 16), midZ, (zpos[3] * 16)) + ""); 152 | 153 | } 154 | 155 | 156 | /* This will will do check all seeds 157 | * By first verify that it will spawn a quad witch hut, then if its valid check if a 158 | * monument will spawn inside. This is done by only check the top left region 159 | * As it has the most amount of chunks that are available. It will miss a few possible 160 | * spots. The top left will with limits have up to 27 valid chunks for spawning. 161 | 162 | */ 163 | public static void checkIfValid(long seed) { 164 | long seedBit = seed & 281474976710655L; //magic number 165 | bitIt = new bitIterator(seedBit); 166 | xzPair monCords = null; 167 | String mon_str; 168 | if(debug) System.out.println("Right possible: " + seed); 169 | while(bitIt.hasNext()){ 170 | long seedFull = bitIt.next(); 171 | biomeGenerator generate = new biomeGenerator(seedFull, 2); 172 | if(allSwamp(xpos, zpos, generate)){ 173 | //Quad hut calc. 174 | mon_str = checkForMonumnetinBR(xmon, zmon, seed, generate); 175 | System.out.print("("+seed+") Seed: " + seedFull); 176 | printQuadHut(); 177 | System.out.println(mon_str); 178 | } 179 | 180 | } 181 | 182 | } 183 | 184 | 185 | public static void checkCoords(long currentSeed) { 186 | int xr, zr; 187 | int radius = 4; 188 | hut = new structureHut(); 189 | monument = new structureMonument(); 190 | for(int x=-radius; x= 22 ){ 222 | // candidate witch hut, is in the bottom left of the 32x32 chunk array 223 | // this means that to be in a quad it would be in top right of the quad 224 | 225 | // check the 32x32 chunk area neighbors to the left and below 226 | if(debug) System.out.println("Start in BL @(" + x +"," + z + ")"); 227 | if ( checkForStructureTL(x, z+1, currentSeed) && 228 | checkForStructureTR(x-1, z+1, currentSeed) && 229 | checkForStructureBR(x-1, z, currentSeed)) { 230 | xpos[TOPRIGHT] = x * 32 + xr; 231 | zpos[TOPRIGHT] = z * 32 + zr; 232 | checkIfValid(currentSeed); 233 | } 234 | } 235 | 236 | } else{ 237 | if( zr <= 1 ) { 238 | // candidate witch hut, is in the top right of the 32x32 chunk array 239 | // this means that to be in a quad it would be in bottom left of the quad 240 | 241 | // check the 32x32 chunk area neighbors to the right and above 242 | if(debug) System.out.println("Start in TR @(" + x +"," + z + ")"); 243 | if ( checkForStructureBR(x, z-1, currentSeed) && 244 | checkForStructureBL(x+1, z-1, currentSeed) && 245 | checkForStructureTL(x+1, z, currentSeed)) { 246 | xpos[BOTTOMLEFT] = x * 32 + xr; 247 | zpos[BOTTOMLEFT] = z * 32 + zr; 248 | checkIfValid(currentSeed); 249 | 250 | } 251 | } 252 | else if( zr >= 22 ){ 253 | // candidate witch hut, is in the bottom right of the 32x32 chunk array 254 | // this means that to be in a quad it would be in top left of the quad 255 | 256 | // check the 32x32 chunk area neighbors to the right and below 257 | if(debug) System.out.println("Start in BR @(" + x +"," + z + ")"); 258 | if ( checkForStructureBL(x+1, z, currentSeed) && 259 | checkForStructureTL(x+1, z+1, currentSeed) && 260 | checkForStructureTR(x, z+1, currentSeed)) { 261 | xpos[TOPLEFT] = x * 32 + xr; 262 | zpos[TOPLEFT] = z * 32 + zr; 263 | xmon = x; 264 | zmon = z; 265 | checkIfValid(currentSeed); 266 | } 267 | } 268 | } 269 | } 270 | } 271 | } 272 | } 273 | 274 | public static void main(String[] args) { 275 | if (args.length > 0) { 276 | System.out.println("Will use " + args[0] + " as seed lite to check"); 277 | if(debug) System.out.println(args[0]); 278 | Path path = Paths.get(args[0]); 279 | try (Stream lines = Files.lines(path)) { 280 | lines.forEach(s -> checkCoords(Long.parseLong(s))); 281 | } catch (IOException ex) { 282 | System.out.println("Error"+ ex); 283 | } 284 | } else { 285 | System.out.println("Will just do random check"); 286 | long startSeed = -281474976710658L; 287 | while (startSeed < -281474976710656L || startSeed > 281470000000000L ) { 288 | startSeed = rnd.nextLong(); //Long.parseLong(args[0]); 289 | } 290 | if(debug) startSeed = 147915050934441L; 291 | System.out.println("Start seed:" + startSeed); 292 | long endSeed = 281474976710656L; //higher than 2^48 will be useless 293 | long currentSeed; 294 | long count = 0; 295 | 296 | for(currentSeed = startSeed; currentSeed <= endSeed; currentSeed++){ 297 | count += 1; 298 | checkCoords(currentSeed); 299 | } 300 | System.out.println("Checked: " + count + ", bye!"); 301 | } 302 | 303 | } 304 | } -------------------------------------------------------------------------------- /src/HutandMonumentFinder.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | import java.util.Random; 4 | 5 | import com.scicraft.seedfinder.*; 6 | 7 | public class HutandMonumentFinder { 8 | public final static int HUT = 0; 9 | public final static int MONUMNET = 1; 10 | public final static int TOPRIGHT = 0; 11 | public final static int BOTTOMRIGHT = 1; 12 | public final static int BOTTOMLEFT = 2; 13 | public final static int TOPLEFT = 3; 14 | public static Random rnd = new Random(); 15 | public static int[] xpos = new int[4]; 16 | public static int[] zpos = new int[4]; 17 | public static int[] mxpos = new int[4]; 18 | public static int[] mzpos = new int[4]; 19 | public static int xmon, zmon; 20 | public static structureHut hut; 21 | public static structureMonument monument; 22 | public static bitIterator bitIt; 23 | public final static int monumnetLimit=22; 24 | public final static boolean debug=true; 25 | 26 | public static boolean allSwamp(int[] x, int[] z, biomeGenerator generate) 27 | { 28 | for(int i = 0; i < 4; i++) 29 | { 30 | if(generate.getBiomeAt(x[i] * 16 + 8, z[i] * 16 + 8) != 6) 31 | return false; 32 | } 33 | return true; 34 | } 35 | 36 | private static boolean checkForStructureBR(int x, int z, long seed) { 37 | if (checkForMonumnetinBR(x, z, seed) || checkForHutinBR(x,z,seed) ) { 38 | return true; 39 | } 40 | return false; 41 | } 42 | 43 | private static boolean checkForHutinBR(int x, int z, long seed) { 44 | xzPair coords = hut.structurePosInRegion(x, z, seed); 45 | int xrand = coords.getX(); 46 | int zrand = coords.getZ(); 47 | xpos[TOPLEFT] = x * 32 + xrand; 48 | zpos[TOPLEFT] = z * 32 + zrand; 49 | 50 | 51 | return xrand >= 22 && zrand >= 22; 52 | } 53 | 54 | private static boolean checkForMonumnetinBR(int x, int z, long seed) { 55 | xzPair coords = monument.structurePosInRegion(x, z, seed); 56 | int xrand = coords.getX(); 57 | int zrand = coords.getZ(); 58 | mxpos[TOPLEFT] = x * 32 + xrand; 59 | mzpos[TOPLEFT] = z * 32 + zrand; 60 | 61 | return xrand >= monumnetLimit && zrand >= monumnetLimit; 62 | } 63 | 64 | 65 | 66 | private static boolean checkForStructureBL(int x, int z, long seed) { 67 | if (checkForMonumnetinBL(x, z, seed) || checkForHutinBL(x,z,seed) ) { 68 | return true; 69 | } 70 | return false; 71 | } 72 | 73 | private static boolean checkForHutinBL(int x, int z, long seed) { 74 | xzPair coords = hut.structurePosInRegion(x, z, seed); 75 | int xrand = coords.getX(); 76 | int zrand = coords.getZ(); 77 | xpos[TOPRIGHT] = x * 32 + xrand; 78 | zpos[TOPRIGHT] = z * 32 + zrand; 79 | 80 | return xrand <=1 && zrand >= 22; 81 | } 82 | 83 | private static boolean checkForMonumnetinBL(int x, int z, long seed) { 84 | xzPair coords = monument.structurePosInRegion(x, z, seed); 85 | int xrand = coords.getX(); 86 | int zrand = coords.getZ(); 87 | mxpos[TOPRIGHT] = x * 32 + xrand; 88 | mzpos[TOPRIGHT] = z * 32 + zrand; 89 | 90 | return xrand <=1 && zrand >= monumnetLimit; 91 | } 92 | 93 | 94 | private static boolean checkForStructureTR(int x, int z, long seed) { 95 | if (checkForHutinTR(x, z, seed) || checkForMonumnetinTR(x,z,seed) ) { 96 | return true; 97 | } 98 | return false; 99 | } 100 | 101 | private static boolean checkForHutinTR(int x, int z, long seed) { 102 | xzPair coords = hut.structurePosInRegion(x, z, seed); 103 | int xrand = coords.getX(); 104 | int zrand = coords.getZ(); 105 | xpos[BOTTOMLEFT] = x * 32 + xrand; 106 | zpos[BOTTOMLEFT] = z * 32 + zrand; 107 | 108 | return xrand >=22 && zrand <= 1; 109 | } 110 | 111 | private static boolean checkForMonumnetinTR(int x, int z, long seed) { 112 | xzPair coords = monument.structurePosInRegion(x, z, seed); 113 | int xrand = coords.getX(); 114 | int zrand = coords.getZ(); 115 | mxpos[BOTTOMLEFT] = x * 32 + xrand; 116 | mzpos[BOTTOMLEFT] = z * 32 + zrand; 117 | 118 | return xrand >= monumnetLimit && zrand <= 1; 119 | } 120 | 121 | 122 | private static boolean checkForStructureTL(int x, int z, long seed) { 123 | if (checkForHutinTL(x, z, seed) || checkForMonumnetinTL(x,z,seed) ) { 124 | return true; 125 | } 126 | return false; 127 | } 128 | 129 | private static boolean checkForHutinTL(int x, int z, long seed) { 130 | xzPair coords = hut.structurePosInRegion(x, z, seed); 131 | int xrand = coords.getX(); 132 | int zrand = coords.getZ(); 133 | xpos[BOTTOMRIGHT] = x * 32 + xrand; 134 | zpos[BOTTOMRIGHT] = z * 32 + zrand; 135 | 136 | return xrand <=1 && zrand <= 1; 137 | } 138 | 139 | private static boolean checkForMonumnetinTL(int x, int z, long seed) { 140 | xzPair coords = monument.structurePosInRegion(x, z, seed); 141 | int xrand = coords.getX(); 142 | int zrand = coords.getZ(); 143 | mxpos[BOTTOMRIGHT] = x * 32 + xrand; 144 | mzpos[BOTTOMRIGHT] = z * 32 + zrand; 145 | 146 | return xrand <=1 && zrand <= 1; 147 | } 148 | 149 | private static int printCorner(int corner, biomeGenerator generate) { 150 | int c = 0; 151 | if (!(xpos[corner] == 0 && zpos[corner] == 0)) { 152 | if( hut.structureWillSpawn(0,0,xpos[corner], zpos[corner], generate)) { 153 | System.out.print(" hut: (" + (xpos[corner] * 16) + "," + (zpos[corner] * 16) +")"); 154 | c++; 155 | } 156 | } 157 | if (!(mxpos[corner] == 0 && mzpos[corner] == 0)) { 158 | if (monument.structureWillSpawn(0,0,mxpos[corner], mzpos[corner], generate)) { 159 | System.out.print(" monument: (" + (mxpos[corner] * 16) + "," + (mzpos[corner] * 16) +")"); 160 | c++; 161 | } 162 | } 163 | return c; 164 | } 165 | 166 | private static int hutorMon(int corner) { 167 | if (!(xpos[corner] == 0 && zpos[corner] == 0)) { 168 | return HUT; 169 | } else if (!(mxpos[corner] == 0 && mzpos[corner] == 0)) { 170 | return MONUMNET; 171 | } else { 172 | System.out.println("err m: " + (mxpos[corner] * 16) + " " + (mzpos[corner] * 16)); 173 | System.out.println("err h: " + (xpos[corner] * 16) + " " + (zpos[corner] * 16)); 174 | } 175 | return 100; 176 | } 177 | 178 | private static boolean checkCorner(int corner, biomeGenerator generate) { 179 | boolean spawnHut = false; 180 | boolean spawnMon = false; 181 | //System.out.print(" " + corner + " " +xpos[corner] +", " + zpos[corner] ); 182 | //System.out.print(" " + corner + " " +mxpos[corner] +", " + mzpos[corner] ); 183 | if (!(xpos[corner] == 0 && zpos[corner] == 0)) { 184 | spawnHut = hut.structureWillSpawn(0,0,xpos[corner], zpos[corner], generate); 185 | } 186 | if (!(mxpos[corner] == 0 && mzpos[corner] == 0)) { 187 | spawnMon = monument.structureWillSpawn(0,0,mxpos[corner], mzpos[corner], generate); 188 | } 189 | //System.out.println(" " + corner + " " +spawnHut +" " + spawnMon ); 190 | return (spawnHut || spawnMon); 191 | } 192 | 193 | 194 | public static void checkIfValid(long seed) { 195 | long seedBit = seed & 281474976710655L; //magic number 196 | bitIt = new bitIterator(seedBit); 197 | int structure = 0; 198 | 199 | System.out.println("checking hut and monumnet " + seed); 200 | for(int i = 0; i < 4; i++) { 201 | structure += hutorMon(i); 202 | } 203 | 204 | while(bitIt.hasNext()){ 205 | long seedFull = bitIt.next(); 206 | biomeGenerator generate = new biomeGenerator(seedFull, 2); 207 | if(checkCorner(BOTTOMRIGHT, generate) && 208 | checkCorner(TOPRIGHT, generate) && 209 | checkCorner(TOPLEFT, generate) && 210 | checkCorner(BOTTOMLEFT, generate)) { 211 | System.out.print("Seed: " + seedFull); 212 | int c = 0; 213 | for(int i = 0; i < 4; i++) { 214 | c += printCorner(i, generate); 215 | } 216 | System.out.println(" structures: " + c); 217 | 218 | } 219 | } 220 | 221 | } 222 | 223 | 224 | public static void checkBits(long seed) { 225 | long seedBit = seed & 281474976710655L; //magic number 226 | bitIt = new bitIterator(seedBit); 227 | 228 | 229 | System.out.println("checking bits of base " + seedBit); 230 | System.out.println((xpos[0] * 16) + " " + (zpos[0] * 16)); 231 | System.out.println((xpos[1] * 16) + " " + (zpos[1] * 16)); 232 | System.out.println((xpos[2] * 16) + " " + (zpos[2] * 16)); 233 | System.out.println((xpos[3] * 16) + " " + (zpos[3] * 16)); 234 | 235 | while(bitIt.hasNext()){ 236 | long seedFull = bitIt.next(); 237 | biomeGenerator generate = new biomeGenerator(seedFull, 2); 238 | if(allSwamp(xpos, zpos, generate)) 239 | System.out.println(seedFull); 240 | } 241 | 242 | } 243 | 244 | 245 | public static void main(String[] args) { 246 | long startSeed = -281474976710658L; 247 | while (startSeed < -281474976710656L || startSeed > 281470000000000L ) { 248 | startSeed = rnd.nextLong(); //Long.parseLong(args[0]); 249 | } 250 | if(debug) startSeed = 148372070833119L; 251 | if(debug) System.out.println("Seed:" + startSeed); 252 | long endSeed = 281474976710656L; //higher than 2^48 will be useless 253 | int radius = 4; 254 | long currentSeed; 255 | int xr, zr; 256 | hut = new structureHut(); 257 | monument = new structureMonument(); 258 | for(currentSeed = startSeed; currentSeed <= endSeed; currentSeed++){ 259 | 260 | for(int x=-radius; x= 22 ){ 290 | // candidate witch hut, is in the bottom left of the 32x32 chunk array 291 | // this means that to be in a quad it would be in top right of the quad 292 | 293 | // check the 32x32 chunk area neighbors to the left and below 294 | if ( checkForStructureTL(x, z+1, currentSeed) && 295 | checkForStructureTR(x-1, z+1, currentSeed) && 296 | checkForStructureBR(x-1, z, currentSeed)) { 297 | xpos[TOPRIGHT] = x * 32 + xr; 298 | zpos[TOPRIGHT] = z * 32 + zr; 299 | checkIfValid(currentSeed); 300 | } 301 | } 302 | 303 | } else{ 304 | if( zr <= 1 ) { 305 | // candidate witch hut, is in the top right of the 32x32 chunk array 306 | // this means that to be in a quad it would be in bottom left of the quad 307 | 308 | // check the 32x32 chunk area neighbors to the right and above 309 | if ( checkForStructureBR(x, z-1, currentSeed) && 310 | checkForStructureBL(x+1, z-1, currentSeed) && 311 | checkForStructureTL(x+1, z, currentSeed)) { 312 | xpos[BOTTOMLEFT] = x * 32 + xr; 313 | zpos[BOTTOMLEFT] = z * 32 + zr; 314 | checkIfValid(currentSeed); 315 | 316 | } 317 | } 318 | else if( zr >= 22 ){ 319 | // candidate witch hut, is in the bottom right of the 32x32 chunk array 320 | // this means that to be in a quad it would be in top left of the quad 321 | 322 | // check the 32x32 chunk area neighbors to the right and below 323 | if ( checkForStructureBL(x+1, z, currentSeed) && 324 | checkForStructureTL(x+1, z+1, currentSeed) && 325 | checkForStructureTR(x, z+1, currentSeed)) { 326 | xpos[TOPLEFT] = x * 32 + xr; 327 | zpos[TOPLEFT] = z * 32 + zr; 328 | checkIfValid(currentSeed); 329 | } 330 | } 331 | } 332 | } 333 | for(int i = 0; i < 4; i++) { 334 | xpos[i] = 0; 335 | zpos[i] = 0; 336 | mxpos[i] = 0; 337 | mzpos[i] = 0; 338 | } 339 | } 340 | } 341 | } 342 | } 343 | } -------------------------------------------------------------------------------- /src/minecraft/biome/BiomeGenBase.java: -------------------------------------------------------------------------------- 1 | package minecraft.biome; 2 | 3 | import com.google.common.collect.Maps; 4 | import com.google.common.collect.Sets; 5 | import java.util.Map; 6 | import java.util.Set; 7 | 8 | public abstract class BiomeGenBase 9 | { 10 | protected static final BiomeGenBase.Height height_Default = new BiomeGenBase.Height(0.1F, 0.2F); 11 | protected static final BiomeGenBase.Height height_ShallowWaters = new BiomeGenBase.Height(-0.5F, 0.0F); 12 | protected static final BiomeGenBase.Height height_Oceans = new BiomeGenBase.Height(-1.0F, 0.1F); 13 | protected static final BiomeGenBase.Height height_DeepOceans = new BiomeGenBase.Height(-1.8F, 0.1F); 14 | protected static final BiomeGenBase.Height height_LowPlains = new BiomeGenBase.Height(0.125F, 0.05F); 15 | protected static final BiomeGenBase.Height height_MidPlains = new BiomeGenBase.Height(0.2F, 0.2F); 16 | protected static final BiomeGenBase.Height height_LowHills = new BiomeGenBase.Height(0.45F, 0.3F); 17 | protected static final BiomeGenBase.Height height_HighPlateaus = new BiomeGenBase.Height(1.5F, 0.025F); 18 | protected static final BiomeGenBase.Height height_MidHills = new BiomeGenBase.Height(1.0F, 0.5F); 19 | protected static final BiomeGenBase.Height height_Shores = new BiomeGenBase.Height(0.0F, 0.025F); 20 | protected static final BiomeGenBase.Height height_RockyWaters = new BiomeGenBase.Height(0.1F, 0.8F); 21 | protected static final BiomeGenBase.Height height_LowIslands = new BiomeGenBase.Height(0.2F, 0.3F); 22 | protected static final BiomeGenBase.Height height_PartiallySubmerged = new BiomeGenBase.Height(-0.2F, 0.1F); 23 | 24 | /** An array of all the biomes, indexed by biome id. */ 25 | private static final BiomeGenBase[] biomeList = new BiomeGenBase[256]; 26 | public static final Set explorationBiomesList = Sets.newHashSet(); 27 | public static final Map field_180278_o = Maps.newHashMap(); 28 | public static final BiomeGenBase ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setHeight(height_Oceans); 29 | public static final BiomeGenBase plains = (new BiomeGenPlains(1)).setColor(9286496).setBiomeName("Plains"); 30 | public static final BiomeGenBase desert = (new BiomeGenDesert(2)).setColor(16421912).setBiomeName("Desert").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setHeight(height_LowPlains); 31 | public static final BiomeGenBase extremeHills = (new BiomeGenHills(3, false)).setColor(6316128).setBiomeName("Extreme Hills").setHeight(height_MidHills).setTemperatureRainfall(0.2F, 0.3F); 32 | public static final BiomeGenBase forest = (new BiomeGenForest(4, 0)).setColor(353825).setBiomeName("Forest"); 33 | public static final BiomeGenBase taiga = (new BiomeGenTaiga(5, 0)).setColor(747097).setBiomeName("Taiga").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(height_MidPlains); 34 | public static final BiomeGenBase swampland = (new BiomeGenSwamp(6)).setColor(522674).setBiomeName("Swampland").setFillerBlockMetadata(9154376).setHeight(height_PartiallySubmerged).setTemperatureRainfall(0.8F, 0.9F); 35 | public static final BiomeGenBase river = (new BiomeGenRiver(7)).setColor(255).setBiomeName("River").setHeight(height_ShallowWaters); 36 | public static final BiomeGenBase hell = (new BiomeGenHell(8)).setColor(16711680).setBiomeName("Hell").setDisableRain().setTemperatureRainfall(2.0F, 0.0F); 37 | 38 | /** Is the biome used for sky world. */ 39 | public static final BiomeGenBase sky = (new BiomeGenEnd(9)).setColor(8421631).setBiomeName("The End").setDisableRain(); 40 | public static final BiomeGenBase frozenOcean = (new BiomeGenOcean(10)).setColor(9474208).setBiomeName("FrozenOcean").setEnableSnow().setHeight(height_Oceans).setTemperatureRainfall(0.0F, 0.5F); 41 | public static final BiomeGenBase frozenRiver = (new BiomeGenRiver(11)).setColor(10526975).setBiomeName("FrozenRiver").setEnableSnow().setHeight(height_ShallowWaters).setTemperatureRainfall(0.0F, 0.5F); 42 | public static final BiomeGenBase icePlains = (new BiomeGenSnow(12, false)).setColor(16777215).setBiomeName("Ice Plains").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F).setHeight(height_LowPlains); 43 | public static final BiomeGenBase iceMountains = (new BiomeGenSnow(13, false)).setColor(10526880).setBiomeName("Ice Mountains").setEnableSnow().setHeight(height_LowHills).setTemperatureRainfall(0.0F, 0.5F); 44 | public static final BiomeGenBase mushroomIsland = (new BiomeGenMushroomIsland(14)).setColor(16711935).setBiomeName("MushroomIsland").setTemperatureRainfall(0.9F, 1.0F).setHeight(height_LowIslands); 45 | public static final BiomeGenBase mushroomIslandShore = (new BiomeGenMushroomIsland(15)).setColor(10486015).setBiomeName("MushroomIslandShore").setTemperatureRainfall(0.9F, 1.0F).setHeight(height_Shores); 46 | 47 | /** Beach biome. */ 48 | public static final BiomeGenBase beach = (new BiomeGenBeach(16)).setColor(16440917).setBiomeName("Beach").setTemperatureRainfall(0.8F, 0.4F).setHeight(height_Shores); 49 | 50 | /** Desert Hills biome. */ 51 | public static final BiomeGenBase desertHills = (new BiomeGenDesert(17)).setColor(13786898).setBiomeName("DesertHills").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setHeight(height_LowHills); 52 | 53 | /** Forest Hills biome. */ 54 | public static final BiomeGenBase forestHills = (new BiomeGenForest(18, 0)).setColor(2250012).setBiomeName("ForestHills").setHeight(height_LowHills); 55 | 56 | /** Taiga Hills biome. */ 57 | public static final BiomeGenBase taigaHills = (new BiomeGenTaiga(19, 0)).setColor(1456435).setBiomeName("TaigaHills").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(height_LowHills); 58 | 59 | /** Extreme Hills Edge biome. */ 60 | public static final BiomeGenBase extremeHillsEdge = (new BiomeGenHills(20, true)).setColor(7501978).setBiomeName("Extreme Hills Edge").setHeight(height_MidHills.attenuate()).setTemperatureRainfall(0.2F, 0.3F); 61 | 62 | /** Jungle biome identifier */ 63 | public static final BiomeGenBase jungle = (new BiomeGenJungle(21, false)).setColor(5470985).setBiomeName("Jungle").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.9F); 64 | public static final BiomeGenBase jungleHills = (new BiomeGenJungle(22, false)).setColor(2900485).setBiomeName("JungleHills").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.9F).setHeight(height_LowHills); 65 | public static final BiomeGenBase jungleEdge = (new BiomeGenJungle(23, true)).setColor(6458135).setBiomeName("JungleEdge").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.8F); 66 | public static final BiomeGenBase deepOcean = (new BiomeGenOcean(24)).setColor(48).setBiomeName("Deep Ocean").setHeight(height_DeepOceans); 67 | public static final BiomeGenBase stoneBeach = (new BiomeGenStoneBeach(25)).setColor(10658436).setBiomeName("Stone Beach").setTemperatureRainfall(0.2F, 0.3F).setHeight(height_RockyWaters); 68 | public static final BiomeGenBase coldBeach = (new BiomeGenBeach(26)).setColor(16445632).setBiomeName("Cold Beach").setTemperatureRainfall(0.05F, 0.3F).setHeight(height_Shores).setEnableSnow(); 69 | public static final BiomeGenBase birchForest = (new BiomeGenForest(27, 2)).setBiomeName("Birch Forest").setColor(3175492); 70 | public static final BiomeGenBase birchForestHills = (new BiomeGenForest(28, 2)).setBiomeName("Birch Forest Hills").setColor(2055986).setHeight(height_LowHills); 71 | public static final BiomeGenBase roofedForest = (new BiomeGenForest(29, 3)).setColor(4215066).setBiomeName("Roofed Forest"); 72 | public static final BiomeGenBase coldTaiga = (new BiomeGenTaiga(30, 0)).setColor(3233098).setBiomeName("Cold Taiga").setFillerBlockMetadata(5159473).setEnableSnow().setTemperatureRainfall(-0.5F, 0.4F).setHeight(height_MidPlains).func_150563_c(16777215); 73 | public static final BiomeGenBase coldTaigaHills = (new BiomeGenTaiga(31, 0)).setColor(2375478).setBiomeName("Cold Taiga Hills").setFillerBlockMetadata(5159473).setEnableSnow().setTemperatureRainfall(-0.5F, 0.4F).setHeight(height_LowHills).func_150563_c(16777215); 74 | public static final BiomeGenBase megaTaiga = (new BiomeGenTaiga(32, 1)).setColor(5858897).setBiomeName("Mega Taiga").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.3F, 0.8F).setHeight(height_MidPlains); 75 | public static final BiomeGenBase megaTaigaHills = (new BiomeGenTaiga(33, 1)).setColor(4542270).setBiomeName("Mega Taiga Hills").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.3F, 0.8F).setHeight(height_LowHills); 76 | public static final BiomeGenBase extremeHillsPlus = (new BiomeGenHills(34, true)).setColor(5271632).setBiomeName("Extreme Hills+").setHeight(height_MidHills).setTemperatureRainfall(0.2F, 0.3F); 77 | public static final BiomeGenBase savanna = (new BiomeGenSavanna(35)).setColor(12431967).setBiomeName("Savanna").setTemperatureRainfall(1.2F, 0.0F).setDisableRain().setHeight(height_LowPlains); 78 | public static final BiomeGenBase savannaPlateau = (new BiomeGenSavanna(36)).setColor(10984804).setBiomeName("Savanna Plateau").setTemperatureRainfall(1.0F, 0.0F).setDisableRain().setHeight(height_HighPlateaus); 79 | public static final BiomeGenBase mesa = (new BiomeGenMesa(37, false, false)).setColor(14238997).setBiomeName("Mesa"); 80 | public static final BiomeGenBase mesaPlateau_F = (new BiomeGenMesa(38, false, true)).setColor(11573093).setBiomeName("Mesa Plateau F").setHeight(height_HighPlateaus); 81 | public static final BiomeGenBase mesaPlateau = (new BiomeGenMesa(39, false, false)).setColor(13274213).setBiomeName("Mesa Plateau").setHeight(height_HighPlateaus); 82 | public static final BiomeGenBase field_180279_ad = ocean; 83 | public String biomeName; 84 | public int color; 85 | public int field_150609_ah; 86 | 87 | public int fillerBlockMetadata; 88 | 89 | /** The minimum height of this biome. Default 0.1. */ 90 | public float minHeight; 91 | 92 | /** The maximum height of this biome. Default 0.3. */ 93 | public float maxHeight; 94 | 95 | /** The temperature of this biome. */ 96 | public float temperature; 97 | 98 | /** The rainfall in this biome. */ 99 | public float rainfall; 100 | 101 | /** Color tint applied to water depending on biome */ 102 | public int waterColorMultiplier; 103 | 104 | /** Set to true if snow is enabled for this biome. */ 105 | protected boolean enableSnow; 106 | 107 | /** 108 | * Is true (default) if the biome support rain (desert and nether can't have rain) 109 | */ 110 | protected boolean enableRain; 111 | 112 | /** The id number to this biome, and its index in the biomeList array. */ 113 | public final int biomeID; 114 | 115 | protected BiomeGenBase(int p_i1971_1_) 116 | { 117 | this.fillerBlockMetadata = 5169201; 118 | this.minHeight = height_Default.rootHeight; 119 | this.maxHeight = height_Default.variation; 120 | this.temperature = 0.5F; 121 | this.rainfall = 0.5F; 122 | this.waterColorMultiplier = 16777215; 123 | this.enableRain = true; 124 | 125 | this.biomeID = p_i1971_1_; 126 | biomeList[p_i1971_1_] = this; 127 | } 128 | 129 | 130 | /** 131 | * Sets the temperature and rainfall of this biome. 132 | */ 133 | protected BiomeGenBase setTemperatureRainfall(float p_76732_1_, float p_76732_2_) 134 | { 135 | if (p_76732_1_ > 0.1F && p_76732_1_ < 0.2F) 136 | { 137 | throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow"); 138 | } 139 | else 140 | { 141 | this.temperature = p_76732_1_; 142 | this.rainfall = p_76732_2_; 143 | return this; 144 | } 145 | } 146 | 147 | protected final BiomeGenBase setHeight(BiomeGenBase.Height p_150570_1_) 148 | { 149 | this.minHeight = p_150570_1_.rootHeight; 150 | this.maxHeight = p_150570_1_.variation; 151 | return this; 152 | } 153 | 154 | /** 155 | * Disable the rain for the biome. 156 | */ 157 | protected BiomeGenBase setDisableRain() 158 | { 159 | this.enableRain = false; 160 | return this; 161 | } 162 | 163 | /** 164 | * sets enableSnow to true during biome initialization. returns BiomeGenBase. 165 | */ 166 | protected BiomeGenBase setEnableSnow() 167 | { 168 | this.enableSnow = true; 169 | return this; 170 | } 171 | 172 | protected BiomeGenBase setBiomeName(String p_76735_1_) 173 | { 174 | this.biomeName = p_76735_1_; 175 | return this; 176 | } 177 | 178 | protected BiomeGenBase setFillerBlockMetadata(int p_76733_1_) 179 | { 180 | this.fillerBlockMetadata = p_76733_1_; 181 | return this; 182 | } 183 | 184 | protected BiomeGenBase setColor(int p_76739_1_) 185 | { 186 | this.func_150557_a(p_76739_1_, false); 187 | return this; 188 | } 189 | 190 | protected BiomeGenBase func_150563_c(int p_150563_1_) 191 | { 192 | this.field_150609_ah = p_150563_1_; 193 | return this; 194 | } 195 | 196 | protected BiomeGenBase func_150557_a(int p_150557_1_, boolean p_150557_2_) 197 | { 198 | this.color = p_150557_1_; 199 | 200 | if (p_150557_2_) 201 | { 202 | this.field_150609_ah = (p_150557_1_ & 16711422) >> 1; 203 | } 204 | else 205 | { 206 | this.field_150609_ah = p_150557_1_; 207 | } 208 | 209 | return this; 210 | } 211 | 212 | 213 | /** 214 | * Returns true if the biome have snowfall instead a normal rain. 215 | */ 216 | public boolean getEnableSnow() 217 | { 218 | return this.isSnowyBiome(); 219 | } 220 | 221 | /** 222 | * Return true if the biome supports lightning bolt spawn, either by have the bolts enabled and have rain enabled. 223 | */ 224 | public boolean canSpawnLightningBolt() 225 | { 226 | return this.isSnowyBiome() ? false : this.enableRain; 227 | } 228 | 229 | /** 230 | * Checks to see if the rainfall level of the biome is extremely high 231 | */ 232 | public boolean isHighHumidity() 233 | { 234 | return this.rainfall > 0.85F; 235 | } 236 | 237 | /** 238 | * returns the chance a creature has to spawn. 239 | */ 240 | public float getSpawningChance() 241 | { 242 | return 0.1F; 243 | } 244 | 245 | /** 246 | * Gets an integer representation of this biome's rainfall 247 | */ 248 | public final int getIntRainfall() 249 | { 250 | return (int)(this.rainfall * 65536.0F); 251 | } 252 | 253 | /** 254 | * Gets a floating point representation of this biome's rainfall 255 | */ 256 | public final float getFloatRainfall() 257 | { 258 | return this.rainfall; 259 | } 260 | 261 | public boolean isSnowyBiome() 262 | { 263 | return this.enableSnow; 264 | } 265 | 266 | /** 267 | * Creates a mutated version of the biome and places it into the biomeList with an index equal to the original plus 268 | * 128 269 | */ 270 | protected BiomeGenBase createMutation() 271 | { 272 | return this.createMutatedBiome(this.biomeID + 128); 273 | } 274 | 275 | protected BiomeGenBase createMutatedBiome(int p_180277_1_) 276 | { 277 | return new BiomeGenMutated(p_180277_1_, this); 278 | } 279 | 280 | public Class getBiomeClass() 281 | { 282 | return this.getClass(); 283 | } 284 | 285 | /** 286 | * returns true if the biome specified is equal to this biome 287 | */ 288 | public boolean isEqualTo(BiomeGenBase p_150569_1_) 289 | { 290 | return p_150569_1_ == this ? true : (p_150569_1_ == null ? false : this.getBiomeClass() == p_150569_1_.getBiomeClass()); 291 | } 292 | 293 | public BiomeGenBase.TempCategory getTempCategory() 294 | { 295 | return (double)this.temperature < 0.2D ? BiomeGenBase.TempCategory.COLD : ((double)this.temperature < 1.0D ? BiomeGenBase.TempCategory.MEDIUM : BiomeGenBase.TempCategory.WARM); 296 | } 297 | 298 | public static BiomeGenBase[] getBiomeGenArray() 299 | { 300 | return biomeList; 301 | } 302 | 303 | /** 304 | * return the biome specified by biomeID, or 0 (ocean) if out of bounds 305 | */ 306 | public static BiomeGenBase getBiome(int p_150568_0_) 307 | { 308 | return getBiomeFromBiomeList(p_150568_0_, (BiomeGenBase)null); 309 | } 310 | 311 | public static BiomeGenBase getBiomeFromBiomeList(int p_180276_0_, BiomeGenBase p_180276_1_) 312 | { 313 | if (p_180276_0_ >= 0 && p_180276_0_ <= biomeList.length) 314 | { 315 | BiomeGenBase var2 = biomeList[p_180276_0_]; 316 | return var2 == null ? p_180276_1_ : var2; 317 | } 318 | else 319 | { 320 | System.err.println("Biome ID is out of bounds: " + p_180276_0_ + ", defaulting to 0 (Ocean)"); 321 | return ocean; 322 | } 323 | } 324 | 325 | static 326 | { 327 | plains.createMutation(); 328 | desert.createMutation(); 329 | forest.createMutation(); 330 | taiga.createMutation(); 331 | swampland.createMutation(); 332 | icePlains.createMutation(); 333 | jungle.createMutation(); 334 | jungleEdge.createMutation(); 335 | coldTaiga.createMutation(); 336 | savanna.createMutation(); 337 | savannaPlateau.createMutation(); 338 | mesa.createMutation(); 339 | mesaPlateau_F.createMutation(); 340 | mesaPlateau.createMutation(); 341 | birchForest.createMutation(); 342 | birchForestHills.createMutation(); 343 | roofedForest.createMutation(); 344 | megaTaiga.createMutation(); 345 | extremeHills.createMutation(); 346 | extremeHillsPlus.createMutation(); 347 | megaTaiga.createMutatedBiome(megaTaigaHills.biomeID + 128).setBiomeName("Redwood Taiga Hills M"); 348 | BiomeGenBase[] var0 = biomeList; 349 | int var1 = var0.length; 350 | 351 | for (int var2 = 0; var2 < var1; ++var2) 352 | { 353 | BiomeGenBase var3 = var0[var2]; 354 | 355 | if (var3 != null) 356 | { 357 | if (field_180278_o.containsKey(var3.biomeName)) 358 | { 359 | throw new Error("Biome \"" + var3.biomeName + "\" is defined as both ID " + ((BiomeGenBase)field_180278_o.get(var3.biomeName)).biomeID + " and " + var3.biomeID); 360 | } 361 | 362 | field_180278_o.put(var3.biomeName, var3); 363 | 364 | if (var3.biomeID < 128) 365 | { 366 | explorationBiomesList.add(var3); 367 | } 368 | } 369 | } 370 | 371 | explorationBiomesList.remove(hell); 372 | explorationBiomesList.remove(sky); 373 | explorationBiomesList.remove(frozenOcean); 374 | explorationBiomesList.remove(extremeHillsEdge); 375 | } 376 | 377 | public static class Height 378 | { 379 | public float rootHeight; 380 | public float variation; 381 | 382 | public Height(float p_i45371_1_, float p_i45371_2_) 383 | { 384 | this.rootHeight = p_i45371_1_; 385 | this.variation = p_i45371_2_; 386 | } 387 | 388 | public BiomeGenBase.Height attenuate() 389 | { 390 | return new BiomeGenBase.Height(this.rootHeight * 0.8F, this.variation * 0.6F); 391 | } 392 | } 393 | 394 | public static enum TempCategory 395 | { 396 | OCEAN("OCEAN", 0), 397 | COLD("COLD", 1), 398 | MEDIUM("MEDIUM", 2), 399 | WARM("WARM", 3); 400 | 401 | private static final BiomeGenBase.TempCategory[] $VALUES = new BiomeGenBase.TempCategory[]{OCEAN, COLD, MEDIUM, WARM}; 402 | 403 | private TempCategory(String p_i45372_1_, int p_i45372_2_) {} 404 | } 405 | } 406 | --------------------------------------------------------------------------------