@Override public BiomeData getData(BaseBiome biome) { return new ForgeBiomeData(Biome.getBiome(biome.getId())); }
public String[] toDetailedString() { this.compileMatches(); String[] breakdown = new String[this._matches.size() + 1]; breakdown[0] = this._matches.size() + " biome matches"; if (this._matches.size() > 0) { breakdown[0] = breakdown[0] + ':'; } int i = 1; for (Entry<Integer,Float> entry : this._matches.entrySet()) { float weight = entry.getValue(); Biome biome = Biome.getBiome(entry.getKey()); if (biome == null) { breakdown[i] = "[??]"; } else { breakdown[i] = biome.getBiomeName(); } breakdown[i] = breakdown[i] + " - " + weight; ++i; } return breakdown; }
private boolean isJungleCompatible(int p_151631_1_) { return Biome.getBiome(p_151631_1_) != null && Biome.getBiome(p_151631_1_).getBiomeClass() == BiomeJungle.class ? true : p_151631_1_ == Biome.getIdForBiome(Biomes.JUNGLE_EDGE) || p_151631_1_ == Biome.getIdForBiome(Biomes.JUNGLE) || p_151631_1_ == Biome.getIdForBiome(Biomes.JUNGLE_HILLS) || p_151631_1_ == Biome.getIdForBiome(Biomes.FOREST) || p_151631_1_ == Biome.getIdForBiome(Biomes.TAIGA) || isBiomeOceanic(p_151631_1_); }
private boolean isMesa(int p_151633_1_) { return Biome.getBiome(p_151633_1_) instanceof BiomeMesa; } }
@Override @SideOnly(Side.CLIENT) public void getTooltip(Tooltip tooltip, ITooltipFlag tooltipFlag) { if (tolerated.isEmpty()) { return; } int x = (int) (getRelativeMousePosition().xPos() / 16.0f); int y = (int) (getRelativeMousePosition().yPos() / 16.0f); int i = x + y * 8; if (i >= tolerated.size()) { return; } Biome biome = Biome.getBiome(tolerated.get(i)); if (biome != null) { tooltip.add(biome.getBiomeName()); } }
public static BiomeType getBiome(int index) { return (BiomeType) Biome.getBiome(index); }
public static int getNextFreeBiomeId() { for (int i = BiomeHelper.nextBiomeId; i < 256; i++) if (Biome.getBiome(i) != null) { if (i == 255) throw new IllegalArgumentException("There are no more biome ids avaliable!"); continue; }else{ BiomeHelper.nextBiomeId = i + 1; return i; } return -1; }
@Override public Iterator<Biome> getIterator() { final List<Biome> list = new ArrayList<>(); for(final int i:this.ids){ final Biome gen = Biome.getBiome(i); if(gen == null){ APIInfo.log.error("Error applying tweaks. Biome ID "+i+" does not correspond to a biome! Check the output files for the correct ID!"); continue; } list.add(gen); } return list.iterator(); }
Biome biome = Biome.getBiome(entry.getKey());
@Override @SuppressWarnings("rawtypes") public boolean areBiomesViable(int x, int z, int checkRadius, List viableBiomes) { IntCache.resetIntCache(); int minX = x - checkRadius >> 2; int minZ = z - checkRadius >> 2; int maxX = x + checkRadius >> 2; int maxZ = z + checkRadius >> 2; int sizeX = maxX - minX + 1; int sizeZ = maxZ - minZ + 1; int[] biomeArray = biomeGenLayer.getInts(minX, minZ, sizeX, sizeZ); for (int index = 0; index < sizeX * sizeZ; ++index) if (!viableBiomes.contains(Biome.getBiome(biomeArray[index], Biomes.DEFAULT))) return false; return true; }
@Override @SideOnly(Side.CLIENT) public void onRenderForeground(int guiWidth, int guiHeight) { for (int i = 0; i < tolerated.size(); ++i) { int x = i % 8 * 16; int y = i / 8 * 16; if (Biome.getBiome(i) != null) { //TODO FIND COLOR //CraftGUI.Render.colour(Biome.getBiome(i).color); } CraftGUI.RENDER.texture(CraftGUITexture.BUTTON, new Area(x, y, 16, 16)); } }
@Override public Biome[] getBiomes(@Nullable Biome[] biomesForGeneration, int x, int z, int sizeX, int sizeZ, boolean useCache) { IntCache.resetIntCache(); if (biomesForGeneration == null || biomesForGeneration.length < sizeX * sizeZ) biomesForGeneration = new Biome[sizeX * sizeZ]; if (useCache && sizeX == 16 && sizeZ == 16 && (x & 15) == 0 && (z & 15) == 0) { Biome[] cachedBiomes = biomeCache.getCachedBiomes(x, z); System.arraycopy(cachedBiomes, 0, biomesForGeneration, 0, sizeX * sizeZ); return biomesForGeneration; } else { int[] generatedBiomes = biomeGenLayer.getInts(x, z, sizeX, sizeZ); for (int index = 0; index < sizeX * sizeZ; ++index) biomesForGeneration[index] = Biome.getBiome(generatedBiomes[index], Biomes.DEFAULT); return biomesForGeneration; } }
/** * TODO: The getBiomGenAt(int, int) no longer exists * @Override public Biome getBiomeGenAt(int chunkX, int chunkZ) { return biomeCache.getBiomeGenAt(chunkX, chunkZ); }*/ @Override public Biome[] getBiomesForGeneration(Biome biomesForGeneration[], int x, int z, int sizeX, int sizeZ) { IntCache.resetIntCache(); if (biomesForGeneration == null || biomesForGeneration.length < sizeX * sizeZ) biomesForGeneration = new Biome[sizeX * sizeZ]; int[] biomeArray = biomeGenLayer.getInts(x, z, sizeX, sizeZ); for (int index = 0; index < sizeX * sizeZ; ++index) biomesForGeneration[index] = Biome.getBiome(biomeArray[index], Biomes.DEFAULT); return biomesForGeneration; }
/** * TODO: This now centers around the BlockPos */ @Override @SuppressWarnings("rawtypes") public BlockPos findBiomePosition(int x, int z, int checkRadius, List viableBiomes, Random rand) { IntCache.resetIntCache(); int minX = x - checkRadius >> 2; int minZ = z - checkRadius >> 2; int maxX = x + checkRadius >> 2; int maxZ = z + checkRadius >> 2; int sizeX = maxX - minX + 1; int sizeZ = maxZ - minZ + 1; int[] biomeArray = biomeGenLayer.getInts(minX, minZ, sizeX, sizeZ); BlockPos pos = null; int attempts = 0; for (int index = 0; index < sizeX * sizeZ; ++index) { int finalX = minX + index % sizeX << 2; int finalZ = minZ + index / sizeX << 2; if (viableBiomes.contains(Biome.getBiome(biomeArray[index], Biomes.DEFAULT)) && (pos == null || rand.nextInt(attempts + 1) == 0)) { pos = new BlockPos(finalX, 0, finalZ); ++attempts; } } return pos; }
@Override public void perform() throws Exception { for(final int i:this.pack.getRawIds()) for (final String type:this.types) { if (MinecraftForge.EVENT_BUS .post(new BiomeTweakEvent.RemoveDecoration(this, Biome.getBiome(i), i, type))) continue; if (!BiomeEventHandler.getDecorateTypes().containsKey(i)) BiomeEventHandler.getDecorateTypes().put(i, new ArrayList<String>()); BiomeEventHandler.getDecorateTypes().get(i).add(type); } }
@Override public void perform() throws Exception { for(final int i:this.pack.getRawIds()) for (final String type:this.types) { if (MinecraftForge.EVENT_BUS .post(new BiomeTweakEvent.RemoveFeature(this, Biome.getBiome(i), i, type))) continue; if (!BiomeEventHandler.getPopulateTypes().containsKey(i)) BiomeEventHandler.getPopulateTypes().put(i, new ArrayList<String>()); BiomeEventHandler.getPopulateTypes().get(i).add(type); } }
@Override public void perform() throws Exception { for(final int i:this.pack.getRawIds()) for (final String type:this.types) { if (MinecraftForge.EVENT_BUS .post(new BiomeTweakEvent.RemoveOre(this, Biome.getBiome(i), i, type))) continue; if (!BiomeEventHandler.getOreTypes().containsKey(i)) BiomeEventHandler.getOreTypes().put(i, new ArrayList<String>()); BiomeEventHandler.getOreTypes().get(i).add(type); } }
private int getColor(final int chunkX, final int chunkZ) { if(this.bProvider == null) { final DummyWorld world = new DummyWorld(new WorldInfo(this.worldSettings, this.worldName)); world.provider.setWorld(world); this.bProvider = world.getBiomeProvider(); } this.tempArray[0] = null; final int bId = Biome.getIdForBiome(this.bProvider.getBiomes(this.tempArray, (chunkX << 4) + 8, (chunkZ << 4) + 8, 1, 1, false)[0]); if(this.colorArray[bId] == -1) { LogHelper.info(bId); LogHelper.info(Biome.getBiome(bId)); LogHelper.info(Biome.REGISTRY.getNameForObject(Biome.getBiome(bId)));; this.colorArray[bId] = BiomeColorMappings.getColorForBiome(Biome.REGISTRY.getNameForObject(Biome.getBiome(bId)).toString()); } return this.colorArray[bId]; }
final int savedBiomeId = biomeIds.getSavedId(); Biome alreadyRegisteredBiome = Biome.getBiome(generationBiomeId); if (alreadyRegisteredBiome != null) { if (!StringHelper.toComputerFriendlyName(alreadyRegisteredBiome.biomeName).equalsIgnoreCase(biomeNameForRegistry)) { alreadyRegisteredBiome = Biome.getBiome(generationBiomeId); if (alreadyRegisteredBiome != null) { throw new RuntimeException("Attempt was made to attempted to register biome '" + registryKey + "' with id '" + generationBiomeId + "' " Biome existingBiome = Biome.getBiome(savedBiomeId); if (existingBiome == null)
if (xo != 0 || zo != 0) { int biomeID = currentBiomeInts[xx + 1 + xo + (zz + 1 + zo) * (sizeX + 2)]; Biome biome = Biome.getBiome(biomeID); if (biome != this.biome) { surrounded = false;