Added rockcutter

This commit is contained in:
Gig 2015-04-12 22:45:13 +01:00
parent e5110e2e92
commit da6e88c254
8 changed files with 187 additions and 15 deletions

View file

@ -13,6 +13,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.client.TechRebornCreativeTab;
import techreborn.init.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -35,7 +36,7 @@ public class BlockOre extends Block{
}
@Override
public Item getItemDropped(int par1, Random random, int par2)
public Item getItemDropped(int meta, Random random, int fortune)
{
return Item.getItemFromBlock(this);
}

View file

@ -8,6 +8,7 @@ public class ConfigTechReborn {
private static ConfigTechReborn instance = null;
public static String CATEGORY_WORLD = "world";
public static String CATEGORY_POWER = "power";
public static String CATEGORY_CRAFTING = "crafting";
//WORLDGEN
public static boolean GalenaOreTrue;
@ -26,6 +27,15 @@ public class ConfigTechReborn {
//Power
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;
@ -113,11 +123,31 @@ public class ConfigTechReborn {
"Allow SodaliteOre to be generated in your world.")
.getBoolean(true);
//Power
ThermalGenertaorOutput = config.get(CATEGORY_POWER,
"Thermal Generator Power", 30,
"The amount of power that the thermal generator makes for 1mb of lava")
.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())
config.save();
}

View file

@ -29,6 +29,8 @@ public class TechRebornConfigGui extends GuiConfig{
"tr.configgui.category.trWorld", TRWORLD.class));
list.add(new DummyConfigElement.DummyCategoryElement("Power",
"tr.configgui.category.trPower", TRPOWER.class));
list.add(new DummyConfigElement.DummyCategoryElement("Crafting",
"tr.configgui.category.trCrafting", TRCRAFTING.class));
return list;
}
@ -101,4 +103,28 @@ public class TechRebornConfigGui extends GuiConfig{
.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()));
}
}
}

View file

@ -1,12 +1,16 @@
package techreborn.init;
import org.apache.logging.log4j.message.MapMessage.MapFormat;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.oredict.OreDictionary;
import techreborn.items.ItemDusts;
import techreborn.items.ItemGems;
import techreborn.items.ItemIngots;
import techreborn.items.ItemParts;
import techreborn.items.tools.ItemRockCutter;
import techreborn.util.LogHelper;
import cpw.mods.fml.common.registry.GameRegistry;
@ -16,6 +20,7 @@ public class ModItems {
public static Item ingots;
public static Item gems;
public static Item parts;
public static Item rockCutter;
public static void init()
{
@ -27,6 +32,8 @@ public class ModItems {
GameRegistry.registerItem(gems, "gem");
parts = new ItemParts();
GameRegistry.registerItem(parts, "part");
rockCutter = new ItemRockCutter(ToolMaterial.EMERALD);
GameRegistry.registerItem(rockCutter, "rockCutter");
LogHelper.info("TechReborns Items Loaded");
registerOreDict();

View file

@ -5,12 +5,14 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import techreborn.api.CentrifugeRecipie;
import techreborn.api.TechRebornAPI;
import techreborn.config.ConfigTechReborn;
import techreborn.util.CraftingHelper;
import techreborn.util.LogHelper;
import techreborn.util.RecipeRemover;
import cpw.mods.fml.common.registry.GameRegistry;
public class ModRecipes {
public static ConfigTechReborn config;
public static void init()
{
@ -23,10 +25,14 @@ public class ModRecipes {
public static void removeIc2Recipes()
{
RecipeRemover.removeAnyRecipe(IC2Items.getItem("macerator"));
RecipeRemover.removeAnyRecipe(IC2Items.getItem("miningDrill"));
RecipeRemover.removeAnyRecipe(IC2Items.getItem("diamondDrill"));
RecipeRemover.removeAnyRecipe(IC2Items.getItem("solarPanel"));
if(config.ExpensiveMacerator);
RecipeRemover.removeAnyRecipe(IC2Items.getItem("macerator"));
if(config.ExpensiveDrill);
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");
}
@ -35,27 +41,28 @@ public class ModRecipes {
{
//IC2 Recipes
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("macerator"),
if(config.ExpensiveMacerator);
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("macerator"),
new Object[]{"FDF", "DMD", "FCF",
'F', Items.flint,
'D', Items.diamond,
'M', IC2Items.getItem("machine"),
'C', IC2Items.getItem("electronicCircuit")});
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("miningDrill"),
if(config.ExpensiveDrill);
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("miningDrill"),
new Object[]{" S ", "SCS", "SBS",
'S', "ingotSteel",
'B', IC2Items.getItem("reBattery"),
'C', IC2Items.getItem("electronicCircuit")});
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("diamondDrill"),
if(config.ExpensiveDiamondDrill);
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("diamondDrill"),
new Object[]{" D ", "DBD", "TCT",
'D', "gemDiamond",
'T', "ingotTitanium",
'B', IC2Items.getItem("miningDrill"),
'C', IC2Items.getItem("advancedCircuit")});
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("solarPanel"),
if(config.ExpensiveSolar);
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("solarPanel"),
new Object[]{"PPP", "SZS", "CGC",
'P', "paneGlass",
'S', new ItemStack(ModItems.parts,1,1),
@ -124,6 +131,7 @@ public class ModRecipes {
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotBrass",
'M', new ItemStack(ModItems.parts,1,13)});
//Storage Blocks
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,0),
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,15), "blockNickel");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,16), "blockInvar");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.rockCutter), Items.apple);
LogHelper.info("Shapless Recipes Added");
}

View 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;
}
}

View file

@ -145,3 +145,6 @@ item.techreborn.part.SteelMachineHull.name=Steel Machine Hull
item.techreborn.part.TitaniumMachineHull.name=Titanium 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