Java 类net.minecraft.item.Item.ToolMaterial 实例源码
项目:Randores2
文件:MaterialDefinitionGenerator.java
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);
}
}
项目:Technical
文件:TechnicalTools.java
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;
}
项目:Toms-Mod
文件:ToolGroup.java
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()));
}
}
项目:rtap
文件:toolJelloShears.java
public toolJelloShears(ToolMaterial material) {
setUnlocalizedName(Reference.RTAPItems.TOOLJELLOSHEARS.getUnlocalizedName());
setRegistryName(Reference.RTAPItems.TOOLJELLOSHEARS.getRegistryName());
setCreativeTab(Reference.tabRTAP);
setMaxDamage(237);
}
项目:rtap
文件:toolRamenShears.java
public toolRamenShears(ToolMaterial material) {
setUnlocalizedName(Reference.RTAPItems.TOOLRAMENSHEARS.getUnlocalizedName());
setRegistryName(Reference.RTAPItems.TOOLRAMENSHEARS.getRegistryName());
setCreativeTab(Reference.tabRTAP);
setMaxDamage(62);
}
项目:rtap
文件:toolBolognaShears.java
public toolBolognaShears(ToolMaterial material) {
setUnlocalizedName(Reference.RTAPItems.TOOLBOLOGNASHEARS.getUnlocalizedName());
setRegistryName(Reference.RTAPItems.TOOLBOLOGNASHEARS.getRegistryName());
setCreativeTab(Reference.tabRTAP);
setMaxDamage(-1);
}
项目:rtap
文件:toolCatHairShears.java
public toolCatHairShears(ToolMaterial material) {
setUnlocalizedName(Reference.RTAPItems.TOOLCATHAIRSHEARS.getUnlocalizedName());
setRegistryName(Reference.RTAPItems.TOOLCATHAIRSHEARS.getRegistryName());
setCreativeTab(Reference.tabRTAP);
setMaxDamage(4);
}
项目:uniquecrops
文件:ItemPrecisionAxe.java
public ItemPrecisionAxe() {
super(ToolMaterial.DIAMOND);
setRegistryName("precision.axe");
setUnlocalizedName(UniqueCrops.MOD_ID + ".precision.axe");
setCreativeTab(UniqueCrops.TAB);
GameRegistry.register(this);
}
项目:uniquecrops
文件:ItemPrecisionShovel.java
public ItemPrecisionShovel() {
super(ToolMaterial.DIAMOND);
setRegistryName("precision.shovel");
setUnlocalizedName(UniqueCrops.MOD_ID + ".precision.shovel");
setCreativeTab(UniqueCrops.TAB);
GameRegistry.register(this);
}
项目:Rival-Rebels-Mod
文件:ItemRod.java
public ItemRod()
{
super(1, ToolMaterial.EMERALD, new HashSet());
maxStackSize = 1;
this.setMaxDamage(32);
setCreativeTab(RivalRebels.rralltab);
}
项目:Nuclear-Foundation
文件:SetTools.java
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;
}
项目:Nuclear-Foundation
文件:ItemManager.java
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);
}
项目:BIGB
文件:AutoCreateForOres.java
/**
* 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;
}
项目:BIGB
文件:AutoItemAndBlock.java
/**
* 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;
}
项目:Alloycraft
文件:UtilsToolset.java
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);
}
}
项目:BIGB
文件:AutoItemAndBlock.java
/**
* Creates a hoe from the specs provided.
*/
public static ItemHoe CreateHoe(ToolMaterial toolmaterial, CreativeTabs creativetab, int mininglevel, String texture, String unlocalizedname)
{
ItemHoe hoe;
hoe = new AutoHoe(toolmaterial, creativetab, mininglevel, texture, unlocalizedname);
return hoe;
}
项目:BIGB
文件:AutoItemAndBlock.java
/**
* Creates a shovel from the specs provided.
*/
public static ItemSpade CreateShovel(ToolMaterial toolmaterial, CreativeTabs creative, int mininglevel, String Texture, String UnlocalizedName)
{
ItemSpade shovel;
shovel = new AutoSpade(toolmaterial, creative, mininglevel, Texture, UnlocalizedName);
return shovel;
}
项目:FissionWarfare
文件:ItemShovelBase.java
public ItemShovelBase(String imagePath, ToolMaterial toolMaterial) {
super(toolMaterial);
this.imagePath = imagePath;
this.toolMaterial = toolMaterial;
setTextureName(Reference.MOD_ID + ":tools/" + imagePath);
setCreativeTab(InitTabs.tabMain);
setUnlocalizedName(imagePath);
GameRegistry.registerItem(this, imagePath);
}
项目:FissionWarfare
文件:ItemAxeBase.java
public ItemAxeBase(String imagePath, ToolMaterial toolMaterial) {
super(toolMaterial);
this.imagePath = imagePath;
this.toolMaterial = toolMaterial;
setTextureName(Reference.MOD_ID + ":tools/" + imagePath);
setCreativeTab(InitTabs.tabMain);
setUnlocalizedName(imagePath);
GameRegistry.registerItem(this, imagePath);
}
项目:FissionWarfare
文件:ItemPickaxeBase.java
public ItemPickaxeBase(String imagePath, ToolMaterial toolMaterial) {
super(toolMaterial);
this.imagePath = imagePath;
this.toolMaterial = toolMaterial;
setTextureName(Reference.MOD_ID + ":tools/" + imagePath);
setCreativeTab(InitTabs.tabMain);
setUnlocalizedName(imagePath);
GameRegistry.registerItem(this, imagePath);
}
项目:Nuclear-Foundation
文件:ItemManager.java
public static void addSecondary(String type,ToolMaterial toolMat,ArmorMaterial armorMat,boolean shears){
if(toolMat!=null&&Config.IsToolsEnabled){
Tools.add(new SetTools(type, toolMat,shears));
}
if(armorMat!=null&&Config.IsArmorEnebled){
Armor.add(new SetArmor(type, armorMat));
}
}
项目:Alloycraft
文件:UtilsToolset.java
public UtilsAxe(ToolMaterial material, String name, String modid, Item toolmat, String translatedName) {
super(material, material.getDamageVsEntity(), material.getEfficiencyOnProperMaterial());
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);
}
}
项目:LightningCraft
文件:ToolHelper.java
/** Get a tool material's repair stack safely */
public static ItemStack getRepairStack(ToolMaterial mat) {
if(matMap.containsKey(mat)) {
return matMap.get(mat);
} else {
try {
return mat.getRepairItemStack();
} catch(Exception e) {
return null;
}
}
}
项目:Alloycraft
文件:UtilsToolset.java
public UtilsPickaxe(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);
}
}
项目:Nuclear-Foundation
文件:SetTools.java
public SetTools(String type, ToolMaterial material,boolean shears){
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);
if(shears==true)
this.Shears=new ItemBasicShears(material, type);
else
this.Shears=null;
}
项目:Alloycraft
文件:UtilsToolset.java
public UtilsSword(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);
}
}
项目:Randores2
文件:MaterialDefinition.java
public MaterialDefinition setToolMaterial(ToolMaterial toolMaterial) {
this.toolMaterial = toolMaterial;
return this;
}
项目:Randores2
文件:MaterialDefinition.java
public ToolMaterial getToolMaterial() {
return this.toolMaterial;
}
项目:Thermionics
文件:ThermionicsItems.java
@SubscribeEvent
public static void onRegister(RegistryEvent.Register<Item> event) {
//Thermionics.LOG.info("Registering items");
IForgeRegistry<Item> r = event.getRegistry();
//Blocks first
for(Block b : Thermionics.instance().needItemRegistration) {
if (b instanceof BlockBase) {
item(r, new ItemBlockEquivalentState(b));
} else if (b instanceof BlockBattery) {
item(r, new ItemBlockBattery(b));
} else {
ItemBlock i = new ItemBlock(b);
i.setRegistryName(b.getRegistryName());
item(r, i);
}
}
//Unified Hammer
ThermionicsItems.HAMMER = item(r, new ItemHammer(ToolMaterial.IRON, "iron"));
//Legacy Hammers - switchover to neo-hammer isn't done yet, so always register
//if (CONFIG_ENFORCE_COMPATIBILITY) {
ThermionicsItems.HAMMER_GOLD = item(r, new ItemHammer(ToolMaterial.GOLD, "gold"));
ThermionicsItems.HAMMER_DIAMOND = item(r, new ItemHammer(ToolMaterial.DIAMOND, "diamond"));
//Since we can't *safely*, *cleanly* rendezvous with other mods about Item.ToolMaterial properties, make our own
//For hammers, these values are multiplied by 9 (so iron, which gives a pick 250 uses, gives a hammer 2250 to
//compensate for the extra material used
/* name repairOre level uses eff dmg ench */
/* iron ingotIron 2 250 6f 2f 14 */
ThermionicsItems.HAMMER_COPPER = item(r, new ItemHammer("copper", "ingotCopper", 2, 200, 7f, 1f, 20));
ThermionicsItems.HAMMER_LEAD = item(r, new ItemHammer("lead", "ingotLead", 2, 1550, 4f, 2f, 8));
ThermionicsItems.HAMMER_INVAR = item(r, new ItemHammer("invar", "ingotInvar", 2, 300, 6f, 2f, 14));
//}
//Ingredients
ThermionicsItems.INGREDIENT = item(r, new ItemSubtyped<EnumIngredient> ("ingredient", EnumIngredient.values(), false));
ThermionicsItems.FABRIC_SQUARE = item(r, new ItemFabricSquare());
ThermionicsItems.ALLOMANTIC_POWDER = item(r, new ItemSubtyped<EnumAllomanticPowder>("allomanticpowder", EnumAllomanticPowder.values(), true));
OreDictionary.registerOre("gearBrass", new ItemStack(ThermionicsItems.INGREDIENT,1, EnumIngredient.GEAR_BRASS.ordinal()));
//Booze
ThermionicsItems.EMPTY_SPIRIT_BOTTLE= item(r, new ItemSpiritBottle("empty"));
ThermionicsItems.SPIRIT_BOTTLE = item(r, new ItemSpiritBottle(null));
//Cloaks
ThermionicsItems.MISTCLOAK = item(r, new ItemMistcloak());
ThermionicsItems.SCARF = item(r, new ItemScarf());
//Creative
ThermionicsItems.CHUNK_UNLOADER = item(r, new ItemChunkUnloader());
}
项目:CustomWorldGen
文件:EnumHelper.java
public static ToolMaterial addToolMaterial(String name, int harvestLevel, int maxUses, float efficiency, float damage, int enchantability)
{
return addEnum(ToolMaterial.class, name, harvestLevel, maxUses, efficiency, damage, enchantability);
}
项目:AdvancedCombat
文件:SwordCustomRepair.java
public SwordCustomRepair(ToolMaterial mat) {
super(mat);
repairStacks = new JointList<ItemStack>();
}
项目:AdvancedCombat
文件:SwordShiny.java
public SwordShiny(ToolMaterial material) {
super(material);
}
项目:Minecraft-Modding-Tutorials
文件:ItemModAxe.java
public ItemModAxe(ToolMaterial material, String unlocalizedName) {
super(material);
this.setUnlocalizedName(unlocalizedName);
this.setCreativeTab(BitOfEverything.items);
}
项目:Hammer-Mod
文件:ItemCreeperHammer.java
public ItemCreeperHammer(ToolMaterial material) {
super(material);
}
项目:Minecraft-Modding-Tutorials
文件:ItemModHoe.java
public ItemModHoe(ToolMaterial material, String unlocalizedName) {
super(material);
this.setUnlocalizedName(unlocalizedName);
this.setCreativeTab(BitOfEverything.items);
}
项目:Hammer-Mod
文件:ItemTntHammer.java
public ItemTntHammer(ToolMaterial material) {
super(material);
}
项目:4Space-5
文件:ItemSetTools.java
public ItemAxeBasic(String name, ToolMaterial material) {
super(material);
this.setUnlocalizedName(name);
}
项目:4Space-5
文件:ItemSetTools.java
public ItemHoeBasic(String name, ToolMaterial material) {
super(material);
this.setUnlocalizedName(name);
}
项目:Hammer-Mod
文件:ItemBoneHammer.java
public ItemBoneHammer(ToolMaterial material) {
super(material);
}
项目:4Space-5
文件:ItemSetTools.java
public ItemSpadeBasic(String name, ToolMaterial material) {
super(material);
this.setUnlocalizedName(name);
}