ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java

42 lines
1.7 KiB
Java
Raw Normal View History

2016-03-19 11:36:17 +01:00
package de.ellpeck.actuallyadditions.mod.items;
2019-05-02 09:08:15 +02:00
import java.util.Collections;
import java.util.Set;
2016-03-19 11:36:17 +01:00
import com.google.common.collect.Sets;
2019-05-02 09:08:15 +02:00
2016-03-19 11:36:17 +01:00
import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
2019-05-02 09:08:15 +02:00
import net.minecraftforge.common.IRarity;
2019-05-02 09:10:29 +02:00
public class ItemAxeAA extends ItemToolAA {
2016-03-19 11:36:17 +01:00
2016-04-20 21:39:03 +02:00
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(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);
2016-03-19 11:36:17 +01:00
2019-05-02 09:10:29 +02:00
public ItemAxeAA(Item.ToolMaterial material, String repairItem, String unlocalizedName, IRarity rarity) {
2016-03-19 11:36:17 +01:00
super(6.0F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON);
this.setHarvestLevel("axe", material.getHarvestLevel());
2016-03-19 11:36:17 +01:00
}
2019-05-02 09:10:29 +02:00
public ItemAxeAA(Item.ToolMaterial material, ItemStack repairItem, String unlocalizedName, IRarity rarity) {
2016-03-19 11:36:17 +01:00
super(6.0F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON);
this.setHarvestLevel("axe", material.getHarvestLevel());
2016-03-19 11:36:17 +01:00
}
2016-05-02 17:09:23 +02:00
@Override
2019-05-02 09:10:29 +02:00
public float getDestroySpeed(ItemStack stack, IBlockState state) {
2016-03-19 11:36:17 +01:00
Material material = state.getMaterial();
2017-11-16 00:11:17 +01:00
return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getDestroySpeed(stack, state) : this.efficiency;
2016-03-19 11:36:17 +01:00
}
@Override
2019-05-02 09:10:29 +02:00
public Set<String> getToolClasses(ItemStack stack) {
return Collections.singleton("axe");
}
2016-03-19 11:36:17 +01:00
}