本文整理匯總了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);
}
}
示例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;
}
示例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()));
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}