Advertisement
SavageKiller13

Axe Class

Mar 20th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.79 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.Savage_Killer13.SavagesMilitary.tools;
  7.  
  8. import com.Savage_Killer13.SavagesMilitary.Main;
  9. import com.Savage_Killer13.SavagesMilitary.init.ModItems;
  10. import com.Savage_Killer13.SavagesMilitary.util.IHasModel;
  11. import com.google.common.collect.Sets;
  12. import java.util.Set;
  13. import net.minecraft.block.Block;
  14. import net.minecraft.block.material.Material;
  15. import net.minecraft.block.state.IBlockState;
  16. import net.minecraft.creativetab.CreativeTabs;
  17. import net.minecraft.init.Blocks;
  18. import net.minecraft.item.ItemStack;
  19. import net.minecraft.item.ItemTool;
  20.  
  21. /**
  22.  *
  23.  * @author Soren Mortimer
  24.  */
  25. public class ToolAxe extends ItemTool implements IHasModel {
  26.    
  27.     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);
  28.    
  29.  
  30.     public ToolAxe(String name, ToolMaterial material){
  31.         super(material, EFFECTIVE_ON);
  32.         setUnlocalizedName(name);
  33.         setRegistryName(name);
  34.  
  35.         setCreativeTab(CreativeTabs.TOOLS);
  36.         ModItems.ITEMS.add(this);
  37.     }
  38.  
  39.  
  40.  
  41.     public float getStrVsBlock(ItemStack stack, IBlockState state) {
  42.         Material material = state.getMaterial();
  43.         return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
  44.     }
  45.  
  46.  
  47.  
  48.     @Override
  49.     public void registerModels() {
  50.     Main.proxy.registerItemRenderer(this, 0, "inventory");
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement