net.minecraft.world.biome.Biomes Java Examples

The following examples show how to use net.minecraft.world.biome.Biomes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MoonBiomeLayers.java    From Galacticraft-Rewoven with MIT License 6 votes vote down vote up
public static boolean areSimilar(int id1, int id2) {
    if (id1 == id2) {
        return true;
    } else {
        Biome biome = Registry.BIOME.get(id1);
        Biome biome2 = Registry.BIOME.get(id2);
        if (biome != null && biome2 != null) {
            if (biome != Biomes.WOODED_BADLANDS_PLATEAU && biome != Biomes.BADLANDS_PLATEAU) {
                if (biome.getCategory() != Biome.Category.NONE && biome2.getCategory() != Biome.Category.NONE && biome.getCategory() == biome2.getCategory()) {
                    return true;
                } else {
                    return biome == biome2;
                }
            } else {
                return biome2 == Biomes.WOODED_BADLANDS_PLATEAU || biome2 == Biomes.BADLANDS_PLATEAU;
            }
        } else {
            return false;
        }
    }
}
 
Example #2
Source File: OilPoolGenerator.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
public static void registerOilLake() {
    for (Biome biome : Biome.BIOMES) {
        if (!biome.getCategory().equals(Biomes.NETHER_WASTES.getCategory()) && !biome.getCategory().equals(Biomes.THE_END.getCategory())) {

            biome.addFeature(GenerationStep.Feature.UNDERGROUND_DECORATION, new ConfiguredFeature<>((LakeFeature) Feature.LAKE, new SingleStateFeatureConfig(GalacticraftBlocks.CRUDE_OIL.getDefaultState())));
        }
    }
}
 
Example #3
Source File: Protocol_1_15_2.java    From multiconnect with MIT License 5 votes vote down vote up
private void mutateBiomeRegistry(ISimpleRegistry<Biome> registry) {
    rename(registry, Biomes.NETHER_WASTES, "nether");
    registry.unregister(Biomes.SOUL_SAND_VALLEY);
    registry.unregister(Biomes.CRIMSON_FOREST);
    registry.unregister(Biomes.WARPED_FOREST);
    registry.unregister(Biomes.BASALT_DELTAS);
}
 
Example #4
Source File: PatchworkBiomes.java    From patchwork-api with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static Biome getDefaultRiver(Biome biome) {
	if (biome == Biomes.SNOWY_TUNDRA) {
		return Biomes.FROZEN_RIVER;
	} else if (biome == Biomes.MUSHROOM_FIELDS || biome == Biomes.MUSHROOM_FIELD_SHORE) {
		return Biomes.MUSHROOM_FIELD_SHORE;
	}

	return Biomes.RIVER;
}
 
Example #5
Source File: SaplingBlockMixin.java    From fabric-carpet with MIT License 5 votes vote down vote up
@Inject(method = "generate", at = @At(value = "INVOKE", shift = At.Shift.BEFORE,
        target = "Lnet/minecraft/block/sapling/SaplingGenerator;generate(Lnet/minecraft/world/IWorld;Lnet/minecraft/world/gen/chunk/ChunkGenerator;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Ljava/util/Random;)Z"),
        cancellable = true)
private void onGenerate(ServerWorld serverWorld_1, BlockPos blockPos_1, BlockState blockState_1, Random random_1, CallbackInfo ci)
{
    if(CarpetSettings.desertShrubs && serverWorld_1.getBiome(blockPos_1) == Biomes.DESERT && !BlockSaplingHelper.hasWater(serverWorld_1, blockPos_1))
    {
        serverWorld_1.setBlockState(blockPos_1, Blocks.DEAD_BUSH.getDefaultState(), 3);
        ci.cancel();
    }
}
 
Example #6
Source File: Protocol_1_13_2.java    From multiconnect with MIT License 4 votes vote down vote up
private void mutateBiomeRegistry(ISimpleRegistry<Biome> registry) {
    registry.unregister(Biomes.BAMBOO_JUNGLE);
    registry.unregister(Biomes.BAMBOO_JUNGLE_HILLS);
}
 
