diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 2a4037e0b..506ed743a 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -71,6 +71,7 @@ potion.hbm_phosphorus=Phosphorverbrennung tool.ability.recursion=Erzadern-Miner tool.ability.hammer=AoE tool.ability.silktouch=Präzisionswerkzeug +tool.ability.fortune=Erz-Extraktor tool.ability.smelter=Auto-Ofen tool.ability.shredder=Auto-Brecher tool.ability.cnetrifuge=Auto-Zentrifuge @@ -655,6 +656,7 @@ item.ingot_steel.name=Stahlbarren item.plate_steel.name=Stahlplatte item.ingot_beryllium.name=Berylliumbarren item.plate_schrabidium.name=Schrabidiumplatte +item.ingot_schraranium.name=Schraraniumbarren item.ingot_schrabidium.name=Schrabidiumbarren item.nugget_schrabidium.name=Schrabidiumnugget item.plate_copper.name=Kupferplatte diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index c1e6b7a71..cc948c46d 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -71,6 +71,7 @@ potion.hbm_phosphorus=Phosphorus Burns tool.ability.recursion=Vein Miner tool.ability.hammer=AoE tool.ability.silktouch=Precision Miner +tool.ability.fortune=Ore Extractor tool.ability.smelter=Auto-Smelter tool.ability.shredder=Auto-Shredder tool.ability.centrifuge=Auto-Centrifuge @@ -655,6 +656,7 @@ item.ingot_steel.name=Steel Ingot item.plate_steel.name=Steel Plate item.ingot_beryllium.name=Beryllium Ingot item.plate_schrabidium.name=Schrabidium Plate +item.ingot_schraranium.name=Schraranium Ingot item.ingot_schrabidium.name=Schrabidium Ingot item.nugget_schrabidium.name=Schrabidium Nugget item.plate_copper.name=Copper Plate diff --git a/assets/hbm/textures/blocks/ash.png b/assets/hbm/textures/blocks/ash.png new file mode 100644 index 000000000..a16315628 Binary files /dev/null and b/assets/hbm/textures/blocks/ash.png differ diff --git a/assets/hbm/textures/items/ingot_schraranium.png b/assets/hbm/textures/items/ingot_schraranium.png new file mode 100644 index 000000000..664d11e73 Binary files /dev/null and b/assets/hbm/textures/items/ingot_schraranium.png differ diff --git a/com/hbm/handler/ToolAbility.java b/com/hbm/handler/ToolAbility.java index 113f2f33b..749f602d4 100644 --- a/com/hbm/handler/ToolAbility.java +++ b/com/hbm/handler/ToolAbility.java @@ -11,9 +11,12 @@ import com.hbm.inventory.ShredderRecipes; import com.hbm.items.ModItems; import com.hbm.items.tool.ItemToolAbility; import com.hbm.main.MainRegistry; +import com.hbm.util.EnchantmentUtil; import net.minecraft.block.Block; import net.minecraft.client.resources.I18n; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -167,16 +170,18 @@ public abstract class ToolAbility { @Override public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) { - //a band-aid on a gaping wound - if(block == Blocks.lit_redstone_ore) - block = Blocks.redstone_ore; + //if the tool is already enchanted, do nothing + if(EnchantmentHelper.getSilkTouchModifier(player) || player.getHeldItem() == null) + return; - ItemStack stack = new ItemStack(block, 1, meta); + //add enchantment + ItemStack stack = player.getHeldItem(); - if(stack.getItem() != null) { - world.setBlockToAir(x, y, z); - world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, stack)); - } + EnchantmentUtil.addEnchantment(stack, Enchantment.silkTouch, 1); + block.harvestBlock(world, player, x, y, z, meta); + EnchantmentUtil.removeEnchantment(stack, Enchantment.silkTouch); + + world.setBlockToAir(x, y, z); } @Override @@ -190,6 +195,42 @@ public abstract class ToolAbility { } } + public static class LuckAbility extends ToolAbility { + + int luck; + + public LuckAbility(int luck) { + this.luck = luck; + } + + @Override + public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) { + + //if the tool is already enchanted, do nothing + if(EnchantmentHelper.getFortuneModifier(player) > 0 || player.getHeldItem() == null) + return; + + //add enchantment + ItemStack stack = player.getHeldItem(); + + EnchantmentUtil.addEnchantment(stack, Enchantment.fortune, luck); + block.harvestBlock(world, player, x, y, z, meta); + EnchantmentUtil.removeEnchantment(stack, Enchantment.fortune); + + world.setBlockToAir(x, y, z); + } + + @Override + public String getName() { + return "tool.ability.luck"; + } + + @Override + public String getFullName() { + return I18n.format(getName()) + " (" + luck + ")"; + } + } + public static class SmelterAbility extends ToolAbility { @Override diff --git a/com/hbm/inventory/MachineRecipes.java b/com/hbm/inventory/MachineRecipes.java index fa6ab9009..d05221cbe 100644 --- a/com/hbm/inventory/MachineRecipes.java +++ b/com/hbm/inventory/MachineRecipes.java @@ -141,10 +141,10 @@ public class MachineRecipes { list.add(new GasCentOutput(1, new ItemStack(ModItems.fluorite), 4)); return list; case WATZ: - list.add(new GasCentOutput(1, new ItemStack(ModItems.nugget_schrabidium), 1)); - list.add(new GasCentOutput(3, new ItemStack(ModItems.nugget_uranium), 2)); - list.add(new GasCentOutput(3, new ItemStack(ModItems.powder_iron), 3)); - list.add(new GasCentOutput(3, new ItemStack(ModItems.powder_copper), 4)); + list.add(new GasCentOutput(1, new ItemStack(ModItems.nugget_solinium), 1)); + list.add(new GasCentOutput(1, new ItemStack(ModItems.nugget_uranium), 1)); + list.add(new GasCentOutput(5, new ItemStack(ModItems.powder_lead), 1)); + list.add(new GasCentOutput(10, new ItemStack(ModItems.dust), 1)); return list; case SAS3: list.add(new GasCentOutput(4, new ItemStack(ModItems.nugget_schrabidium), 1)); @@ -200,7 +200,7 @@ public class MachineRecipes { case PUF6: return 100; case WATZ: - return 100; + return 1000; case SAS3: return 100; case COOLANT: @@ -2854,28 +2854,27 @@ public class MachineRecipes { break; case LW_ELEMENT: list.add(new ItemStack(ModItems.ingot_tungsten, 4)); - list.add(new ItemStack(ModItems.plate_advanced_alloy, 6)); - list.add(new ItemStack(ModItems.rod_empty, 4)); + list.add(new ItemStack(ModItems.plate_advanced_alloy, 4)); + list.add(new ItemStack(ModItems.rod_empty, 2)); list.add(new ItemStack(ModItems.wire_magnetized_tungsten, 2)); - list.add(new ItemStack(ModItems.circuit_red_copper, 1)); + list.add(new ItemStack(ModItems.wire_advanced_alloy, 4)); break; case LW_CONTROL: list.add(new ItemStack(ModItems.ingot_tungsten, 4)); list.add(new ItemStack(ModItems.ingot_advanced_alloy, 4)); list.add(new ItemStack(ModItems.ingot_lead, 2)); list.add(new ItemStack(ModItems.wire_magnetized_tungsten, 4)); - list.add(new ItemStack(ModItems.circuit_copper, 2)); + list.add(new ItemStack(ModItems.wire_advanced_alloy, 2)); break; case LW_COOLER: list.add(new ItemStack(ModItems.ingot_tungsten, 2)); list.add(new ItemStack(ModItems.ingot_steel, 2)); - list.add(new ItemStack(ModItems.niter, 6)); - list.add(new ItemStack(ModItems.powder_quartz, 4)); + list.add(new ItemStack(ModItems.niter, 4)); break; case LW_STRUTURE: list.add(new ItemStack(ModItems.ingot_tungsten, 2)); list.add(new ItemStack(ModItems.ingot_lead, 2)); - list.add(new ItemStack(ModItems.ingot_steel, 5)); + list.add(new ItemStack(ModItems.ingot_steel, 3)); break; case LW_HATCH: list.add(new ItemStack(ModBlocks.reinforced_brick, 1)); @@ -2891,7 +2890,7 @@ public class MachineRecipes { break; case LW_CORE: list.add(new ItemStack(ModBlocks.block_meteor, 1)); - list.add(new ItemStack(ModItems.circuit_gold, 8)); + list.add(new ItemStack(ModItems.circuit_gold, 5)); list.add(new ItemStack(ModItems.circuit_schrabidium, 2)); list.add(new ItemStack(ModItems.wire_magnetized_tungsten, 12)); break; diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 45b545d4d..144d68334 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -113,6 +113,7 @@ public class ModItems { public static Item ingot_aluminium; public static Item fluorite; public static Item ingot_beryllium; + public static Item ingot_schraranium; public static Item ingot_schrabidium; public static Item ingot_plutonium_fuel; public static Item ingot_uranium_fuel; @@ -1987,6 +1988,7 @@ public class ModItems { plate_iron = new Item().setUnlocalizedName("plate_iron").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_iron"); ingot_lead = new Item().setUnlocalizedName("ingot_lead").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_lead"); plate_lead = new Item().setUnlocalizedName("plate_lead").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_lead"); + ingot_schraranium = new ItemRadioactive(2.5F, false, true).setUnlocalizedName("ingot_schraranium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_schraranium"); ingot_schrabidium = new ItemRadioactive(7.5F, false, true).setUnlocalizedName("ingot_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_schrabidium"); plate_schrabidium = new ItemRadioactive(7.5F, false, true).setUnlocalizedName("plate_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_schrabidium"); plate_copper = new Item().setUnlocalizedName("plate_copper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_copper"); @@ -3898,6 +3900,7 @@ public class ModItems { GameRegistry.registerItem(ingot_cobalt, ingot_cobalt.getUnlocalizedName()); GameRegistry.registerItem(ingot_dura_steel, ingot_dura_steel.getUnlocalizedName()); GameRegistry.registerItem(ingot_polymer, ingot_polymer.getUnlocalizedName()); + GameRegistry.registerItem(ingot_schraranium, ingot_schraranium.getUnlocalizedName()); GameRegistry.registerItem(ingot_schrabidium, ingot_schrabidium.getUnlocalizedName()); GameRegistry.registerItem(ingot_magnetized_tungsten, ingot_magnetized_tungsten.getUnlocalizedName()); GameRegistry.registerItem(ingot_combine_steel, ingot_combine_steel.getUnlocalizedName()); diff --git a/com/hbm/items/tool/ItemToolAbility.java b/com/hbm/items/tool/ItemToolAbility.java index 11a9eed3e..9aa3b33a9 100644 --- a/com/hbm/items/tool/ItemToolAbility.java +++ b/com/hbm/items/tool/ItemToolAbility.java @@ -9,6 +9,7 @@ import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import com.google.common.collect.Sets; import com.hbm.handler.ToolAbility; +import com.hbm.handler.ToolAbility.SilkAbility; import com.hbm.handler.WeaponAbility; import cpw.mods.fml.relauncher.Side; @@ -158,6 +159,9 @@ public class ItemToolAbility extends ItemTool { if(!canOperate(stack)) return false; + if(this.getCurrentAbility(stack) instanceof SilkAbility) + return true; + return getDigSpeed(stack, block, 0) > 1; } diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index f832777e8..cd6e3ee09 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -458,7 +458,7 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.deco_titanium), new Object[] { "ingotTitanium", ModBlocks.steel_scaffold })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.deco_tungsten), new Object[] { "ingotTungsten", ModBlocks.steel_scaffold })); - GameRegistry.addRecipe(new ItemStack(ModItems.nugget_euphemium, 1), new Object[] { "###", "###", "###", '#', ModItems.rod_quad_euphemium }); + GameRegistry.addRecipe(new ItemStack(ModItems.nugget_euphemium, 1), new Object[] { "##", "##", '#', ModItems.rod_quad_euphemium }); GameRegistry.addRecipe(new ItemStack(ModItems.ingot_euphemium, 1), new Object[] { "###", "###", "###", '#', ModItems.nugget_euphemium }); GameRegistry.addRecipe(new ItemStack(ModItems.nugget_euphemium, 9), new Object[] { "#", '#', ModItems.ingot_euphemium }); diff --git a/com/hbm/util/EnchantmentUtil.java b/com/hbm/util/EnchantmentUtil.java new file mode 100644 index 000000000..8a7131475 --- /dev/null +++ b/com/hbm/util/EnchantmentUtil.java @@ -0,0 +1,26 @@ +package com.hbm.util; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.item.ItemStack; + +public class EnchantmentUtil { + + public static void addEnchantment(ItemStack stack, Enchantment enchantment, int level) { + + stack.addEnchantment(enchantment, level); + } + + public static void removeEnchantment(ItemStack stack, Enchantment enchantment) { + + int i = 0; + for( ; i < stack.getEnchantmentTagList().tagCount(); i++) { + if(stack.getEnchantmentTagList().getCompoundTagAt(i).getShort("id") == enchantment.effectId) + break; + } + + stack.getEnchantmentTagList().removeTag(i); + + if(stack.getEnchantmentTagList().tagCount() == 0) + stack.getTagCompound().removeTag("ench"); + } +}