Override getToolClasses() in tools so that they work with basically every mod that needs it to work.

Duh.
This commit is contained in:
Ellpeck 2016-07-17 13:34:38 +02:00
parent edf870403f
commit 8b0a5eb799
3 changed files with 18 additions and 0 deletions

View file

@ -20,6 +20,7 @@ import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import java.util.Collections;
import java.util.Set;
public class ItemAxeAA extends ItemToolAA{
@ -39,4 +40,9 @@ public class ItemAxeAA extends ItemToolAA{
Material material = state.getMaterial();
return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
@Override
public Set<String> getToolClasses(ItemStack stack){
return Collections.singleton("axe");
}
}

View file

@ -20,6 +20,7 @@ import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import java.util.Collections;
import java.util.Set;
public class ItemPickaxeAA extends ItemToolAA{
@ -80,4 +81,9 @@ public class ItemPickaxeAA extends ItemToolAA{
Material material = state.getMaterial();
return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
@Override
public Set<String> getToolClasses(ItemStack stack){
return Collections.singleton("pickaxe");
}
}

View file

@ -26,6 +26,7 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import java.util.Collections;
import java.util.Set;
public class ItemShovelAA extends ItemToolAA{
@ -51,4 +52,9 @@ public class ItemShovelAA extends ItemToolAA{
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
return Items.IRON_SHOVEL.onItemUse(stack, playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ);
}
@Override
public Set<String> getToolClasses(ItemStack stack){
return Collections.singleton("shovel");
}
}