Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 127 lines 4.6 kB view raw
1package net.minecraft.server; 2 3import java.util.ArrayList; 4import java.util.List; 5import java.util.Random; 6 7import uk.betacraft.uberbukkit.UberbukkitConfig; 8 9public class BiomeBase { 10 11 public static final BiomeBase RAINFOREST = (new BiomeRainforest()).b(588342).a("Rainforest").a(2094168); 12 public static final BiomeBase SWAMPLAND = (new BiomeSwamp()).b(522674).a("Swampland").a(9154376); 13 public static final BiomeBase SEASONAL_FOREST = (new BiomeBase()).b(10215459).a("Seasonal Forest"); 14 public static final BiomeBase FOREST = (new BiomeForest()).b(353825).a("Forest").a(5159473); 15 public static final BiomeBase SAVANNA = (new BiomeDesert()).b(14278691).a("Savanna"); 16 public static final BiomeBase SHRUBLAND = (new BiomeBase()).b(10595616).a("Shrubland"); 17 public static final BiomeBase TAIGA = (new BiomeTaiga()).b(3060051).a("Taiga").b().a(8107825); 18 public static final BiomeBase DESERT = (new BiomeDesert()).b(16421912).a("Desert").e(); 19 public static final BiomeBase PLAINS = (new BiomeDesert()).b(16767248).a("Plains"); 20 public static final BiomeBase ICE_DESERT = (new BiomeDesert()).b(16772499).a("Ice Desert").b().e().a(12899129); 21 public static final BiomeBase TUNDRA = (new BiomeBase()).b(5762041).a("Tundra").b().a(12899129); 22 public static final BiomeBase HELL = (new BiomeHell()).b(16711680).a("Hell").e(); 23 public static final BiomeBase SKY = (new BiomeSky()).b(8421631).a("Sky").e(); 24 public String n; 25 public int o; 26 public byte p; 27 public byte q; 28 public int r; 29 protected List s; 30 protected List t; 31 protected List u; 32 private boolean v; 33 private boolean w; 34 private static BiomeBase[] x = new BiomeBase[4096]; 35 36 protected BiomeBase() { 37 this.p = (byte) Block.GRASS.id; 38 this.q = (byte) Block.DIRT.id; 39 this.r = 5169201; 40 this.s = new ArrayList(); 41 this.t = new ArrayList(); 42 this.u = new ArrayList(); 43 this.w = true; 44 this.s.add(new BiomeMeta(EntitySpider.class, 10)); 45 this.s.add(new BiomeMeta(EntityZombie.class, 10)); 46 this.s.add(new BiomeMeta(EntitySkeleton.class, 10)); 47 this.s.add(new BiomeMeta(EntityCreeper.class, 10)); 48 this.t.add(new BiomeMeta(EntitySheep.class, 12)); 49 this.t.add(new BiomeMeta(EntityPig.class, 10)); 50 this.t.add(new BiomeMeta(EntityChicken.class, 10)); 51 this.t.add(new BiomeMeta(EntityCow.class, 8)); 52 // uberbukkit 53 if (UberbukkitConfig.getInstance().getBoolean("mechanics.spawn_squids", true)) 54 this.u.add(new BiomeMeta(EntitySquid.class, 10)); 55 56 if (UberbukkitConfig.getInstance().getBoolean("mechanics.spawn_slimes", true)) 57 this.s.add(new BiomeMeta(EntitySlime.class, 10)); 58 } 59 60 private BiomeBase e() { 61 this.w = false; 62 return this; 63 } 64 65 public static void a() { 66 for (int i = 0; i < 64; ++i) { 67 for (int j = 0; j < 64; ++j) { 68 x[i + j * 64] = a((float) i / 63.0F, (float) j / 63.0F); 69 } 70 } 71 72 DESERT.p = DESERT.q = (byte) Block.SAND.id; 73 ICE_DESERT.p = ICE_DESERT.q = (byte) Block.SAND.id; 74 } 75 76 public WorldGenerator a(Random random) { 77 return (WorldGenerator) (random.nextInt(10) == 0 ? new WorldGenBigTree() : new WorldGenTrees()); 78 } 79 80 protected BiomeBase b() { 81 this.v = true; 82 return this; 83 } 84 85 protected BiomeBase a(String s) { 86 this.n = s; 87 return this; 88 } 89 90 protected BiomeBase a(int i) { 91 this.r = i; 92 return this; 93 } 94 95 protected BiomeBase b(int i) { 96 this.o = i; 97 return this; 98 } 99 100 public static BiomeBase a(double d0, double d1) { 101 int i = (int) (d0 * 63.0D); 102 int j = (int) (d1 * 63.0D); 103 104 return x[i + j * 64]; 105 } 106 107 public static BiomeBase a(float f, float f1) { 108 f1 *= f; 109 return f < 0.1F ? TUNDRA : (f1 < 0.2F ? (f < 0.5F ? TUNDRA : (f < 0.95F ? SAVANNA : DESERT)) : (f1 > 0.5F && f < 0.7F ? SWAMPLAND : (f < 0.5F ? TAIGA : (f < 0.97F ? (f1 < 0.35F ? SHRUBLAND : FOREST) : (f1 < 0.45F ? PLAINS : (f1 < 0.9F ? SEASONAL_FOREST : RAINFOREST)))))); 110 } 111 112 public List a(EnumCreatureType enumcreaturetype) { 113 return enumcreaturetype == EnumCreatureType.MONSTER ? this.s : (enumcreaturetype == EnumCreatureType.CREATURE ? this.t : (enumcreaturetype == EnumCreatureType.WATER_CREATURE ? this.u : null)); 114 } 115 116 public boolean c() { 117 return this.v; 118 } 119 120 public boolean d() { 121 return this.v ? false : this.w; 122 } 123 124 static { 125 a(); 126 } 127}