Example #7
Source File: Protocol_1_12_2.java    From multiconnect with MIT License 4 votes vote down vote up
private void mutateBiomeRegistry(ISimpleRegistry<Biome> registry) {
    rename(registry, Biomes.MOUNTAINS, "extreme_hills");
    rename(registry, Biomes.SWAMP, "swampland");
    rename(registry, Biomes.NETHER_WASTES, "hell");
    rename(registry, Biomes.THE_END, "sky");
    rename(registry, Biomes.SNOWY_TUNDRA, "ice_flats");
    rename(registry, Biomes.SNOWY_MOUNTAINS, "ice_mountains");
    rename(registry, Biomes.MUSHROOM_FIELDS, "mushroom_island");
    rename(registry, Biomes.MUSHROOM_FIELD_SHORE, "mushroom_island_shore");
    rename(registry, Biomes.BEACH, "beaches");
    rename(registry, Biomes.WOODED_HILLS, "forest_hills");
    rename(registry, Biomes.MOUNTAIN_EDGE, "smaller_extreme_hills");
    rename(registry, Biomes.STONE_SHORE, "stone_beach");
    rename(registry, Biomes.SNOWY_BEACH, "cold_beach");
    rename(registry, Biomes.DARK_FOREST, "roofed_forest");
    rename(registry, Biomes.SNOWY_TAIGA, "taiga_cold");
    rename(registry, Biomes.SNOWY_TAIGA_HILLS, "taiga_cold_hills");
    rename(registry, Biomes.GIANT_TREE_TAIGA, "redwood_taiga");
    rename(registry, Biomes.GIANT_TREE_TAIGA_HILLS, "redwood_taiga_hills");
    rename(registry, Biomes.WOODED_MOUNTAINS, "extreme_hills_with_trees");
    rename(registry, Biomes.SAVANNA_PLATEAU, "savanna_rock");
    rename(registry, Biomes.BADLANDS, "mesa");
    rename(registry, Biomes.WOODED_BADLANDS_PLATEAU, "mesa_rock");
    rename(registry, Biomes.BADLANDS_PLATEAU, "mesa_clear_rock");
    registry.purge(Biomes.SMALL_END_ISLANDS);
    registry.purge(Biomes.END_MIDLANDS);
    registry.purge(Biomes.END_HIGHLANDS);
    registry.purge(Biomes.END_BARRENS);
    registry.purge(Biomes.WARM_OCEAN);
    registry.purge(Biomes.LUKEWARM_OCEAN);
    registry.purge(Biomes.COLD_OCEAN);
    registry.purge(Biomes.DEEP_WARM_OCEAN);
    registry.purge(Biomes.DEEP_LUKEWARM_OCEAN);
    registry.purge(Biomes.DEEP_WARM_OCEAN);
    registry.purge(Biomes.DEEP_LUKEWARM_OCEAN);
    registry.purge(Biomes.DEEP_COLD_OCEAN);
    registry.purge(Biomes.DEEP_FROZEN_OCEAN);
    rename(registry, Biomes.THE_VOID, "void");
    rename(registry, Biomes.SUNFLOWER_PLAINS, "mutated_plains");
    rename(registry, Biomes.DESERT_LAKES, "mutated_desert");
    rename(registry, Biomes.GRAVELLY_MOUNTAINS, "mutated_extreme_hills");
    rename(registry, Biomes.FLOWER_FOREST, "mutated_forest");
    rename(registry, Biomes.TAIGA_MOUNTAINS, "mutated_taiga");
    rename(registry, Biomes.SWAMP_HILLS, "mutated_swampland");
    rename(registry, Biomes.ICE_SPIKES, "mutated_ice_flats");
    rename(registry, Biomes.MODIFIED_JUNGLE, "mutated_jungle");
    rename(registry, Biomes.MODIFIED_JUNGLE_EDGE, "mutated_jungle_edge");
    rename(registry, Biomes.TALL_BIRCH_FOREST, "mutated_birch_forest");
    rename(registry, Biomes.TALL_BIRCH_HILLS, "mutated_birch_forest_hills");
    rename(registry, Biomes.DARK_FOREST_HILLS, "mutated_roofed_forest_hills");
    rename(registry, Biomes.SNOWY_TAIGA_MOUNTAINS, "mutated_taiga_cold");
    rename(registry, Biomes.GIANT_SPRUCE_TAIGA, "mutated_redwood_taiga");
    rename(registry, Biomes.GIANT_SPRUCE_TAIGA_HILLS, "mutated_redwood_taiga_hills");
    rename(registry, Biomes.MODIFIED_GRAVELLY_MOUNTAINS, "mutated_extreme_hills_with_trees");
    rename(registry, Biomes.SHATTERED_SAVANNA, "mutated_savanna");
    rename(registry, Biomes.SHATTERED_SAVANNA_PLATEAU, "mutated_savanna_rock");
    rename(registry, Biomes.ERODED_BADLANDS, "mutated_mesa");
    rename(registry, Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU, "mutated_mesa_rock");
    rename(registry, Biomes.MODIFIED_BADLANDS_PLATEAU, "mutated_mesa_clear_rock");
}
 
