Switch frequency transmitter, chainsaws, drills, and jackhammers to jsons
|
@ -14,16 +14,30 @@ public class RegisterItemJsons {
|
|||
}
|
||||
|
||||
private static void registerItems() {
|
||||
register(ModItems.reBattery, "reBattery");
|
||||
register(ModItems.lithiumBattery, "lithiumBattery");
|
||||
register(ModItems.energyCrystal, "energyCrystal");
|
||||
register(ModItems.lapotronCrystal, "lapotronCrystal");
|
||||
register(ModItems.lapotronicOrb, "lapotronicOrb");
|
||||
register(ModItems.reBattery, "rebattery");
|
||||
register(ModItems.lithiumBattery, "lithiumbattery");
|
||||
register(ModItems.energyCrystal, "energycrystal");
|
||||
register(ModItems.lapotronCrystal, "lapotroncrystal");
|
||||
register(ModItems.lapotronicOrb, "lapotronicorb");
|
||||
register(ModItems.nanosaber, "nanosaber");
|
||||
|
||||
register(ModItems.frequencyTransmitter, "frequencytransmitter");
|
||||
|
||||
register(ModItems.ironDrill, "tool/steel_drill");
|
||||
register(ModItems.diamondDrill, "tool/diamond_drill");
|
||||
register(ModItems.advancedDrill, "tool/advanced_drill");
|
||||
|
||||
register(ModItems.ironChainsaw, "tool/steel_chainsaw");
|
||||
register(ModItems.diamondChainsaw, "tool/diamond_chainsaw");
|
||||
register(ModItems.advancedChainsaw, "tool/advanced_chainsaw");
|
||||
|
||||
register(ModItems.steelJackhammer, "tool/steel_jackhammer");
|
||||
register(ModItems.diamondJackhammer, "tool/diamond_jackhammer");
|
||||
register(ModItems.advancedJackhammer, "tool/advanced_jackhammer");
|
||||
}
|
||||
|
||||
private static void registerBlocks() {
|
||||
register(ModBlocks.ironFence, "ironFence");
|
||||
register(ModBlocks.ironFence, "ironfence");
|
||||
}
|
||||
|
||||
private static void register(Item item, int meta, String name) {
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
package techreborn.items;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import reborncore.RebornCore;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.hud.StackInfoElement;
|
||||
import reborncore.client.hud.StackInfoHUD;
|
||||
import reborncore.common.util.ChatUtils;
|
||||
|
@ -24,16 +23,29 @@ import techreborn.config.ConfigTechReborn;
|
|||
import techreborn.init.ModItems;
|
||||
import techreborn.lib.MessageIDs;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemFrequencyTransmitter extends ItemTextureBase implements ITexturedItem {
|
||||
public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
|
||||
|
||||
public ItemFrequencyTransmitter() {
|
||||
setUnlocalizedName("techreborn.frequencyTransmitter");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setMaxStackSize(1);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
StackInfoHUD.registerElement(new StackInfoFreqTransmitter());
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:coords"), new IItemPropertyGetter() {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack stack,
|
||||
@Nullable
|
||||
World worldIn,
|
||||
@Nullable
|
||||
EntityLivingBase entityIn) {
|
||||
if (stack != ItemStack.EMPTY && stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) {
|
||||
return 1.0F;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,7 +101,7 @@ public class ItemFrequencyTransmitter extends ItemTextureBase implements ITextur
|
|||
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
if (ConfigTechReborn.FreqTransmitterTooltip) {
|
||||
if (stack.getTagCompound() != null) {
|
||||
if (stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) {
|
||||
int x = stack.getTagCompound().getInteger("x");
|
||||
int y = stack.getTagCompound().getInteger("y");
|
||||
int z = stack.getTagCompound().getInteger("z");
|
||||
|
@ -106,16 +118,6 @@ public class ItemFrequencyTransmitter extends ItemTextureBase implements ITextur
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int arg0) {
|
||||
return "techreborn:items/tool/frequency_transmitter";
|
||||
}
|
||||
|
||||
public static class StackInfoFreqTransmitter extends StackInfoElement {
|
||||
public StackInfoFreqTransmitter() {
|
||||
super(ModItems.frequencyTransmitter);
|
||||
|
@ -127,7 +129,7 @@ public class ItemFrequencyTransmitter extends ItemTextureBase implements ITextur
|
|||
Color gold = Color.GOLD;
|
||||
Color grey = Color.GRAY;
|
||||
if (stack.getItem() instanceof ItemFrequencyTransmitter) {
|
||||
if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) {
|
||||
if (stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) {
|
||||
int coordX = stack.getTagCompound().getInteger("x");
|
||||
int coordY = stack.getTagCompound().getInteger("y");
|
||||
int coordZ = stack.getTagCompound().getInteger("z");
|
||||
|
|
|
@ -38,13 +38,4 @@ public class ItemAdvancedChainsaw extends ItemChainsaw {
|
|||
return Items.DIAMOND_AXE.canHarvestBlock(blockIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/advancedChainsaw";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,13 +38,4 @@ public class ItemAdvancedDrill extends ItemDrill {
|
|||
return Items.DIAMOND_PICKAXE.canHarvestBlock(blockIn) || Items.DIAMOND_SHOVEL.canHarvestBlock(blockIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/advancedDrill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,14 +31,4 @@ public class ItemAdvancedJackhammer extends ItemJackhammer {
|
|||
itemList.add(uncharged);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/advancedJackhammer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,28 +1,26 @@
|
|||
package techreborn.items.tools;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.IHandHeld;
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Enchantments;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
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.PowerSystem;
|
||||
import reborncore.common.powerSystem.PoweredItem;
|
||||
import reborncore.common.util.TorchHelper;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedItem, IHandHeld {
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
|
||||
public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo {
|
||||
|
||||
public static int tier = 1;
|
||||
public int maxCharge = 1;
|
||||
|
@ -36,12 +34,24 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI
|
|||
efficiencyOnProperMaterial = 20F;
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(240);
|
||||
setUnlocalizedName(unlocalizedName);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
this.maxCharge = energyCapacity;
|
||||
this.tier = tier;
|
||||
this.unpoweredSpeed = unpoweredSpeed;
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:animated"), new IItemPropertyGetter() {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack stack,
|
||||
@Nullable
|
||||
World worldIn,
|
||||
@Nullable
|
||||
EntityLivingBase entityIn) {
|
||||
if (stack != ItemStack.EMPTY && PoweredItem.canUseEnergy(cost, stack) && entityIn != null && entityIn.getHeldItemMainhand().isItemEqual(stack)) {
|
||||
return 1.0F;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -49,45 +59,19 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI
|
|||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean onBlockDestroyed(ItemStack stack, World worldIn,
|
||||
// IBlockState blockIn, BlockPos pos, EntityLivingBase entityLiving) {
|
||||
// Random rand = new Random();
|
||||
// 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 (!PoweredItem.canUseEnergy(cost, stack)) {
|
||||
// return unpoweredSpeed;
|
||||
// }
|
||||
//
|
||||
// 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 hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
|
||||
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos,
|
||||
EntityLivingBase entityLiving) {
|
||||
Random rand = new Random();
|
||||
if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack) + 1) == 0) {
|
||||
PoweredItem.useEnergy(cost, stack);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos,
|
||||
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
return TorchHelper.placeTorch(playerIn.getHeldItem(hand), playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -131,20 +115,4 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI
|
|||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/nullChainsaw";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
|
||||
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ public class ItemDiamondChainsaw extends ItemChainsaw {
|
|||
this.cost = 250;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item,
|
||||
|
@ -33,18 +32,10 @@ public class ItemDiamondChainsaw extends ItemChainsaw {
|
|||
itemList.add(uncharged);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(IBlockState blockIn) {
|
||||
return Items.DIAMOND_AXE.canHarvestBlock(blockIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/diamondChainsaw";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,13 +38,4 @@ public class ItemDiamondDrill extends ItemDrill {
|
|||
return Items.DIAMOND_PICKAXE.canHarvestBlock(state) || Items.DIAMOND_SHOVEL.canHarvestBlock(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/diamondDrill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,14 +31,4 @@ public class ItemDiamondJackhammer extends ItemJackhammer {
|
|||
itemList.add(uncharged);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/diamondJackhammer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,37 +1,22 @@
|
|||
package techreborn.items.tools;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.IHandHeld;
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
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.Enchantments;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
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.PowerSystem;
|
||||
import reborncore.common.powerSystem.PoweredItem;
|
||||
import reborncore.common.util.TorchHelper;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem, IHandHeld {
|
||||
public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo {
|
||||
|
||||
public static int tier = 1;
|
||||
public int maxCharge = 1;
|
||||
|
@ -44,9 +29,7 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured
|
|||
this.efficiencyOnProperMaterial = efficiencyOnProperMaterial;
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(240);
|
||||
setUnlocalizedName(unlocalizedName);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
this.maxCharge = energyCapacity;
|
||||
this.tier = tier;
|
||||
this.unpoweredSpeed = unpoweredSpeed;
|
||||
|
@ -61,7 +44,7 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured
|
|||
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos,
|
||||
EntityLivingBase entityLiving) {
|
||||
Random rand = new Random();
|
||||
if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.getEnchantmentByID(34), stack) + 1) == 0) {
|
||||
if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack) + 1) == 0) {
|
||||
PoweredItem.useEnergy(cost, stack);
|
||||
}
|
||||
return true;
|
||||
|
@ -86,12 +69,6 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos,
|
||||
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
return TorchHelper.placeTorch(playerIn.getHeldItem(hand), playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
|
@ -133,21 +110,4 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured
|
|||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/nullDrill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player,
|
||||
int useRemaining) {
|
||||
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,14 @@
|
|||
package techreborn.items.tools;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.IHandHeld;
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
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.Enchantments;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
@ -24,15 +17,13 @@ import reborncore.RebornCore;
|
|||
import reborncore.api.power.IEnergyItemInfo;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.powerSystem.PoweredItem;
|
||||
import reborncore.common.util.TorchHelper;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.utils.OreDictUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem, IHandHeld {
|
||||
public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo {
|
||||
|
||||
public static int tier = 1;
|
||||
public int maxCharge = 1;
|
||||
|
@ -46,7 +37,6 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex
|
|||
setMaxStackSize(1);
|
||||
setMaxDamage(240);
|
||||
setUnlocalizedName(unlocalizedName);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
this.maxCharge = energyCapacity;
|
||||
this.tier = tier;
|
||||
}
|
||||
|
@ -60,7 +50,7 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex
|
|||
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos,
|
||||
EntityLivingBase entityLiving) {
|
||||
Random rand = new Random();
|
||||
if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.getEnchantmentByID(34), stack) + 1) == 0) {
|
||||
if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack) + 1) == 0) {
|
||||
PoweredItem.useEnergy(cost, stack);
|
||||
}
|
||||
return true;
|
||||
|
@ -86,12 +76,6 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos,
|
||||
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
return TorchHelper.placeTorch(playerIn.getHeldItem(hand), playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
|
@ -147,20 +131,4 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex
|
|||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/nullJackhammer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
|
||||
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,14 +37,4 @@ public class ItemSteelChainsaw extends ItemChainsaw {
|
|||
public boolean canHarvestBlock(IBlockState state) {
|
||||
return Items.IRON_AXE.canHarvestBlock(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/steelChainsaw";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,14 +37,4 @@ public class ItemSteelDrill extends ItemDrill {
|
|||
public boolean canHarvestBlock(IBlockState state) {
|
||||
return Items.IRON_PICKAXE.canHarvestBlock(state) || Items.IRON_SHOVEL.canHarvestBlock(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/steelDrill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,14 +31,4 @@ public class ItemSteelJackhammer extends ItemJackhammer {
|
|||
itemList.add(uncharged);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName(int damage) {
|
||||
return "techreborn:items/tool/steelJackhammer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMeta() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/frequency_transmitter"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"predicate": {
|
||||
"techreborn:coords": 1
|
||||
},
|
||||
"model": "techreborn:item/frequencytransmittercoords"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/frequency_transmitter_coords"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/advanced_chainsaw"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"predicate": {
|
||||
"techreborn:animated": 1
|
||||
},
|
||||
"model": "techreborn:item/tool/override/advanced_chainsaw_animated"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/advanced_drill"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/advanced_jackhammer"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/diamond_chainsaw"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"predicate": {
|
||||
"techreborn:animated": 1
|
||||
},
|
||||
"model": "techreborn:item/tool/override/diamond_chainsaw_animated"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/diamond_drill"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/diamond_jackhammer"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/advanced_chainsaw_animated"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/diamond_chainsaw_animated"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/steel_chainsaw_animated"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/steel_chainsaw"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"predicate": {
|
||||
"techreborn:animated": 1
|
||||
},
|
||||
"model": "techreborn:item/tool/override/steel_chainsaw_animated"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/steel_drill"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/tool/steel_jackhammer"
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 614 B After Width: | Height: | Size: 614 B |
After Width: | Height: | Size: 728 B |
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"animation":{
|
||||
"frametime":2
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 574 B |
Before Width: | Height: | Size: 632 B After Width: | Height: | Size: 632 B |
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 621 B |
After Width: | Height: | Size: 718 B |
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"animation":{
|
||||
"frametime":2
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 585 B |
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 585 B |
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 494 B |
After Width: | Height: | Size: 540 B |
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 625 B |
After Width: | Height: | Size: 735 B |
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"animation":{
|
||||
"frametime":2
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 581 B After Width: | Height: | Size: 581 B |
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |