Added rockcutter
This commit is contained in:
parent
e5110e2e92
commit
da6e88c254
8 changed files with 187 additions and 15 deletions
|
@ -13,6 +13,7 @@ import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
import techreborn.init.ModItems;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@ -35,9 +36,9 @@ public class BlockOre extends Block{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int par1, Random random, int par2)
|
public Item getItemDropped(int meta, Random random, int fortune)
|
||||||
{
|
{
|
||||||
return Item.getItemFromBlock(this);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -8,6 +8,7 @@ public class ConfigTechReborn {
|
||||||
private static ConfigTechReborn instance = null;
|
private static ConfigTechReborn instance = null;
|
||||||
public static String CATEGORY_WORLD = "world";
|
public static String CATEGORY_WORLD = "world";
|
||||||
public static String CATEGORY_POWER = "power";
|
public static String CATEGORY_POWER = "power";
|
||||||
|
public static String CATEGORY_CRAFTING = "crafting";
|
||||||
|
|
||||||
//WORLDGEN
|
//WORLDGEN
|
||||||
public static boolean GalenaOreTrue;
|
public static boolean GalenaOreTrue;
|
||||||
|
@ -25,6 +26,15 @@ public class ConfigTechReborn {
|
||||||
|
|
||||||
//Power
|
//Power
|
||||||
public static int ThermalGenertaorOutput;
|
public static int ThermalGenertaorOutput;
|
||||||
|
|
||||||
|
//Crafting
|
||||||
|
public static boolean ExpensiveMacerator;
|
||||||
|
public static boolean ExpensiveDrill;
|
||||||
|
public static boolean ExpensiveDiamondDrill;
|
||||||
|
public static boolean ExpensiveSolar;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static Configuration config;
|
public static Configuration config;
|
||||||
|
@ -112,11 +122,31 @@ public class ConfigTechReborn {
|
||||||
"Allow SodaliteOre", true,
|
"Allow SodaliteOre", true,
|
||||||
"Allow SodaliteOre to be generated in your world.")
|
"Allow SodaliteOre to be generated in your world.")
|
||||||
.getBoolean(true);
|
.getBoolean(true);
|
||||||
|
|
||||||
|
//Power
|
||||||
ThermalGenertaorOutput = config.get(CATEGORY_POWER,
|
ThermalGenertaorOutput = config.get(CATEGORY_POWER,
|
||||||
"Thermal Generator Power", 30,
|
"Thermal Generator Power", 30,
|
||||||
"The amount of power that the thermal generator makes for 1mb of lava")
|
"The amount of power that the thermal generator makes for 1mb of lava")
|
||||||
.getInt();
|
.getInt();
|
||||||
|
|
||||||
|
|
||||||
|
//Crafting
|
||||||
|
ExpensiveMacerator = config.get(CATEGORY_CRAFTING,
|
||||||
|
"Allow Expensive Macerator", true,
|
||||||
|
"Allow TechReborn to overrite the IC2 recipe for Macerator.")
|
||||||
|
.getBoolean(true);
|
||||||
|
ExpensiveDrill = config.get(CATEGORY_CRAFTING,
|
||||||
|
"Allow Expensive Drill", true,
|
||||||
|
"Allow TechReborn to overrite the IC2 recipe for Drill.")
|
||||||
|
.getBoolean(true);
|
||||||
|
ExpensiveDiamondDrill = config.get(CATEGORY_CRAFTING,
|
||||||
|
"Allow Expensive DiamondDrill", true,
|
||||||
|
"Allow TechReborn to overrite the IC2 recipe for DiamondDrill.")
|
||||||
|
.getBoolean(true);
|
||||||
|
ExpensiveSolar = config.get(CATEGORY_CRAFTING,
|
||||||
|
"Allow Expensive Solar pannels", true,
|
||||||
|
"Allow TechReborn to overrite the IC2 recipe for Solar pannels.")
|
||||||
|
.getBoolean(true);
|
||||||
|
|
||||||
if (config.hasChanged())
|
if (config.hasChanged())
|
||||||
config.save();
|
config.save();
|
||||||
|
|
|
@ -29,6 +29,8 @@ public class TechRebornConfigGui extends GuiConfig{
|
||||||
"tr.configgui.category.trWorld", TRWORLD.class));
|
"tr.configgui.category.trWorld", TRWORLD.class));
|
||||||
list.add(new DummyConfigElement.DummyCategoryElement("Power",
|
list.add(new DummyConfigElement.DummyCategoryElement("Power",
|
||||||
"tr.configgui.category.trPower", TRPOWER.class));
|
"tr.configgui.category.trPower", TRPOWER.class));
|
||||||
|
list.add(new DummyConfigElement.DummyCategoryElement("Crafting",
|
||||||
|
"tr.configgui.category.trCrafting", TRCRAFTING.class));
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -101,4 +103,28 @@ public class TechRebornConfigGui extends GuiConfig{
|
||||||
.toString()));
|
.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Crafting
|
||||||
|
public static class TRCRAFTING extends CategoryEntry {
|
||||||
|
public TRCRAFTING(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
|
||||||
|
{
|
||||||
|
super(owningScreen, owningEntryList, configElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected GuiScreen buildChildScreen()
|
||||||
|
{
|
||||||
|
return new GuiConfig(this.owningScreen,
|
||||||
|
(new ConfigElement(ConfigTechReborn.config
|
||||||
|
.getCategory(ConfigTechReborn.CATEGORY_CRAFTING)))
|
||||||
|
.getChildElements(), this.owningScreen.modID,
|
||||||
|
Configuration.CATEGORY_GENERAL,
|
||||||
|
this.configElement.requiresWorldRestart()
|
||||||
|
|| this.owningScreen.allRequireWorldRestart,
|
||||||
|
this.configElement.requiresMcRestart()
|
||||||
|
|| this.owningScreen.allRequireMcRestart,
|
||||||
|
GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config
|
||||||
|
.toString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
package techreborn.init;
|
package techreborn.init;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.message.MapMessage.MapFormat;
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.Item.ToolMaterial;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
import techreborn.items.ItemDusts;
|
import techreborn.items.ItemDusts;
|
||||||
import techreborn.items.ItemGems;
|
import techreborn.items.ItemGems;
|
||||||
import techreborn.items.ItemIngots;
|
import techreborn.items.ItemIngots;
|
||||||
import techreborn.items.ItemParts;
|
import techreborn.items.ItemParts;
|
||||||
|
import techreborn.items.tools.ItemRockCutter;
|
||||||
import techreborn.util.LogHelper;
|
import techreborn.util.LogHelper;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
|
@ -16,6 +20,7 @@ public class ModItems {
|
||||||
public static Item ingots;
|
public static Item ingots;
|
||||||
public static Item gems;
|
public static Item gems;
|
||||||
public static Item parts;
|
public static Item parts;
|
||||||
|
public static Item rockCutter;
|
||||||
|
|
||||||
public static void init()
|
public static void init()
|
||||||
{
|
{
|
||||||
|
@ -27,6 +32,8 @@ public class ModItems {
|
||||||
GameRegistry.registerItem(gems, "gem");
|
GameRegistry.registerItem(gems, "gem");
|
||||||
parts = new ItemParts();
|
parts = new ItemParts();
|
||||||
GameRegistry.registerItem(parts, "part");
|
GameRegistry.registerItem(parts, "part");
|
||||||
|
rockCutter = new ItemRockCutter(ToolMaterial.EMERALD);
|
||||||
|
GameRegistry.registerItem(rockCutter, "rockCutter");
|
||||||
LogHelper.info("TechReborns Items Loaded");
|
LogHelper.info("TechReborns Items Loaded");
|
||||||
|
|
||||||
registerOreDict();
|
registerOreDict();
|
||||||
|
|
|
@ -5,13 +5,15 @@ import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import techreborn.api.CentrifugeRecipie;
|
import techreborn.api.CentrifugeRecipie;
|
||||||
import techreborn.api.TechRebornAPI;
|
import techreborn.api.TechRebornAPI;
|
||||||
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.util.CraftingHelper;
|
import techreborn.util.CraftingHelper;
|
||||||
import techreborn.util.LogHelper;
|
import techreborn.util.LogHelper;
|
||||||
import techreborn.util.RecipeRemover;
|
import techreborn.util.RecipeRemover;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class ModRecipes {
|
public class ModRecipes {
|
||||||
|
public static ConfigTechReborn config;
|
||||||
|
|
||||||
public static void init()
|
public static void init()
|
||||||
{
|
{
|
||||||
removeIc2Recipes();
|
removeIc2Recipes();
|
||||||
|
@ -23,10 +25,14 @@ public class ModRecipes {
|
||||||
|
|
||||||
public static void removeIc2Recipes()
|
public static void removeIc2Recipes()
|
||||||
{
|
{
|
||||||
RecipeRemover.removeAnyRecipe(IC2Items.getItem("macerator"));
|
if(config.ExpensiveMacerator);
|
||||||
RecipeRemover.removeAnyRecipe(IC2Items.getItem("miningDrill"));
|
RecipeRemover.removeAnyRecipe(IC2Items.getItem("macerator"));
|
||||||
RecipeRemover.removeAnyRecipe(IC2Items.getItem("diamondDrill"));
|
if(config.ExpensiveDrill);
|
||||||
RecipeRemover.removeAnyRecipe(IC2Items.getItem("solarPanel"));
|
RecipeRemover.removeAnyRecipe(IC2Items.getItem("miningDrill"));
|
||||||
|
if(config.ExpensiveDiamondDrill);
|
||||||
|
RecipeRemover.removeAnyRecipe(IC2Items.getItem("diamondDrill"));
|
||||||
|
if(config.ExpensiveSolar);
|
||||||
|
RecipeRemover.removeAnyRecipe(IC2Items.getItem("solarPanel"));
|
||||||
|
|
||||||
LogHelper.info("IC2 Recipes Removed");
|
LogHelper.info("IC2 Recipes Removed");
|
||||||
}
|
}
|
||||||
|
@ -35,27 +41,28 @@ public class ModRecipes {
|
||||||
{
|
{
|
||||||
|
|
||||||
//IC2 Recipes
|
//IC2 Recipes
|
||||||
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("macerator"),
|
if(config.ExpensiveMacerator);
|
||||||
|
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("macerator"),
|
||||||
new Object[]{"FDF", "DMD", "FCF",
|
new Object[]{"FDF", "DMD", "FCF",
|
||||||
'F', Items.flint,
|
'F', Items.flint,
|
||||||
'D', Items.diamond,
|
'D', Items.diamond,
|
||||||
'M', IC2Items.getItem("machine"),
|
'M', IC2Items.getItem("machine"),
|
||||||
'C', IC2Items.getItem("electronicCircuit")});
|
'C', IC2Items.getItem("electronicCircuit")});
|
||||||
|
if(config.ExpensiveDrill);
|
||||||
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("miningDrill"),
|
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("miningDrill"),
|
||||||
new Object[]{" S ", "SCS", "SBS",
|
new Object[]{" S ", "SCS", "SBS",
|
||||||
'S', "ingotSteel",
|
'S', "ingotSteel",
|
||||||
'B', IC2Items.getItem("reBattery"),
|
'B', IC2Items.getItem("reBattery"),
|
||||||
'C', IC2Items.getItem("electronicCircuit")});
|
'C', IC2Items.getItem("electronicCircuit")});
|
||||||
|
if(config.ExpensiveDiamondDrill);
|
||||||
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("diamondDrill"),
|
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("diamondDrill"),
|
||||||
new Object[]{" D ", "DBD", "TCT",
|
new Object[]{" D ", "DBD", "TCT",
|
||||||
'D', "gemDiamond",
|
'D', "gemDiamond",
|
||||||
'T', "ingotTitanium",
|
'T', "ingotTitanium",
|
||||||
'B', IC2Items.getItem("miningDrill"),
|
'B', IC2Items.getItem("miningDrill"),
|
||||||
'C', IC2Items.getItem("advancedCircuit")});
|
'C', IC2Items.getItem("advancedCircuit")});
|
||||||
|
if(config.ExpensiveSolar);
|
||||||
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("solarPanel"),
|
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("solarPanel"),
|
||||||
new Object[]{"PPP", "SZS", "CGC",
|
new Object[]{"PPP", "SZS", "CGC",
|
||||||
'P', "paneGlass",
|
'P', "paneGlass",
|
||||||
'S', new ItemStack(ModItems.parts,1,1),
|
'S', new ItemStack(ModItems.parts,1,1),
|
||||||
|
@ -124,6 +131,7 @@ public class ModRecipes {
|
||||||
new Object[]{"AAA", "AMA", "AAA",
|
new Object[]{"AAA", "AMA", "AAA",
|
||||||
'A', "ingotBrass",
|
'A', "ingotBrass",
|
||||||
'M', new ItemStack(ModItems.parts,1,13)});
|
'M', new ItemStack(ModItems.parts,1,13)});
|
||||||
|
|
||||||
//Storage Blocks
|
//Storage Blocks
|
||||||
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,0),
|
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,0),
|
||||||
new Object[]{"AAA", "AAA", "AAA",
|
new Object[]{"AAA", "AAA", "AAA",
|
||||||
|
@ -210,6 +218,8 @@ public class ModRecipes {
|
||||||
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,14), "blockPlatinum");
|
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,14), "blockPlatinum");
|
||||||
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,15), "blockNickel");
|
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,15), "blockNickel");
|
||||||
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,16), "blockInvar");
|
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,16), "blockInvar");
|
||||||
|
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.rockCutter), Items.apple);
|
||||||
|
|
||||||
|
|
||||||
LogHelper.info("Shapless Recipes Added");
|
LogHelper.info("Shapless Recipes Added");
|
||||||
}
|
}
|
||||||
|
|
95
src/main/java/techreborn/items/tools/ItemRockCutter.java
Normal file
95
src/main/java/techreborn/items/tools/ItemRockCutter.java
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
package techreborn.items.tools;
|
||||||
|
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemPickaxe;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class ItemRockCutter extends ItemPickaxe implements IElectricItem{
|
||||||
|
|
||||||
|
public int maxCharge = 40000;
|
||||||
|
public int cost = 200;
|
||||||
|
public int hitCost = 300;
|
||||||
|
public int tier = 2;
|
||||||
|
|
||||||
|
public ItemRockCutter(ToolMaterial toolMaterial)
|
||||||
|
{
|
||||||
|
super(toolMaterial);
|
||||||
|
setUnlocalizedName("techreborn.rockcutter");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
|
setMaxStackSize(1);
|
||||||
|
setMaxDamage(27);
|
||||||
|
efficiencyOnProperMaterial = 16F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = iconRegister.registerIcon("techreborn:" + "rockcutter");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canHarvestBlock(Block block, ItemStack stack)
|
||||||
|
{
|
||||||
|
return Items.diamond_pickaxe.canHarvestBlock(block, stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRepairable()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||||
|
{
|
||||||
|
par1ItemStack.addEnchantment(Enchantment.silkTouch, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canProvideEnergy(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getChargedItem(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getEmptyItem(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getMaxCharge(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return maxCharge;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return tier;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getTransferLimit(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -145,3 +145,6 @@ item.techreborn.part.SteelMachineHull.name=Steel Machine Hull
|
||||||
item.techreborn.part.TitaniumMachineHull.name=Titanium Machine Hull
|
item.techreborn.part.TitaniumMachineHull.name=Titanium Machine Hull
|
||||||
item.techreborn.part.BrassMachineHull.name=Brass Machine Hull
|
item.techreborn.part.BrassMachineHull.name=Brass Machine Hull
|
||||||
|
|
||||||
|
#Tools
|
||||||
|
item.techreborn.rockcutter.name=Rockcutter
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Loading…
Reference in a new issue