made Dungeon loot easy to add
This commit is contained in:
parent
15c3608c6e
commit
6cc1071961
3 changed files with 29 additions and 2 deletions
|
@ -3,7 +3,9 @@ package techreborn;
|
|||
import java.io.File;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import org.apache.commons.lang3.time.StopWatch;
|
||||
|
||||
import techreborn.achievement.TRAchievements;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.client.GuiHandler;
|
||||
|
@ -20,6 +22,7 @@ import techreborn.packets.PacketHandler;
|
|||
import techreborn.proxies.CommonProxy;
|
||||
import techreborn.tiles.idsu.IDSUManager;
|
||||
import techreborn.util.LogHelper;
|
||||
import techreborn.world.DungeonLoot;
|
||||
import techreborn.world.TROreGen;
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
@ -80,6 +83,7 @@ public class Core {
|
|||
}
|
||||
// WorldGen
|
||||
GameRegistry.registerWorldGenerator(new TROreGen(), 0);
|
||||
DungeonLoot.init();
|
||||
// Register Gui Handler
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
|
||||
// packets
|
||||
|
|
|
@ -14,8 +14,7 @@ import techreborn.tiles.TileBlastFurnace;
|
|||
|
||||
public class GuiBlastFurnace extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/industrial_blast_furnace.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_blast_furnace.png");
|
||||
|
||||
TileBlastFurnace blastfurnace;
|
||||
|
||||
|
|
24
src/main/java/techreborn/world/DungeonLoot.java
Normal file
24
src/main/java/techreborn/world/DungeonLoot.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
package techreborn.world;
|
||||
|
||||
import techreborn.items.ItemIngots;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
|
||||
public class DungeonLoot {
|
||||
|
||||
public static void init()
|
||||
{
|
||||
generate(ItemIngots.getIngotByName("steel"), 5);
|
||||
}
|
||||
|
||||
public static void generate(ItemStack itemStack, int rare)
|
||||
{
|
||||
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(itemStack, itemStack.getItemDamage(), itemStack.stackSize, rare));
|
||||
ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR).addItem(new WeightedRandomChestContent(itemStack, itemStack.getItemDamage(), itemStack.stackSize, rare));
|
||||
ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST).addItem(new WeightedRandomChestContent(itemStack ,itemStack.getItemDamage(), itemStack.stackSize, rare));
|
||||
ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_CORRIDOR).addItem(new WeightedRandomChestContent(itemStack ,itemStack.getItemDamage(), itemStack.stackSize, rare));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue