Improve energy bars on items
This commit is contained in:
parent
467544ebfe
commit
226c0bc619
30 changed files with 431 additions and 152 deletions
|
@ -1,8 +1,16 @@
|
|||
package techreborn.items.tools;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.common.powerSystem.PoweredItem;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemAdvancedDrill extends ItemDrill {
|
||||
|
||||
|
@ -12,6 +20,19 @@ public class ItemAdvancedDrill extends ItemDrill {
|
|||
this.cost = 250;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item,
|
||||
CreativeTabs par2CreativeTabs, NonNullList itemList) {
|
||||
ItemStack stack = new ItemStack(ModItems.advancedDrill);
|
||||
ItemStack uncharged = stack.copy();
|
||||
ItemStack charged = stack.copy();
|
||||
PoweredItem.setEnergy(getMaxPower(charged), charged);
|
||||
|
||||
itemList.add(uncharged);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(IBlockState blockIn) {
|
||||
return Items.DIAMOND_PICKAXE.canHarvestBlock(blockIn) || Items.DIAMOND_SHOVEL.canHarvestBlock(blockIn);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue