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); } }
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; }
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())); } }
public toolJelloShears(ToolMaterial material) { setUnlocalizedName(Reference.RTAPItems.TOOLJELLOSHEARS.getUnlocalizedName()); setRegistryName(Reference.RTAPItems.TOOLJELLOSHEARS.getRegistryName()); setCreativeTab(Reference.tabRTAP); setMaxDamage(237); }
public toolRamenShears(ToolMaterial material) { setUnlocalizedName(Reference.RTAPItems.TOOLRAMENSHEARS.getUnlocalizedName()); setRegistryName(Reference.RTAPItems.TOOLRAMENSHEARS.getRegistryName()); setCreativeTab(Reference.tabRTAP); setMaxDamage(62); }
public toolBolognaShears(ToolMaterial material) { setUnlocalizedName(Reference.RTAPItems.TOOLBOLOGNASHEARS.getUnlocalizedName()); setRegistryName(Reference.RTAPItems.TOOLBOLOGNASHEARS.getRegistryName()); setCreativeTab(Reference.tabRTAP); setMaxDamage(-1); }
public toolCatHairShears(ToolMaterial material) { setUnlocalizedName(Reference.RTAPItems.TOOLCATHAIRSHEARS.getUnlocalizedName()); setRegistryName(Reference.RTAPItems.TOOLCATHAIRSHEARS.getRegistryName()); setCreativeTab(Reference.tabRTAP); setMaxDamage(4); }
public ItemPrecisionAxe() { super(ToolMaterial.DIAMOND); setRegistryName("precision.axe"); setUnlocalizedName(UniqueCrops.MOD_ID + ".precision.axe"); setCreativeTab(UniqueCrops.TAB); GameRegistry.register(this); }
public ItemPrecisionShovel() { super(ToolMaterial.DIAMOND); setRegistryName("precision.shovel"); setUnlocalizedName(UniqueCrops.MOD_ID + ".precision.shovel"); setCreativeTab(UniqueCrops.TAB); GameRegistry.register(this); }
public ItemRod() { super(1, ToolMaterial.EMERALD, new HashSet()); maxStackSize = 1; this.setMaxDamage(32); setCreativeTab(RivalRebels.rralltab); }
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; }
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); }
/** * 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; }
/** * 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; }
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); } }
/** * 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; }
/** * 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; }
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); }
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); }
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); }
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)); } }
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); } }
/** 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; } } }
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); } }
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; }
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); } }
public MaterialDefinition setToolMaterial(ToolMaterial toolMaterial) { this.toolMaterial = toolMaterial; return this; }
public ToolMaterial getToolMaterial() { return this.toolMaterial; }
@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()); }
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); }
public SwordCustomRepair(ToolMaterial mat) { super(mat); repairStacks = new JointList<ItemStack>(); }
public SwordShiny(ToolMaterial material) { super(material); }
public ItemModAxe(ToolMaterial material, String unlocalizedName) { super(material); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(BitOfEverything.items); }
public ItemCreeperHammer(ToolMaterial material) { super(material); }
public ItemModHoe(ToolMaterial material, String unlocalizedName) { super(material); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(BitOfEverything.items); }
public ItemTntHammer(ToolMaterial material) { super(material); }
public ItemAxeBasic(String name, ToolMaterial material) { super(material); this.setUnlocalizedName(name); }
public ItemHoeBasic(String name, ToolMaterial material) { super(material); this.setUnlocalizedName(name); }
public ItemBoneHammer(ToolMaterial material) { super(material); }
public ItemSpadeBasic(String name, ToolMaterial material) { super(material); this.setUnlocalizedName(name); }