@Override public void update() { if (!MiscPeripherals.proxy.isServer()) return; if (++ticker >= 20) { Vec3 pos = turtle.getPosition(); if (pos != null) { ticker = 0; World world = turtle.getWorld(); if (world != null) { int x = (int)Math.floor(pos.xCoord); int y = (int)Math.floor(pos.yCoord); int z = (int)Math.floor(pos.zCoord); if (MiscPeripherals.instance.sideSensitive) { ForgeDirection dir = Util.getDirectionFromTurtleSide(side, turtle.getFacingDir()); x += dir.offsetX; y += dir.offsetY; z += dir.offsetZ; } skyVisible = !world.provider.hasNoSky && world.canBlockSeeTheSky(x, y, z); sunVisible = world.isDaytime() && skyVisible && (world.getWorldChunkManager().getBiomeGenAt(x, z) instanceof BiomeGenDesert || (!world.isRaining() && !world.isThundering())); } } } if (canUpdate()) { euBuffer += getProduction(); while (euBuffer >= MiscPeripherals.instance.fuelEU) { euBuffer -= MiscPeripherals.instance.fuelEU * Util.addFuel(turtle, 1); } } }
public static boolean oilPresent(World world, Random rand, int x, int z, BlockVec3 pos) { boolean doGen2 = false; for (Integer dim : ConfigManagerCore.externalOilGen) { if (dim == world.provider.dimensionId) { doGen2 = true; break; } } if (!doGen2) return false; final BiomeGenBase biomegenbase = world.getBiomeGenForCoords(x + 8, z + 8); if (biomegenbase.biomeID == BiomeGenBase.sky.biomeID || biomegenbase.biomeID == BiomeGenBase.hell.biomeID) { return false; } rand.setSeed(world.getSeed()); long i1 = rand.nextInt() / 2L * 2L + 1L; long j1 = rand.nextInt() / 2L * 2L + 1L; rand.setSeed(x * i1 + z * j1 ^ world.getSeed()); double randMod = Math.min(0.2D, 0.08D * ConfigManagerCore.oilGenFactor); if (biomegenbase.rootHeight >= 0.45F) { randMod /= 2; } if (biomegenbase.rootHeight < -0.5F) { randMod *= 1.8; } if (biomegenbase instanceof BiomeGenDesert) { randMod *= 1.8; } final boolean flag1 = rand.nextDouble() <= randMod; final boolean flag2 = rand.nextDouble() <= randMod; if (flag1 || flag2) { pos.y = 17 + rand.nextInt(10) + rand.nextInt(5); pos.x = x + rand.nextInt(16); pos.z = z + rand.nextInt(16); return true; } return false; }
public boolean isDesert() { return worldObj.provider.getBiomeGenForCoords(xCoord >> 4, zCoord >> 4) instanceof BiomeGenDesert; }
public static float getTemperaturesForBiomes(BiomeGenBase biome, EntityPlayer player) { if (biome instanceof BiomeGenBeach) { return 30; } if (biome instanceof BiomeGenHills) { if (player.posY > 64) { return (float) (18 - player.posY - 64 / 250); } else return 18; } if (biome instanceof BiomeGenDesert) { return 40; } if (biome instanceof BiomeGenForest) { return 22; } if (biome instanceof BiomeGenEnd) { return -23; } if (biome instanceof BiomeGenHell) { return 40; } if (biome instanceof BiomeGenJungle) { return -25; } if (biome instanceof BiomeGenOcean) { return 15; } if (biome instanceof BiomeGenPlains) { return 23; } if (biome instanceof BiomeGenRiver) { return 19; } if (biome instanceof BiomeGenSavanna) { return 33; } if (biome instanceof BiomeGenSwamp) { return 21; } if (biome instanceof BiomeGenSnow) { return -5; } if (biome instanceof BiomeGenStoneBeach) { return 28; } if (biome instanceof BiomeGenMushroomIsland) { return 23; } if (biome instanceof BiomeGenMutated) { return (float) (Math.random() * 30); } if (biome instanceof BiomeGenMesa) { return (float) (Math.random() * 30); } return 21.3f; }
private DesertBiomeType() { super((BiomeGenDesert) BiomeGenBase.desert); }
private DesertHillsBiomeType() { super((BiomeGenDesert) BiomeGenBase.desertHills); }
public static void registerVanillaBiomes(){ BiomeDictionary.registerBiomeType(new BiomeGenBeach(16), BiomeDictionary.Type.BEACH, BiomeDictionary.Type.SANDY, BiomeDictionary.Type.HOT); BiomeDictionary.registerBiomeType(new BiomeGenForest(27, 2), BiomeDictionary.Type.FOREST); BiomeDictionary.registerBiomeType(new BiomeGenForest(28, 2), BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenBeach(26), BiomeDictionary.Type.COLD, BiomeDictionary.Type.BEACH, BiomeDictionary.Type.SANDY, BiomeDictionary.Type.HOT); BiomeDictionary.registerBiomeType(new BiomeGenTaiga(30, 0), BiomeDictionary.Type.COLD, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.SNOWY); BiomeDictionary.registerBiomeType(new BiomeGenTaiga(31, 0), BiomeDictionary.Type.COLD, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.SNOWY, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenOcean(24), BiomeDictionary.Type.OCEAN, BiomeDictionary.Type.WATER); BiomeDictionary.registerBiomeType(new BiomeGenDesert(2), BiomeDictionary.Type.SANDY, BiomeDictionary.Type.HOT, BiomeDictionary.Type.DRY); BiomeDictionary.registerBiomeType(new BiomeGenDesert(17), BiomeDictionary.Type.SANDY, BiomeDictionary.Type.HOT, BiomeDictionary.Type.DRY); BiomeDictionary.registerBiomeType(new BiomeGenHills(3, false), BiomeDictionary.Type.COLD, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenHills(20, true), BiomeDictionary.Type.COLD, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenHills(34, true), BiomeDictionary.Type.COLD, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenForest(4, 0), BiomeDictionary.Type.FOREST); BiomeDictionary.registerBiomeType(new BiomeGenForest(18, 0), BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenOcean(10), BiomeDictionary.Type.SNOWY, BiomeDictionary.Type.OCEAN, BiomeDictionary.Type.WATER); BiomeDictionary.registerBiomeType(new BiomeGenRiver(11), BiomeDictionary.Type.COLD, BiomeDictionary.Type.RIVER); BiomeDictionary.registerBiomeType(new BiomeGenHell(8), BiomeDictionary.Type.NETHER); BiomeDictionary.registerBiomeType(new BiomeGenSnow(13, false), BiomeDictionary.Type.COLD, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenSnow(12, false), BiomeDictionary.Type.SNOWY, BiomeDictionary.Type.COLD, BiomeDictionary.Type.PLAINS); BiomeDictionary.registerBiomeType(new BiomeGenJungle(21, false), BiomeDictionary.Type.JUNGLE); BiomeDictionary.registerBiomeType(new BiomeGenJungle(23, false), BiomeDictionary.Type.JUNGLE, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenJungle(22, false), BiomeDictionary.Type.JUNGLE, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenTaiga(32, 1), BiomeDictionary.Type.SNOWY, BiomeDictionary.Type.COLD, BiomeDictionary.Type.FOREST); BiomeDictionary.registerBiomeType(new BiomeGenTaiga(33, 1), BiomeDictionary.Type.SNOWY, BiomeDictionary.Type.COLD, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenStoneBeach(25), BiomeDictionary.Type.WASTELAND, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenMesa(38, false, true), BiomeDictionary.Type.WASTELAND, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenMesa(39, false, false), BiomeDictionary.Type.WASTELAND, BiomeDictionary.Type.HILLS); BiomeDictionary.registerBiomeType(new BiomeGenMushroomIsland(14), BiomeDictionary.Type.MUSHROOM); BiomeDictionary.registerBiomeType(new BiomeGenMushroomIsland(15), BiomeDictionary.Type.MUSHROOM); BiomeDictionary.registerBiomeType(new BiomeGenSnow(12, false), BiomeDictionary.Type.OCEAN, BiomeDictionary.Type.WATER); BiomeDictionary.registerBiomeType(new BiomeGenPlains(1), BiomeDictionary.Type.PLAINS); BiomeDictionary.registerBiomeType(new BiomeGenRiver(7), BiomeDictionary.Type.RIVER); BiomeDictionary.registerBiomeType(new BiomeGenForest(29, 3), BiomeDictionary.Type.FOREST, BiomeDictionary.Type.DENSE); BiomeDictionary.registerBiomeType(new BiomeGenStoneBeach(25), BiomeDictionary.Type.WASTELAND, BiomeDictionary.Type.DRY); BiomeDictionary.registerBiomeType(new BiomeGenStoneBeach(25), BiomeDictionary.Type.WASTELAND, BiomeDictionary.Type.DRY); BiomeDictionary.registerBiomeType(new BiomeGenEnd(9), BiomeDictionary.Type.END); BiomeDictionary.registerBiomeType(new BiomeGenStoneBeach(25), BiomeDictionary.Type.BEACH); BiomeDictionary.registerBiomeType(BiomeGenBase.swampland, BiomeDictionary.Type.SWAMP); BiomeDictionary.registerBiomeType(new BiomeGenTaiga(5, 0), BiomeDictionary.Type.COLD, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.SNOWY); BiomeDictionary.registerBiomeType(new BiomeGenTaiga(19, 0), BiomeDictionary.Type.COLD, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.SNOWY, BiomeDictionary.Type.HILLS); }
/** * Adds a ore with one spawn block. * @param ore The ore which should generate. * @param spawnBlock The block in which the ore will spawn. * @param random A instance of random. * @param world A instance of the current world. * @param posX The X position in which the ore should generate. * @param posZ The Z position in which the ore should generate. * @param minY The minimum Y position the ore can generate. * @param maxY The maximum Y position the ore can generate. * @param minVeinSize The minimum vein size. * @param maxVeinSize The maximum vein size. * @param spawnChance The chance of the block spawning. * */ private void addDesertOre(Block ore, Block spawnBlock, Random random, World world, int posX, int posZ, int minY, int maxY, int minVeinSize, int maxVeinSize, int spawnChance) { BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(posX ,posZ); if(biome instanceof BiomeGenDesert){ for (int i = 0; i < spawnChance; i++) { int defaultChunkSize = 16; int xPos = posX + random.nextInt(defaultChunkSize); int yPos = minY + random.nextInt(maxY - minY); int zPos = posZ + random.nextInt(defaultChunkSize); new WorldGenMinable(ore,(minVeinSize + random.nextInt(maxVeinSize - minVeinSize)), spawnBlock).generate(world, random, xPos, yPos, zPos); } } }