Added jackhammers

This commit is contained in:
TheDoctorSoda 2016-02-28 11:18:59 -08:00
parent 3ad3453499
commit 9e5f223a42
21 changed files with 359 additions and 98 deletions

View file

@ -10,9 +10,9 @@ The current main maintainer is [@gigabit101](https://github.com/gigabit101/) if
[@modmuss50](https://github.com/modmuss50/) is a past maintainer of the mod (see [here](http://techreborn.ninja/?p=20)).
# Reccommended Builds:
# Recommended Builds:
See [this list](http://minecraft.curseforge.com/projects/techreborn/files?sort=releasetype). The top one should always be the latest, reccommended build of TechReborn. Currently TechReborn does not have a reccommended 1.8.9 build.
See [this list](http://minecraft.curseforge.com/projects/techreborn/files?sort=releasetype). The top one should always be the latest, recommended build of TechReborn. Currently TechReborn does not have a recommended 1.8.9 build.
# Jenkins Builds:
@ -21,7 +21,7 @@ Jenkins builds of TechReborn are compiled directly from this repository. Please
1.8.9:
---
*This version is constantly recieving updates, and does not have a stable, reccommended, release. Once again, remember to backup your worlds before using jenkins builds.*
*This version is constantly recieving updates, and does not have a stable, recommended, release. Once again, remember to backup your worlds before using jenkins builds.*
[![Build Status](http://modmuss50.me:8080/job/TechReborn-1.8.9/badge/icon)](http://modmuss50.me:8080/job/TechReborn-1.8.9/)

View file

@ -99,6 +99,9 @@ public class ConfigTechReborn {
public static int IronChainsawCharge;
public static int DiamondChainsawCharge;
public static int AdvancedChainsawCharge;
public static int IronJackhammerCharge;
public static int DiamondJackhammerCharge;
public static int SteelJackhammerCharge;
public static int LapotronPackCharge;
public static int LithiumBatpackCharge;
public static int LapotronicOrbMaxCharge;
@ -114,6 +117,9 @@ public class ConfigTechReborn {
public static int IronChainsawTier;
public static int DiamondChainsawTier;
public static int AdvancedChainsawTier;
public static int IronJackhammerTier;
public static int DiamondJackhammerTier;
public static int SteelJackhammerTier;
public static int LapotronPackTier;
public static int LapotronicOrbTier;
public static int LithiumBatpackTier;
@ -408,6 +414,18 @@ public class ConfigTechReborn {
.get(CATEGORY_POWER, "AdvancedChainsaw MaxCharge", 1000000, "Set the max charge for the advanced chainsaw")
.getInt();
IronJackhammerCharge = config
.get(CATEGORY_POWER, "IronJackhammer MaxCharge", 10000, "Set the max charge for the iron jackhammer")
.getInt();
SteelJackhammerCharge = config
.get(CATEGORY_POWER, "AdvancedJackhammer MaxCharge", 20000, "Set the max charge for the advanced jackhammer")
.getInt();
DiamondJackhammerCharge = config
.get(CATEGORY_POWER, "DiamondJackhammer MaxCharge", 100000, "Set the max charge for the diamond jackhammer")
.getInt();
LapotronPackCharge = config
.get(CATEGORY_POWER, "LapotronPack MaxCharge", 100000000, "Set the max charge for the LapotronPack")
.getInt();
@ -468,6 +486,15 @@ public class ConfigTechReborn {
AdvancedChainsawTier = config.get(CATEGORY_POWER, "AdvancedChainsaw Tier", 2, "Set the Tier of the advanced chainsaw")
.getInt();
IronJackhammerTier = config.get(CATEGORY_POWER, "IronJackhammer Tier", 2, "Set the Tier of the iron jackhammer")
.getInt();
DiamondJackhammerTier = config.get(CATEGORY_POWER, "DiamondJackhammer Tier", 2, "Set the Tier of the diamond jackhammer")
.getInt();
SteelJackhammerTier = config.get(CATEGORY_POWER, "AdvancedJackhammer Tier", 2, "Set the Tier of the advanced jackhammer")
.getInt();
LapotronPackTier = config.get(CATEGORY_POWER, "LapotronPack Tier", 2, "Set the Tier of the LapotronPack")
.getInt();

View file

@ -79,6 +79,9 @@ public class ModItems {
public static Item ironChainsaw;
public static Item diamondChainsaw;
public static Item advancedChainsaw;
public static Item ironJackhammer;
public static Item steelJackhammer;
public static Item diamondJackhammer;
public static Item hammer;
public static Item wrench;
public static Item cables;
@ -149,6 +152,13 @@ public class ModItems {
GameRegistry.registerItem(diamondChainsaw, "diamondchainsaw");
advancedChainsaw = PoweredItem.createItem(ItemAdvancedChainsaw.class);
GameRegistry.registerItem(advancedChainsaw, "advancedchainsaw");
ironJackhammer = PoweredItem.createItem(ItemIronJackhammer.class);
GameRegistry.registerItem(ironJackhammer, "ironjackhammer");
steelJackhammer = PoweredItem.createItem(ItemSteelJackhammer.class);
GameRegistry.registerItem(steelJackhammer, "steeljackhammer");
diamondJackhammer = PoweredItem.createItem(ItemDiamondJackhammer.class);
GameRegistry.registerItem(diamondJackhammer, "diamondjackhammer");
hammer = new ItemHammer(100);
GameRegistry.registerItem(hammer, "hammer");

View file

@ -9,6 +9,7 @@ public class ItemAdvancedChainsaw extends ItemChainsaw {
public ItemAdvancedChainsaw() {
super(ToolMaterial.EMERALD, "techreborn.advancedChainsaw", ConfigTechReborn.AdvancedChainsawCharge, ConfigTechReborn.AdvancedDrillTier, 4.0F);
this.cost = 250;
}
@Override

View file

@ -9,6 +9,7 @@ public class ItemAdvancedDrill extends ItemDrill {
public ItemAdvancedDrill() {
super(ToolMaterial.EMERALD, "techreborn.advancedDrill", ConfigTechReborn.AdvancedDrillCharge, ConfigTechReborn.AdvancedDrillTier, 4.0F);
this.cost = 250;
}
@Override

View file

@ -30,122 +30,121 @@ import techreborn.utils.OreDictUtils;
public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedItem {
public int maxCharge = 1;
public int cost = 250;
public float unpoweredSpeed = 2.0F;
public static int tier = 1;
public double transferLimit = 100;
public int maxCharge = 1;
public int cost = 250;
public float unpoweredSpeed = 2.0F;
public static int tier = 1;
public double transferLimit = 100;
public ItemChainsaw(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier, float unpoweredSpeed) {
super(material);
efficiencyOnProperMaterial = 20F;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName(unlocalizedName);
RebornCore.jsonDestroyer.registerObject(this);
this.maxCharge=energyCapacity;
this.tier=tier;
this.unpoweredSpeed=unpoweredSpeed;
}
public ItemChainsaw(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier, float unpoweredSpeed) {
super(material);
efficiencyOnProperMaterial = 20F;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName(unlocalizedName);
RebornCore.jsonDestroyer.registerObject(this);
this.maxCharge = energyCapacity;
this.tier = tier;
this.unpoweredSpeed = unpoweredSpeed;
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) {
Random rand = new Random();
if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack)+1) == 0) {
if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack) + 1) == 0) {
PoweredItem.useEnergy(cost, stack);
}
return true;
}
@Override
public float getDigSpeed(ItemStack stack, IBlockState state) {
if(OreDictUtils.isOre(state, "treeLeaves")&&PoweredItem.canUseEnergy(cost, stack)){
return 40F;
}
if(!PoweredItem.canUseEnergy(cost, stack)){
return unpoweredSpeed;
}
if (Items.wooden_axe.getDigSpeed(stack, state) > 1.0F) {
return efficiencyOnProperMaterial;
} else {
return super.getDigSpeed(stack, state);
}
}
@Override
public float getDigSpeed(ItemStack stack, IBlockState state) {
if (!PoweredItem.canUseEnergy(cost, stack)) {
return unpoweredSpeed;
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
return true;
}
if (OreDictUtils.isOre(state, "treeLeaves") && PoweredItem.canUseEnergy(cost, stack)) {
return 40F;
}
if (Items.wooden_axe.getDigSpeed(stack, state) > 1.0F) {
return efficiencyOnProperMaterial;
} else {
return super.getDigSpeed(stack, state);
}
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {
return TorchHelper.placeTorch(stack, playerIn, worldIn, pos.getX(), pos.getY(), pos.getZ(), side.getIndex(), hitX, hitY, hitZ);
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
return true;
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {
return TorchHelper.placeTorch(stack, playerIn, worldIn, pos.getX(), pos.getY(), pos.getZ(), side.getIndex(), hitX, hitY, hitZ);
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public double getMaxPower(ItemStack stack) {
return maxCharge;
}
@Override
public double getMaxPower(ItemStack stack) {
return maxCharge;
}
@Override
public boolean canAcceptEnergy(ItemStack stack) {
return true;
}
@Override
public boolean canAcceptEnergy(ItemStack stack) {
return true;
}
@Override
public boolean canProvideEnergy(ItemStack stack) {
return false;
}
@Override
public boolean canProvideEnergy(ItemStack stack) {
return false;
}
@Override
public double getMaxTransfer(ItemStack stack) {
return transferLimit;
}
@Override
public double getMaxTransfer(ItemStack stack) {
return transferLimit;
}
@Override
public int getStackTeir(ItemStack stack) {
return tier;
}
@Override
public int getStackTeir(ItemStack stack) {
return tier;
}
@SuppressWarnings(
{"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
itemList.add(itemStack);
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
itemList.add(itemStack);
ItemStack charged = new ItemStack(this, 1);
PoweredItem.setEnergy(getMaxPower(charged), charged);
itemList.add(charged);
}
ItemStack charged = new ItemStack(this, 1);
PoweredItem.setEnergy(getMaxPower(charged), charged);
itemList.add(charged);
}
@Override
public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge;
@Override
public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge;
}
}
@Override
public boolean showDurabilityBar(ItemStack stack) {
return true;
}
@Override
public boolean showDurabilityBar(ItemStack stack) {
return true;
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/nullChainsaw";
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/nullChainsaw";
}
@Override
public int getMaxMeta() {
return 1;
}
@Override
public int getMaxMeta() {
return 1;
}
}

View file

@ -9,6 +9,7 @@ public class ItemDiamondChainsaw extends ItemChainsaw {
public ItemDiamondChainsaw() {
super(ToolMaterial.EMERALD, "techreborn.diamondChainsaw", ConfigTechReborn.DiamondChainsawCharge, ConfigTechReborn.DiamondChainsawTier, 2.5F);
this.cost = 250;
}
@Override

View file

@ -9,6 +9,7 @@ public class ItemDiamondDrill extends ItemDrill {
public ItemDiamondDrill() {
super(ToolMaterial.EMERALD, "techreborn.diamondDrill", ConfigTechReborn.DiamondDrillCharge, ConfigTechReborn.DiamondDrillTier, 2.5F);
this.cost = 250;
}
@Override

View file

@ -0,0 +1,22 @@
package techreborn.items.tools;
import techreborn.config.ConfigTechReborn;
public class ItemDiamondJackhammer extends ItemJackhammer {
public ItemDiamondJackhammer() {
super(ToolMaterial.EMERALD, "techreborn.diamondJackhammer", ConfigTechReborn.DiamondJackhammerCharge, ConfigTechReborn.DiamondJackhammerTier);
this.cost = 250;
this.efficiencyOnProperMaterial = 60F;
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/diamondJackhammer";
}
@Override
public int getMaxMeta() {
return 1;
}
}

View file

@ -9,7 +9,8 @@ public class ItemIronChainsaw extends ItemChainsaw {
public ItemIronChainsaw() {
super(ToolMaterial.IRON, "techreborn.ironChainsaw", ConfigTechReborn.IronChainsawCharge, ConfigTechReborn.IronChainsawTier, 2.0F);
}
this.cost = 50;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {

View file

@ -9,6 +9,7 @@ public class ItemIronDrill extends ItemDrill {
public ItemIronDrill() {
super(ToolMaterial.IRON, "techreborn.ironDrill", ConfigTechReborn.IronDrillCharge, ConfigTechReborn.IronDrillTier, 2.0F);
this.cost = 50;
}
@Override

View file

@ -0,0 +1,22 @@
package techreborn.items.tools;
import techreborn.config.ConfigTechReborn;
public class ItemIronJackhammer extends ItemJackhammer {
public ItemIronJackhammer() {
super(ToolMaterial.IRON, "techreborn.ironJackhammer", ConfigTechReborn.IronJackhammerCharge, ConfigTechReborn.IronJackhammerTier);
this.cost = 50;
this.efficiencyOnProperMaterial = 12F;
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/ironJackhammer";
}
@Override
public int getMaxMeta() {
return 1;
}
}

View file

@ -0,0 +1,151 @@
package techreborn.items.tools;
import java.util.List;
import java.util.Random;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.RebornCore;
import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.util.TorchHelper;
import techreborn.client.TechRebornCreativeTab;
import techreborn.utils.OreDictUtils;
public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem {
public int maxCharge = 1;
public int cost = 250;
public static int tier = 1;
public double transferLimit = 100;
public ItemJackhammer(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier) {
super(material);
efficiencyOnProperMaterial = 20F;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName(unlocalizedName);
RebornCore.jsonDestroyer.registerObject(this);
this.maxCharge = energyCapacity;
this.tier = tier;
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) {
Random rand = new Random();
if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack) + 1) == 0) {
PoweredItem.useEnergy(cost, stack);
}
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
if (OreDictUtils.isOre(block, "stone") && PoweredItem.canUseEnergy(cost, stack)) {
return true;
}
return false;
}
@Override
public float getDigSpeed(ItemStack stack, IBlockState state) {
if (OreDictUtils.isOre(state, "stone") && PoweredItem.canUseEnergy(cost, stack)) {
return efficiencyOnProperMaterial;
} else {
return 0.5F;
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
return true;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {
return TorchHelper.placeTorch(stack, playerIn, worldIn, pos.getX(), pos.getY(), pos.getZ(), side.getIndex(), hitX, hitY, hitZ);
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public double getMaxPower(ItemStack stack) {
return maxCharge;
}
@Override
public boolean canAcceptEnergy(ItemStack stack) {
return true;
}
@Override
public boolean canProvideEnergy(ItemStack stack) {
return false;
}
@Override
public double getMaxTransfer(ItemStack stack) {
return transferLimit;
}
@Override
public int getStackTeir(ItemStack stack) {
return tier;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
itemList.add(itemStack);
ItemStack charged = new ItemStack(this, 1);
PoweredItem.setEnergy(getMaxPower(charged), charged);
itemList.add(charged);
}
@Override
public double getDurabilityForDisplay(ItemStack stack) {
if (PoweredItem.getEnergy(stack) > getMaxPower(stack)) {
return 0;
}
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge;
}
@Override
public boolean showDurabilityBar(ItemStack stack) {
return true;
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/nullJackhammer";
}
@Override
public int getMaxMeta() {
return 1;
}
}

View file

@ -0,0 +1,22 @@
package techreborn.items.tools;
import techreborn.config.ConfigTechReborn;
public class ItemSteelJackhammer extends ItemJackhammer {
public ItemSteelJackhammer() {
super(ToolMaterial.EMERALD, "techreborn.steelJackhammer", ConfigTechReborn.SteelJackhammerCharge, ConfigTechReborn.SteelJackhammerTier);
this.cost = 100;
this.efficiencyOnProperMaterial = 16F;
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/steelJackhammer";
}
@Override
public int getMaxMeta() {
return 1;
}
}

View file

@ -23,9 +23,8 @@ public class OreDictUtils {
}
public static boolean isOre(ItemStack stack, String oreName) {
int id = OreDictionary.getOreID(oreName);
if (stack != null || stack.getItem() != null) {
if (stack != null && stack.getItem() != null && oreName != null) {
int id = OreDictionary.getOreID(oreName);
int[] ids = OreDictionary.getOreIDs(stack);
for (int i : ids) {

View file

@ -610,6 +610,9 @@ item.techreborn.advancedChainsaw.name=Advanced Chainsaw
item.techreborn.lapotronicorb.name=Lapotronic Energy Orb
item.techreborn.cloakingdevice.name=Cloaking Device
item.techreborn.hammer.name=Iron Hammer
item.techreborn.ironJackhammer.name=Iron Jackhammer
item.techreborn.steelJackhammer.name=Steel Jackhammer
item.techreborn.diamondJackhammer.name=Diamond Jackhammer
#Buckets
item.bucketberylium.name=Berylium Bucket

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B