當前位置: 首頁>>代碼示例>>Java>>正文


Java ToolMaterial類代碼示例

本文整理匯總了Java中net.minecraft.item.Item.ToolMaterial的典型用法代碼示例。如果您正苦於以下問題:Java ToolMaterial類的具體用法?Java ToolMaterial怎麽用?Java ToolMaterial使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ToolMaterial類屬於net.minecraft.item.Item包,在下文中一共展示了ToolMaterial類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: applyBackers

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public static void applyBackers(List<MaterialDefinition> definitions) {
    for (MaterialDefinition definition : definitions) {
        ToolMaterial toolMaterial = definition.getToolMaterial();
        ArmorMaterial armorMaterial = definition.getArmorMaterial();

        RandoresItemData itemData = definition.getData();

        RandoresItems.hoe.registerBacker(itemData, new ItemHoe(toolMaterial));
        RandoresItems.sword.registerBacker(itemData, new ItemSword(toolMaterial));
        RandoresItems.axe.registerBacker(itemData, new ConstructableAxe(toolMaterial, toolMaterial.getDamageVsEntity() + 5f, -3f));
        RandoresItems.shovel.registerBacker(itemData, new ItemSpade(toolMaterial));
        RandoresItems.pickaxe.registerBacker(itemData, new ConstructablePickaxe(toolMaterial));
        RandoresItems.battleaxe.registerBacker(itemData, new ConstructableAxe(toolMaterial, toolMaterial.getDamageVsEntity() + 8f, -3.5f));
        RandoresItems.helmet.registerBacker(itemData, armorMaterial);
        RandoresItems.chestplate.registerBacker(itemData, armorMaterial);
        RandoresItems.leggings.registerBacker(itemData, armorMaterial);
        RandoresItems.boots.registerBacker(itemData, armorMaterial);
    }
}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:20,代碼來源:MaterialDefinitionGenerator.java

示例2: enchantTool

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public static ItemStack enchantTool(ItemStack tool, ToolMaterial material) {
	Item itemTool = tool.getItem();
	if(itemTool instanceof TechnicalTool) {
		if(material == UraniumDioxide) {
			tool.addEnchantment(Technical.enchantmantRadioactivity, 1);
			tool.addEnchantment(Enchantment.unbreaking, 2);
		} else if(material == Barium)
			tool.addEnchantment(Enchantment.unbreaking, 3);
		else if(material == Chromium)
			tool.addEnchantment(Enchantment.unbreaking, 4);
		else if(material == Tungsten)
			tool.addEnchantment(Enchantment.unbreaking, 5);
		else if(material == Beryllium)
			tool.addEnchantment(Enchantment.unbreaking, 10);
	}
	return tool;
}
 
開發者ID:viddeno,項目名稱:Technical,代碼行數:18,代碼來源:TechnicalTools.java

示例3: ToolGroup

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public ToolGroup(ToolMaterial mat, float attackSpeed, Map<Integer, String> meta, String materialName, int hammerLvl) {
	items = new HashMap<>();
	this.hammerLvl = hammerLvl;
	this.materialName = materialName;
	items.put("pickaxe", new Pickaxe(mat));
	items.put("axe", new Axe(mat, attackSpeed));
	items.put("shovel", new Shovel(mat));
	items.put("hoe", new Hoe(mat));
	items.put("sword", new Sword(mat));
	if (meta != null) {
		Head head;
		items.put("head", head = new Head(meta));
		heads = items.entrySet().stream().filter(notHead).map(i -> {
			if (head.isValid(i.getKey()))
				return new EmptyEntry<>(i.getKey(), new ItemStack(head, 1, head.getMetadata(i.getKey())));
			else
				return new EmptyEntry<>(i.getKey(), ItemStack.EMPTY);
		}).filter(i -> !i.getValue().isEmpty()).collect(Collectors.toMap(i -> i.getKey(), i -> i.getValue()));
	}
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:21,代碼來源:ToolGroup.java

示例4: toolJelloShears

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public toolJelloShears(ToolMaterial material) {

		setUnlocalizedName(Reference.RTAPItems.TOOLJELLOSHEARS.getUnlocalizedName());
		setRegistryName(Reference.RTAPItems.TOOLJELLOSHEARS.getRegistryName());
		setCreativeTab(Reference.tabRTAP);
		setMaxDamage(237);

	}
 
開發者ID:Bedrockbreaker,項目名稱:rtap,代碼行數:9,代碼來源:toolJelloShears.java

示例5: toolRamenShears

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public toolRamenShears(ToolMaterial material) {

		setUnlocalizedName(Reference.RTAPItems.TOOLRAMENSHEARS.getUnlocalizedName());
		setRegistryName(Reference.RTAPItems.TOOLRAMENSHEARS.getRegistryName());
		setCreativeTab(Reference.tabRTAP);
		setMaxDamage(62);

	}
 
開發者ID:Bedrockbreaker,項目名稱:rtap,代碼行數:9,代碼來源:toolRamenShears.java

示例6: toolBolognaShears

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public toolBolognaShears(ToolMaterial material) {

		setUnlocalizedName(Reference.RTAPItems.TOOLBOLOGNASHEARS.getUnlocalizedName());
		setRegistryName(Reference.RTAPItems.TOOLBOLOGNASHEARS.getRegistryName());
		setCreativeTab(Reference.tabRTAP);
		setMaxDamage(-1);

	}
 
開發者ID:Bedrockbreaker,項目名稱:rtap,代碼行數:9,代碼來源:toolBolognaShears.java

示例7: toolCatHairShears

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public toolCatHairShears(ToolMaterial material) {

		setUnlocalizedName(Reference.RTAPItems.TOOLCATHAIRSHEARS.getUnlocalizedName());
		setRegistryName(Reference.RTAPItems.TOOLCATHAIRSHEARS.getRegistryName());
		setCreativeTab(Reference.tabRTAP);
		setMaxDamage(4);

	}
 
開發者ID:Bedrockbreaker,項目名稱:rtap,代碼行數:9,代碼來源:toolCatHairShears.java

示例8: ItemPrecisionAxe

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public ItemPrecisionAxe() {
	
	super(ToolMaterial.DIAMOND);
	setRegistryName("precision.axe");
	setUnlocalizedName(UniqueCrops.MOD_ID + ".precision.axe");
	setCreativeTab(UniqueCrops.TAB);
	GameRegistry.register(this);
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:9,代碼來源:ItemPrecisionAxe.java

示例9: ItemPrecisionShovel

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public ItemPrecisionShovel() {
	
	super(ToolMaterial.DIAMOND);
	setRegistryName("precision.shovel");
	setUnlocalizedName(UniqueCrops.MOD_ID + ".precision.shovel");
	setCreativeTab(UniqueCrops.TAB);
	GameRegistry.register(this);
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:9,代碼來源:ItemPrecisionShovel.java

示例10: ItemRod

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public ItemRod()
{
	super(1, ToolMaterial.EMERALD, new HashSet());
	maxStackSize = 1;
	this.setMaxDamage(32);
	setCreativeTab(RivalRebels.rralltab);
}
 
開發者ID:rodolphito,項目名稱:Rival-Rebels-Mod,代碼行數:8,代碼來源:ItemRod.java

示例11: SetTools

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public SetTools(String type, ToolMaterial material){
	this.Type=type;
	this.Material=material;
	this.Pick=new ItemBasicPick(material, type);
	this.Shovel=new ItemBasicShovel(material, type);
	this.Axe=new ItemBasicAxe(material, type);
	this.Sword=new ItemBasicSword(material, type);
	this.Hoe=new ItemBasicHoe(material, type);
	this.Shears=null;
}
 
開發者ID:EnderiumSmith,項目名稱:Nuclear-Foundation,代碼行數:11,代碼來源:SetTools.java

示例12: addMaterial

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public static void addMaterial(String type,ToolMaterial toolMat,ArmorMaterial armorMat,boolean shears){
	Ingot.Metal.add(type);
	Dust.Metal.add(type);
	Nugget.Metal.add(type);
	Gear.Metal.add(type);
	Plate.Metal.add(type);
	Rod.Metal.add(type);
	if(toolMat!=null&&Config.IsToolsEnabled){
		Tools.add(new SetTools(type, toolMat,true));
	}
	if(armorMat!=null&&Config.IsArmorEnebled){
		Armor.add(new SetArmor(type, armorMat));
	}
	Types.add(type);
}
 
開發者ID:EnderiumSmith,項目名稱:Nuclear-Foundation,代碼行數:16,代碼來源:ItemManager.java

示例13: PopulateMaterial

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
/**
 * Creates a tool material.
 */
public static void PopulateMaterial(OreStuff stuff)
{
		int harvest = stuff.OreBlock.getLightOpacity() / 3;
		harvest++;
		int durability = stuff.OreBlock.getBlockColor() * stuff.OreBlock.getLightOpacity();
		int efficiency = stuff.OreBlock.getBlockColor() / 3 + 10;
		int damage = stuff.OreBlock.getLightValue() - 2;
		
		ToolMaterial material = AutoItemAndBlock.CreateToolMaterial(stuff.BaseName, harvest, durability, efficiency, damage, 1);
		stuff.MetalMaterial = material;
		stuff.HasMetalMaterial = true;
}
 
開發者ID:SneakyTactician,項目名稱:BIGB,代碼行數:16,代碼來源:AutoCreateForOres.java

示例14: CreateSword

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
/**
 * Creates a sword from the specs provided.
 */
public static ItemSword CreateSword(ToolMaterial toolmaterial, CreativeTabs creativetab, int mininglevel, String texture, String unlocalizedname)
{
	ItemSword sword;
	sword = new AutoSword(toolmaterial, creativetab, mininglevel, texture, unlocalizedname);
	return sword;
}
 
開發者ID:SneakyTactician,項目名稱:BIGB,代碼行數:10,代碼來源:AutoItemAndBlock.java

示例15: UtilsHoe

import net.minecraft.item.Item.ToolMaterial; //導入依賴的package包/類
public UtilsHoe(ToolMaterial material, String name, String modid, Item toolmat, String translatedName) {
	super(material);
	GameRegistry.register(this, new ResourceLocation(modid, name));
	this.setUnlocalizedName(modid + "_" + name);
    setCreativeTab(CreativeTabs.COMBAT);
    matlist.add(toolmat);
    craftingmap.put(toolmat, this);
    if (this != null){
    	toollists.put(modid, this);
		toollistsname.put(this, name);
	    UtilsItem.modItems.put(modid, this);
	    UtilsItem.itemNameList.put(this, name);
	    UtilsItem.translatedNameList.put(this, translatedName);
	    }
}
 
開發者ID:AshIndigo,項目名稱:Alloycraft,代碼行數:16,代碼來源:UtilsToolset.java


注:本文中的net.minecraft.item.Item.ToolMaterial類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。