Jump to content

Recommended Posts

Posted

Hey guys,

 

I'm trying to figure a way to allow the removal of biomes via the config file.

My code so far looks like this:

 

 

package mods.B0bGary.Biomes;

import java.io.File;

import mods.B0bGary.Biomes.core.Reference;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

@Mod(modid="BiomeRemover", name="B0bGary's Biome Remover!", version=Reference.VERSION_NUMBER)


public class Base{

public static String version = Reference.VERSION_NUMBER;

@Instance("B0bGary's Biome Remover!")
public static Base instance;

public static String modid = "BiomeRemover";

public boolean doesPlainsSpawn;
public boolean doesDesertSpawn;
public boolean doesExtremeHillsSpawn;
public boolean doesForestSpawn;
public boolean doesTaigaSpawn;
public boolean doesSwampSpawn;
public boolean doesRiverSpawn;
public boolean doesFrozenOceanSpawn;
public boolean doesFrozenRiverSpawn;
public boolean doesIcePlainsSpawn;
public boolean doesIceMountainsSpawn;
public boolean doesMushroomSpawn;
public boolean doesMushroomShoreSpawn;
public boolean doesBeachSpawn;
public boolean doesDesertHillsSpawn;
public boolean doesForestHillsSpawn;
public boolean doesTaigaHillsSpawn;
public boolean doesExtremeHillsEdgeSpawn;
public boolean doesJungleSpawn;
public boolean doesJungleHillsSpawn;

public boolean doesOceanSpawn;
public boolean doesJungleEdgeSpawn;
public boolean doesDeepOceanSpawn;
public boolean doesStoneBeachSpawn;
public boolean doesColdBeachSpawn;
public boolean doesBirchForestSpawn;	
public boolean doesBirchForestHillsSpawn;
public boolean doesRoofedForestSpawn;
public boolean doesColdTaigaSpawn;
public boolean doesColdTaigaHillsSpawn;
public boolean doesMegaTaigaSpawn;
public boolean doesMegaTaigaHillsSpawn;
public boolean doesExtremeHillsPlusSpawn;
public boolean doesSavannaSpawn;
public boolean doesSavannaPlateauSpawn;
public boolean doesMesaSpawn;
public boolean doesMesaPlateau_FSpawn;
public boolean doesMesaPlateauSpawn;




public void initConfiguration(FMLInitializationEvent event){
	Configuration config = new Configuration(new File("config/Biome Remover.cfg"));
	config.load();
	doesPlainsSpawn=config.get("Biomes", "Enable Plains Biome?", true).getBoolean(true);
	doesExtremeHillsSpawn=config.get("Biomes", "Enable Extreme Hills Biome?", true).getBoolean(true);
	doesDesertSpawn=config.get("Biomes", "Enable Desert Biome?", true).getBoolean(true);
	doesForestSpawn=config.get("Biomes", "Enable Forest Biome?", true).getBoolean(true);
	doesTaigaSpawn=config.get("Biomes", "Enable Taiga Biome?", true).getBoolean(true);
	doesSwampSpawn=config.get("Biomes", "Enable Swamp Biome?", true).getBoolean(true);
	doesRiverSpawn=config.get("Biomes", "Enable River Biome?", true).getBoolean(true);
	doesFrozenOceanSpawn=config.get("Biomes", "Enable Frozen Ocean Biome?", true).getBoolean(true);
	doesFrozenRiverSpawn=config.get("Biomes", "Enable Frozen River Biome?", true).getBoolean(true);
	doesIcePlainsSpawn=config.get("Biomes", "Enable Ice Plains Biome?", true).getBoolean(true);
	doesIceMountainsSpawn=config.get("Biomes", "Enable Ice Mountains Biome?", true).getBoolean(true);
	doesMushroomSpawn=config.get("Biomes", "Enable Mushroom Island Biome?", true).getBoolean(true);
	doesMushroomShoreSpawn=config.get("Biomes", "Enable Mushroom Island Shore Biome?", true).getBoolean(true);
	doesBeachSpawn=config.get("Biomes", "Enable Beach Biome?", true).getBoolean(true);
	doesDesertHillsSpawn=config.get("Biomes", "Enable Desert Hills Biome?", true).getBoolean(true);
	doesForestHillsSpawn=config.get("Biomes", "Enable Forest Hills Biome?", true).getBoolean(true);
	doesTaigaHillsSpawn=config.get("Biomes", "Enable Taiga Hills Biome?", true).getBoolean(true);
	doesExtremeHillsEdgeSpawn=config.get("Biomes", "Enable Extreme Hills Edge Biome?", true).getBoolean(true);
	doesJungleSpawn=config.get("Biomes", "Enable Jungle Biome?", true).getBoolean(true);
	doesJungleHillsSpawn=config.get("Biomes", "Enable Jungle Hills Biome?", true).getBoolean(true);

	doesOceanSpawn=config.get("Biomes", "Enable Ocean Biome?", true).getBoolean(true);
	doesJungleEdgeSpawn=config.get("Biomes", "Enable Jungle Edge Biome?", true).getBoolean(true);
	doesDeepOceanSpawn=config.get("Biomes", "Enable Deep Ocean Biome?", true).getBoolean(true);
	doesStoneBeachSpawn=config.get("Biomes", "Enable Stone Beach Biome?", true).getBoolean(true);
	doesColdBeachSpawn=config.get("Biomes", "Enable Cold Beach Biome?", true).getBoolean(true);
	doesBirchForestSpawn=config.get("Biomes", "Enable Birch Forest Biome?", true).getBoolean(true);
	doesBirchForestHillsSpawn=config.get("Biomes", "Enable Birch Forest Hills Biome?", true).getBoolean(true);
	doesRoofedForestSpawn=config.get("Biomes", "Enable Roofed Forest Biome?", true).getBoolean(true);
	doesColdTaigaSpawn=config.get("Biomes", "Enable Cold Taiga Biome?", true).getBoolean(true);
	doesColdTaigaHillsSpawn=config.get("Biomes", "Enable Cold Taiga Hills Biome?", true).getBoolean(true);
	doesMegaTaigaSpawn=config.get("Biomes", "Enable Mega Taiga Biome?", true).getBoolean(true);
	doesMegaTaigaHillsSpawn=config.get("Biomes", "Enable Mega Taiga Hills Biome?", true).getBoolean(true);
	doesExtremeHillsPlusSpawn=config.get("Biomes", "Enable Exteme Hills Plus Biome?", true).getBoolean(true);
	doesSavannaSpawn=config.get("Biomes", "Enable Savanna Biome?", true).getBoolean(true);
	doesSavannaPlateauSpawn=config.get("Biomes", "Enable Savanna Plateau Biome?", true).getBoolean(true);
	doesMesaSpawn=config.get("Biomes", "Enable Mesa Biome?", true).getBoolean(true);
	doesMesaPlateau_FSpawn=config.get("Biomes", "Enable Mesa Plateau F Biome?", true).getBoolean(true);
	doesMesaPlateauSpawn=config.get("Biomes", "Enable Mesa Plateau Biome?", true).getBoolean(true);

	config.save();
}

//Init
    @EventHandler
public void preInit(FMLPreInitializationEvent event){
    	
	//biomes();
}
    
