mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 11:49:23 +01:00
Made dungeon loot config also disable loot in villages
This commit is contained in:
parent
8b96a8b73c
commit
dd710b4dbe
4 changed files with 48 additions and 41 deletions
|
@ -43,7 +43,7 @@ public enum ConfigBoolValues{
|
|||
SHOW_BOOKLET_INFO("Booklet Quick Opening Info", ConfigCategories.TOOL_VALUES, true, "If true,'Press key for more information' text should show when the item has a page in the booklet"),
|
||||
GIVE_BOOKLET_ON_FIRST_CRAFT("Give Booklet on First Craft", ConfigCategories.OTHER, true, "If true, the booklet should be given to the player when he first crafts something from the Mod"),
|
||||
|
||||
DUNGEON_LOOT("Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot generate in dungeons??"),
|
||||
DUNGEON_LOOT("Village and Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot generate in dungeons? (This also disables loot in lush caves and village houses!)"),
|
||||
GEN_LUSH_CAVES("Generate Lush Caves", ConfigCategories.WORLD_GEN, true, "Should caves with trees and grass randomly generate underground?"),
|
||||
|
||||
WATER_BOWL("Water Bowl", ConfigCategories.OTHER, true, "Should right-clicking a bowl on water blocks create a water bowl?"),
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.gen;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
||||
import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -95,7 +96,7 @@ public class WorldGenLushCaves{
|
|||
}
|
||||
trees.generate(world, rand, pos.up());
|
||||
|
||||
if(!crateGenDone && genCrate){
|
||||
if(ConfigBoolValues.DUNGEON_LOOT.isEnabled() && !crateGenDone && genCrate){
|
||||
BlockPos cratePos = pos.add(MathHelper.getRandomIntegerInRange(rand, -2, 2), MathHelper.getRandomIntegerInRange(rand, 3, 8), MathHelper.getRandomIntegerInRange(rand, -2, 2));
|
||||
|
||||
IBlockState state = world.getBlockState(cratePos);
|
||||
|
|
|
@ -15,6 +15,7 @@ import de.ellpeck.actuallyadditions.api.laser.LaserType;
|
|||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheColoredLampColors;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
||||
import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager;
|
||||
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
||||
|
@ -102,6 +103,7 @@ public class VillageComponentEngineerHouse extends StructureVillagePieces.House1
|
|||
}
|
||||
|
||||
private void fillHouse(World world, StructureBoundingBox sbb){
|
||||
if(ConfigBoolValues.DUNGEON_LOOT.isEnabled()){
|
||||
if(world.rand.nextBoolean()){
|
||||
TileEntity compost = this.getTileAtPos(world, 6, 1, 2, sbb);
|
||||
if(compost instanceof TileEntityCompost){
|
||||
|
@ -144,6 +146,9 @@ public class VillageComponentEngineerHouse extends StructureVillagePieces.House1
|
|||
((TileEntityCoalGenerator)coal).setInventorySlotContents(0, new ItemStack(Items.COAL, world.rand.nextInt(25)+3, 1));
|
||||
}
|
||||
|
||||
VillageComponentJamHouse.generateCrate(world, sbb, this.getXWithOffset(6, 4), this.getYWithOffset(4), this.getZWithOffset(6, 4), DungeonLoot.ENGINEER_HOUSE);
|
||||
}
|
||||
|
||||
TileEntity firstRelay = this.getTileAtPos(world, 6, 5, 6, sbb);
|
||||
TileEntity secondRelay = this.getTileAtPos(world, 8, 5, 3, sbb);
|
||||
if(firstRelay instanceof TileEntityLaserRelayEnergy && secondRelay instanceof TileEntityLaserRelayEnergy){
|
||||
|
@ -152,8 +157,6 @@ public class VillageComponentEngineerHouse extends StructureVillagePieces.House1
|
|||
|
||||
int meta = world.rand.nextInt(TheColoredLampColors.values().length);
|
||||
this.setBlockState(world, InitBlocks.blockColoredLampOn.getStateFromMeta(meta), 8, 1, 6, sbb);
|
||||
|
||||
VillageComponentJamHouse.generateCrate(world, sbb, this.getXWithOffset(6, 4), this.getYWithOffset(4), this.getZWithOffset(6, 4), DungeonLoot.ENGINEER_HOUSE);
|
||||
}
|
||||
|
||||
private void spawnActualHouse(World world, StructureBoundingBox sbb){
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.gen.village.component;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
||||
import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager;
|
||||
import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest;
|
||||
|
@ -190,7 +191,9 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
|
|||
this.fillWithBlocks(world, sbb, 3, 1, 4, 4, 1, 6, Blocks.CARPET.getStateFromMeta(10), Blocks.CARPET.getStateFromMeta(10), false);
|
||||
|
||||
//Loot Chest
|
||||
if(ConfigBoolValues.DUNGEON_LOOT.isEnabled()){
|
||||
generateCrate(world, this.boundingBox, this.getXWithOffset(8, 6), this.getYWithOffset(1), this.getZWithOffset(8, 6), DungeonLoot.JAM_HOUSE);
|
||||
}
|
||||
|
||||
//Torches
|
||||
this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.SOUTH), 6, 2, 0, sbb);
|
||||
|
|
Loading…
Reference in a new issue