From cca76e50201533ca1ddb83b269216b8930fe5220 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 16 Mar 2017 12:01:10 +0100 Subject: [PATCH] generate village chests even if dungeon loot is disabled --- .../mod/config/values/ConfigBoolValues.java | 2 +- .../mod/misc/DungeonLoot.java | 85 ++++++++++--------- 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java index 1f03eae4a..c6a4dbf48 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java @@ -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("Village and Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot generate in dungeons? (This also disables loot in lush caves and village houses!)"), + DUNGEON_LOOT("Village and Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot generate in dungeons?"), 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?"), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java index 941c13afe..d3f463b52 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java @@ -44,7 +44,7 @@ public class DungeonLoot{ @SubscribeEvent public void onLootTableLoad(LootTableLoadEvent event){ - if(ConfigBoolValues.DUNGEON_LOOT.isEnabled() && event.getName() != null && event.getTable() != null){ + if(event.getName() != null && event.getTable() != null){ LootCondition[] noCondition = new LootCondition[0]; LootPool pool = event.getTable().getPool("main"); @@ -58,47 +58,50 @@ public class DungeonLoot{ boolean addQuartz = false; boolean addBatWings = false; - if(LootTableList.CHESTS_SIMPLE_DUNGEON.equals(event.getName())){ - addCrystals = true; - addDrillCore = true; - addQuartz = true; + if(ConfigBoolValues.DUNGEON_LOOT.isEnabled()){ + if(LootTableList.CHESTS_SIMPLE_DUNGEON.equals(event.getName())){ + addCrystals = true; + addDrillCore = true; + addQuartz = true; + } + else if(LootTableList.CHESTS_ABANDONED_MINESHAFT.equals(event.getName())){ + addCrystals = true; + addDrillCore = true; + } + else if(LootTableList.CHESTS_VILLAGE_BLACKSMITH.equals(event.getName())){ + addDrillCore = true; + addQuartz = true; + } + else if(LootTableList.CHESTS_STRONGHOLD_LIBRARY.equals(event.getName())){ + addBatWings = true; + } + else if(LootTableList.CHESTS_IGLOO_CHEST.equals(event.getName())){ + addBatWings = true; + } + else if(LootTableList.CHESTS_DESERT_PYRAMID.equals(event.getName())){ + addDrillCore = true; + addBatWings = true; + } + else if(LootTableList.CHESTS_NETHER_BRIDGE.equals(event.getName())){ + addBatWings = true; + addCrystals = true; + addDrillCore = true; + } + else if(LootTableList.CHESTS_END_CITY_TREASURE.equals(event.getName())){ + addBatWings = true; + addCrystals = true; + addDrillCore = true; + addQuartz = true; + } + else if(LootTableList.CHESTS_WOODLAND_MANSION.equals(event.getName())){ + addBatWings = true; + addCrystals = true; + addDrillCore = true; + addQuartz = true; + } } - else if(LootTableList.CHESTS_ABANDONED_MINESHAFT.equals(event.getName())){ - addCrystals = true; - addDrillCore = true; - } - else if(LootTableList.CHESTS_VILLAGE_BLACKSMITH.equals(event.getName())){ - addDrillCore = true; - addQuartz = true; - } - else if(LootTableList.CHESTS_STRONGHOLD_LIBRARY.equals(event.getName())){ - addBatWings = true; - } - else if(LootTableList.CHESTS_IGLOO_CHEST.equals(event.getName())){ - addBatWings = true; - } - else if(LootTableList.CHESTS_DESERT_PYRAMID.equals(event.getName())){ - addDrillCore = true; - addBatWings = true; - } - else if(LootTableList.CHESTS_NETHER_BRIDGE.equals(event.getName())){ - addBatWings = true; - addCrystals = true; - addDrillCore = true; - } - else if(LootTableList.CHESTS_END_CITY_TREASURE.equals(event.getName())){ - addBatWings = true; - addCrystals = true; - addDrillCore = true; - addQuartz = true; - } - else if(LootTableList.CHESTS_WOODLAND_MANSION.equals(event.getName())){ - addBatWings = true; - addCrystals = true; - addDrillCore = true; - addQuartz = true; - } - else if(JAM_HOUSE.equals(event.getName())){ + + if(JAM_HOUSE.equals(event.getName())){ LootFunction jamDamage = new SetMetadata(noCondition, new RandomValueRange(0, TheJams.values().length-1)); LootFunction jamAmount = new SetCount(noCondition, new RandomValueRange(3, 5)); pool.addEntry(new LootEntryItem(InitItems.itemJams, 2, 0, new LootFunction[]{jamDamage, jamAmount}, noCondition, ModUtil.MOD_ID+":jams"));