Java Code Examples for net.minecraft.item.Item.ToolMaterial

The following are Jave code examples for showing how to use ToolMaterial of the net.minecraft.item.Item class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: statclock   File: ToolRefinedSword.java   Source Code and License Vote up 5 votes
public ToolRefinedSword(String name, Item.ToolMaterial material) {
    super(material);
    setUnlocalizedName(name);
    setCreativeTab(Statclock.TabStatclock);
    //setMaxDamage(100);
    GameRegistry.register(this, new ResourceLocation(References.MODID, "refined_sword"));
}
 
Example 2
Project: customstuff4   File: WrappedToolMaterialImpl.java   Source Code and License Vote up 5 votes
@Override
public Item.ToolMaterial getToolMaterial()
{
    return Arrays.stream(Item.ToolMaterial.values())
                 .filter(mat -> mat.name().equalsIgnoreCase(material))
                 .findFirst().orElse(null);

}
 
Example 3
Project: CompositeGear   File: ItemsCG.java   Source Code and License Vote up 5 votes
public static void load()
{
	Item.ToolMaterial compositeToolMaterial = EnumHelper.addToolMaterial("CG_COMPOSITE", 2, 1800, 6.0F, 2.0F, 13);
	Item.ToolMaterial compositeDaggerMaterial = EnumHelper.addToolMaterial("CG_COMPOSITE_DAGGER", 2, 600, 6.0F, 0.0F, 15);
	
	// TODO: Solve this garbage with materials.

	ItemArmor.ArmorMaterial accessoryArmorMaterial = EnumHelper.addArmorMaterial("CG_ACCESSORY", null, 100, new int[] { 1, 2, 2, 1 }, 15, null, 0);
	ItemArmor.ArmorMaterial compositeMaskArmorMaterial = EnumHelper.addArmorMaterial("CG_MASK_COMPOSITE", null, 50, new int[] { 3, 9, 6, 3 }, 12, null, 0);
	ItemArmor.ArmorMaterial compositeArmorMaterial = EnumHelper.addArmorMaterial("CG_COMPOSITE", null, 50, new int[] { 3, 9, 6, 3 }, 12, null, 0);

	// Armor
	compositeHelmet = new ItemCompositeArmor("composite_helmet", compositeArmorMaterial, COMPOSITE_NAME, 0, EntityEquipmentSlot.HEAD).setDefaultColor(8815987).setRarity(EnumRarity.UNCOMMON);
	compositeChestplate = new ItemCompositeArmor("composite_chestplate", compositeArmorMaterial, COMPOSITE_NAME , 0, EntityEquipmentSlot.CHEST).setDefaultColor(8815987).setRarity(EnumRarity.UNCOMMON);
	compositeLeggings = new ItemCompositeArmor("composite_leggings", compositeArmorMaterial, COMPOSITE_NAME, 0, EntityEquipmentSlot.LEGS).setDefaultColor(8815987).setRarity(EnumRarity.UNCOMMON);
	compositeBoots = new ItemCompositeArmor("composite_boots", compositeArmorMaterial, COMPOSITE_NAME, 0, EntityEquipmentSlot.FEET).setDefaultColor(8815987).setRarity(EnumRarity.UNCOMMON);

	// Respirators
	respiratorHalfMask = new ItemCGArmor("respirator_halfmask", accessoryArmorMaterial, "respirator_halfmask", 0, EntityEquipmentSlot.HEAD)
			.setItemClass(EnumItemClass.ACCESSORY_ARMOR).setAirMask(true).setMinAir(80);

	respiratorMask = new ItemCGArmor("respirator_mask", accessoryArmorMaterial, "respirator_mask", 0, EntityEquipmentSlot.HEAD)
			.setItemClass(EnumItemClass.ACCESSORY_ARMOR).setAirMask(true).setMinAir(20).setMaxDamage(150);
	
	respiratorMaskComposite = new ItemCGArmor("respirator_mask_composite", compositeMaskArmorMaterial, "respirator_mask_composite", 0, EntityEquipmentSlot.HEAD)
			.setItemClass(EnumItemClass.LIGHT_ARMOR).setAirMask(true).setMinAir(20).setRarity(EnumRarity.UNCOMMON).setMaxDamage(200);
	
	// Decorative
	ushankaHat = new ItemCompositeArmor("ushanka_hat", accessoryArmorMaterial, "ushanka_hat", 0, EntityEquipmentSlot.HEAD).setDefaultColor(8487297)
			.setItemClass(EnumItemClass.ACCESSORY_ARMOR).setHasDescription(true).setMaxDamage(300);
	
	balaclavaMask = new ItemCompositeArmor("balaclava_mask", accessoryArmorMaterial, "balaclava_mask", 0, EntityEquipmentSlot.HEAD).setDefaultColor(8487297)
			.setItemClass(EnumItemClass.ACCESSORY_ARMOR).setHasDescription(true);
	
	shemaghMask = new ItemCompositeArmor("shemagh_mask", accessoryArmorMaterial, "shemagh_mask", 0, EntityEquipmentSlot.HEAD).setDefaultColor(8487297)
			.setHasOverlayIcon(true).setItemClass(EnumItemClass.ACCESSORY_ARMOR).setHasDescription(true);

	// Weapons
	compositeSword = new ItemCGSword("composite_sword", compositeToolMaterial);
	compositeDagger = new ItemCGSword("composite_dagger", compositeDaggerMaterial);
	compositeBow = new ItemCGBow("composite_bow", 2000, 15);

	if (CompositeGear.proxy.isClient()) {
		registerMultiItem(compositeSword, "composite_sword", "items/tool/generic");
		registerMultiItem(compositeDagger, "composite_dagger", "items/tool/generic");
		registerItemModel(compositeBow, "tool/composite_bow");
	}
}
 
Example 4
Project: MagicWinds   File: ToolTestSword.java   Source Code and License Vote up 4 votes
public ToolTestSword(String name, Item.ToolMaterial material, CreativeTabs tab) {
    super(name, material, tab);
}
 
Example 5
Project: customstuff4   File: WrappedToolMaterial.java   Source Code and License Vote up 4 votes
static WrappedToolMaterial of(Item.ToolMaterial material)
{
    return () -> material;
}
 
Example 6
Project: BetterBeginningsReborn   File: ItemHammer.java   Source Code and License Vote up 4 votes
protected ItemHammer(Item.ToolMaterial material)
{
    super(2.0F, -3.1F, material, breakableBlocks);
    setHarvestLevel("pickaxe", 1);
}
 
Example 7
Project: customstuff4   File: WrappedToolMaterial.java   Source Code and License Vote up 2 votes
/**
 * Gets the material. Returns null if the material does not exist.
 */
Item.ToolMaterial getToolMaterial();