generate village chests even if dungeon loot is disabled

This commit is contained in:
Ellpeck 2017-03-16 12:01:10 +01:00
parent d0f8ee1dc7
commit cca76e5020
2 changed files with 45 additions and 42 deletions

View file

@ -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"), 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"), 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?"), 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?"), WATER_BOWL("Water Bowl", ConfigCategories.OTHER, true, "Should right-clicking a bowl on water blocks create a water bowl?"),

View file

@ -44,7 +44,7 @@ public class DungeonLoot{
@SubscribeEvent @SubscribeEvent
public void onLootTableLoad(LootTableLoadEvent event){ 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]; LootCondition[] noCondition = new LootCondition[0];
LootPool pool = event.getTable().getPool("main"); LootPool pool = event.getTable().getPool("main");
@ -58,6 +58,7 @@ public class DungeonLoot{
boolean addQuartz = false; boolean addQuartz = false;
boolean addBatWings = false; boolean addBatWings = false;
if(ConfigBoolValues.DUNGEON_LOOT.isEnabled()){
if(LootTableList.CHESTS_SIMPLE_DUNGEON.equals(event.getName())){ if(LootTableList.CHESTS_SIMPLE_DUNGEON.equals(event.getName())){
addCrystals = true; addCrystals = true;
addDrillCore = true; addDrillCore = true;
@ -98,7 +99,9 @@ public class DungeonLoot{
addDrillCore = true; addDrillCore = true;
addQuartz = 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 jamDamage = new SetMetadata(noCondition, new RandomValueRange(0, TheJams.values().length-1));
LootFunction jamAmount = new SetCount(noCondition, new RandomValueRange(3, 5)); 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")); pool.addEntry(new LootEntryItem(InitItems.itemJams, 2, 0, new LootFunction[]{jamDamage, jamAmount}, noCondition, ModUtil.MOD_ID+":jams"));