Java Code Examples for net.minecraft.item.Item#ToolMaterial
The following examples show how to use
net.minecraft.item.Item#ToolMaterial .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Sakura_mod File: ItemKotachi.java License: MIT License | 5 votes |
public ItemKotachi(Item.ToolMaterial material, String name) { this.material = material; this.maxStackSize = 1; this.setMaxDamage((int) (material.getMaxUses()*0.75f)); this.setUnlocalizedName(SakuraMain.MODID + "." + name); this.attackDamage = material.getAttackDamage(); this.addPropertyOverride(new ResourceLocation("blocking"), new IItemPropertyGetter() { @SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { return entityIn != null && entityIn.isHandActive() && entityIn.getActiveItemStack() == stack ? 1.0F : 0.0F; } }); }
Example 2
Source Project: Sakura_mod File: ItemKatana.java License: MIT License | 5 votes |
public ItemKatana(Item.ToolMaterial material, String name) { this.material = material; this.maxStackSize = 1; this.setMaxDamage(material.getMaxUses()); this.setUnlocalizedName(SakuraMain.MODID + "." + name); this.attackDamage = 3.0F + material.getAttackDamage(); this.addPropertyOverride(new ResourceLocation("blocking"), new IItemPropertyGetter() { @SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { return entityIn != null && entityIn.isHandActive() && entityIn.getActiveItemStack() == stack ? 1.0F : 0.0F; } }); }
Example 3
Source Project: customstuff4 File: WrappedToolMaterialImpl.java License: GNU General Public License v3.0 | 5 votes |
@Override public Item.ToolMaterial getToolMaterial() { return Arrays.stream(Item.ToolMaterial.values()) .filter(mat -> mat.name().equalsIgnoreCase(material)) .findFirst().orElse(null); }
Example 4
Source Project: TofuCraftReload File: ItemPickaxeBasic.java License: MIT License | 4 votes |
public ItemPickaxeBasic(Item.ToolMaterial material, String name) { super(material); this.setUnlocalizedName(TofuMain.MODID+"."+name); }
Example 5
Source Project: TofuCraftReload File: ItemShovelBasic.java License: MIT License | 4 votes |
public ItemShovelBasic(Item.ToolMaterial material, String name) { super(material); this.setUnlocalizedName(TofuMain.MODID + "." + name); }
Example 6
Source Project: TofuCraftReload File: ItemAxeBasic.java License: MIT License | 4 votes |
public ItemAxeBasic(Item.ToolMaterial material, float damage, float speed, String name) { super(material, damage, speed); this.setUnlocalizedName(TofuMain.MODID + "." + name); }
Example 7
Source Project: customstuff4 File: WrappedToolMaterial.java License: GNU General Public License v3.0 | 4 votes |
static WrappedToolMaterial of(Item.ToolMaterial material) { return () -> material; }
Example 8
Source Project: Electro-Magic-Tools File: ItemVanillaOmnitool.java License: GNU General Public License v3.0 | 4 votes |
public ItemVanillaOmnitool(Item.ToolMaterial material, int maxDamage, String textureName, Item repairMaterial) { super(material, maxDamage, textureName); this.repairMaterial = repairMaterial; this.repairMeta = 0; damageAdded = 4; }
Example 9
Source Project: Electro-Magic-Tools File: ItemVanillaOmnitool.java License: GNU General Public License v3.0 | 4 votes |
public ItemVanillaOmnitool(Item.ToolMaterial material, int maxDamage, String textureName, Item repairMaterial, float damageAdded) { super(material, maxDamage, textureName); this.repairMaterial = repairMaterial; this.repairMeta = 0; this.damageAdded = damageAdded; }
Example 10
Source Project: Electro-Magic-Tools File: ItemVanillaOmnitool.java License: GNU General Public License v3.0 | 4 votes |
public ItemVanillaOmnitool(Item.ToolMaterial material, int maxDamage, String textureName, Item repairMaterial, int repairMeta) { super(material, maxDamage, textureName); this.repairMaterial = repairMaterial; this.repairMeta = repairMeta; damageAdded = 4; }
Example 11
Source Project: Electro-Magic-Tools File: ItemVanillaOmnitool.java License: GNU General Public License v3.0 | 4 votes |
public ItemVanillaOmnitool(Item.ToolMaterial material, int maxDamage, String textureName, Item repairMaterial, int repairMeta, float damageAdded) { super(material, maxDamage, textureName); this.repairMaterial = repairMaterial; this.repairMeta = repairMeta; this.damageAdded = damageAdded; }
Example 12
Source Project: customstuff4 File: WrappedToolMaterial.java License: GNU General Public License v3.0 | 2 votes |
/** * Gets the material. Returns null if the material does not exist. */ Item.ToolMaterial getToolMaterial();