2016-02-24 05:24:50 +01:00
|
|
|
package techreborn.init;
|
|
|
|
|
2016-02-26 14:03:30 +01:00
|
|
|
import java.util.Arrays;
|
|
|
|
|
2016-02-24 05:24:50 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.util.WeightedRandomChestContent;
|
|
|
|
import net.minecraftforge.common.ChestGenHooks;
|
2016-02-24 06:26:57 +01:00
|
|
|
import techreborn.config.ConfigTechReborn;
|
2016-02-24 06:07:18 +01:00
|
|
|
import techreborn.items.ItemIngots;
|
2016-02-24 05:24:50 +01:00
|
|
|
|
|
|
|
public class ModLoot {
|
2016-02-24 06:26:57 +01:00
|
|
|
|
|
|
|
public static WeightedRandomChestContent rubberSaplingLoot = new WeightedRandomChestContent(new ItemStack(ModBlocks.rubberSapling), 1, 3, 25);
|
|
|
|
public static WeightedRandomChestContent copperIngotLoot = new WeightedRandomChestContent(ItemIngots.getIngotByName("copper"), 1, 4, 20);
|
|
|
|
public static WeightedRandomChestContent tinIngotLoot = new WeightedRandomChestContent(ItemIngots.getIngotByName("tin"), 1, 4, 20);
|
|
|
|
public static WeightedRandomChestContent steelIngotLoot = new WeightedRandomChestContent(ItemIngots.getIngotByName("steel"), 1, 3, 5);
|
2016-02-24 05:24:50 +01:00
|
|
|
|
|
|
|
public static void init(){
|
2016-02-24 09:18:21 +01:00
|
|
|
if(ConfigTechReborn.RubberSaplingLoot){
|
2016-02-24 06:26:57 +01:00
|
|
|
generate(rubberSaplingLoot);
|
|
|
|
}
|
2016-02-24 09:18:21 +01:00
|
|
|
if(ConfigTechReborn.CopperIngotsLoot){
|
2016-02-24 06:26:57 +01:00
|
|
|
generate(copperIngotLoot);
|
|
|
|
}
|
2016-02-24 09:18:21 +01:00
|
|
|
if(ConfigTechReborn.TinIngotsLoot){
|
2016-02-24 06:26:57 +01:00
|
|
|
generate(tinIngotLoot);
|
|
|
|
}
|
2016-02-24 09:18:21 +01:00
|
|
|
if(ConfigTechReborn.SteelIngotsLoot){
|
2016-02-24 06:26:57 +01:00
|
|
|
generate(steelIngotLoot);
|
|
|
|
}
|
2016-02-24 05:24:50 +01:00
|
|
|
}
|
2016-02-24 06:26:57 +01:00
|
|
|
public static void generate(WeightedRandomChestContent chestContent) {
|
|
|
|
for (String category : Arrays.asList(ChestGenHooks.VILLAGE_BLACKSMITH, ChestGenHooks.MINESHAFT_CORRIDOR, ChestGenHooks.PYRAMID_DESERT_CHEST, ChestGenHooks.PYRAMID_JUNGLE_CHEST, ChestGenHooks.PYRAMID_JUNGLE_DISPENSER, ChestGenHooks.STRONGHOLD_CORRIDOR, ChestGenHooks.STRONGHOLD_LIBRARY, ChestGenHooks.STRONGHOLD_CROSSING, ChestGenHooks.BONUS_CHEST, ChestGenHooks.DUNGEON_CHEST)) {
|
|
|
|
ChestGenHooks.addItem(category, chestContent);
|
|
|
|
}
|
|
|
|
}
|
2016-02-24 05:24:50 +01:00
|
|
|
}
|