    @EventHandler
public void load(FMLInitializationEvent event) {
    	this.initConfiguration(event);

		biomes();


}
    @EventHandler
public void postInit(FMLPostInitializationEvent event){
    	//biomes();
}


   

public void biomes(){

	WorldChunkManager.allowedBiomes.clear();


	if(doesPlainsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.plains);
	}
	if(doesDesertSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.desert);
	}
	if(doesExtremeHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.extremeHills);
	}
	if(doesForestSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.forest);
	}
	if(doesTaigaSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.taiga);
	}
	if(doesSwampSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.swampland);
	}
	if(doesRiverSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.river);
	}
	if(doesFrozenOceanSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.frozenOcean);
	}
	if(doesFrozenRiverSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.frozenRiver);
	}
	if(doesIcePlainsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.icePlains);
	}
	if(doesIceMountainsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.iceMountains);
	}
	if(doesMushroomSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.mushroomIsland);
	}
	if(doesMushroomShoreSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.mushroomIslandShore);
	}
	if(doesBeachSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.beach);
	}
	if(doesDesertHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.desertHills);
	}
	if(doesForestHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.forestHills);
	}
	if(doesTaigaHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.taigaHills);
	}
	if(doesExtremeHillsEdgeSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.extremeHillsEdge);
	}
	if(doesJungleSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.jungle);
	}
	if(doesJungleHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.jungleHills);
	}

	if(doesOceanSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.ocean);
	}
	if(doesJungleEdgeSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.jungleEdge);
	}
	if(doesDeepOceanSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.deepOcean);
	}
	if(doesStoneBeachSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.stoneBeach);
	}
	if(doesColdBeachSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.coldBeach);
	}
	if(doesBirchForestSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.birchForest);
	}
	if(doesBirchForestHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.birchForestHills);
	}
	if(doesRoofedForestSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.roofedForest);
	}
	if(doesColdTaigaSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.coldTaiga);
	}
	if(doesColdTaigaHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.coldTaigaHills);
	}
	if(doesMegaTaigaSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.megaTaiga);
	}
	if(doesMegaTaigaHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.megaTaigaHills);
	}
	if(doesExtremeHillsPlusSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.extremeHillsPlus);
	}
	if(doesSavannaSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.savanna);
	}
	if(doesSavannaPlateauSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.savannaPlateau);
	}
	if(doesMesaSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.mesa);
	}
	if(doesMesaPlateau_FSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.mesaPlateau_F);
	}
	if(doesMesaPlateauSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.mesaPlateau);
	}



   //  WorldChunkManager.allowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(forestHills, _myBiome));
}



     
/*

private static void removeBiome(BiomeGenBase biome){
	List<BiomeEntry> biomesw = BiomeManager.warmBiomes;

	Iterator<BiomeEntry> checkw = biomesw.iterator();


	while (checkw.hasNext()){
		BiomeGenBase checkBiome = checkw.next().biome;
		if (checkBiome == biome){
			checkw.remove();
		}
	}
	List<BiomeEntry> biomesc = BiomeManager.coolBiomes;

	Iterator<BiomeEntry> checkc = biomesc.iterator();


	while (checkc.hasNext()){
		BiomeGenBase checkBiome = checkc.next().biome;
		if (checkBiome == biome){
			checkc.remove();
		}
	}
	List<BiomeEntry> biomesi = BiomeManager.icyBiomes;

	Iterator<BiomeEntry> checki = biomesi.iterator();


	while (checki.hasNext()){
		BiomeGenBase checkBiome = checki.next().biome;
		if (checkBiome == biome){
			checki.remove();
		}
	}
	/*
	List<BiomeEntry> biomesd = BiomeManager.desertBiomes;

			Iterator<BiomeEntry> checkd = biomesd.iterator();


			while (checkd.hasNext()){
				BiomeGenBase checkBiome = checkd.next().biome;
				if (checkBiome == biome){
					checkd.remove();
				}
			}
			*/


}

 

 

 

