diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index 91811b1d5..23fec019d 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -56,7 +56,9 @@ public enum ConfigIntValues{ COFFEE_AMOUNT("Coffee Amount", ConfigCategories.WORLD_GEN, 6, 1, 50, "The Chance of Coffee generating"), RICE_CHANCE("Rice Chance", ConfigCategories.WORLD_GEN, 50, 1, 3000, "The 1 in X chance for Rice to generate"), NORMAL_PLANT_CHANCE("Plant Chance", ConfigCategories.WORLD_GEN, 400, 1, 3000, "The 1 in X chance for Flax, Coffee and Canola to generate"), - TREASURE_CHEST_CHANCE("Treasure Chest Chance", ConfigCategories.WORLD_GEN, 300, 1, 3000, "The 1 in X chance for a Treasure Chest to generate in a Deep Ocean"), + TREASURE_CHEST_CHANCE("Treasure Chest Chance", ConfigCategories.WORLD_GEN, 300, 1, 3000, "The 1 in X chance for a Treasure Chest to generate in an Ocean"), + TREASURE_CHEST_MIN_HEIGHT("Treasure Chest Min Height", ConfigCategories.WORLD_GEN, 25, 0, 65, "The Min Height for a Treasure Chest to generate"), + TREASURE_CHEST_MAX_HEIGHT("Treasure Chest Max Height", ConfigCategories.WORLD_GEN, 45, 0, 65, "The Max Height for a Treasure Chest to generate"), GRINDER_ENERGY_USED("Energy Use: Crusher", ConfigCategories.MACHINE_VALUES, 40, 1, 500, "The Amount of Energy used by the Crusher per Tick"), GRINDER_DOUBLE_ENERGY_USED("Energy Use: Double Crusher", ConfigCategories.MACHINE_VALUES, 60, 1, 500, "The Amount of Energy used by the Double Crusher per Tick"), diff --git a/src/main/java/ellpeck/actuallyadditions/event/WorldDecorationEvent.java b/src/main/java/ellpeck/actuallyadditions/event/WorldDecorationEvent.java index dd1432a2f..6e2b2b100 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/WorldDecorationEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/WorldDecorationEvent.java @@ -9,7 +9,7 @@ import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenOcean; import net.minecraftforge.event.terraingen.DecorateBiomeEvent; import java.util.ArrayList; @@ -32,10 +32,12 @@ public class WorldDecorationEvent{ int genZ = event.chunkZ+event.rand.nextInt(16)+8; int genY = event.world.getTopSolidOrLiquidBlock(genX, genZ); - if(event.world.getBiomeGenForCoords(genX, genZ) == BiomeGenBase.deepOcean){ - if(event.world.getBlock(genX, genY, genZ).getMaterial() == Material.water){ - if(event.world.getBlock(genX, genY-1, genZ).getMaterial().isSolid()){ - event.world.setBlock(genX, genY, genZ, InitBlocks.blockTreasureChest, 0, 2); + if(event.world.getBiomeGenForCoords(genX, genZ) instanceof BiomeGenOcean){ + if(genY >= ConfigIntValues.TREASURE_CHEST_MIN_HEIGHT.getValue() && genY <= ConfigIntValues.TREASURE_CHEST_MAX_HEIGHT.getValue()){ + if(event.world.getBlock(genX, genY, genZ).getMaterial() == Material.water){ + if(event.world.getBlock(genX, genY-1, genZ).getMaterial().isSolid()){ + event.world.setBlock(genX, genY, genZ, InitBlocks.blockTreasureChest, 0, 2); + } } } } diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 9de7f4605..20b5f766f 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -194,7 +194,7 @@ tooltip.actuallyadditions.itemResonantRice.desc=Don't know what it does... maybe tooltip.actuallyadditions.itemResonantRice.uncraftable.desc=Uncraftable because there's no Mod installed that adds Enderium :( tile.actuallyadditions.blockTreasureChest.name=Treasure Chest -tooltip.actuallyadditions.blockTreasureChest.desc.1=A Chest found on the Ground of Deep Ocean Biomes +tooltip.actuallyadditions.blockTreasureChest.desc.1=A Chest found on the Ground of Ocean Biomes tooltip.actuallyadditions.blockTreasureChest.desc.2=Maybe you'll get something awesome when you Right-Click it? tile.actuallyadditions.blockCanolaPress.name=Canola Press