mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-26 04:59:23 +01:00
Added oregen and plantgen dimension blacklist
This commit is contained in:
parent
f4c401aa67
commit
84db3bbcef
4 changed files with 36 additions and 14 deletions
|
@ -29,6 +29,9 @@ public class ConfigValues{
|
|||
public static String[] paxelExtraMiningWhitelist;
|
||||
public static String[] drillExtraminingWhitelist;
|
||||
|
||||
public static int[] oreGenDimensionBlacklist;
|
||||
public static int[] plantDimensionBlacklist;
|
||||
|
||||
public static void defineConfigValues(Configuration config){
|
||||
|
||||
for(ConfigCrafting currConf : craftingConfig){
|
||||
|
@ -48,5 +51,7 @@ public class ConfigValues{
|
|||
mashedFoodCraftingExceptions = config.get(ConfigCategories.ITEMS_CRAFTING.name, "Mashed Food Crafting Exceptions", new String[]{"ActuallyAdditions:itemCoffee"}, "The ItemFood, IGrowable and IPlantable Items that can not be used to craft Mashed Food. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.").getStringList();
|
||||
paxelExtraMiningWhitelist = config.get(ConfigCategories.TOOL_VALUES.name, "AIOT Extra Whitelist", new String[]{"TConstruct:GravelOre"}, "By default, the AIOT can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.").getStringList();
|
||||
drillExtraminingWhitelist = config.get(ConfigCategories.TOOL_VALUES.name, "Drill Extra Whitelist", new String[]{"TConstruct:GravelOre"}, "By default, the Drill can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.").getStringList();
|
||||
oreGenDimensionBlacklist = config.get(ConfigCategories.WORLD_GEN.name, "OreGen Dimension Blacklist", new int[0], "The IDs of the dimensions that Actually Additions OreGen (Black Quartz for example) is banned in").getIntList();
|
||||
plantDimensionBlacklist = config.get(ConfigCategories.WORLD_GEN.name, "Plant Blacklist", new int[0], "The IDs of the dimensions that Actually Additions Plants (Rice for example) are banned in").getIntList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,10 @@ import cpw.mods.fml.common.eventhandler.Event;
|
|||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||
import ellpeck.actuallyadditions.blocks.metalists.TheWildPlants;
|
||||
import ellpeck.actuallyadditions.config.ConfigValues;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -29,11 +31,13 @@ public class WorldDecorationEvent{
|
|||
@SubscribeEvent
|
||||
public void onWorldDecoration(DecorateBiomeEvent.Decorate event){
|
||||
if((event.getResult() == Event.Result.ALLOW || event.getResult() == Event.Result.DEFAULT)){
|
||||
this.generateRice(event);
|
||||
this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.CANOLA.ordinal(), ConfigIntValues.CANOLA_AMOUNT.getValue(), ConfigBoolValues.DO_CANOLA_GEN.isEnabled(), Material.grass, event);
|
||||
this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.FLAX.ordinal(), ConfigIntValues.FLAX_AMOUNT.getValue(), ConfigBoolValues.DO_FLAX_GEN.isEnabled(), Material.grass, event);
|
||||
this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.COFFEE.ordinal(), ConfigIntValues.COFFEE_AMOUNT.getValue(), ConfigBoolValues.DO_COFFEE_GEN.isEnabled(), Material.grass, event);
|
||||
this.genPlantNormally(InitBlocks.blockBlackLotus, 0, ConfigIntValues.BLACK_LOTUS_AMOUNT.getValue(), ConfigBoolValues.DO_LOTUS_GEN.isEnabled(), Material.grass, event);
|
||||
if(Util.arrayContains(ConfigValues.plantDimensionBlacklist, event.world.provider.dimensionId) < 0){
|
||||
this.generateRice(event);
|
||||
this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.CANOLA.ordinal(), ConfigIntValues.CANOLA_AMOUNT.getValue(), ConfigBoolValues.DO_CANOLA_GEN.isEnabled(), Material.grass, event);
|
||||
this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.FLAX.ordinal(), ConfigIntValues.FLAX_AMOUNT.getValue(), ConfigBoolValues.DO_FLAX_GEN.isEnabled(), Material.grass, event);
|
||||
this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.COFFEE.ordinal(), ConfigIntValues.COFFEE_AMOUNT.getValue(), ConfigBoolValues.DO_COFFEE_GEN.isEnabled(), Material.grass, event);
|
||||
this.genPlantNormally(InitBlocks.blockBlackLotus, 0, ConfigIntValues.BLACK_LOTUS_AMOUNT.getValue(), ConfigBoolValues.DO_LOTUS_GEN.isEnabled(), Material.grass, event);
|
||||
}
|
||||
|
||||
//Generate Treasure Chests
|
||||
if(ConfigBoolValues.DO_TREASURE_CHEST_GEN.isEnabled()){
|
||||
|
|
|
@ -14,9 +14,11 @@ import cpw.mods.fml.common.IWorldGenerator;
|
|||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
||||
import ellpeck.actuallyadditions.config.ConfigValues;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
@ -40,15 +42,17 @@ public class OreGen implements IWorldGenerator{
|
|||
return;
|
||||
}
|
||||
|
||||
switch(world.provider.dimensionId){
|
||||
case -1:
|
||||
generateNether(world, random, chunkX*16, chunkZ*16);
|
||||
//case 0:
|
||||
// generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
case 1:
|
||||
generateEnd(world, random, chunkX*16, chunkZ*16);
|
||||
default:
|
||||
generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
if(Util.arrayContains(ConfigValues.oreGenDimensionBlacklist, world.provider.dimensionId) < 0){
|
||||
switch(world.provider.dimensionId){
|
||||
case -1:
|
||||
generateNether(world, random, chunkX*16, chunkZ*16);
|
||||
//case 0:
|
||||
// generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
case 1:
|
||||
generateEnd(world, random, chunkX*16, chunkZ*16);
|
||||
default:
|
||||
generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,15 @@ public class Util{
|
|||
return -1;
|
||||
}
|
||||
|
||||
public static int arrayContains(int[] array, int num){
|
||||
for(int i = 0; i < array.length; i++){
|
||||
if(num == array[i]){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static class GetRecipes{
|
||||
|
||||
public static CrusherRecipeRegistry.CrusherRecipe lastCrusherRecipe(){
|
||||
|
|
Loading…
Reference in a new issue