From ec1f746ca10c740a210e9bbd3792f5f7e9e9c37b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 15 Nov 2015 19:24:36 +0100 Subject: [PATCH] Add Dungeon Loot --- .../actuallyadditions/ActuallyAdditions.java | 1 + .../config/values/ConfigBoolValues.java | 4 +- .../actuallyadditions/misc/DungeonLoot.java | 51 ++++++++++++++++++ .../textures/items/itemDrillPurple.png | Bin 524 -> 503 bytes 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/main/java/ellpeck/actuallyadditions/misc/DungeonLoot.java diff --git a/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java b/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java index 9364fb267..61e21c61a 100644 --- a/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java +++ b/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java @@ -84,6 +84,7 @@ public class ActuallyAdditions{ TileEntityBase.init(); InitEvents.init(); InitCrafting.init(); + DungeonLoot.init(); FMLInterModComms.sendMessage("Waila", "register", "ellpeck.actuallyadditions.waila.WailaDataProvider.register"); proxy.init(event); diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java index 2d59a07a7..e1c634d45 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java @@ -58,7 +58,9 @@ public enum ConfigBoolValues{ GIVE_BOOKLET_ON_FIRST_CRAFT("Give Booklet on First Craft", ConfigCategories.OTHER, true, "If the booklet should be given to the player when he first crafts something from the Mod"), ENABLE_SEASONAL("Seasonal Mode", ConfigCategories.OTHER, true, "If Seasonal Mode is enabled"), - LESS_LASER_RELAY_PARTICLES("Laser Relay: Particles", ConfigCategories.MACHINE_VALUES, false, "If the Laser Relay should have less laser particles to prevent lag"); + LESS_LASER_RELAY_PARTICLES("Laser Relay: Particles", ConfigCategories.MACHINE_VALUES, false, "If the Laser Relay should have less laser particles to prevent lag"), + + DUNGEON_LOOT("Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot spawn in Dungeons"); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/misc/DungeonLoot.java b/src/main/java/ellpeck/actuallyadditions/misc/DungeonLoot.java new file mode 100644 index 000000000..74c7a808b --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/misc/DungeonLoot.java @@ -0,0 +1,51 @@ +/* + * This file ("DungeonLoot.java") is part of the Actually Additions Mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015 Ellpeck + */ + +package ellpeck.actuallyadditions.misc; + +import ellpeck.actuallyadditions.blocks.InitBlocks; +import ellpeck.actuallyadditions.config.values.ConfigBoolValues; +import ellpeck.actuallyadditions.items.InitItems; +import ellpeck.actuallyadditions.items.metalists.TheCrystals; +import ellpeck.actuallyadditions.items.metalists.TheMiscItems; +import ellpeck.actuallyadditions.util.ModUtil; +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraftforge.common.ChestGenHooks; + +public class DungeonLoot{ + + public static void init(){ + if(ConfigBoolValues.DUNGEON_LOOT.isEnabled()){ + ModUtil.LOGGER.info("Initializing Dungeon Loot..."); + + ChestGenHooks dungeon = ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST); + ChestGenHooks mineshaft = ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR); + ChestGenHooks blacksmith = ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH); + + for(int i = 0; i < TheCrystals.values().length; i++){ + WeightedRandomChestContent item = new WeightedRandomChestContent(new ItemStack(InitItems.itemCrystal, 1, i), 2, 4, 15); + WeightedRandomChestContent block = new WeightedRandomChestContent(new ItemStack(InitBlocks.blockCrystal, 1, i), 1, 3, 5); + dungeon.addItem(item); + dungeon.addItem(block); + mineshaft.addItem(item); + mineshaft.addItem(block); + } + WeightedRandomChestContent drillCore = new WeightedRandomChestContent(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()), 1, 1, 40); + dungeon.addItem(drillCore); + mineshaft.addItem(drillCore); + blacksmith.addItem(drillCore); + + WeightedRandomChestContent quartz = new WeightedRandomChestContent(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 3, 4, 50); + dungeon.addItem(quartz); + blacksmith.addItem(quartz); + } + } +} diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemDrillPurple.png b/src/main/resources/assets/actuallyadditions/textures/items/itemDrillPurple.png index c9719f257133862e2d78da4e51b10c602731479d..be8633004f91de4772d14c47e3ad9c31f87b71e0 100644 GIT binary patch delta 398 zcmV;90df9}1os1wJPHs101FTSts}j4kw!XyVo5|nR5(wal3PmxK^TU;NmCbHlt&loj|?zYoN5frq8e->LDz!`w&@%ZI%Pl&#ice1fhPg;Z_*fl zAg>gmV_eR3P@L}|N3W=ankcT;q0yPOK%=y1Q>PcC=|jM!wFV0Gj%xUsRlgIkRG_+t z;rF<~XXTZz78;^5pSiM8N0#2OOC`BLaXK*VS20DZkR)gCQC@B#&pP37d8LI6>xiHJ zH-XpXz^GS&PjNAc&y*Z3-kOy!=GuLEaG${Av}1C_Bb6irH=;5>gBa!H0xi0Q37_&s z(i`V+>;apUl*3U5^XIs#NF=>ZECuoSj`>GfN%-w_x5#snN?A&r_Mx9)Bf74e8$-c$ s@Pp;I(|t8q_7CBwTOfusSxkW2yus=)?x@SN zkobSI+!ECgs7va#dj2nF-3<;`ywd;GtUqyPVA8ORXR|1Cg6-XXc9MymV2 z2V*dH&E7!GAo@(YHr$ZaP?x;xLKx!C5QN=;urP$lFhg#EU4k$K6gyBQ*g;NqHijV( z@0k5}(~!Wg83yX=>fj1(ZLI!-0u~fIP$A+#bZq2*J3AZFG?5P&7yxk@{VhHZ+HQyd O0000