Example #8
Source File: BiomeDictionary.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
private static void registerVanillaBiomes() {
	addTypes(Biomes.OCEAN, OCEAN);
	addTypes(Biomes.PLAINS, PLAINS);
	addTypes(Biomes.DESERT, HOT, DRY, SANDY);
	addTypes(Biomes.MOUNTAINS, MOUNTAIN, HILLS);
	addTypes(Biomes.FOREST, FOREST);
	addTypes(Biomes.TAIGA, COLD, CONIFEROUS, FOREST);
	addTypes(Biomes.SWAMP, WET, SWAMP);
	addTypes(Biomes.RIVER, RIVER);
	addTypes(Biomes.NETHER, HOT, DRY, NETHER);
	addTypes(Biomes.THE_END, COLD, DRY, END);
	addTypes(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY);
	addTypes(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY);
	addTypes(Biomes.SNOWY_TUNDRA, COLD, SNOWY, WASTELAND);
	addTypes(Biomes.SNOWY_MOUNTAINS, COLD, SNOWY, MOUNTAIN);
	addTypes(Biomes.MUSHROOM_FIELDS, MUSHROOM, RARE);
	addTypes(Biomes.MUSHROOM_FIELD_SHORE, MUSHROOM, BEACH, RARE);
	addTypes(Biomes.BEACH, BEACH);
	addTypes(Biomes.DESERT_HILLS, HOT, DRY, SANDY, HILLS);
	addTypes(Biomes.WOODED_HILLS, FOREST, HILLS);
	addTypes(Biomes.TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS);
	addTypes(Biomes.MOUNTAIN_EDGE, MOUNTAIN);
	addTypes(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE);
	addTypes(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS);
	addTypes(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST, RARE);
	addTypes(Biomes.DEEP_OCEAN, OCEAN);
	addTypes(Biomes.STONE_SHORE, BEACH);
	addTypes(Biomes.SNOWY_BEACH, COLD, BEACH, SNOWY);
	addTypes(Biomes.BIRCH_FOREST, FOREST);
	addTypes(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS);
	addTypes(Biomes.DARK_FOREST, SPOOKY, DENSE, FOREST);
	addTypes(Biomes.SNOWY_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY);
	addTypes(Biomes.SNOWY_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS);
	addTypes(Biomes.GIANT_TREE_TAIGA, COLD, CONIFEROUS, FOREST);
	addTypes(Biomes.GIANT_TREE_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS);
	addTypes(Biomes.WOODED_MOUNTAINS, MOUNTAIN, FOREST, SPARSE);
	addTypes(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE);
	addTypes(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE, RARE);
	addTypes(Biomes.BADLANDS, MESA, SANDY, DRY);
	addTypes(Biomes.WOODED_BADLANDS_PLATEAU, MESA, SANDY, DRY, SPARSE);
	addTypes(Biomes.BADLANDS_PLATEAU, MESA, SANDY, DRY);
	addTypes(Biomes.SMALL_END_ISLANDS, END);
	addTypes(Biomes.END_MIDLANDS, END);
	addTypes(Biomes.END_HIGHLANDS, END);
	addTypes(Biomes.END_BARRENS, END);
	addTypes(Biomes.WARM_OCEAN, OCEAN, HOT);
	addTypes(Biomes.LUKEWARM_OCEAN, OCEAN);
	addTypes(Biomes.COLD_OCEAN, OCEAN, COLD);
	addTypes(Biomes.DEEP_WARM_OCEAN, OCEAN, HOT);
	addTypes(Biomes.DEEP_LUKEWARM_OCEAN, OCEAN);
	addTypes(Biomes.DEEP_COLD_OCEAN, OCEAN, COLD);
	addTypes(Biomes.DEEP_FROZEN_OCEAN, OCEAN, COLD);
	addTypes(Biomes.THE_VOID, VOID);
	addTypes(Biomes.SUNFLOWER_PLAINS, PLAINS, RARE);
	addTypes(Biomes.DESERT_LAKES, HOT, DRY, SANDY, RARE);
	addTypes(Biomes.GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE);
	addTypes(Biomes.FLOWER_FOREST, FOREST, HILLS, RARE);
	addTypes(Biomes.TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE);
	addTypes(Biomes.SWAMP_HILLS, WET, SWAMP, HILLS, RARE);
	addTypes(Biomes.ICE_SPIKES, COLD, SNOWY, HILLS, RARE);
	addTypes(Biomes.MODIFIED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE);
	addTypes(Biomes.MODIFIED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE);
	addTypes(Biomes.TALL_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE);
	addTypes(Biomes.TALL_BIRCH_HILLS, FOREST, DENSE, MOUNTAIN, RARE);
	addTypes(Biomes.DARK_FOREST_HILLS, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE);
	addTypes(Biomes.SNOWY_TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE);
	addTypes(Biomes.GIANT_SPRUCE_TAIGA, DENSE, FOREST, RARE);
	addTypes(Biomes.GIANT_SPRUCE_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE);
	addTypes(Biomes.MODIFIED_GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE);
	addTypes(Biomes.SHATTERED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
	addTypes(Biomes.SHATTERED_SAVANNA_PLATEAU, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE);
	addTypes(Biomes.ERODED_BADLANDS, HOT, DRY, SPARSE, MOUNTAIN, RARE);
	addTypes(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, HILLS, RARE);
	addTypes(Biomes.MODIFIED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, MOUNTAIN, RARE);

	if (DEBUG) {
		StringBuilder buf = new StringBuilder();
		buf.append("BiomeDictionary:\n");
		Type.BY_NAME.forEach((name, type) -> buf.append("    ").append(type.name).append(": ").append(type.biomes.stream().map(b -> Registry.BIOME.getId(b).toString()).collect(Collectors.joining(", "))).append('\n'));
		LOGGER.debug(buf.toString());
	}
}