Skip to content

Instantly share code, notes, and snippets.

@Pokechu22
Last active July 12, 2020 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pokechu22/6c65eab5e6e922a7fe5d870900882c55 to your computer and use it in GitHub Desktop.
Save Pokechu22/6c65eab5e6e922a7fe5d870900882c55 to your computer and use it in GitHub Desktop.
1.8.9/1.9 BiomeGenBase
diff --git a/15w51b/aib.java b/16w02a/aic.java
index bf60267..204f2a6 100755
--- a/15w51b/aib.java
+++ b/16w02a/aic.java
@@ -1,278 +1,176 @@
import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.Random;
import java.util.Set;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-public abstract class aib {
- private static final Logger aM = LogManager.getLogger();
- protected static final aqw a = ajo.b.v();
- protected static final aqw b = ajo.a.v();
- protected static final aqw c = ajo.h.v();
- protected static final aqw d = ajo.n.v();
- protected static final aqw e = ajo.cM.v();
- protected static final aqw f = ajo.A.v();
- protected static final aqw g = ajo.aI.v();
- protected static final aqw h = ajo.j.v();
- protected static final aib.a i = new aib.a(0.1F, 0.2F);
- protected static final aib.a j = new aib.a(-0.5F, 0.0F);
- protected static final aib.a k = new aib.a(-1.0F, 0.1F);
- protected static final aib.a l = new aib.a(-1.8F, 0.1F);
- protected static final aib.a m = new aib.a(0.125F, 0.05F);
- protected static final aib.a n = new aib.a(0.2F, 0.2F);
- protected static final aib.a o = new aib.a(0.45F, 0.3F);
- protected static final aib.a p = new aib.a(1.5F, 0.025F);
- protected static final aib.a q = new aib.a(1.0F, 0.5F);
- protected static final aib.a r = new aib.a(0.0F, 0.025F);
- protected static final aib.a s = new aib.a(0.1F, 0.8F);
- protected static final aib.a t = new aib.a(0.2F, 0.3F);
- protected static final aib.a u = new aib.a(-0.2F, 0.1F);
- private static final aib[] aN = new aib[256];
- public static final Set v = Sets.newHashSet();
- public static final Map w = Maps.newHashMap();
- public static final aib x = (new aiq(0)).b(112).a("Ocean").a(k);
- public static final aib y = (new air(1)).b(9286496).a("Plains");
- public static final aib z = (new aig(2)).b(16421912).a("Desert").b().a(2.0F, 0.0F).a(m);
- public static final aib A = (new aih(3, false)).b(6316128).a("Extreme Hills").a(q).a(0.2F, 0.3F);
- public static final aib B = (new aij(4, 0)).b(353825).a("Forest");
- public static final aib C = (new aix(5, 0)).b(747097).a("Taiga").a(5159473).a(0.25F, 0.8F).a(n);
- public static final aib D = (new aiw(6)).b(522674).a("Swampland").a(9154376).a(u).a(0.8F, 0.9F);
- public static final aib E = (new ait(7)).b(255).a("River").a(j);
- public static final aib F = (new aik(8)).b(16711680).a("Hell").b().a(2.0F, 0.0F);
- public static final aib G = (new aiy(9)).b(8421631).a("The End").b();
- public static final aib H = (new aiq(10)).b(9474208).a("FrozenOcean").c().a(k).a(0.0F, 0.5F);
- public static final aib I = (new ait(11)).b(10526975).a("FrozenRiver").c().a(j).a(0.0F, 0.5F);
- public static final aib J = (new ail(12, false)).b(16777215).a("Ice Plains").c().a(0.0F, 0.5F).a(m);
- public static final aib K = (new ail(13, false)).b(10526880).a("Ice Mountains").c().a(o).a(0.0F, 0.5F);
- public static final aib L = (new aio(14)).b(16711935).a("MushroomIsland").a(0.9F, 1.0F).a(t);
- public static final aib M = (new aio(15)).b(10486015).a("MushroomIslandShore").a(0.9F, 1.0F).a(r);
- public static final aib N = (new aia(16)).b(16440917).a("Beach").a(0.8F, 0.4F).a(r);
- public static final aib O = (new aig(17)).b(13786898).a("DesertHills").b().a(2.0F, 0.0F).a(o);
- public static final aib P = (new aij(18, 0)).b(2250012).a("ForestHills").a(o);
- public static final aib Q = (new aix(19, 0)).b(1456435).a("TaigaHills").a(5159473).a(0.25F, 0.8F).a(o);
- public static final aib R = (new aih(20, true)).b(7501978).a("Extreme Hills Edge").a(q.a()).a(0.2F, 0.3F);
- public static final aib S = (new aim(21, false)).b(5470985).a("Jungle").a(5470985).a(0.95F, 0.9F);
- public static final aib T = (new aim(22, false)).b(2900485).a("JungleHills").a(5470985).a(0.95F, 0.9F).a(o);
- public static final aib U = (new aim(23, true)).b(6458135).a("JungleEdge").a(5470985).a(0.95F, 0.8F);
- public static final aib V = (new aiq(24)).b(48).a("Deep Ocean").a(l);
- public static final aib W = (new aiv(25)).b(10658436).a("Stone Beach").a(0.2F, 0.3F).a(s);
- public static final aib X = (new aia(26)).b(16445632).a("Cold Beach").a(0.05F, 0.3F).a(r).c();
- public static final aib Y = (new aij(27, 2)).a("Birch Forest").b(3175492);
- public static final aib Z = (new aij(28, 2)).a("Birch Forest Hills").b(2055986).a(o);
- public static final aib aa = (new aij(29, 3)).b(4215066).a("Roofed Forest");
- public static final aib ab = (new aix(30, 0)).b(3233098).a("Cold Taiga").a(5159473).c().a(-0.5F, 0.4F).a(n).c(16777215);
- public static final aib ac = (new aix(31, 0)).b(2375478).a("Cold Taiga Hills").a(5159473).c().a(-0.5F, 0.4F).a(o).c(16777215);
- public static final aib ad = (new aix(32, 1)).b(5858897).a("Mega Taiga").a(5159473).a(0.3F, 0.8F).a(n);
- public static final aib ae = (new aix(33, 1)).b(4542270).a("Mega Taiga Hills").a(5159473).a(0.3F, 0.8F).a(o);
- public static final aib af = (new aih(34, true)).b(5271632).a("Extreme Hills+").a(q).a(0.2F, 0.3F);
- public static final aib ag = (new aiu(35)).b(12431967).a("Savanna").a(1.2F, 0.0F).b().a(m);
- public static final aib ah = (new aiu(36)).b(10984804).a("Savanna Plateau").a(1.0F, 0.0F).b().a(p);
- public static final aib ai = (new ain(37, false, false)).b(14238997).a("Mesa");
- public static final aib aj = (new ain(38, false, true)).b(11573093).a("Mesa Plateau F").a(p);
- public static final aib ak = (new ain(39, false, false)).b(13274213).a("Mesa Plateau").a(p);
- public static final aib al = (new aja(127)).b(0).a("The Void").b();
- public static final aib am = x;
- protected static final awp an;
- protected static final awp ao;
- protected static final att ap;
- public String aq;
- public int ar;
- public int as;
- public aqw at = ajo.c.v();
- public aqw au = ajo.d.v();
- public int av = 5169201;
- public float aw = i.a;
- public float ax = i.b;
- public float ay = 0.5F;
- public float az = 0.5F;
- public int aA = 16777215;
- public aie aB;
- protected List aC = Lists.newArrayList();
- protected List aD = Lists.newArrayList();
- protected List aE = Lists.newArrayList();
- protected List aF = Lists.newArrayList();
- protected boolean aG;
- protected boolean aH = true;
- public final int aI;
- protected ava aJ = new ava(false);
- protected atk aK = new atk(false);
- protected auy aL = new auy();
-
- protected aib(int var1) {
- this.aI = ☃;
- aN[☃] = this;
- this.aB = this.a();
- this.aD.add(new aib.c(wb.class, 12, 4, 4));
- this.aD.add(new aib.c(vz.class, 10, 4, 4));
- this.aD.add(new aib.c(vu.class, 10, 4, 4));
- this.aD.add(new aib.c(vv.class, 8, 4, 4));
- this.aC.add(new aib.c(ze.class, 100, 4, 4));
- this.aC.add(new aib.c(zg.class, 100, 4, 4));
- this.aC.add(new aib.c(zc.class, 100, 4, 4));
- this.aC.add(new aib.c(yo.class, 100, 4, 4));
- this.aC.add(new aib.c(zd.class, 100, 4, 4));
- this.aC.add(new aib.c(yp.class, 10, 1, 4));
- this.aC.add(new aib.c(zf.class, 5, 1, 1));
- this.aE.add(new aib.c(wd.class, 10, 4, 4));
- this.aF.add(new aib.c(vr.class, 10, 8, 8));
- }
-
- protected aie a() {
- return new aie();
- }
-
- protected aib a(float var1, float var2) {
- if (☃ > 0.1F && ☃ < 0.2F) {
- throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow");
- } else {
- this.ay = ☃;
- this.az = ☃;
- return this;
- }
- }
-
- protected final aib a(aib.a var1) {
- this.aw = ☃.a;
- this.ax = ☃.b;
- return this;
- }
-
- protected aib b() {
- this.aH = false;
- return this;
- }
-
- public atj a(Random var1) {
- return (atj)(☃.nextInt(10) == 0 ? this.aK : this.aJ);
- }
-
- public atx b(Random var1) {
- return new auz(aov.a.b);
- }
-
- public alg.a a(Random var1, cj var2) {
- return ☃.nextInt(3) > 0 ? alg.a.a : alg.a.b;
- }
-
- protected aib c() {
- this.aG = true;
- return this;
- }
-
- protected aib a(String var1) {
- this.aq = ☃;
- return this;
- }
-
- protected aib a(int var1) {
- this.av = ☃;
- return this;
- }
-
- protected aib b(int var1) {
- this.a(☃, false);
- return this;
- }
-
- protected aib c(int var1) {
- this.as = ☃;
- return this;
- }
-
- protected aib a(int var1, boolean var2) {
- this.ar = ☃;
- if (☃) {
- this.as = (☃ & 16711422) >> 1;
- } else {
- this.as = ☃;
- }
-
- return this;
+public abstract class aic {
+ private static final Logger y = LogManager.getLogger();
+ protected static final aqz a = ajq.b.u();
+ protected static final aqz b = ajq.a.u();
+ protected static final aqz c = ajq.h.u();
+ protected static final aqz d = ajq.n.u();
+ protected static final aqz e = ajq.cM.u();
+ protected static final aqz f = ajq.A.u();
+ protected static final aqz g = ajq.aI.u();
+ protected static final aqz h = ajq.j.u();
+ public static final Set i = Sets.newHashSet();
+ public static final ct j = new ct();
+ protected static final aws k = new aws(new Random(1234L), 1);
+ protected static final aws l = new aws(new Random(2345L), 1);
+ protected static final atw m = new atw();
+ protected static final avd n = new avd(false);
+ protected static final atn o = new atn(false);
+ protected static final avb p = new avb();
+ public static final cx q = new cx();
+ private final String z;
+ private final float A;
+ private final float B;
+ private final float C;
+ private final float D;
+ private final int E;
+ private final boolean F;
+ private final boolean G;
+ private final String H;
+ public aqz r = ajq.c.u();
+ public aqz s = ajq.d.u();
+ public aif t;
+ protected List u = Lists.newArrayList();
+ protected List v = Lists.newArrayList();
+ protected List w = Lists.newArrayList();
+ protected List x = Lists.newArrayList();
+
+ public static int a(aic var0) {
+ return q.a(☃);
+ }
+
+ public static aic a(int var0) {
+ return (aic)q.a(☃);
+ }
+
+ public static aic b(aic var0) {
+ return (aic)q.c(j.a(a(☃)));
+ }
+
+ protected aic(aic.a var1) {
+ this.z = ☃.a;
+ this.A = ☃.b;
+ this.B = ☃.c;
+ this.C = ☃.d;
+ this.D = ☃.e;
+ this.E = ☃.f;
+ this.F = ☃.g;
+ this.G = ☃.h;
+ this.H = ☃.i;
+ this.t = this.a();
+ this.v.add(new aic.c(wc.class, 12, 4, 4));
+ this.v.add(new aic.c(wa.class, 10, 4, 4));
+ this.v.add(new aic.c(vv.class, 10, 4, 4));
+ this.v.add(new aic.c(vw.class, 8, 4, 4));
+ this.u.add(new aic.c(zg.class, 100, 4, 4));
+ this.u.add(new aic.c(zi.class, 100, 4, 4));
+ this.u.add(new aic.c(ze.class, 100, 4, 4));
+ this.u.add(new aic.c(yq.class, 100, 4, 4));
+ this.u.add(new aic.c(zf.class, 100, 4, 4));
+ this.u.add(new aic.c(yr.class, 10, 1, 4));
+ this.u.add(new aic.c(zh.class, 5, 1, 1));
+ this.w.add(new aic.c(we.class, 10, 4, 4));
+ this.x.add(new aic.c(vs.class, 10, 8, 8));
+ }
+
+ protected aif a() {
+ return new aif();
+ }
+
+ public boolean b() {
+ return this.H != null;
+ }
+
+ public atm a(Random var1) {
+ return (atm)(☃.nextInt(10) == 0 ? o : n);
+ }
+
+ public aua b(Random var1) {
+ return new avc(aoy.a.b);
+ }
+
+ public ali.a a(Random var1, cj var2) {
+ return ☃.nextInt(3) > 0 ? ali.a.a : ali.a.b;
}
public int a(float var1) {
☃ = ☃ / 3.0F;
- ☃ = om.a(☃, -1.0F, 1.0F);
- return om.c(0.62222224F - ☃ * 0.05F, 0.5F + ☃ * 0.1F, 1.0F);
+ ☃ = on.a(☃, -1.0F, 1.0F);
+ return on.c(0.62222224F - ☃ * 0.05F, 0.5F + ☃ * 0.1F, 1.0F);
}
- public List a(sa var1) {
+ public List a(sb var1) {
switch(☃) {
case a:
- return this.aC;
+ return this.u;
case b:
- return this.aD;
+ return this.v;
case d:
- return this.aE;
+ return this.w;
case c:
- return this.aF;
+ return this.x;
default:
return Collections.emptyList();
}
}
- public boolean d() {
- return this.j();
+ public boolean c() {
+ return this.p();
}
- public boolean e() {
- return this.j() ? false : this.aH;
+ public boolean d() {
+ return this.p() ? false : this.G;
}
- public boolean f() {
- return this.az > 0.85F;
+ public boolean e() {
+ return this.k() > 0.85F;
}
- public float g() {
+ public float f() {
return 0.1F;
}
- public final float i() {
- return this.az;
- }
-
public final float a(cj var1) {
if (☃.q() > 64) {
- float ☃ = (float)(an.a((double)☃.p() * 1.0D / 8.0D, (double)☃.r() * 1.0D / 8.0D) * 4.0D);
- return this.ay - (☃ + (float)☃.q() - 64.0F) * 0.05F / 30.0F;
+ float ☃ = (float)(k.a((double)((float)☃.p() / 8.0F), (double)((float)☃.r() / 8.0F)) * 4.0D);
+ return this.n() - (☃ + (float)☃.q() - 64.0F) * 0.05F / 30.0F;
} else {
- return this.ay;
+ return this.n();
}
}
- public void a(aho var1, Random var2, cj var3) {
- this.aB.a(☃, ☃, this, ☃);
+ public void a(ahp var1, Random var2, cj var3) {
+ this.t.a(☃, ☃, this, ☃);
}
public int b(cj var1) {
- double ☃ = (double)om.a(this.a(☃), 0.0F, 1.0F);
- double ☃ = (double)om.a(this.i(), 0.0F, 1.0F);
- return ahn.a(☃, ☃);
+ double ☃ = (double)on.a(this.a(☃), 0.0F, 1.0F);
+ double ☃ = (double)on.a(this.k(), 0.0F, 1.0F);
+ return aho.a(☃, ☃);
}
public int c(cj var1) {
- double ☃ = (double)om.a(this.a(☃), 0.0F, 1.0F);
- double ☃ = (double)om.a(this.i(), 0.0F, 1.0F);
- return ahl.a(☃, ☃);
- }
-
- public boolean j() {
- return this.aG;
+ double ☃ = (double)on.a(this.a(☃), 0.0F, 1.0F);
+ double ☃ = (double)on.a(this.k(), 0.0F, 1.0F);
+ return ahm.a(☃, ☃);
}
- public void a(aho var1, Random var2, asz var3, int var4, int var5, double var6) {
+ public void a(ahp var1, Random var2, atc var3, int var4, int var5, double var6) {
this.b(☃, ☃, ☃, ☃, ☃, ☃);
}
- public final void b(aho var1, Random var2, asz var3, int var4, int var5, double var6) {
+ public final void b(ahp var1, Random var2, atc var3, int var4, int var5, double var6) {
int ☃ = ☃.K();
- aqw ☃ = this.at;
- aqw ☃ = this.au;
+ aqz ☃ = this.r;
+ aqz ☃ = this.s;
int ☃ = -1;
int ☃ = (int)(☃ / 3.0D + 3.0D + ☃.nextDouble() * 0.25D);
int ☃ = ☃ & 15;
@@ -283,20 +181,20 @@ public abstract class aib {
if (☃ <= ☃.nextInt(5)) {
☃.a(☃, ☃, ☃, c);
} else {
- aqw ☃ = ☃.a(☃, ☃, ☃);
- if (☃.a() == awy.a) {
+ aqz ☃ = ☃.a(☃, ☃, ☃);
+ if (☃.a() == axb.a) {
☃ = -1;
- } else if (☃.t() == ajo.b) {
+ } else if (☃.t() == ajq.b) {
if (☃ == -1) {
if (☃ <= 0) {
☃ = b;
☃ = a;
} else if (☃ >= ☃ - 4 && ☃ <= ☃ + 1) {
- ☃ = this.at;
- ☃ = this.au;
+ ☃ = this.r;
+ ☃ = this.s;
}
- if (☃ < ☃ && (☃ == null || ☃.a() == awy.a)) {
+ if (☃ < ☃ && (☃ == null || ☃.a() == axb.a)) {
if (this.a(☃.c(☃, ☃, ☃)) < 0.15F) {
☃ = g;
} else {
@@ -317,9 +215,9 @@ public abstract class aib {
} else if (☃ > 0) {
--☃;
☃.a(☃, ☃, ☃, ☃);
- if (☃ == 0 && ☃.t() == ajo.m) {
+ if (☃ == 0 && ☃.t() == ajq.m) {
☃ = ☃.nextInt(4) + Math.max(0, ☃ - 63);
- ☃ = ☃.c(any.a) == any.a.b ? e : f;
+ ☃ = ☃.c(aob.a) == aob.a.b ? e : f;
}
}
}
@@ -328,115 +226,190 @@ public abstract class aib {
}
- protected aib k() {
- return this.d(this.aI + 128);
- }
-
- protected aib d(int var1) {
- return new aip(☃, this);
- }
-
- public Class l() {
+ public Class g() {
return this.getClass();
}
- public boolean a(aib var1) {
- if (☃ == this) {
- return true;
- } else if (☃ == null) {
- return false;
+ public aic.b h() {
+ if ((double)this.n() < 0.2D) {
+ return aic.b.b;
} else {
- return this.l() == ☃.l();
+ return (double)this.n() < 1.0D ? aic.b.c : aic.b.d;
}
}
- public aib.b m() {
- if ((double)this.ay < 0.2D) {
- return aib.b.b;
- } else {
- return (double)this.ay < 1.0D ? aib.b.c : aib.b.d;
- }
+ public static aic b(int var0) {
+ return a(☃, (aic)null);
}
- public static aib[] n() {
- return aN;
+ public static aic a(int var0, aic var1) {
+ aic ☃ = a(☃);
+ return ☃ == null ? ☃ : ☃;
}
- public static aib e(int var0) {
- return a(☃, (aib)null);
+ public boolean i() {
+ return false;
}
- public static aib a(int var0, aib var1) {
- if (☃ >= 0 && ☃ <= aN.length) {
- aib ☃ = aN[☃];
- return ☃ == null ? ☃ : ☃;
- } else {
- aM.warn("Biome ID is out of bounds: " + ☃ + ", defaulting to 0 (Ocean)");
- return x;
+ public final float j() {
+ return this.A;
+ }
+
+ public final float k() {
+ return this.D;
+ }
+
+ public final String l() {
+ return this.z;
+ }
+
+ public final float m() {
+ return this.B;
+ }
+
+ public final float n() {
+ return this.C;
+ }
+
+ public final int o() {
+ return this.E;
+ }
+
+ public final boolean p() {
+ return this.F;
+ }
+
+ public static void q() {
+ a(0, "ocean", new ait((new aic.a("Ocean")).c(-1.0F).d(0.1F)));
+ a(1, "plains", new aiu(false, (new aic.a("Plains")).c(0.125F).d(0.05F).a(0.8F).b(0.4F)));
+ a(2, "desert", new aii((new aic.a("Desert")).c(0.125F).d(0.05F).a(2.0F).b(0.0F).a()));
+ a(3, "extreme_hills", new aij(aij.a.a, (new aic.a("Extreme Hills")).c(1.0F).d(0.5F).a(0.2F).b(0.3F)));
+ a(4, "forest", new ail(ail.a.a, (new aic.a("Forest")).a(0.7F).b(0.8F)));
+ a(5, "taiga", new aiz(aiz.a.a, (new aic.a("Taiga")).c(0.2F).d(0.2F).a(0.25F).b(0.8F)));
+ a(6, "swampland", new aiy((new aic.a("Swampland")).c(-0.2F).d(0.1F).a(0.8F).b(0.9F).a(14745518)));
+ a(7, "river", new aiv((new aic.a("River")).c(-0.5F).d(0.0F)));
+ a(8, "hell", new aim((new aic.a("Hell")).a(2.0F).b(0.0F).a()));
+ a(9, "sky", new aja((new aic.a("The End")).a()));
+ a(10, "frozen_ocean", new ait((new aic.a("FrozenOcean")).c(-1.0F).d(0.1F).a(0.0F).b(0.5F).b()));
+ a(11, "frozen_river", new aiv((new aic.a("FrozenRiver")).c(-0.5F).d(0.0F).a(0.0F).b(0.5F).b()));
+ a(12, "ice_flats", new ain(false, (new aic.a("Ice Plains")).c(0.125F).d(0.05F).a(0.0F).b(0.5F).b()));
+ a(13, "ice_mountains", new ain(false, (new aic.a("Ice Mountains")).c(0.45F).d(0.3F).a(0.0F).b(0.5F).b()));
+ a(14, "mushroom_island", new aiq((new aic.a("MushroomIsland")).c(0.2F).d(0.3F).a(0.9F).b(1.0F)));
+ a(15, "mushroom_island_shore", new aiq((new aic.a("MushroomIslandShore")).c(0.0F).d(0.025F).a(0.9F).b(1.0F)));
+ a(16, "beaches", new aib((new aic.a("Beach")).c(0.0F).d(0.025F).a(0.8F).b(0.4F)));
+ a(17, "desert_hills", new aii((new aic.a("DesertHills")).c(0.45F).d(0.3F).a(2.0F).b(0.0F).a()));
+ a(18, "forest_hills", new ail(ail.a.a, (new aic.a("ForestHills")).c(0.45F).d(0.3F).a(0.7F).b(0.8F)));
+ a(19, "taiga_hills", new aiz(aiz.a.a, (new aic.a("TaigaHills")).a(0.25F).b(0.8F).c(0.45F).d(0.3F)));
+ a(20, "smaller_extreme_hills", new aij(aij.a.b, (new aic.a("Extreme Hills Edge")).c(0.8F).d(0.3F).a(0.2F).b(0.3F)));
+ a(21, "jungle", new aio(false, (new aic.a("Jungle")).a(0.95F).b(0.9F)));
+ a(22, "jungle_hills", new aio(false, (new aic.a("JungleHills")).c(0.45F).d(0.3F).a(0.95F).b(0.9F)));
+ a(23, "jungle_edge", new aio(true, (new aic.a("JungleEdge")).a(0.95F).b(0.8F)));
+ a(24, "deep_ocean", new ait((new aic.a("Deep Ocean")).c(-1.8F).d(0.1F)));
+ a(25, "stone_beach", new aix((new aic.a("Stone Beach")).c(0.1F).d(0.8F).a(0.2F).b(0.3F)));
+ a(26, "cold_beach", new aib((new aic.a("Cold Beach")).c(0.0F).d(0.025F).a(0.05F).b(0.3F).b()));
+ a(27, "birch_forest", new ail(ail.a.c, (new aic.a("Birch Forest")).a(0.6F).b(0.6F)));
+ a(28, "birch_forest_hills", new ail(ail.a.c, (new aic.a("Birch Forest Hills")).c(0.45F).d(0.3F).a(0.6F).b(0.6F)));
+ a(29, "roofed_forest", new ail(ail.a.d, (new aic.a("Roofed Forest")).a(0.7F).b(0.8F)));
+ a(30, "taiga_cold", new aiz(aiz.a.a, (new aic.a("Cold Taiga")).c(0.2F).d(0.2F).a(-0.5F).b(0.4F).b()));
+ a(31, "taiga_cold_hills", new aiz(aiz.a.a, (new aic.a("Cold Taiga Hills")).c(0.45F).d(0.3F).a(-0.5F).b(0.4F).b()));
+ a(32, "redwood_taiga", new aiz(aiz.a.b, (new aic.a("Mega Taiga")).a(0.3F).b(0.8F).c(0.2F).d(0.2F)));
+ a(33, "redwood_taiga_hills", new aiz(aiz.a.b, (new aic.a("Mega Taiga Hills")).c(0.45F).d(0.3F).a(0.3F).b(0.8F)));
+ a(34, "extreme_hills_with_trees", new aij(aij.a.b, (new aic.a("Extreme Hills+")).c(1.0F).d(0.5F).a(0.2F).b(0.3F)));
+ a(35, "savanna", new aiw((new aic.a("Savanna")).c(0.125F).d(0.05F).a(1.2F).b(0.0F).a()));
+ a(36, "savanna_rock", new aiw((new aic.a("Savanna Plateau")).c(1.5F).d(0.025F).a(1.0F).b(0.0F).a()));
+ a(37, "mesa", new aip(false, false, (new aic.a("Mesa")).a(2.0F).b(0.0F).a()));
+ a(38, "mesa_rock", new aip(false, true, (new aic.a("Mesa Plateau F")).c(1.5F).d(0.025F).a(2.0F).b(0.0F).a()));
+ a(39, "mesa_clear_rock", new aip(false, false, (new aic.a("Mesa Plateau")).c(1.5F).d(0.025F).a(2.0F).b(0.0F).a()));
+ a(127, "void", new ajc((new aic.a("The Void")).a()));
+ a(129, "mutated_plains", new aiu(true, (new aic.a("Sunflower Plains")).a("plains").c(0.125F).d(0.05F).a(0.8F).b(0.4F)));
+ a(130, "mutated_desert", new aii((new aic.a("Desert M")).a("desert").c(0.225F).d(0.25F).a(2.0F).b(0.0F).a()));
+ a(131, "mutated_extreme_hills", new aij(aij.a.c, (new aic.a("Extreme Hills M")).a("extreme_hills").c(1.0F).d(0.5F).a(0.2F).b(0.3F)));
+ a(132, "mutated_forest", new ail(ail.a.b, (new aic.a("Flower Forest")).a("forest").d(0.4F).a(0.7F).b(0.8F)));
+ a(133, "mutated_taiga", new aiz(aiz.a.a, (new aic.a("Taiga M")).a("taiga").c(0.3F).d(0.4F).a(0.25F).b(0.8F)));
+ a(134, "mutated_swampland", new aiy((new aic.a("Swampland M")).a("swampland").c(-0.1F).d(0.3F).a(0.8F).b(0.9F).a(14745518)));
+ a(140, "mutated_ice_flats", new ain(true, (new aic.a("Ice Plains Spikes")).a("ice_flats").c(0.425F).d(0.45000002F).a(0.0F).b(0.5F).b()));
+ a(149, "mutated_jungle", new aio(false, (new aic.a("Jungle M")).a("jungle").c(0.2F).d(0.4F).a(0.95F).b(0.9F)));
+ a(151, "mutated_jungle_edge", new aio(true, (new aic.a("JungleEdge M")).a("jungle_edge").c(0.2F).d(0.4F).a(0.95F).b(0.8F)));
+ a(155, "mutated_birch_forest", new air((new aic.a("Birch Forest M")).a("birch_forest").c(0.2F).d(0.4F).a(0.6F).b(0.6F)));
+ a(156, "mutated_birch_forest_hills", new air((new aic.a("Birch Forest Hills M")).a("birch_forest").c(0.55F).d(0.5F).a(0.6F).b(0.6F)));
+ a(157, "mutated_roofed_forest", new ail(ail.a.d, (new aic.a("Roofed Forest M")).a("roofed_forest").c(0.2F).d(0.4F).a(0.7F).b(0.8F)));
+ a(158, "mutated_taiga_cold", new aiz(aiz.a.a, (new aic.a("Cold Taiga M")).a("taiga_cold").c(0.3F).d(0.4F).a(-0.5F).b(0.4F).b()));
+ a(160, "mutated_redwood_taiga", new aiz(aiz.a.c, (new aic.a("Mega Spruce Taiga")).a("redwood_taiga").c(0.2F).d(0.2F).a(0.25F).b(0.8F)));
+ a(161, "mutated_redwood_taiga_hills", new aiz(aiz.a.c, (new aic.a("Redwood Taiga Hills M")).a("redwood_taiga_hills").c(0.2F).d(0.2F).a(0.25F).b(0.8F)));
+ a(162, "mutated_extreme_hills_with_trees", new aij(aij.a.c, (new aic.a("Extreme Hills+ M")).a("extreme_hills_with_trees").c(1.0F).d(0.5F).a(0.2F).b(0.3F)));
+ a(163, "mutated_savanna", new ais((new aic.a("Savanna M")).a("savanna").c(0.3625F).d(1.225F).a(1.1F).b(0.0F).a()));
+ a(164, "mutated_savanna_rock", new ais((new aic.a("Savanna Plateau M")).a("savanna_rock").c(1.05F).d(1.2125001F).a(1.0F).b(0.0F).a()));
+ a(165, "mutated_mesa", new aip(true, false, (new aic.a("Mesa (Bryce)")).a("mesa").a(2.0F).b(0.0F).a()));
+ a(166, "mutated_mesa_rock", new aip(false, true, (new aic.a("Mesa Plateau F M")).a("mesa_rock").c(0.45F).d(0.3F).a(2.0F).b(0.0F).a()));
+ a(167, "mutated_mesa_clear_rock", new aip(false, false, (new aic.a("Mesa Plateau M")).a("mesa_clear_rock").c(0.45F).d(0.3F).a(2.0F).b(0.0F).a()));
+ Collections.addAll(i, new aic[]{aih.a, aih.c, aih.d, aih.e, aih.f, aih.g, aih.h, aih.i, aih.m, aih.n, aih.o, aih.p, aih.q, aih.r, aih.s, aih.t, aih.u, aih.w, aih.x, aih.y, aih.z, aih.A, aih.B, aih.C, aih.D, aih.E, aih.F, aih.G, aih.H, aih.I, aih.J, aih.K, aih.L, aih.M, aih.N, aih.O});
+ }
+
+ private static void a(int var0, String var1, aic var2) {
+ q.a(☃, new kk(☃), ☃);
+ if (☃.b()) {
+ j.a(new kk(☃.H), ☃);
}
- }
- public boolean o() {
- return false;
}
- static {
- y.k();
- z.k();
- B.k();
- C.k();
- D.k();
- J.k();
- S.k();
- U.k();
- ab.k();
- ag.k();
- ah.k();
- ai.k();
- aj.k();
- ak.k();
- Y.k();
- Z.k();
- aa.k();
- ad.k();
- A.k();
- af.k();
- ad.d(ae.aI + 128).a("Redwood Taiga Hills M");
-
- for(aib ☃ : aN) {
- if (☃ != null) {
- if (w.containsKey(☃.aq)) {
- throw new Error("Biome \"" + ☃.aq + "\" is defined as both ID " + ((aib)w.get(☃.aq)).aI + " and " + ☃.aI);
- }
+ public static class a {
+ private final String a;
+ private float b = 0.1F;
+ private float c = 0.2F;
+ private float d = 0.5F;
+ private float e = 0.5F;
+ private int f = 16777215;
+ private boolean g;
+ private boolean h = true;
+ private String i;
+
+ public a(String var1) {
+ this.a = ☃;
+ }
- w.put(☃.aq, ☃);
- if (☃.aI < 128) {
- v.add(☃);
- }
+ protected aic.a a(float var1) {
+ if (☃ > 0.1F && ☃ < 0.2F) {
+ throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow");
+ } else {
+ this.d = ☃;
+ return this;
}
}
- v.remove(F);
- v.remove(G);
- v.remove(H);
- v.remove(R);
- v.remove(al);
- an = new awp(new Random(1234L), 1);
- ao = new awp(new Random(2345L), 1);
- ap = new att();
- }
-
- public static class a {
- public float a;
- public float b;
+ protected aic.a b(float var1) {
+ this.e = ☃;
+ return this;
+ }
- public a(float var1, float var2) {
- this.a = ☃;
+ protected aic.a c(float var1) {
this.b = ☃;
+ return this;
+ }
+
+ protected aic.a d(float var1) {
+ this.c = ☃;
+ return this;
+ }
+
+ protected aic.a a() {
+ this.h = false;
+ return this;
+ }
+
+ protected aic.a b() {
+ this.g = true;
+ return this;
}
- public aib.a a() {
- return new aib.a(this.a * 0.8F, this.b * 0.6F);
+ protected aic.a a(int var1) {
+ this.f = ☃;
+ return this;
+ }
+
+ protected aic.a a(String var1) {
+ this.i = ☃;
+ return this;
}
}
@@ -447,7 +420,7 @@ public abstract class aib {
d;
}
- public static class c extends ou.a {
+ public static class c extends ov.a {
public Class b;
public int c;
public int d;
diff --git a/mcp918-beta-win-1.8.9/src/minecraft/net/minecraft/world/biome/BiomeGenBase.java b/mcp924-beta/src/minecraft/net/minecraft/world/biome/BiomeGenBase.java
index b39c20a..9dfcbab 100755
--- a/mcp918-beta-win-1.8.9/src/minecraft/net/minecraft/world/biome/BiomeGenBase.java
+++ b/mcp924-beta/src/minecraft/net/minecraft/world/biome/BiomeGenBase.java
@@ -1,11 +1,9 @@
package net.minecraft.world.biome;
import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.Random;
import java.util.Set;
import net.minecraft.block.BlockFlower;
@@ -26,13 +24,16 @@ import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityPig;
-import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntitySquid;
+import net.minecraft.init.Biomes;
import net.minecraft.init.Blocks;
-import net.minecraft.util.BlockPos;
-import net.minecraft.util.MathHelper;
+import net.minecraft.util.ObjectIntIdentityMap;
+import net.minecraft.util.ResourceLocation;
import net.minecraft.util.WeightedRandom;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.MathHelper;
+import net.minecraft.util.registry.RegistryNamespaced;
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.World;
@@ -50,154 +51,94 @@ import org.apache.logging.log4j.Logger;
public abstract class BiomeGenBase {
private static final Logger logger = LogManager.getLogger();
- protected static final BiomeGenBase.Height height_Default = new BiomeGenBase.Height(0.1F, 0.2F);
- protected static final BiomeGenBase.Height height_ShallowWaters = new BiomeGenBase.Height(-0.5F, 0.0F);
- protected static final BiomeGenBase.Height height_Oceans = new BiomeGenBase.Height(-1.0F, 0.1F);
- protected static final BiomeGenBase.Height height_DeepOceans = new BiomeGenBase.Height(-1.8F, 0.1F);
- protected static final BiomeGenBase.Height height_LowPlains = new BiomeGenBase.Height(0.125F, 0.05F);
- protected static final BiomeGenBase.Height height_MidPlains = new BiomeGenBase.Height(0.2F, 0.2F);
- protected static final BiomeGenBase.Height height_LowHills = new BiomeGenBase.Height(0.45F, 0.3F);
- protected static final BiomeGenBase.Height height_HighPlateaus = new BiomeGenBase.Height(1.5F, 0.025F);
- protected static final BiomeGenBase.Height height_MidHills = new BiomeGenBase.Height(1.0F, 0.5F);
- protected static final BiomeGenBase.Height height_Shores = new BiomeGenBase.Height(0.0F, 0.025F);
- protected static final BiomeGenBase.Height height_RockyWaters = new BiomeGenBase.Height(0.1F, 0.8F);
- protected static final BiomeGenBase.Height height_LowIslands = new BiomeGenBase.Height(0.2F, 0.3F);
- protected static final BiomeGenBase.Height height_PartiallySubmerged = new BiomeGenBase.Height(-0.2F, 0.1F);
-
- /** An array of all the biomes, indexed by biome id. */
- private static final BiomeGenBase[] biomeList = new BiomeGenBase[256];
+ protected static final IBlockState STONE = Blocks.stone.getDefaultState();
+ protected static final IBlockState AIR = Blocks.air.getDefaultState();
+ protected static final IBlockState BEDROCK = Blocks.bedrock.getDefaultState();
+ protected static final IBlockState GRAVEL = Blocks.gravel.getDefaultState();
+ protected static final IBlockState RED_SANDSTONE = Blocks.red_sandstone.getDefaultState();
+ protected static final IBlockState SANDSTONE = Blocks.sandstone.getDefaultState();
+ protected static final IBlockState ICE = Blocks.ice.getDefaultState();
+ protected static final IBlockState WATER = Blocks.water.getDefaultState();
public static final Set<BiomeGenBase> explorationBiomesList = Sets.<BiomeGenBase>newHashSet();
- public static final Map<String, BiomeGenBase> BIOME_ID_MAP = Maps.<String, BiomeGenBase>newHashMap();
- public static final BiomeGenBase ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setHeight(height_Oceans);
- public static final BiomeGenBase plains = (new BiomeGenPlains(1)).setColor(9286496).setBiomeName("Plains");
- public static final BiomeGenBase desert = (new BiomeGenDesert(2)).setColor(16421912).setBiomeName("Desert").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setHeight(height_LowPlains);
- public static final BiomeGenBase extremeHills = (new BiomeGenHills(3, false)).setColor(6316128).setBiomeName("Extreme Hills").setHeight(height_MidHills).setTemperatureRainfall(0.2F, 0.3F);
- public static final BiomeGenBase forest = (new BiomeGenForest(4, 0)).setColor(353825).setBiomeName("Forest");
- public static final BiomeGenBase taiga = (new BiomeGenTaiga(5, 0)).setColor(747097).setBiomeName("Taiga").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(height_MidPlains);
- public static final BiomeGenBase swampland = (new BiomeGenSwamp(6)).setColor(522674).setBiomeName("Swampland").setFillerBlockMetadata(9154376).setHeight(height_PartiallySubmerged).setTemperatureRainfall(0.8F, 0.9F);
- public static final BiomeGenBase river = (new BiomeGenRiver(7)).setColor(255).setBiomeName("River").setHeight(height_ShallowWaters);
- public static final BiomeGenBase hell = (new BiomeGenHell(8)).setColor(16711680).setBiomeName("Hell").setDisableRain().setTemperatureRainfall(2.0F, 0.0F);
-
- /** Is the biome used for sky world. */
- public static final BiomeGenBase sky = (new BiomeGenEnd(9)).setColor(8421631).setBiomeName("The End").setDisableRain();
- public static final BiomeGenBase frozenOcean = (new BiomeGenOcean(10)).setColor(9474208).setBiomeName("FrozenOcean").setEnableSnow().setHeight(height_Oceans).setTemperatureRainfall(0.0F, 0.5F);
- public static final BiomeGenBase frozenRiver = (new BiomeGenRiver(11)).setColor(10526975).setBiomeName("FrozenRiver").setEnableSnow().setHeight(height_ShallowWaters).setTemperatureRainfall(0.0F, 0.5F);
- public static final BiomeGenBase icePlains = (new BiomeGenSnow(12, false)).setColor(16777215).setBiomeName("Ice Plains").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F).setHeight(height_LowPlains);
- public static final BiomeGenBase iceMountains = (new BiomeGenSnow(13, false)).setColor(10526880).setBiomeName("Ice Mountains").setEnableSnow().setHeight(height_LowHills).setTemperatureRainfall(0.0F, 0.5F);
- public static final BiomeGenBase mushroomIsland = (new BiomeGenMushroomIsland(14)).setColor(16711935).setBiomeName("MushroomIsland").setTemperatureRainfall(0.9F, 1.0F).setHeight(height_LowIslands);
- public static final BiomeGenBase mushroomIslandShore = (new BiomeGenMushroomIsland(15)).setColor(10486015).setBiomeName("MushroomIslandShore").setTemperatureRainfall(0.9F, 1.0F).setHeight(height_Shores);
-
- /** Beach biome. */
- public static final BiomeGenBase beach = (new BiomeGenBeach(16)).setColor(16440917).setBiomeName("Beach").setTemperatureRainfall(0.8F, 0.4F).setHeight(height_Shores);
-
- /** Desert Hills biome. */
- public static final BiomeGenBase desertHills = (new BiomeGenDesert(17)).setColor(13786898).setBiomeName("DesertHills").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setHeight(height_LowHills);
-
- /** Forest Hills biome. */
- public static final BiomeGenBase forestHills = (new BiomeGenForest(18, 0)).setColor(2250012).setBiomeName("ForestHills").setHeight(height_LowHills);
-
- /** Taiga Hills biome. */
- public static final BiomeGenBase taigaHills = (new BiomeGenTaiga(19, 0)).setColor(1456435).setBiomeName("TaigaHills").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(height_LowHills);
-
- /** Extreme Hills Edge biome. */
- public static final BiomeGenBase extremeHillsEdge = (new BiomeGenHills(20, true)).setColor(7501978).setBiomeName("Extreme Hills Edge").setHeight(height_MidHills.attenuate()).setTemperatureRainfall(0.2F, 0.3F);
-
- /** Jungle biome identifier */
- public static final BiomeGenBase jungle = (new BiomeGenJungle(21, false)).setColor(5470985).setBiomeName("Jungle").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.9F);
- public static final BiomeGenBase jungleHills = (new BiomeGenJungle(22, false)).setColor(2900485).setBiomeName("JungleHills").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.9F).setHeight(height_LowHills);
- public static final BiomeGenBase jungleEdge = (new BiomeGenJungle(23, true)).setColor(6458135).setBiomeName("JungleEdge").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.8F);
- public static final BiomeGenBase deepOcean = (new BiomeGenOcean(24)).setColor(48).setBiomeName("Deep Ocean").setHeight(height_DeepOceans);
- public static final BiomeGenBase stoneBeach = (new BiomeGenStoneBeach(25)).setColor(10658436).setBiomeName("Stone Beach").setTemperatureRainfall(0.2F, 0.3F).setHeight(height_RockyWaters);
- public static final BiomeGenBase coldBeach = (new BiomeGenBeach(26)).setColor(16445632).setBiomeName("Cold Beach").setTemperatureRainfall(0.05F, 0.3F).setHeight(height_Shores).setEnableSnow();
- public static final BiomeGenBase birchForest = (new BiomeGenForest(27, 2)).setBiomeName("Birch Forest").setColor(3175492);
- public static final BiomeGenBase birchForestHills = (new BiomeGenForest(28, 2)).setBiomeName("Birch Forest Hills").setColor(2055986).setHeight(height_LowHills);
- public static final BiomeGenBase roofedForest = (new BiomeGenForest(29, 3)).setColor(4215066).setBiomeName("Roofed Forest");
- 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);
- 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);
- public static final BiomeGenBase megaTaiga = (new BiomeGenTaiga(32, 1)).setColor(5858897).setBiomeName("Mega Taiga").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.3F, 0.8F).setHeight(height_MidPlains);
- 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);
- public static final BiomeGenBase extremeHillsPlus = (new BiomeGenHills(34, true)).setColor(5271632).setBiomeName("Extreme Hills+").setHeight(height_MidHills).setTemperatureRainfall(0.2F, 0.3F);
- public static final BiomeGenBase savanna = (new BiomeGenSavanna(35)).setColor(12431967).setBiomeName("Savanna").setTemperatureRainfall(1.2F, 0.0F).setDisableRain().setHeight(height_LowPlains);
- public static final BiomeGenBase savannaPlateau = (new BiomeGenSavanna(36)).setColor(10984804).setBiomeName("Savanna Plateau").setTemperatureRainfall(1.0F, 0.0F).setDisableRain().setHeight(height_HighPlateaus);
- public static final BiomeGenBase mesa = (new BiomeGenMesa(37, false, false)).setColor(14238997).setBiomeName("Mesa");
- public static final BiomeGenBase mesaPlateau_F = (new BiomeGenMesa(38, false, true)).setColor(11573093).setBiomeName("Mesa Plateau F").setHeight(height_HighPlateaus);
- public static final BiomeGenBase mesaPlateau = (new BiomeGenMesa(39, false, false)).setColor(13274213).setBiomeName("Mesa Plateau").setHeight(height_HighPlateaus);
- public static final BiomeGenBase field_180279_ad = ocean;
- protected static final NoiseGeneratorPerlin temperatureNoise;
- protected static final NoiseGeneratorPerlin GRASS_COLOR_NOISE;
- protected static final WorldGenDoublePlant DOUBLE_PLANT_GENERATOR;
- public String biomeName;
- public int color;
- public int field_150609_ah;
+ public static final ObjectIntIdentityMap<BiomeGenBase> MUTATION_TO_BASE_ID_MAP = new ObjectIntIdentityMap();
+ protected static final NoiseGeneratorPerlin temperatureNoise = new NoiseGeneratorPerlin(new Random(1234L), 1);
+ protected static final NoiseGeneratorPerlin GRASS_COLOR_NOISE = new NoiseGeneratorPerlin(new Random(2345L), 1);
+ protected static final WorldGenDoublePlant DOUBLE_PLANT_GENERATOR = new WorldGenDoublePlant();
- /** The block expected to be on the top of this biome */
- public IBlockState topBlock = Blocks.grass.getDefaultState();
+ /** The tree generator. */
+ protected static final WorldGenTrees worldGeneratorTrees = new WorldGenTrees(false);
- /** The block to fill spots in when not on the top */
- public IBlockState fillerBlock = Blocks.dirt.getDefaultState();
- public int fillerBlockMetadata = 5169201;
+ /** The big tree generator. */
+ protected static final WorldGenBigTree worldGeneratorBigTree = new WorldGenBigTree(false);
+
+ /** The swamp tree generator. */
+ protected static final WorldGenSwamp worldGeneratorSwamp = new WorldGenSwamp();
+ public static final RegistryNamespaced<ResourceLocation, BiomeGenBase> biomeRegistry = new RegistryNamespaced();
+ private final String biomeName;
- /** The minimum height of this biome. Default 0.1. */
- public float minHeight;
+ /** The base height of this biome. Default 0.1. */
+ private final float baseHeight;
- /** The maximum height of this biome. Default 0.3. */
- public float maxHeight;
+ /** The variation from the base height of the biome. Default 0.3. */
+ private final float heightVariation;
/** The temperature of this biome. */
- public float temperature;
+ private final float temperature;
/** The rainfall in this biome. */
- public float rainfall;
+ private final float rainfall;
/** Color tint applied to water depending on biome */
- public int waterColorMultiplier;
-
- /** The biome decorator. */
- public BiomeDecorator theBiomeDecorator;
- protected List<BiomeGenBase.SpawnListEntry> spawnableMonsterList;
- protected List<BiomeGenBase.SpawnListEntry> spawnableCreatureList;
- protected List<BiomeGenBase.SpawnListEntry> spawnableWaterCreatureList;
- protected List<BiomeGenBase.SpawnListEntry> spawnableCaveCreatureList;
+ private final int waterColor;
/** Set to true if snow is enabled for this biome. */
- protected boolean enableSnow;
+ private final boolean enableSnow;
/**
* Is true (default) if the biome support rain (desert and nether can't have rain)
*/
- protected boolean enableRain;
+ private final boolean enableRain;
- /** The id number to this biome, and its index in the biomeList array. */
- public final int biomeID;
+ /** The unique identifier of the biome for which this is a mutation of. */
+ private final String baseBiomeRegName;
- /** The tree generator. */
- protected WorldGenTrees worldGeneratorTrees;
+ /** The block expected to be on the top of this biome */
+ public IBlockState topBlock = Blocks.grass.getDefaultState();
- /** The big tree generator. */
- protected WorldGenBigTree worldGeneratorBigTree;
+ /** The block to fill spots in when not on the top */
+ public IBlockState fillerBlock = Blocks.dirt.getDefaultState();
- /** The swamp tree generator. */
- protected WorldGenSwamp worldGeneratorSwamp;
-
- protected BiomeGenBase(int id) {
- this.minHeight = height_Default.rootHeight;
- this.maxHeight = height_Default.variation;
- this.temperature = 0.5F;
- this.rainfall = 0.5F;
- this.waterColorMultiplier = 16777215;
- this.spawnableMonsterList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
- this.spawnableCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
- this.spawnableWaterCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
- this.spawnableCaveCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
- this.enableRain = true;
- this.worldGeneratorTrees = new WorldGenTrees(false);
- this.worldGeneratorBigTree = new WorldGenBigTree(false);
- this.worldGeneratorSwamp = new WorldGenSwamp();
- this.biomeID = id;
- biomeList[id] = this;
+ /** The biome decorator. */
+ public BiomeDecorator theBiomeDecorator;
+ protected List<BiomeGenBase.SpawnListEntry> spawnableMonsterList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
+ protected List<BiomeGenBase.SpawnListEntry> spawnableCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
+ protected List<BiomeGenBase.SpawnListEntry> spawnableWaterCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
+ protected List<BiomeGenBase.SpawnListEntry> spawnableCaveCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
+
+ public static int getIdForBiome(BiomeGenBase biome) {
+ return biomeRegistry.getIDForObject(biome);
+ }
+
+ public static BiomeGenBase getBiomeForId(int id) {
+ return (BiomeGenBase)biomeRegistry.getObjectById(id);
+ }
+
+ public static BiomeGenBase getMutationForBiome(BiomeGenBase biome) {
+ return (BiomeGenBase)MUTATION_TO_BASE_ID_MAP.getByValue(getIdForBiome(biome));
+ }
+
+ protected BiomeGenBase(BiomeGenBase.BiomeProperties properties) {
+ this.biomeName = properties.biomeName;
+ this.baseHeight = properties.baseHeight;
+ this.heightVariation = properties.heightVariation;
+ this.temperature = properties.temperature;
+ this.rainfall = properties.rainfall;
+ this.waterColor = properties.waterColor;
+ this.enableSnow = properties.enableSnow;
+ this.enableRain = properties.enableRain;
+ this.baseBiomeRegName = properties.baseBiomeRegName;
this.theBiomeDecorator = this.createBiomeDecorator();
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4));
- this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4));
@@ -219,35 +160,12 @@ public abstract class BiomeGenBase {
return new BiomeDecorator();
}
- /**
- * Sets the temperature and rainfall of this biome.
- */
- protected BiomeGenBase setTemperatureRainfall(float temperatureIn, float rainfallIn) {
- if (temperatureIn > 0.1F && temperatureIn < 0.2F) {
- throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow");
- } else {
- this.temperature = temperatureIn;
- this.rainfall = rainfallIn;
- return this;
- }
- }
-
- protected final BiomeGenBase setHeight(BiomeGenBase.Height heights) {
- this.minHeight = heights.rootHeight;
- this.maxHeight = heights.variation;
- return this;
- }
-
- /**
- * Disable the rain for the biome.
- */
- protected BiomeGenBase setDisableRain() {
- this.enableRain = false;
- return this;
+ public boolean isMutation() {
+ return this.baseBiomeRegName != null;
}
public WorldGenAbstractTree genBigTreeChance(Random rand) {
- return (WorldGenAbstractTree)(rand.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees);
+ return (WorldGenAbstractTree)(rand.nextInt(10) == 0 ? worldGeneratorBigTree : worldGeneratorTrees);
}
/**
@@ -261,53 +179,15 @@ public abstract class BiomeGenBase {
return rand.nextInt(3) > 0 ? BlockFlower.EnumFlowerType.DANDELION : BlockFlower.EnumFlowerType.POPPY;
}
- /**
- * sets enableSnow to true during biome initialization. returns BiomeGenBase.
- */
- protected BiomeGenBase setEnableSnow() {
- this.enableSnow = true;
- return this;
- }
-
- protected BiomeGenBase setBiomeName(String name) {
- this.biomeName = name;
- return this;
- }
-
- protected BiomeGenBase setFillerBlockMetadata(int meta) {
- this.fillerBlockMetadata = meta;
- return this;
- }
-
- protected BiomeGenBase setColor(int colorIn) {
- this.func_150557_a(colorIn, false);
- return this;
- }
-
- protected BiomeGenBase func_150563_c(int p_150563_1_) {
- this.field_150609_ah = p_150563_1_;
- return this;
- }
-
- protected BiomeGenBase func_150557_a(int p_150557_1_, boolean p_150557_2_) {
- this.color = p_150557_1_;
-
- if (p_150557_2_) {
- this.field_150609_ah = (p_150557_1_ & 16711422) >> 1;
- } else {
- this.field_150609_ah = p_150557_1_;
- }
-
- return this;
- }
-
/**
* takes temperature, returns color
+ *
+ * @param currentTemperature The temperature at a pre-calculated specific point in this biome
*/
- public int getSkyColorByTemp(float p_76731_1_) {
- p_76731_1_ = p_76731_1_ / 3.0F;
- p_76731_1_ = MathHelper.clamp_float(p_76731_1_, -1.0F, 1.0F);
- return MathHelper.hsvToRGB(0.62222224F - p_76731_1_ * 0.05F, 0.5F + p_76731_1_ * 0.1F, 1.0F);
+ public int getSkyColorByTemp(float currentTemperature) {
+ currentTemperature = currentTemperature / 3.0F;
+ currentTemperature = MathHelper.clamp_float(currentTemperature, -1.0F, 1.0F);
+ return MathHelper.hsvToRGB(0.62222224F - currentTemperature * 0.05F, 0.5F + currentTemperature * 0.1F, 1.0F);
}
public List<BiomeGenBase.SpawnListEntry> getSpawnableList(EnumCreatureType creatureType) {
@@ -337,9 +217,9 @@ public abstract class BiomeGenBase {
}
/**
- * Return true if the biome supports lightning bolt spawn, either by have the bolts enabled and have rain enabled.
+ * Check if rain can occur in biome
*/
- public boolean canSpawnLightningBolt() {
+ public boolean canRain() {
return this.isSnowyBiome() ? false : this.enableRain;
}
@@ -347,7 +227,7 @@ public abstract class BiomeGenBase {
* Checks to see if the rainfall level of the biome is extremely high
*/
public boolean isHighHumidity() {
- return this.rainfall > 0.85F;
+ return this.getRainfall() > 0.85F;
}
/**
@@ -357,29 +237,15 @@ public abstract class BiomeGenBase {
return 0.1F;
}
- /**
- * Gets an integer representation of this biome's rainfall
- */
- public final int getIntRainfall() {
- return (int)(this.rainfall * 65536.0F);
- }
-
- /**
- * Gets a floating point representation of this biome's rainfall
- */
- public final float getFloatRainfall() {
- return this.rainfall;
- }
-
/**
* Gets a floating point representation of this biome's temperature
*/
public final float getFloatTemperature(BlockPos pos) {
if (pos.getY() > 64) {
- float f = (float)(temperatureNoise.func_151601_a((double)pos.getX() * 1.0D / 8.0D, (double)pos.getZ() * 1.0D / 8.0D) * 4.0D);
- return this.temperature - (f + (float)pos.getY() - 64.0F) * 0.05F / 30.0F;
+ float f = (float)(temperatureNoise.func_151601_a((double)((float)pos.getX() / 8.0F), (double)((float)pos.getZ() / 8.0F)) * 4.0D);
+ return this.getTemperature() - (f + (float)pos.getY() - 64.0F) * 0.05F / 30.0F;
} else {
- return this.temperature;
+ return this.getTemperature();
}
}
@@ -389,57 +255,63 @@ public abstract class BiomeGenBase {
public int getGrassColorAtPos(BlockPos pos) {
double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(pos), 0.0F, 1.0F);
- double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
+ double d1 = (double)MathHelper.clamp_float(this.getRainfall(), 0.0F, 1.0F);
return ColorizerGrass.getGrassColor(d0, d1);
}
public int getFoliageColorAtPos(BlockPos pos) {
double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(pos), 0.0F, 1.0F);
- double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
+ double d1 = (double)MathHelper.clamp_float(this.getRainfall(), 0.0F, 1.0F);
return ColorizerFoliage.getFoliageColor(d0, d1);
}
- public boolean isSnowyBiome() {
- return this.enableSnow;
- }
-
- public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int p_180622_4_, int p_180622_5_, double p_180622_6_) {
- this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, p_180622_4_, p_180622_5_, p_180622_6_);
+ public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) {
+ this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
- public final void generateBiomeTerrain(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int p_180628_4_, int p_180628_5_, double p_180628_6_) {
+ /**
+ * Given x, z coordinates, we count down all the y positions starting at 255 and working our way down. When we hit a
+ * non-air block, we replace it with this.topBlock (default grass, descendants may set otherwise), and then a
+ * relatively shallow layer of blocks of type this.fillerBlock (default dirt). A random set of blocks below y == 5 (but
+ * always including y == 0) is replaced with bedrock.
+ *
+ * If we don't hit non-air until somewhat below sea level, we top with gravel and fill down with stone.
+ *
+ * If this.fillerBlock is red sand, we replace some of that with red sandstone.
+ */
+ public final void generateBiomeTerrain(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) {
int i = worldIn.getSeaLevel();
IBlockState iblockstate = this.topBlock;
IBlockState iblockstate1 = this.fillerBlock;
int j = -1;
- int k = (int)(p_180628_6_ / 3.0D + 3.0D + rand.nextDouble() * 0.25D);
- int l = p_180628_4_ & 15;
- int i1 = p_180628_5_ & 15;
+ int k = (int)(noiseVal / 3.0D + 3.0D + rand.nextDouble() * 0.25D);
+ int l = x & 15;
+ int i1 = z & 15;
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
for (int j1 = 255; j1 >= 0; --j1) {
if (j1 <= rand.nextInt(5)) {
- chunkPrimerIn.setBlockState(i1, j1, l, Blocks.bedrock.getDefaultState());
+ chunkPrimerIn.setBlockState(i1, j1, l, BEDROCK);
} else {
IBlockState iblockstate2 = chunkPrimerIn.getBlockState(i1, j1, l);
- if (iblockstate2.getBlock().getMaterial() == Material.air) {
+ if (iblockstate2.getMaterial() == Material.air) {
j = -1;
} else if (iblockstate2.getBlock() == Blocks.stone) {
if (j == -1) {
if (k <= 0) {
- iblockstate = null;
- iblockstate1 = Blocks.stone.getDefaultState();
+ iblockstate = AIR;
+ iblockstate1 = STONE;
} else if (j1 >= i - 4 && j1 <= i + 1) {
iblockstate = this.topBlock;
iblockstate1 = this.fillerBlock;
}
- if (j1 < i && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air)) {
- if (this.getFloatTemperature(blockpos$mutableblockpos.set(p_180628_4_, j1, p_180628_5_)) < 0.15F) {
- iblockstate = Blocks.ice.getDefaultState();
+ if (j1 < i && (iblockstate == null || iblockstate.getMaterial() == Material.air)) {
+ if (this.getFloatTemperature(blockpos$mutableblockpos.set(x, j1, z)) < 0.15F) {
+ iblockstate = ICE;
} else {
- iblockstate = Blocks.water.getDefaultState();
+ iblockstate = WATER;
}
}
@@ -448,9 +320,9 @@ public abstract class BiomeGenBase {
if (j1 >= i - 1) {
chunkPrimerIn.setBlockState(i1, j1, l, iblockstate);
} else if (j1 < i - 7 - k) {
- iblockstate = null;
- iblockstate1 = Blocks.stone.getDefaultState();
- chunkPrimerIn.setBlockState(i1, j1, l, Blocks.gravel.getDefaultState());
+ iblockstate = AIR;
+ iblockstate1 = STONE;
+ chunkPrimerIn.setBlockState(i1, j1, l, GRAVEL);
} else {
chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1);
}
@@ -460,7 +332,7 @@ public abstract class BiomeGenBase {
if (j == 0 && iblockstate1.getBlock() == Blocks.sand) {
j = rand.nextInt(4) + Math.max(0, j1 - 63);
- iblockstate1 = iblockstate1.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? Blocks.red_sandstone.getDefaultState() : Blocks.sandstone.getDefaultState();
+ iblockstate1 = iblockstate1.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? RED_SANDSTONE : SANDSTONE;
}
}
}
@@ -468,110 +340,202 @@ public abstract class BiomeGenBase {
}
}
+ public Class <? extends BiomeGenBase > getBiomeClass() {
+ return this.getClass();
+ }
+
+ public BiomeGenBase.TempCategory getTempCategory() {
+ return (double)this.getTemperature() < 0.2D ? BiomeGenBase.TempCategory.COLD : ((double)this.getTemperature() < 1.0D ? BiomeGenBase.TempCategory.MEDIUM : BiomeGenBase.TempCategory.WARM);
+ }
+
/**
- * Creates a mutated version of the biome and places it into the biomeList with an index equal to the original plus 128
+ * return the biome specified by biomeID, or 0 (ocean) if out of bounds
*/
- protected BiomeGenBase createMutation() {
- return this.createMutatedBiome(this.biomeID + 128);
+ public static BiomeGenBase getBiome(int id) {
+ return getBiomeFromBiomeList(id, (BiomeGenBase)null);
+ }
+
+ public static BiomeGenBase getBiomeFromBiomeList(int biomeId, BiomeGenBase biome) {
+ BiomeGenBase biomegenbase = getBiomeForId(biomeId);
+ return biomegenbase == null ? biome : biomegenbase;
}
- protected BiomeGenBase createMutatedBiome(int p_180277_1_) {
- return new BiomeGenMutated(p_180277_1_, this);
+ public boolean ignorePlayerSpawnSuitability() {
+ return false;
}
- public Class <? extends BiomeGenBase > getBiomeClass() {
- return this.getClass();
+ public final float getBaseHeight() {
+ return this.baseHeight;
}
/**
- * returns true if the biome specified is equal to this biome
+ * Gets a floating point representation of this biome's rainfall
*/
- public boolean isEqualTo(BiomeGenBase biome) {
- return biome == this ? true : (biome == null ? false : this.getBiomeClass() == biome.getBiomeClass());
+ public final float getRainfall() {
+ return this.rainfall;
}
- public BiomeGenBase.TempCategory getTempCategory() {
- return (double)this.temperature < 0.2D ? BiomeGenBase.TempCategory.COLD : ((double)this.temperature < 1.0D ? BiomeGenBase.TempCategory.MEDIUM : BiomeGenBase.TempCategory.WARM);
+ public final String getBiomeName() {
+ return this.biomeName;
+ }
+
+ public final float getHeightVariation() {
+ return this.heightVariation;
+ }
+
+ public final float getTemperature() {
+ return this.temperature;
}
- public static BiomeGenBase[] getBiomeGenArray() {
- return biomeList;
+ public final int getWaterColor() {
+ return this.waterColor;
+ }
+
+ public final boolean isSnowyBiome() {
+ return this.enableSnow;
}
/**
- * return the biome specified by biomeID, or 0 (ocean) if out of bounds
+ * Registers all of the vanilla biomes.
*/
- public static BiomeGenBase getBiome(int id) {
- return getBiomeFromBiomeList(id, (BiomeGenBase)null);
+ public static void registerBiomes() {
+ registerBiome(0, "ocean", new BiomeGenOcean((new BiomeGenBase.BiomeProperties("Ocean")).setBaseHeight(-1.0F).setHeightVariation(0.1F)));
+ registerBiome(1, "plains", new BiomeGenPlains(false, (new BiomeGenBase.BiomeProperties("Plains")).setBaseHeight(0.125F).setHeightVariation(0.05F).setTemperature(0.8F).setRainfall(0.4F)));
+ registerBiome(2, "desert", new BiomeGenDesert((new BiomeGenBase.BiomeProperties("Desert")).setBaseHeight(0.125F).setHeightVariation(0.05F).setTemperature(2.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(3, "extreme_hills", new BiomeGenHills(BiomeGenHills.Type.NORMAL, (new BiomeGenBase.BiomeProperties("Extreme Hills")).setBaseHeight(1.0F).setHeightVariation(0.5F).setTemperature(0.2F).setRainfall(0.3F)));
+ registerBiome(4, "forest", new BiomeGenForest(BiomeGenForest.Type.NORMAL, (new BiomeGenBase.BiomeProperties("Forest")).setTemperature(0.7F).setRainfall(0.8F)));
+ registerBiome(5, "taiga", new BiomeGenTaiga(BiomeGenTaiga.Type.NORMAL, (new BiomeGenBase.BiomeProperties("Taiga")).setBaseHeight(0.2F).setHeightVariation(0.2F).setTemperature(0.25F).setRainfall(0.8F)));
+ registerBiome(6, "swampland", new BiomeGenSwamp((new BiomeGenBase.BiomeProperties("Swampland")).setBaseHeight(-0.2F).setHeightVariation(0.1F).setTemperature(0.8F).setRainfall(0.9F).setWaterColor(14745518)));
+ registerBiome(7, "river", new BiomeGenRiver((new BiomeGenBase.BiomeProperties("River")).setBaseHeight(-0.5F).setHeightVariation(0.0F)));
+ registerBiome(8, "hell", new BiomeGenHell((new BiomeGenBase.BiomeProperties("Hell")).setTemperature(2.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(9, "sky", new BiomeGenEnd((new BiomeGenBase.BiomeProperties("The End")).setRainDisabled()));
+ registerBiome(10, "frozen_ocean", new BiomeGenOcean((new BiomeGenBase.BiomeProperties("FrozenOcean")).setBaseHeight(-1.0F).setHeightVariation(0.1F).setTemperature(0.0F).setRainfall(0.5F).setSnowEnabled()));
+ registerBiome(11, "frozen_river", new BiomeGenRiver((new BiomeGenBase.BiomeProperties("FrozenRiver")).setBaseHeight(-0.5F).setHeightVariation(0.0F).setTemperature(0.0F).setRainfall(0.5F).setSnowEnabled()));
+ registerBiome(12, "ice_flats", new BiomeGenSnow(false, (new BiomeGenBase.BiomeProperties("Ice Plains")).setBaseHeight(0.125F).setHeightVariation(0.05F).setTemperature(0.0F).setRainfall(0.5F).setSnowEnabled()));
+ registerBiome(13, "ice_mountains", new BiomeGenSnow(false, (new BiomeGenBase.BiomeProperties("Ice Mountains")).setBaseHeight(0.45F).setHeightVariation(0.3F).setTemperature(0.0F).setRainfall(0.5F).setSnowEnabled()));
+ registerBiome(14, "mushroom_island", new BiomeGenMushroomIsland((new BiomeGenBase.BiomeProperties("MushroomIsland")).setBaseHeight(0.2F).setHeightVariation(0.3F).setTemperature(0.9F).setRainfall(1.0F)));
+ registerBiome(15, "mushroom_island_shore", new BiomeGenMushroomIsland((new BiomeGenBase.BiomeProperties("MushroomIslandShore")).setBaseHeight(0.0F).setHeightVariation(0.025F).setTemperature(0.9F).setRainfall(1.0F)));
+ registerBiome(16, "beaches", new BiomeGenBeach((new BiomeGenBase.BiomeProperties("Beach")).setBaseHeight(0.0F).setHeightVariation(0.025F).setTemperature(0.8F).setRainfall(0.4F)));
+ registerBiome(17, "desert_hills", new BiomeGenDesert((new BiomeGenBase.BiomeProperties("DesertHills")).setBaseHeight(0.45F).setHeightVariation(0.3F).setTemperature(2.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(18, "forest_hills", new BiomeGenForest(BiomeGenForest.Type.NORMAL, (new BiomeGenBase.BiomeProperties("ForestHills")).setBaseHeight(0.45F).setHeightVariation(0.3F).setTemperature(0.7F).setRainfall(0.8F)));
+ registerBiome(19, "taiga_hills", new BiomeGenTaiga(BiomeGenTaiga.Type.NORMAL, (new BiomeGenBase.BiomeProperties("TaigaHills")).setTemperature(0.25F).setRainfall(0.8F).setBaseHeight(0.45F).setHeightVariation(0.3F)));
+ registerBiome(20, "smaller_extreme_hills", new BiomeGenHills(BiomeGenHills.Type.EXTRA_TREES, (new BiomeGenBase.BiomeProperties("Extreme Hills Edge")).setBaseHeight(0.8F).setHeightVariation(0.3F).setTemperature(0.2F).setRainfall(0.3F)));
+ registerBiome(21, "jungle", new BiomeGenJungle(false, (new BiomeGenBase.BiomeProperties("Jungle")).setTemperature(0.95F).setRainfall(0.9F)));
+ registerBiome(22, "jungle_hills", new BiomeGenJungle(false, (new BiomeGenBase.BiomeProperties("JungleHills")).setBaseHeight(0.45F).setHeightVariation(0.3F).setTemperature(0.95F).setRainfall(0.9F)));
+ registerBiome(23, "jungle_edge", new BiomeGenJungle(true, (new BiomeGenBase.BiomeProperties("JungleEdge")).setTemperature(0.95F).setRainfall(0.8F)));
+ registerBiome(24, "deep_ocean", new BiomeGenOcean((new BiomeGenBase.BiomeProperties("Deep Ocean")).setBaseHeight(-1.8F).setHeightVariation(0.1F)));
+ registerBiome(25, "stone_beach", new BiomeGenStoneBeach((new BiomeGenBase.BiomeProperties("Stone Beach")).setBaseHeight(0.1F).setHeightVariation(0.8F).setTemperature(0.2F).setRainfall(0.3F)));
+ registerBiome(26, "cold_beach", new BiomeGenBeach((new BiomeGenBase.BiomeProperties("Cold Beach")).setBaseHeight(0.0F).setHeightVariation(0.025F).setTemperature(0.05F).setRainfall(0.3F).setSnowEnabled()));
+ registerBiome(27, "birch_forest", new BiomeGenForest(BiomeGenForest.Type.BIRCH, (new BiomeGenBase.BiomeProperties("Birch Forest")).setTemperature(0.6F).setRainfall(0.6F)));
+ registerBiome(28, "birch_forest_hills", new BiomeGenForest(BiomeGenForest.Type.BIRCH, (new BiomeGenBase.BiomeProperties("Birch Forest Hills")).setBaseHeight(0.45F).setHeightVariation(0.3F).setTemperature(0.6F).setRainfall(0.6F)));
+ registerBiome(29, "roofed_forest", new BiomeGenForest(BiomeGenForest.Type.ROOFED, (new BiomeGenBase.BiomeProperties("Roofed Forest")).setTemperature(0.7F).setRainfall(0.8F)));
+ registerBiome(30, "taiga_cold", new BiomeGenTaiga(BiomeGenTaiga.Type.NORMAL, (new BiomeGenBase.BiomeProperties("Cold Taiga")).setBaseHeight(0.2F).setHeightVariation(0.2F).setTemperature(-0.5F).setRainfall(0.4F).setSnowEnabled()));
+ registerBiome(31, "taiga_cold_hills", new BiomeGenTaiga(BiomeGenTaiga.Type.NORMAL, (new BiomeGenBase.BiomeProperties("Cold Taiga Hills")).setBaseHeight(0.45F).setHeightVariation(0.3F).setTemperature(-0.5F).setRainfall(0.4F).setSnowEnabled()));
+ registerBiome(32, "redwood_taiga", new BiomeGenTaiga(BiomeGenTaiga.Type.MEGA, (new BiomeGenBase.BiomeProperties("Mega Taiga")).setTemperature(0.3F).setRainfall(0.8F).setBaseHeight(0.2F).setHeightVariation(0.2F)));
+ registerBiome(33, "redwood_taiga_hills", new BiomeGenTaiga(BiomeGenTaiga.Type.MEGA, (new BiomeGenBase.BiomeProperties("Mega Taiga Hills")).setBaseHeight(0.45F).setHeightVariation(0.3F).setTemperature(0.3F).setRainfall(0.8F)));
+ registerBiome(34, "extreme_hills_with_trees", new BiomeGenHills(BiomeGenHills.Type.EXTRA_TREES, (new BiomeGenBase.BiomeProperties("Extreme Hills+")).setBaseHeight(1.0F).setHeightVariation(0.5F).setTemperature(0.2F).setRainfall(0.3F)));
+ registerBiome(35, "savanna", new BiomeGenSavanna((new BiomeGenBase.BiomeProperties("Savanna")).setBaseHeight(0.125F).setHeightVariation(0.05F).setTemperature(1.2F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(36, "savanna_rock", new BiomeGenSavanna((new BiomeGenBase.BiomeProperties("Savanna Plateau")).setBaseHeight(1.5F).setHeightVariation(0.025F).setTemperature(1.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(37, "mesa", new BiomeGenMesa(false, false, (new BiomeGenBase.BiomeProperties("Mesa")).setTemperature(2.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(38, "mesa_rock", new BiomeGenMesa(false, true, (new BiomeGenBase.BiomeProperties("Mesa Plateau F")).setBaseHeight(1.5F).setHeightVariation(0.025F).setTemperature(2.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(39, "mesa_clear_rock", new BiomeGenMesa(false, false, (new BiomeGenBase.BiomeProperties("Mesa Plateau")).setBaseHeight(1.5F).setHeightVariation(0.025F).setTemperature(2.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(127, "void", new BiomeVoid((new BiomeGenBase.BiomeProperties("The Void")).setRainDisabled()));
+ registerBiome(129, "mutated_plains", new BiomeGenPlains(true, (new BiomeGenBase.BiomeProperties("Sunflower Plains")).setBaseBiome("plains").setBaseHeight(0.125F).setHeightVariation(0.05F).setTemperature(0.8F).setRainfall(0.4F)));
+ registerBiome(130, "mutated_desert", new BiomeGenDesert((new BiomeGenBase.BiomeProperties("Desert M")).setBaseBiome("desert").setBaseHeight(0.225F).setHeightVariation(0.25F).setTemperature(2.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(131, "mutated_extreme_hills", new BiomeGenHills(BiomeGenHills.Type.MUTATED, (new BiomeGenBase.BiomeProperties("Extreme Hills M")).setBaseBiome("extreme_hills").setBaseHeight(1.0F).setHeightVariation(0.5F).setTemperature(0.2F).setRainfall(0.3F)));
+ registerBiome(132, "mutated_forest", new BiomeGenForest(BiomeGenForest.Type.FLOWER, (new BiomeGenBase.BiomeProperties("Flower Forest")).setBaseBiome("forest").setHeightVariation(0.4F).setTemperature(0.7F).setRainfall(0.8F)));
+ registerBiome(133, "mutated_taiga", new BiomeGenTaiga(BiomeGenTaiga.Type.NORMAL, (new BiomeGenBase.BiomeProperties("Taiga M")).setBaseBiome("taiga").setBaseHeight(0.3F).setHeightVariation(0.4F).setTemperature(0.25F).setRainfall(0.8F)));
+ registerBiome(134, "mutated_swampland", new BiomeGenSwamp((new BiomeGenBase.BiomeProperties("Swampland M")).setBaseBiome("swampland").setBaseHeight(-0.1F).setHeightVariation(0.3F).setTemperature(0.8F).setRainfall(0.9F).setWaterColor(14745518)));
+ registerBiome(140, "mutated_ice_flats", new BiomeGenSnow(true, (new BiomeGenBase.BiomeProperties("Ice Plains Spikes")).setBaseBiome("ice_flats").setBaseHeight(0.425F).setHeightVariation(0.45000002F).setTemperature(0.0F).setRainfall(0.5F).setSnowEnabled()));
+ registerBiome(149, "mutated_jungle", new BiomeGenJungle(false, (new BiomeGenBase.BiomeProperties("Jungle M")).setBaseBiome("jungle").setBaseHeight(0.2F).setHeightVariation(0.4F).setTemperature(0.95F).setRainfall(0.9F)));
+ registerBiome(151, "mutated_jungle_edge", new BiomeGenJungle(true, (new BiomeGenBase.BiomeProperties("JungleEdge M")).setBaseBiome("jungle_edge").setBaseHeight(0.2F).setHeightVariation(0.4F).setTemperature(0.95F).setRainfall(0.8F)));
+ registerBiome(155, "mutated_birch_forest", new BiomeGenForestMutated((new BiomeGenBase.BiomeProperties("Birch Forest M")).setBaseBiome("birch_forest").setBaseHeight(0.2F).setHeightVariation(0.4F).setTemperature(0.6F).setRainfall(0.6F)));
+ registerBiome(156, "mutated_birch_forest_hills", new BiomeGenForestMutated((new BiomeGenBase.BiomeProperties("Birch Forest Hills M")).setBaseBiome("birch_forest").setBaseHeight(0.55F).setHeightVariation(0.5F).setTemperature(0.6F).setRainfall(0.6F)));
+ registerBiome(157, "mutated_roofed_forest", new BiomeGenForest(BiomeGenForest.Type.ROOFED, (new BiomeGenBase.BiomeProperties("Roofed Forest M")).setBaseBiome("roofed_forest").setBaseHeight(0.2F).setHeightVariation(0.4F).setTemperature(0.7F).setRainfall(0.8F)));
+ registerBiome(158, "mutated_taiga_cold", new BiomeGenTaiga(BiomeGenTaiga.Type.NORMAL, (new BiomeGenBase.BiomeProperties("Cold Taiga M")).setBaseBiome("taiga_cold").setBaseHeight(0.3F).setHeightVariation(0.4F).setTemperature(-0.5F).setRainfall(0.4F).setSnowEnabled()));
+ registerBiome(160, "mutated_redwood_taiga", new BiomeGenTaiga(BiomeGenTaiga.Type.MEGA_SPRUCE, (new BiomeGenBase.BiomeProperties("Mega Spruce Taiga")).setBaseBiome("redwood_taiga").setBaseHeight(0.2F).setHeightVariation(0.2F).setTemperature(0.25F).setRainfall(0.8F)));
+ registerBiome(161, "mutated_redwood_taiga_hills", new BiomeGenTaiga(BiomeGenTaiga.Type.MEGA_SPRUCE, (new BiomeGenBase.BiomeProperties("Redwood Taiga Hills M")).setBaseBiome("redwood_taiga_hills").setBaseHeight(0.2F).setHeightVariation(0.2F).setTemperature(0.25F).setRainfall(0.8F)));
+ registerBiome(162, "mutated_extreme_hills_with_trees", new BiomeGenHills(BiomeGenHills.Type.MUTATED, (new BiomeGenBase.BiomeProperties("Extreme Hills+ M")).setBaseBiome("extreme_hills_with_trees").setBaseHeight(1.0F).setHeightVariation(0.5F).setTemperature(0.2F).setRainfall(0.3F)));
+ registerBiome(163, "mutated_savanna", new BiomeGenSavannaMutated((new BiomeGenBase.BiomeProperties("Savanna M")).setBaseBiome("savanna").setBaseHeight(0.3625F).setHeightVariation(1.225F).setTemperature(1.1F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(164, "mutated_savanna_rock", new BiomeGenSavannaMutated((new BiomeGenBase.BiomeProperties("Savanna Plateau M")).setBaseBiome("savanna_rock").setBaseHeight(1.05F).setHeightVariation(1.2125001F).setTemperature(1.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(165, "mutated_mesa", new BiomeGenMesa(true, false, (new BiomeGenBase.BiomeProperties("Mesa (Bryce)")).setBaseBiome("mesa").setTemperature(2.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(166, "mutated_mesa_rock", new BiomeGenMesa(false, true, (new BiomeGenBase.BiomeProperties("Mesa Plateau F M")).setBaseBiome("mesa_rock").setBaseHeight(0.45F).setHeightVariation(0.3F).setTemperature(2.0F).setRainfall(0.0F).setRainDisabled()));
+ registerBiome(167, "mutated_mesa_clear_rock", new BiomeGenMesa(false, false, (new BiomeGenBase.BiomeProperties("Mesa Plateau M")).setBaseBiome("mesa_clear_rock").setBaseHeight(0.45F).setHeightVariation(0.3F).setTemperature(2.0F).setRainfall(0.0F).setRainDisabled()));
+ Collections.addAll(explorationBiomesList, new BiomeGenBase[] {Biomes.ocean, Biomes.plains, Biomes.desert, Biomes.extremeHills, Biomes.forest, Biomes.taiga, Biomes.swampland, Biomes.river, Biomes.frozenRiver, Biomes.icePlains, Biomes.iceMountains, Biomes.mushroomIsland, Biomes.mushroomIslandShore, Biomes.beach, Biomes.desertHills, Biomes.forestHills, Biomes.taigaHills, Biomes.jungle, Biomes.jungleHills, Biomes.jungleEdge, Biomes.deepOcean, Biomes.stoneBeach, Biomes.coldBeach, Biomes.birchForest, Biomes.birchForestHills, Biomes.roofedForest, Biomes.coldTaiga, Biomes.coldTaigaHills, Biomes.megaTaiga, Biomes.megaTaigaHills, Biomes.extremeHillsPlus, Biomes.savanna, Biomes.savannaPlateau, Biomes.mesa, Biomes.mesaPlateau_F, Biomes.mesaPlateau});
}
- public static BiomeGenBase getBiomeFromBiomeList(int biomeId, BiomeGenBase biome) {
- if (biomeId >= 0 && biomeId <= biomeList.length) {
- BiomeGenBase biomegenbase = biomeList[biomeId];
- return biomegenbase == null ? biome : biomegenbase;
- } else {
- logger.warn("Biome ID is out of bounds: " + biomeId + ", defaulting to 0 (Ocean)");
- return ocean;
+ /**
+ * Registers a new biome into the registry.
+ *
+ * @param id The numeric Id for the biome.
+ * @param name The name to register the biome under.
+ * @param biome The biome to register.
+ */
+ private static void registerBiome(int id, String name, BiomeGenBase biome) {
+ biomeRegistry.register(id, new ResourceLocation(name), biome);
+
+ if (biome.isMutation()) {
+ MUTATION_TO_BASE_ID_MAP.put(biome, getIdForBiome((BiomeGenBase)biomeRegistry.getObject(new ResourceLocation(biome.baseBiomeRegName))));
}
}
- static {
- plains.createMutation();
- desert.createMutation();
- forest.createMutation();
- taiga.createMutation();
- swampland.createMutation();
- icePlains.createMutation();
- jungle.createMutation();
- jungleEdge.createMutation();
- coldTaiga.createMutation();
- savanna.createMutation();
- savannaPlateau.createMutation();
- mesa.createMutation();
- mesaPlateau_F.createMutation();
- mesaPlateau.createMutation();
- birchForest.createMutation();
- birchForestHills.createMutation();
- roofedForest.createMutation();
- megaTaiga.createMutation();
- extremeHills.createMutation();
- extremeHillsPlus.createMutation();
- megaTaiga.createMutatedBiome(megaTaigaHills.biomeID + 128).setBiomeName("Redwood Taiga Hills M");
-
- for (BiomeGenBase biomegenbase : biomeList) {
- if (biomegenbase != null) {
- if (BIOME_ID_MAP.containsKey(biomegenbase.biomeName)) {
- throw new Error("Biome \"" + biomegenbase.biomeName + "\" is defined as both ID " + ((BiomeGenBase)BIOME_ID_MAP.get(biomegenbase.biomeName)).biomeID + " and " + biomegenbase.biomeID);
- }
+ public static class BiomeProperties {
+ private final String biomeName;
+ private float baseHeight = 0.1F;
+ private float heightVariation = 0.2F;
+ private float temperature = 0.5F;
+ private float rainfall = 0.5F;
+ private int waterColor = 16777215;
+ private boolean enableSnow;
+ private boolean enableRain = true;
+ private String baseBiomeRegName;
- BIOME_ID_MAP.put(biomegenbase.biomeName, biomegenbase);
+ public BiomeProperties(String nameIn) {
+ this.biomeName = nameIn;
+ }
- if (biomegenbase.biomeID < 128) {
- explorationBiomesList.add(biomegenbase);
- }
+ protected BiomeGenBase.BiomeProperties setTemperature(float temperatureIn) {
+ if (temperatureIn > 0.1F && temperatureIn < 0.2F) {
+ throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow");
+ } else {
+ this.temperature = temperatureIn;
+ return this;
}
}
- explorationBiomesList.remove(hell);
- explorationBiomesList.remove(sky);
- explorationBiomesList.remove(frozenOcean);
- explorationBiomesList.remove(extremeHillsEdge);
- temperatureNoise = new NoiseGeneratorPerlin(new Random(1234L), 1);
- GRASS_COLOR_NOISE = new NoiseGeneratorPerlin(new Random(2345L), 1);
- DOUBLE_PLANT_GENERATOR = new WorldGenDoublePlant();
- }
+ protected BiomeGenBase.BiomeProperties setRainfall(float rainfallIn) {
+ this.rainfall = rainfallIn;
+ return this;
+ }
+
+ protected BiomeGenBase.BiomeProperties setBaseHeight(float baseHeightIn) {
+ this.baseHeight = baseHeightIn;
+ return this;
+ }
- public static class Height {
- public float rootHeight;
- public float variation;
+ protected BiomeGenBase.BiomeProperties setHeightVariation(float heightVariationIn) {
+ this.heightVariation = heightVariationIn;
+ return this;
+ }
- public Height(float rootHeightIn, float variationIn) {
- this.rootHeight = rootHeightIn;
- this.variation = variationIn;
+ protected BiomeGenBase.BiomeProperties setRainDisabled() {
+ this.enableRain = false;
+ return this;
}
- public BiomeGenBase.Height attenuate() {
- return new BiomeGenBase.Height(this.rootHeight * 0.8F, this.variation * 0.6F);
+ protected BiomeGenBase.BiomeProperties setSnowEnabled() {
+ this.enableSnow = true;
+ return this;
+ }
+
+ protected BiomeGenBase.BiomeProperties setWaterColor(int waterColorIn) {
+ this.waterColor = waterColorIn;
+ return this;
+ }
+
+ protected BiomeGenBase.BiomeProperties setBaseBiome(String nameIn) {
+ this.baseBiomeRegName = nameIn;
+ return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment