Created
May 24, 2020 15:13
-
-
Save SnowShock35/e539ce53c003810e4c8a8721e23381c8 to your computer and use it in GitHub Desktop.
Biomes O' Plenty Feature Generator Disabling Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, json | |
def main(): | |
features = {"generators":{"emeralds":{"enable":False}, "ruby":{"enable":False}, "topaz":{"enable":False}, "amber":{"enable":False}, "peridot":{"enable":False}, "malachite":{"enable":False}, "sapphire":{"enable":False}, "tanzanite":{"enable":False}, "glowshrooms":{"enable":False}, "miners_delight":{"enable":False}, "algae":{"enable":False}, "amethyst":{"enable":False}, "berry_bushes":{"enable":False}, "big_brown_mushroom":{"enable":False}, "big_red_mushroom":{"enable":False}, "biome_essence":{"enable":False}, "blood_pools":{"enable":False}, "blue_coral":{"enable":False}, "blue_milk_caps":{"enable":False}, "boulders":{"enable":False}, "bromeliad":{"enable":False}, "brown_mushrooms":{"enable":False}, "bushes":{"enable":False}, "cacti":{"enable":False}, "cattail":{"enable":False}, "clover_patches":{"enable":False}, "cobblestone_splatter":{"enable":False}, "crystals":{"enable":False}, "dead_bushes":{"enable":False}, "dead_grass":{"enable":False}, "dead_leaf_piles":{"enable":False}, "desert_sprouts":{"enable":False}, "desertgrass":{"enable":False}, "double_cattail":{"enable":False}, "double_fern":{"enable":False}, "dunegrass":{"enable":False}, "eyebulbs":{"enable":False}, "fire":{"enable":False}, "flat_mushroom":{"enable":False}, "flax":{"enable":False}, "flower_lily":{"enable":False}, "flowers":{"enable":False}, "glowing_coral":{"enable":False}, "glowshrooms_surface":{"enable":False}, "glowstone_crystals":{"enable":False}, "grass":{"enable":False}, "grass_splatter":{"enable":False}, "gravel":{"enable":False}, "hard_ice_splatter":{"enable":False}, "hive":{"enable":False}, "hot_springs":{"enable":False}, "ice_crystals":{"enable":False}, "ice_pools":{"enable":False}, "ivy":{"enable":False}, "kelp":{"enable":False}, "kelp_tall":{"enable":False}, "koru":{"enable":False}, "lakes":{"enable":False}, "large_oak":{"enable":False}, "lava_flows":{"enable":False}, "lava_lakes":{"enable":False}, "lavender":{"enable":False}, "leaf_piles":{"enable":False}, "leaves_clusters":{"enable":False}, "lily":{"enable":False}, "magma_splatter":{"enable":False}, "medium_lily":{"enable":False}, "melons":{"enable":False}, "mud":{"enable":False}, "mud_patches":{"enable":False}, "netherrack_splatter":{"enable":False}, "oases":{"enable":False}, "orange_coral":{"enable":False}, "overgrown_stone_patches":{"enable":False}, "pink_coral":{"enable":False}, "poison_ivy":{"enable":False}, "poison_lakes":{"enable":False}, "portobellos":{"enable":False}, "quicksand":{"enable":False}, "rafflesia":{"enable":False}, "red_mushrooms":{"enable":False}, "river_cane":{"enable":False}, "roots":{"enable":False}, "sacred_oak_trees":{"enable":False}, "sand":{"enable":False}, "small_lily":{"enable":False}, "snow_splatter":{"enable":False}, "sprouts":{"enable":False}, "stone_patches":{"enable":False}, "stone_splatter":{"enable":False}, "sugar_cane":{"enable":False}, "thorns":{"enable":False}, "tiny_cacti":{"enable":False}, "tiny_lily":{"enable":False}, "toadstools":{"enable":False}, "trees":{"enable":False}, "vinesState":{"enable":False}, "water_reeds":{"enable":False}, "wild_rice":{"enable":False}}} | |
biome_dict = [ | |
{ | |
"mod_id": 'biomesoplenty', | |
"enable": True, | |
"biomes": [ | |
"alps", | |
"alps_foothills", | |
"bamboo_forest", | |
"bayou", | |
"bog", | |
"boreal_forest", | |
"brushland", | |
"chaparral", | |
"cherry_blossom_grove", | |
"cold_desert", | |
"coniferous_forest", | |
"coral_reef", | |
"corrupted_sands", | |
"crag", | |
"dead_forest", | |
"dead_swamp", | |
"eucalyptus_forest", | |
"fen", | |
"flower_field", | |
"flower_island", | |
"fungi_forest", | |
"glacier", | |
"grassland", | |
"gravel_beach", | |
"grove", | |
"highland", | |
"kelp_forest", | |
"land_of_lakes", | |
"lavender_fields", | |
"lush_desert", | |
"lush_swamp", | |
"mangrove", | |
"maple_woods", | |
"marsh", | |
"meadow", | |
"moor", | |
"mountain", | |
"mountain_foothills", | |
"mystic_grove", | |
"oasis", | |
"ominous_woods", | |
"orchard", | |
"origin_island", | |
"outback", | |
"overgrown_cliffs", | |
"phantasmagoric_inferno", | |
"polar_chasm", | |
"prairie", | |
"quagmire", | |
"rainforest", | |
"redwood_forest", | |
"sacred_springs", | |
"seasonal_forest", | |
"shield", | |
"shrubland", | |
"snowy_coniferous_forest", | |
"snowy_forest", | |
"steppe", | |
"temperate_rainforest", | |
"tropical_island", | |
"tropical_rainforest", | |
"tundra", | |
"undergarden", | |
"visceral_heap", | |
"volcanic_island", | |
"wasteland", | |
"wetland", | |
"white_beach", | |
"woodland", | |
"xeric_shrubland", | |
] | |
}, | |
{ | |
"mod_id": "minecraft", | |
"enable": True, | |
"biomes": [ | |
"birch_forest", | |
"birch_forest_hills", | |
"desert", | |
"desert_hills", | |
"extreme_hills", | |
"extreme_hills_with_trees", | |
"forest", | |
"forest_hills", | |
"hell", | |
"ice_flats", | |
"ice_mountains", | |
"jungle", | |
"jungle_hills", | |
"mesa", | |
"mesa_clear_rock", | |
"ocean", | |
"plains", | |
"redwood_taiga", | |
"redwood_taiga_hills", | |
"roofed_forest", | |
"savanna", | |
"savanna_rock", | |
"sky", | |
"swampland", | |
"taiga", | |
"taiga_cold", | |
"taiga_cold_hills", | |
"taiga_hills", | |
] | |
} | |
] | |
cfg = { | |
"features": {}, | |
"biomesoplenty": True, | |
"minecraft": True | |
} | |
cfg['features'] = features | |
print('[LOG: INFO] Task Running...') | |
filepath = os.path.dirname(os.path.realpath(__file__)) | |
def initconfig(file, path): | |
print('[LOG: WARN] No configuration file found. Initialising file...') | |
if not os.path.isfile("%s.cfg" % file): | |
file = open(os.path.join(path, "config.cfg"), "w+") | |
file.write(json.dumps(cfg, sort_keys=False, ensure_ascii=True, indent=2)) | |
file.close() | |
return file | |
initconfig("config", filepath) | |
config = open(os.path.join(filepath, "config.cfg"), "r") | |
cfgObj = json.load(config) | |
print('[LOG: INFO] Successfully read configuration file.') | |
config.close() | |
if not os.path.isdir("%s/config/biomesoplenty/biomes" % filepath): | |
print('[LOG: WARN] No configuration directory found. Initialising directories...') | |
os.makedirs("config/biomesoplenty/biomes") | |
for i in range(0, len(biome_dict)): | |
for ii in range(0, len(biome_dict[i]['biomes'])): | |
file = open(filepath + "/config/biomesoplenty/biomes/%s.json" % str(biome_dict[i]['biomes'][ii]), "w+") | |
file.write(json.dumps(cfgObj['features'], sort_keys=True, indent=2, ensure_ascii=True)) | |
# file.close() | |
print('[LOG: INFO] Task Completed') | |
print('# # # # # # # # # # # # # # # # # # # # # # # # #') | |
print('# Biomes O\' Plenty Generator Controller Script #') | |
print('# Copyright (c) 2017 SnowShock35 #') | |
print('# # # # # # # # # # # # # # # # # # # # # # # # #') | |
input('\n\nPress ANY KEY to continue') | |
main() | |
print('\nCongratulations your default configuration has been generated. To continue edit `config.cfg` and rerun the script.') | |
input('\nPress ANY KEY to exit') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment