protected int getPowerPerDamagePoint(@Nonnull ItemStack stack) { EnergyUpgradeHolder eu = EnergyUpgradeManager.loadFromItem(stack); if (eu != null) { return eu.getCapacity() / data.getToolMaterial().getMaxUses(); } else { return 1; } }
public ItemAllToolAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity, int color){ super(4.0F, -2F, toolMat, repairItem, unlocalizedName, rarity, new HashSet<>()); this.color = color; this.setMaxDamage(toolMat.getMaxUses()*4); this.setHarvestLevels(toolMat.getHarvestLevel()); }
public ItemAllToolAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity, int color){ super(4.0F, -2F, toolMat, repairItem, unlocalizedName, rarity, new HashSet<>()); this.color = color; this.setMaxDamage(toolMat.getMaxUses()*4); this.setHarvestLevels(toolMat.getHarvestLevel()); }
public ItemShieldCore(ToolMaterial toolMaterial) { super(); this.toolMaterial = toolMaterial; setMaxStackSize(1); setMaxDamage(toolMaterial.getMaxUses() + 275); addPropertyOverride(new ResourceLocation("blocking"), new IItemPropertyGetter() { @SideOnly (Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { return entityIn != null && entityIn.isHandActive() && entityIn.getActiveItemStack() == stack ? 1.0F : 0.0F; } }); BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(this, ItemArmor.DISPENSER_BEHAVIOR); }
/** * Sandstone is between wood and stone, with stone harvest level */ private static void registerSandstoneMaterials() { MaterialRegistry.sandstoneToolMaterial = EnumHelper.addToolMaterial("sandstone", ToolMaterial.STONE.getHarvestLevel(), (ToolMaterial.STONE.getMaxUses() + ToolMaterial.WOOD.getMaxUses()) / 2, (ToolMaterial.STONE.getEfficiency() + ToolMaterial.STONE.getEfficiency()) / 2, (ToolMaterial.STONE.getAttackDamage() + ToolMaterial.WOOD.getAttackDamage()) / 2.0F, ToolMaterial.GOLD.getEnchantability()); MaterialRegistry.sandstoneToolMaterial.setRepairItem(new ItemStack(Blocks.SANDSTONE)); }
public ItemMace(ToolMaterial material, String name, float stunChance) { super(material,name); //set the base damage to that of lower than usual (balance) this.baseDamage -= 1; this.stunChance = stunChance; this.setMaxDamage(material.getMaxUses() * 2); GameRegistry.register(this); }
public ItemHammer(String regName, ToolMaterial material) { super(regName); attackDamage = 4.f + material.getAttackDamage(); this.material = material; maxStackSize = 1; setMaxDamage(material.getMaxUses()); setHarvestLevel("hammer", material.getHarvestLevel()); }
public ItemCommandBaton(String name, ToolMaterial material) { super(name); this.attackDamage = 4 + material.getAttackDamage(); this.material = material; this.setMaxStackSize(1); this.setMaxDamage(material.getMaxUses()); }
public ItemExcavatorCore(ToolMaterial toolMaterial) { super(1.0F, -3.0F, toolMaterial); addToolClass("shovel"); addToolClass("excavator"); setMaxDamage(toolMaterial.getMaxUses() * 2); effectiveBlocks.addAll(ItemSpade.EFFECTIVE_ON); effectiveMaterials.add(Material.GROUND); effectiveMaterials.add(Material.GRASS); effectiveMaterials.add(Material.SAND); effectiveMaterials.add(Material.SNOW); effectiveMaterials.add(Material.CRAFTED_SNOW); effectiveMaterials.add(Material.CLAY); }
public ItemKitchenKnife(KitchenKnifeWrapper type) { this.type = type; setMaxDamage(type.getMaterial().getMaxUses() * 10); setMaxStackSize(1); setRegistryName(FoodCraftReloadedMod.MODID, NameBuilder.buildRegistryName("kitchen", "knife", type.getMaterial().name().toLowerCase())); setTranslationKey(NameBuilder.buildUnlocalizedName("kitchen", "knife", type.getMaterial().name().toLowerCase())); setCreativeTab(FCRCreativeTabs.BASE); }
public ItemSickleCore(ToolMaterial toolMaterial) { super(2.5F, -2.6F, toolMaterial); addToolClass("sickle"); setMaxDamage(toolMaterial.getMaxUses() * 4); effectiveBlocks.add(Blocks.WEB); effectiveBlocks.add(Blocks.VINE); effectiveBlocks.add(Blocks.LEAVES); effectiveBlocks.add(Blocks.LEAVES2); effectiveMaterials.add(Material.LEAVES); effectiveMaterials.add(Material.PLANTS); effectiveMaterials.add(Material.VINE); effectiveMaterials.add(Material.WEB); }
public VampirismItemWeapon(String regName, Item.ToolMaterial material, float attackSpeedModifier, float attackDamage) { super(regName); this.material = material; this.maxStackSize = 1; this.setMaxDamage(material.getMaxUses()); this.attackDamage = attackDamage; this.attackSpeed = attackSpeedModifier; }
public ItemQuill(String regName, ToolMaterial material) { super(regName); this.material = material; attackDamage = 1.f + material.getAttackDamage(); maxStackSize = 1; setMaxDamage(material.getMaxUses()); setHarvestLevel("quill", material.getHarvestLevel()); }
@Override public ItemStack getCraftingResult(InventoryCrafting matrix) { int currentDurability = 0, totalDurability = 0; for (int a = 0; a < 3; a++) { ItemStack is = matrix.getStackInSlot(a); totalDurability += is.getMaxDamage(); currentDurability += is.getMaxDamage() - is.getItemDamage(); } return new ItemStack(ModItems.JADE_PAXEL, 1, ModMaterials.TOOL_JADE_PAXEL.getMaxUses() - (int) Math.floor((float) currentDurability * ModMaterials.TOOL_JADE_PAXEL.getMaxUses() / totalDurability)); } }
public ItemTrowel(ToolMaterial toolMaterial, String materialName) { theToolMaterial = toolMaterial; setMaxStackSize(1); setMaxDamage(toolMaterial.getMaxUses()); setCreativeTab(CreativeTabBotany.INSTANCE); modelName = "trowel_" + materialName; setUnlocalizedName("botany." + modelName); setRegistryName(modelName); }
public ItemWaraxe(ToolMaterial material, String name, int ignoreDamageAmount) { super(material,name); this.ignoreDamageAmount = ignoreDamageAmount; //set the base damage to that of lower than usual (balance) this.baseDamage -= 1 + ignoreDamageAmount; this.setMaxDamage(material.getMaxUses()*2); GameRegistry.register(this); }
public ItemFishingRodCore(ToolMaterial toolMaterial) { this.toolMaterial = toolMaterial; setMaxStackSize(1); setMaxDamage(toolMaterial.getMaxUses() + 5); addPropertyOverride(new ResourceLocation("cast"), new IItemPropertyGetter() { @SideOnly (Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { return entityIn == null ? 0.0F : (entityIn.getHeldItemMainhand() == stack || entityIn.getHeldItemOffhand() == stack) && entityIn instanceof EntityPlayer && ((EntityPlayer) entityIn).fishEntity != null ? 1.0F : 0.0F; } }); }
public ItemShearsCore(ToolMaterial toolMaterial) { super(); this.toolMaterial = toolMaterial; this.setMaxDamage(toolMaterial.getMaxUses() - 12); }
public ItemWabbajack() { super(); weaponDamage = 20.0F; //toolMaterial = ToolMaterial.WOOD; setMaxStackSize(1); setMaxDamage(ToolMaterial.WOOD.getMaxUses()); setCreativeTab(CreativeTabs.tabCombat); }
public ItemShield(String name, ToolMaterial material) { super(name); this.setFull3D(); this.armorValue = material.getHarvestLevel() * 2 + 1; setMaxDamage(material.getMaxUses()); }