mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Merge branch '1.10' into 1.11
* 1.10: Allow axe specific enchantments on axe
This commit is contained in:
commit
4fe8a2bfec
1 file changed
+17
-12
@@ -1,34 +1,39 @@
|
||||
package mekanism.tools.item;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mekanism.api.util.StackUtils;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.tools.common.MekanismTools;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
public class ItemMekanismAxe extends ItemMekanismTool
|
||||
public class ItemMekanismAxe extends ItemAxe
|
||||
{
|
||||
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.PLANKS, Blocks.BOOKSHELF, Blocks.LOG, Blocks.LOG2, Blocks.CHEST, Blocks.PUMPKIN, Blocks.LIT_PUMPKIN, Blocks.MELON_BLOCK, Blocks.LADDER, Blocks.WOODEN_BUTTON, Blocks.WOODEN_PRESSURE_PLATE});
|
||||
|
||||
public ItemMekanismAxe(ToolMaterial tool)
|
||||
{
|
||||
super(MekanismTools.AXE_DAMAGE.get(tool), MekanismTools.AXE_SPEED.get(tool), tool, EFFECTIVE_ON);
|
||||
super(tool, MekanismTools.AXE_DAMAGE.get(tool), MekanismTools.AXE_SPEED.get(tool));
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack itemstack, IBlockState blockState)
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer playerIn, List<String> list, boolean advanced)
|
||||
{
|
||||
if(blockState != null && blockState.getBlock() != null && blockState.getMaterial() == Material.WOOD)
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
else {
|
||||
return super.getStrVsBlock(itemstack, blockState);
|
||||
}
|
||||
list.add(LangUtils.localize("tooltip.hp") + ": " + (itemstack.getMaxDamage() - itemstack.getItemDamage()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
|
||||
{
|
||||
return StackUtils.equalsWildcard(ItemMekanismTool.getRepairStack(toolMaterial), repair) || super.getIsRepairable(toRepair, repair);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user