This commit is contained in:
modmuss50 2016-02-28 17:00:38 +00:00
commit 3ad3453499
23 changed files with 275 additions and 599 deletions

View file

@ -2,20 +2,34 @@
TechReborn is a resurrection of GregTech 2.78 for modern Minecraft. It brings most of GT4's features and behaviors to Minecraft, with lots of tweaks, and a few editions. It also aims to be more compatible with other mods than GregTech, and has the ultimate goal of becoming a standalone mod, compatible with but not dependent on IC2.
TechReborn is currently in a beta state.
TechReborn is currently in a beta state. Crashes or bugs may happen at any time, so *please* do not use this on a world that is important to you, or at the very least back it up on every update.
We have permission to use Greg's textures, see here :https://i.imgur.com/YQEMrq5.png?1
We have permission to use Greg's textures (see [here](https://i.imgur.com/YQEMrq5.png?1)).
The current main maintainer is @gigabit101 if you need any help please contact us.
The current main maintainer is [@gigabit101](https://github.com/gigabit101/) if you need any help please contact us (see 'Contact' section below).
@modmuss50 is a past maintainer of the mod(see http://techreborn.ninja/?p=20).
[@modmuss50](https://github.com/modmuss50/) is a past maintainer of the mod (see [here](http://techreborn.ninja/?p=20)).
1.7.10:
# Reccommended Builds:
[![Build Status](http://modmuss50.me:8080/job/TechReborn-1.7.10/badge/icon)](http://modmuss50.me:8080/job/TechReborn-1.7.10/)
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.
# Jenkins Builds:
Jenkins builds of TechReborn are compiled directly from this repository. Please remember to backup your worlds before using a jenkins build of TechReborn.
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.*
[![Build Status](http://modmuss50.me:8080/job/TechReborn-1.8.9/badge/icon)](http://modmuss50.me:8080/job/TechReborn-1.8.9/)
REMOVED ALL THE JUNK FROM OTHER VERSION 2.78 ONLY
1.7.10:
---
*Please understand that the 1.7.10 version of TechReborn is not being maintained. We've moved onto TechReborn for Minecraft 1.8.9. If there is an extremely critical bug that you find in the 1.7.10 version, report it to the bug tracker and we will determine if it is drastic enough for a fix.*
[![Build Status](http://modmuss50.me:8080/job/TechReborn-1.7.10/badge/icon)](http://modmuss50.me:8080/job/TechReborn-1.7.10/)
REMOVED ALL THE JUNK FROM OTHER VERSION 2.78 ONLY

View file

@ -11,8 +11,20 @@ Added:
-Diamond drill
-Scrap
-Iron fences
-Iron fence gates
-RF power tooltips
-Copper and Tin Worldgen
-Iron Hammer
-Basic plate recipes
-Solar panel
-Lava and water cells
-Tech Manual
-Wind and Water mills
-Iron chainsaw
-Diamond chainsaw
-Advanced chainsaw
-Wrench (do you even wrench bro?)
-New Power network
-Cables
Changes:
-Updated JEI compatibility
@ -21,7 +33,8 @@ Changes:
-Rubber saplings now spawn in loot chests
-Copper ingots now spawn in loot chests
-Tin ingots now spawn in loot chests
-Optimized imports
Fixes:
-Fixed Config localization issues
-Fixed Config localization issues
-Drill tier and charge configs actually work
-JEI alloy smelter plugin not showing stack amount

View file

@ -53,6 +53,8 @@ public class BlockSolarPanel extends BaseTileBlock implements ITexturedBlock {
boolean isActive = state.getValue(ACTIVE);
if(side == EnumFacing.UP){
return prefix + "solar_panel_top_" + (isActive ? "on" : "off");
} else if(side==EnumFacing.DOWN){
return prefix + "machine_bottom";
}
return prefix + "solar_panel_side_" + (isActive ? "on" : "off");
}

View file

@ -136,14 +136,14 @@ public class ModItems {
treeTap = new ItemTreeTap();
GameRegistry.registerItem(treeTap, "treetap");
ironDrill = PoweredItem.createItem(ItemDrill.class);
ironDrill = PoweredItem.createItem(ItemIronDrill.class);
GameRegistry.registerItem(ironDrill, "irondrill");
diamondDrill = PoweredItem.createItem(ItemDiamondDrill.class);
GameRegistry.registerItem(diamondDrill, "diamonddrill");
advancedDrill = PoweredItem.createItem(ItemAdvancedDrill.class);
GameRegistry.registerItem(advancedDrill, "advanceddrill");
ironChainsaw = PoweredItem.createItem(ItemChainsaw.class);
ironChainsaw = PoweredItem.createItem(ItemIronChainsaw.class);
GameRegistry.registerItem(ironChainsaw, "ironchainsaw");
diamondChainsaw = PoweredItem.createItem(ItemDiamondChainsaw.class);
GameRegistry.registerItem(diamondChainsaw, "diamondchainsaw");

View file

@ -1,50 +1,14 @@
package techreborn.items.tools;
import java.util.List;
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.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
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.config.ConfigTechReborn;
public class ItemAdvancedChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedItem {
public int maxCharge = ConfigTechReborn.AdvancedChainsawCharge;
public int cost = 250;
public static final int tier = ConfigTechReborn.AdvancedChainsawTier;
public double transferLimit = 100;
public class ItemAdvancedChainsaw extends ItemChainsaw {
public ItemAdvancedChainsaw() {
super(ToolMaterial.EMERALD);
efficiencyOnProperMaterial = 20F;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName("techreborn.advancedChainsaw");
RebornCore.jsonDestroyer.registerObject(this);
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) {
PoweredItem.useEnergy(cost, stack);
return true;
super(ToolMaterial.EMERALD, "techreborn.advancedChainsaw", ConfigTechReborn.AdvancedChainsawCharge, ConfigTechReborn.AdvancedDrillTier, 4.0F);
}
@Override
@ -52,85 +16,6 @@ public class ItemAdvancedChainsaw extends ItemAxe implements IEnergyItemInfo, IT
return Items.diamond_axe.canHarvestBlock(block, stack);
}
@Override
public float getDigSpeed(ItemStack stack, IBlockState state) {
if(!PoweredItem.canUseEnergy(cost, stack)){
return 4.0F;
}
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) {
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) {
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/advancedChainsaw";

View file

@ -1,50 +1,14 @@
package techreborn.items.tools;
import java.util.List;
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.entity.EntityLivingBase;
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.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.config.ConfigTechReborn;
public class ItemAdvancedDrill extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem {
public int maxCharge = ConfigTechReborn.AdvancedDrillCharge;
public int cost = 250;
public static final int tier = ConfigTechReborn.AdvancedDrillTier;
public double transferLimit = 100;
public class ItemAdvancedDrill extends ItemDrill {
public ItemAdvancedDrill() {
super(ToolMaterial.EMERALD);
efficiencyOnProperMaterial = 20F;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName("techreborn.advancedDrill");
RebornCore.jsonDestroyer.registerObject(this);
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) {
PoweredItem.useEnergy(cost, stack);
return true;
super(ToolMaterial.EMERALD, "techreborn.advancedDrill", ConfigTechReborn.AdvancedDrillCharge, ConfigTechReborn.AdvancedDrillTier, 4.0F);
}
@Override
@ -52,85 +16,6 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IEnergyItemInfo, I
return Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack);
}
@Override
public float getDigSpeed(ItemStack stack, IBlockState state) {
if(!PoweredItem.canUseEnergy(cost, stack)){
return 4.0F;
}
if (Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F) {
return efficiencyOnProperMaterial;
} else {
return super.getDigSpeed(stack, state);
}
}
@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) {
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/advancedDrill";

View file

@ -1,15 +1,19 @@
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.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
@ -22,40 +26,45 @@ import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.util.TorchHelper;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import techreborn.utils.OreDictUtils;
public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedItem {
public int maxCharge = ConfigTechReborn.IronChainsawCharge;
public int maxCharge = 1;
public int cost = 250;
public static final int tier = ConfigTechReborn.IronChainsawTier;
public float unpoweredSpeed = 2.0F;
public static int tier = 1;
public double transferLimit = 100;
public ItemChainsaw() {
super(ToolMaterial.IRON);
public ItemChainsaw(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier, float unpoweredSpeed) {
super(material);
efficiencyOnProperMaterial = 20F;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName("techreborn.ironChainsaw");
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) {
PoweredItem.useEnergy(cost, stack);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.iron_axe.canHarvestBlock(block, stack);
}
@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 float getDigSpeed(ItemStack stack, IBlockState state) {
if(OreDictUtils.isOre(state, "treeLeaves")&&PoweredItem.canUseEnergy(cost, stack)){
return 40F;
}
if(!PoweredItem.canUseEnergy(cost, stack)){
return 2.0F;
return unpoweredSpeed;
}
if (Items.wooden_axe.getDigSpeed(stack, state) > 1.0F) {
return efficiencyOnProperMaterial;
@ -64,10 +73,9 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
return true;
return true;
}
@ -133,7 +141,7 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/ironChainsaw";
return "techreborn:items/tool/nullChainsaw";
}
@Override

View file

@ -1,50 +1,14 @@
package techreborn.items.tools;
import java.util.List;
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.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
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.config.ConfigTechReborn;
public class ItemDiamondChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedItem {
public int maxCharge = ConfigTechReborn.DiamondChainsawCharge;
public int cost = 250;
public static final int tier = ConfigTechReborn.DiamondChainsawTier;
public double transferLimit = 100;
public class ItemDiamondChainsaw extends ItemChainsaw {
public ItemDiamondChainsaw() {
super(ToolMaterial.EMERALD);
efficiencyOnProperMaterial = 20F;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName("techreborn.diamondChainsaw");
RebornCore.jsonDestroyer.registerObject(this);
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) {
PoweredItem.useEnergy(cost, stack);
return true;
super(ToolMaterial.EMERALD, "techreborn.diamondChainsaw", ConfigTechReborn.DiamondChainsawCharge, ConfigTechReborn.DiamondChainsawTier, 2.5F);
}
@Override
@ -52,85 +16,6 @@ public class ItemDiamondChainsaw extends ItemAxe implements IEnergyItemInfo, ITe
return Items.diamond_axe.canHarvestBlock(block, stack);
}
@Override
public float getDigSpeed(ItemStack stack, IBlockState state) {
if(!PoweredItem.canUseEnergy(cost, stack)){
return 2.5F;
}
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) {
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) {
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/diamondChainsaw";

View file

@ -1,50 +1,14 @@
package techreborn.items.tools;
import java.util.List;
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.entity.EntityLivingBase;
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.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.config.ConfigTechReborn;
public class ItemDiamondDrill extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem {
public int maxCharge = ConfigTechReborn.DiamondDrillCharge;
public int cost = 250;
public static final int tier = ConfigTechReborn.DiamondDrillTier;
public double transferLimit = 100;
public class ItemDiamondDrill extends ItemDrill {
public ItemDiamondDrill() {
super(ToolMaterial.EMERALD);
efficiencyOnProperMaterial = 20F;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName("techreborn.diamondDrill");
RebornCore.jsonDestroyer.registerObject(this);
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) {
PoweredItem.useEnergy(cost, stack);
return true;
super(ToolMaterial.EMERALD, "techreborn.diamondDrill", ConfigTechReborn.DiamondDrillCharge, ConfigTechReborn.DiamondDrillTier, 2.5F);
}
@Override
@ -52,85 +16,6 @@ public class ItemDiamondDrill extends ItemPickaxe implements IEnergyItemInfo, IT
return Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack);
}
@Override
public float getDigSpeed(ItemStack stack, IBlockState state) {
if(!PoweredItem.canUseEnergy(cost, stack)){
return 2.5F;
}
if (Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F) {
return efficiencyOnProperMaterial;
} else {
return super.getDigSpeed(stack, state);
}
}
@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) {
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/diamondDrill";

View file

@ -1,11 +1,14 @@
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.Items;
@ -22,122 +25,119 @@ import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.util.TorchHelper;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem {
public int maxCharge = ConfigTechReborn.IronDrillCharge;
public int cost = 250;
public static final int tier = ConfigTechReborn.IronDrillTier;
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 ItemDrill() {
super(ToolMaterial.IRON);
efficiencyOnProperMaterial = 20F;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName("techreborn.ironDrill");
RebornCore.jsonDestroyer.registerObject(this);
}
public ItemDrill(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) {
PoweredItem.useEnergy(cost, stack);
return true;
}
@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) {
return Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack);
}
@Override
public float getDigSpeed(ItemStack stack, IBlockState state) {
if (!PoweredItem.canUseEnergy(cost, stack)) {
return unpoweredSpeed;
}
if (Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F || Items.wooden_shovel.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 2.0F;
}
if (Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F) {
return efficiencyOnProperMaterial;
} else {
return super.getDigSpeed(stack, state);
}
}
@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 hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
return true;
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public double getMaxPower(ItemStack stack) {
return maxCharge;
}
@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 canAcceptEnergy(ItemStack stack) {
return true;
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public boolean canProvideEnergy(ItemStack stack) {
return false;
}
@Override
public double getMaxTransfer(ItemStack stack) {
return transferLimit;
}
@Override
public double getMaxPower(ItemStack stack) {
return maxCharge;
}
@Override
public int getStackTeir(ItemStack stack) {
return tier;
}
@Override
public boolean canAcceptEnergy(ItemStack stack) {
return true;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
itemList.add(itemStack);
@Override
public boolean canProvideEnergy(ItemStack stack) {
return false;
}
ItemStack charged = new ItemStack(this, 1);
PoweredItem.setEnergy(getMaxPower(charged), charged);
itemList.add(charged);
}
@Override
public double getMaxTransfer(ItemStack stack) {
return transferLimit;
}
@Override
public double getDurabilityForDisplay(ItemStack stack) {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge;
@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);
@Override
public boolean showDurabilityBar(ItemStack stack) {
return true;
}
ItemStack charged = new ItemStack(this, 1);
PoweredItem.setEnergy(getMaxPower(charged), charged);
itemList.add(charged);
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/nullDrill";
}
@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 String getTextureName(int damage) {
return "techreborn:items/tool/ironDrill";
}
@Override
public int getMaxMeta() {
return 1;
}
@Override
public int getMaxMeta() {
return 1;
}
}

View file

@ -22,7 +22,7 @@ public class ItemHammer extends ItemTR implements ITexturedItem {
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {
world.playSoundAtEntity(player, "minecraft:random.anvil_land", 1F, 1F);
world.playSoundAtEntity(player, "techreborn:block_dismantle", 0.8F, 0.4F);
return true;
}

View file

@ -0,0 +1,28 @@
package techreborn.items.tools;
import net.minecraft.block.Block;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import techreborn.config.ConfigTechReborn;
public class ItemIronChainsaw extends ItemChainsaw {
public ItemIronChainsaw() {
super(ToolMaterial.IRON, "techreborn.ironChainsaw", ConfigTechReborn.IronChainsawCharge, ConfigTechReborn.IronChainsawTier, 2.0F);
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.iron_axe.canHarvestBlock(block, stack);
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/ironChainsaw";
}
@Override
public int getMaxMeta() {
return 1;
}
}

View file

@ -0,0 +1,28 @@
package techreborn.items.tools;
import net.minecraft.block.Block;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import techreborn.config.ConfigTechReborn;
public class ItemIronDrill extends ItemDrill {
public ItemIronDrill() {
super(ToolMaterial.IRON, "techreborn.ironDrill", ConfigTechReborn.IronDrillCharge, ConfigTechReborn.IronDrillTier, 2.0F);
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack);
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/ironDrill";
}
@Override
public int getMaxMeta() {
return 1;
}
}

View file

@ -1,6 +1,7 @@
package techreborn.items.tools;
import ic2.api.tile.IWrenchable;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@ -11,6 +12,7 @@ import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.items.ItemTR;
import techreborn.items.ItemTextureBase;
import java.util.Random;
@ -18,11 +20,12 @@ import java.util.Random;
/**
* Created by mark on 26/02/2016.
*/
public class ItemWrench extends ItemTextureBase {
public class ItemWrench extends ItemTR implements ITexturedItem {
public ItemWrench() {
setCreativeTab(TechRebornCreativeTabMisc.instance);
setUnlocalizedName("techreborn.wrench");
}

View file

@ -0,0 +1,40 @@
package techreborn.utils;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.oredict.OreDictionary;
public class OreDictUtils {
public static boolean isOre(Block block, String oreName) {
return isOre(new ItemStack(Item.getItemFromBlock(block)), oreName);
}
public static boolean isOre(IBlockState state, String oreName) {
return isOre(new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getBlock().getMetaFromState(state)), oreName);
}
public static boolean isOre(Item item, String oreName) {
return isOre(new ItemStack(item), oreName);
}
public static boolean isOre(ItemStack stack, String oreName) {
int id = OreDictionary.getOreID(oreName);
if (stack != null || stack.getItem() != null) {
int[] ids = OreDictionary.getOreIDs(stack);
for (int i : ids) {
if (id == i) {
return true;
}
}
}
return false;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B