I've tried several variations, but the biomes still spawn.

Any help is greatly appreciated!

Thanks!

  • 2 weeks later...
Posted

Well, originally I had this:

 

 

private static void removeBiome(BiomeGenBase biome){
	List<BiomeEntry> biomesw = BiomeManager.warmBiomes;

	Iterator<BiomeEntry> checkw = biomesw.iterator();


	while (checkw.hasNext()){
		BiomeGenBase checkBiome = checkw.next().biome;
		if (checkBiome == biome){
			checkw.remove();
		}
	}
	List<BiomeEntry> biomesc = BiomeManager.coolBiomes;

	Iterator<BiomeEntry> checkc = biomesc.iterator();


	while (checkc.hasNext()){
		BiomeGenBase checkBiome = checkc.next().biome;
		if (checkBiome == biome){
			checkc.remove();
		}
	}
	List<BiomeEntry> biomesi = BiomeManager.icyBiomes;

	Iterator<BiomeEntry> checki = biomesi.iterator();


	while (checki.hasNext()){
		BiomeGenBase checkBiome = checki.next().biome;
		if (checkBiome == biome){
			checki.remove();
		}
	}

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • im new to minecraft java modding and I am looking for some help on adding a custom dimension to minecraft java version 1.21.1   I haven't managed to find a good 1.21.1 minecraft dimension turtorial for intellij modding.  all I could find online is how to make the json files for the custom dimension but not how to setup the custom dimension in the game.    im using forge's recommended version for minecraft 1.21.1, any help would be appreciated
    • Thank you for the suggestion if figure that it should be able to support around 40 based on my previous experiences hosting but no one really seems to have a concrete way of figuring it out. You have been alot more helpful than most people and i will probably set up Linux tomorrow.
    • https://mclo.gs/e8nuqSA My friend and I are having the same issue with this pack. We're trying to play on BMC4 with a bunch of extra mods. The game loads up to 'mod gathering' and then crashes. Mod list changes beyond the modpack: Added mods: alexscaves-2.0.2.jar alexsmobsinteraction-5.4-all.jar Apotheosis-1.20.1-7.4.8.jar ApothicAttributes-1.20.1-1.3.7.jar ApothicCombat-1.20.1-1.1.0.jar ApothicCurios-1.20.1-1.0.3e.jar ArmorPoser-forge-1.20.1-2.2.2.jar ars_nouveau-1.20.1-4.12.7-all.jar attributizer-2.1.jar bendy-lib-forge-4.0.0.jar betterarcheology-1.2.1-1.20.1.jar bettercombat-forge-1.8.6+1.20.1.jar BetterThirdPerson-Forge-1.20-1.9.0.jar born_in_chaos_[Forge]1.20.1_1.7.jar cataclysm_ut_lite-AT - 1.20.1.jar celestisynth-1.20.1-1.3.1.jar cobweb-forge-1.20.1-1.0.1.jar common-networking-forge-1.0.5-1.20.1.jar Critters n' Crawlers-2.2.2-mc1.20.1.jar crittersandcompanions-forge-2.2.2.jar domesticationinnovation-1.7.1-1.20.1.jar dummmmmmy-1.20-2.0.6.jar emotecraft-for-MC1.20.1-2.2.7-b.build.50-forge.jar EmoteTweaks-4.0.2.27-forge.jar exposure-1.20.1-1.7.14-forge.jar faunify-forge-1.20.1-1.1.2.jar hallucinatory_plants-2.3.0-1.20.1-forge.jar Icarus-Forge-2.12.0.jar integrated_api-1.5.1+1.20.1-forge.jar irons_spellbooks-1.20.1-3.4.0.9.jar iwannaskate-1.2.0.jar l2library-2.5.1.jar letsdo-API-forge-1.2.15-forge.jar letsdo-bakery-forge-2.0.5.jar letsdo-brewery-forge-2.0.3.jar letsdo-brewery-forge-2.0.5.jar letsdo-candlelight-forge-2.0.2.jar letsdo-farm_and_charm-forge-1.0.4.jar letsdo-herbalbrews-forge-1.0.12.jar letsdo-nethervinery-forge-1.2.17.jar letsdo-vinery-forge-1.4.39.jar modulargolems-2.5.19.jar mutil-1.20.1-6.2.0.jar Pehkui-3.8.2+1.20.1-forge.jar Placebo-1.20.1-8.6.3.jar player-animation-lib-forge-1.0.2-rc1+1.20.jar Powah-5.0.10.jar productivebees-1.20.1-12.6.0.jar Rats-1.20.1-8.1.3.jar refinedstorage-1.12.4.jar refinedstorageaddons-0.10.0.jar RSInfinityBooster-1.20.1-1.0+41.jar rsjukeboxes-1.20.1-1.0.1.0.jar ScorchedGuns-0.4.1-1.20.1.jar simplyswords-forge-1.56.0-1.20.1.jar sophisticatedbackpacks-1.20.1-3.23.23.1281.jar sophisticatedcore-1.20.1-1.2.75.1033.jar soul-fire-d-forge-1.20.1-4.0.11.jar supermartijn642configlib-1.1.8-forge-mc1.20.jar the_bumblezone-7.7.1+1.20.1-forge.jar the_dirty_stuff-2.1-forge-1.20.1.jar traveloptics-4.4.0-1.20.1.jar unusualprehistory-1.5.0.3.jar voicechat-forge-1.20.1-2.5.30.jar wits-1.1.0+1.20.1-forge.jar xercapaint-1.20.1-1.0.1.jar Updated mods: azurelib (3.0.8 > 3.0.9) lithostitched-forge-1.20.1-1.4.10.jar > lithostitched-forge-1.20.1-1.4.11.jar  
    • Graphics are irrelevant for a server. According to google, it should support 20-40. I literally asked it "how many players on a lightly modded minecraft server will a ryzen 5 2600 with 32GB ram support?" Maybe someone with some real world experience has further input. I can say without a doubt that if you run Linux as opposed to windows for the server operating system, you will get better performance and have more resources available to your server.
    • Could someone help me to figure out what's the problem?  I get this crash when I try to enter to a world in forge 1.12.2:  The game crashed: exception in server tick loop Error: java.lang.NullPointerException: Exception in server tick loop Error code: -1 here is the crash report crash-2025-07-15_20.44.02-server333.txt
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.