Java 类net.minecraftforge.common.util.EnumHelper 实例源码

项目:EndermanEvolution    文件:ArmorUtils.java   
public static ItemArmor.ArmorMaterial addArmorMaterial(String enumName, String textureName, int durability, int[] reductionAmounts, int enchantability, SoundEvent soundOnEquip, float toughness) {
    return EnumHelper.addEnum(ItemArmor.ArmorMaterial.class, enumName, new Class[] {
            String.class,
            Integer.TYPE,
            int[].class,
            Integer.TYPE,
            SoundEvent.class,
            Float.TYPE
    }, new Object[] {
            textureName,
            Integer.valueOf(durability),
            reductionAmounts,
            Integer.valueOf(enchantability),
            soundOnEquip,
            Float.valueOf(toughness)
    });
}
项目:Randores2    文件:MaterialDefinition.java   
@SerializationConstructor
public MaterialDefinition(@Name("color") Color color, @Name("name") String name, @Name("ore") OreComponent ore, @Name("components") List<CraftableComponent> craftables, @Name("properties") List<MaterialProperty> properties, @Name("abilities") AbilitySeries series) {
    this.abilitySeries = series;
    this.color = color;
    this.ore = ore;
    this.material = ore.getMaterial();
    this.craftables = craftables;
    this.name = name;
    this.toolMaterial = EnumHelper.addToolMaterial(this.name, this.material.getHarvestLevel(), this.material.getMaxUses(), this.material.getEfficiency(), this.material.getDamage(), this.material.getEnchantability());
    this.totalArmor = sum(this.material.getArmorReduction());
    this.armorMaterial = EnumHelper.addArmorMaterial(this.name, "randores:armor", this.material.getMaxUses() / 10, this.material.getArmorReduction(), this.material.getEnchantability(), SoundEvents.ITEM_ARMOR_EQUIP_IRON, this.material.getToughness());

    this.components = new ArrayList<>();
    this.components.addAll(this.craftables);
    this.components.add(this.ore);
    this.components.add(this.material);

    this.propertiesList = properties;
    this.properties = new HashMap<>();
    for (MaterialProperty property : properties) {
        this.properties.put(property.name(), property);
    }
}
项目:CustomWorldGen    文件:BiomeManager.java   
public static BiomeType getType(String name)
{
    name = name.toUpperCase();

    for (BiomeType t : values())
    {
        if (t.name().equals(name)) return t;
    }

    BiomeType ret = EnumHelper.addEnum(BiomeType.class, name, new Class[0], new Object[0]);

    if (ret.ordinal() >= biomes.length)
    {
        biomes = Arrays.copyOf(biomes, ret.ordinal() + 1);
    }

    return ret;
}
项目:CustomWorldGen    文件:BiomeDictionary.java   
/**
 * Retrieves a Type value by name,
 * if one does not exist already it creates one.
 * This can be used as intermediate measure for modders to
 * add their own category of Biome.
 *
 * There are NO naming conventions besides:
 *   MUST be all upper case (enforced by name.toUpper())
 *   NO Special characters. {Unenforced, just don't be a pain, if it becomes a issue I WILL
 *                             make this RTE with no worry about backwards compatibility}
 *
 * Note: For performance sake, the return value of this function SHOULD be cached.
 * Two calls with the same name SHOULD return the same value.
 *
 *
 * @param name The name of this Type
 * @return An instance of Type for this name.
 */
public static Type getType(String name, Type... subTypes)
{
    name = name.toUpperCase();
    for (Type t : values())
    {
        if (t.name().equals(name))
            return t;
    }
    Type ret = EnumHelper.addEnum(Type.class, name, new Class[]{Type[].class}, new Object[]{subTypes});
    if (ret.ordinal() >= typeInfoList.length)
    {
        typeInfoList = Arrays.copyOf(typeInfoList, ret.ordinal()+1);
    }
    for(BiomeInfo bInfo:biomeInfoMap.values())
    {
        if(bInfo != null)
        {
            EnumSet<Type> oldSet = bInfo.typeList;
            bInfo.typeList = EnumSet.noneOf(Type.class);
            bInfo.typeList.addAll(oldSet);
        }
    }
    return ret;
}
项目:AdvancedCombat    文件:Swords.java   
private static void setupMaterials() {
        // regular materials
        advancedWood = EnumHelper.addToolMaterial("advancedWood", 1, 236, 8.0F, 1.75F, 8);
        (advancedStone = EnumHelper.addToolMaterial("advancedStone", 2, 524, 12.0F, 3.0F, 3)).setRepairItem(new ItemStack(ACBlocks.advancedStone));
        (advancedIron = EnumHelper.addToolMaterial("advancedIron", 3, 2250, 18.0F, 10.0F, 7)).setRepairItem(new ItemStack(Blocks.IRON_BLOCK));
        (advancedGold = EnumHelper.addToolMaterial("advancedGold", 2, 1561, 8.0F, 6.0F, 15)).setRepairItem(new ItemStack(Blocks.GOLD_BLOCK));
        (advancedEmerald = EnumHelper.addToolMaterial("advancedEmerald", 4, 3122, 12.0F, ACConfig.emeraldSwordDamage - 4, 22)).setRepairItem(new ItemStack(Blocks.EMERALD_BLOCK));
        (advancedDiamond = EnumHelper.addToolMaterial("advancedDiamond", 4, 8192, 24.0F, 20.0F, 5)).setRepairItem(new ItemStack(Blocks.DIAMOND_BLOCK));
        (netherStar = EnumHelper.addToolMaterial("netherStar", 4, 9366, 20.0F, 26.0F, 1)).setRepairItem(new ItemStack(Items.NETHER_STAR));
        (advancedNetherStar = EnumHelper.addToolMaterial("advancedNetherStar", 5, 16384, 30.0F, 56.0F, 0)).setRepairItem(new ItemStack(ACBlocks.netherStarBlock));

        creative = EnumHelper.addToolMaterial("creative_", 1000, 1, 0, 0, 0);

        // thaumic materials
//      advancedThaumium = EnumHelper.addToolMaterial("advancedThaumium", 3, 2250, 18.0F, 11.0F, 12);
//      advancedElemental = EnumHelper.addToolMaterial("advancedElemental", 4, 6144, 24.0F, 22.0F, 8);
//      advancedVoid = EnumHelper.addToolMaterial("advancedVoid", 4, 524, 18.0F, 24.0F, 12);
//      advancedCrimson = EnumHelper.addToolMaterial("advancedCrimson", 4, 668, 20.0F, 30.0F, 12);
//      advancedPrimal = EnumHelper.addToolMaterial("advancedPrimal", 5, 937, 22.0F, 36.0F, 12);
//      if(ASModIntegration.thaumcraftExists) {
//          advancedThaumium.setRepairItem(new ItemStack(BlocksTC.metal, 1, 0));
//          advancedVoid.setRepairItem(new ItemStack(BlocksTC.metal, 1, 1));
//      }
    }
项目:4Space-5    文件:VenusItems.java   
@Override
public void initItems() {
    venusItem = new ItemBasics("venusItem", VenusCore.instance.prefixTexture, new String[] {
        "sulfurDust", 
        "ingotSulfur",
        "ruby",
        "ingotUranium",
        "pellucidum",
        "sulfurPlate",
        "rubyPlate",
        "uraniumPlate",
        "tier4HeavyDutyPlate",
        "venusRod",
        "venusRodDust",
        "powerPellucidum",
        "ventBerry",
    });
    batteryUranium = new ItemBattery(VenusCore.instance.prefixTexture, "batteryUranium", 75000.0f);
    batterySulfur = new ItemBattery(VenusCore.instance.prefixTexture, "batterySulfur", 17500.0f);
    armourRuby = new ItemSetArmour(VenusCore.instance.prefixTexture, EnumHelper.addArmorMaterial("ruby", 30, new int[] { 3, 8, 6, 3 }, 12));
    armourSulfur = new ItemSetArmour(VenusCore.instance.prefixTexture, EnumHelper.addArmorMaterial("sulfur", 15, new int[] { 1, 4, 2, 1 }, 7));
    toolsRuby = new ItemSetTools(VenusCore.instance.prefixTexture, EnumHelper.addToolMaterial("ruby", 3, 768, 5.0f, 2, 8));
    toolsSulfur = new ItemSetTools(VenusCore.instance.prefixTexture, EnumHelper.addToolMaterial("sulfur", 3, 416, 6.0f, 1, 2));
}
项目:TRHS_Club_Mod_2016    文件:BiomeManager.java   
public static BiomeType getType(String name)
{
    name = name.toUpperCase();

    for (BiomeType t : values())
    {
        if (t.name().equals(name)) return t;
    }

    BiomeType ret = EnumHelper.addEnum(BiomeType.class, name, BiomeType.class);

    if (ret.ordinal() >= biomes.length)
    {
        biomes = Arrays.copyOf(biomes, ret.ordinal());
    }

    return ret;
}
项目:TeambattleMod    文件:TItems.java   
private void init() {

        teambattleingotraw = new ItemTeambattleIngot().setUnlocalizedName("teambattleingotraw").setCreativeTab(TeambattleMod.tab);
        teambattleingot = new ItemTeambattleIngot().setUnlocalizedName("teambattleingot").setCreativeTab(TeambattleMod.tab);

        teambattletool = EnumHelper.addToolMaterial("TEAMBATTLE", 3, 50000000, 10.0F, 5.0F, 25);
        teambattlearmor = EnumHelper.addArmorMaterial("TEAMBATTLE", "", 3125000, new int[] { 3, 8, 6, 3 }, 25);

        teambattletool.setRepairItem(new ItemStack(teambattleingot));
        teambattlearmor.customCraftingMaterial = teambattleingot;

        teambattlesword = new ItemTeambattleSword(teambattletool).setUnlocalizedName("teambattlesword").setCreativeTab(TeambattleMod.tab);
        teambattlepickaxe = new ItemTeambattlePickaxe(teambattletool).setUnlocalizedName("teambattlepickaxe").setCreativeTab(TeambattleMod.tab);
        teambattleshovel = new ItemTeambattleShovel(teambattletool).setUnlocalizedName("teambattleshovel").setCreativeTab(TeambattleMod.tab);
        teambattlebow = new ItemTeambattleBow().setUnlocalizedName("teambattlebow").setCreativeTab(TeambattleMod.tab);

        teambattlehelmet = new ItemTeambattleArmor(teambattlearmor, 0).setUnlocalizedName("teambattlehelmet").setCreativeTab(TeambattleMod.tab);
        teambattlechestplate = new ItemTeambattleArmor(teambattlearmor, 1).setUnlocalizedName("teambattlechestplate").setCreativeTab(TeambattleMod.tab);
        teambattleleggings = new ItemTeambattleArmor(teambattlearmor, 2).setUnlocalizedName("teambattleleggings").setCreativeTab(TeambattleMod.tab);
        teambattleboots = new ItemTeambattleArmor(teambattlearmor, 3).setUnlocalizedName("teambattleboots").setCreativeTab(TeambattleMod.tab);

        teambattlebackpack = new ItemTeambattleBackpack().setUnlocalizedName("teambattlebackpack").setCreativeTab(TeambattleMod.tab);
        teambattlehangglider = new ItemTeambattleHangglider().setUnlocalizedName("teambattlehangglider").setCreativeTab(TeambattleMod.tab);
    }
项目:Alchemy    文件:AlchemyFXType.java   
@Nullable
public static EnumParticleTypes registerParticleTypes(String name, Class factory, boolean ignoreRange) throws Exception {
    AlchemyModLoader.checkState();
    int id = EnumParticleTypes.values().length;
    if (Always.runOnClient())
        if (Tool.isInstance(IParticleFactory.class, factory))
            Minecraft.getMinecraft().effectRenderer.registerParticle(id, (IParticleFactory) factory.newInstance());
        else 
            AlchemyRuntimeException.onException(new RuntimeException(
                    "Class<" + factory.getName() + "> forgot to implement the Interface<" + IParticleFactory.class.getName() + "> ?"));
    EnumParticleTypes type = EnumHelper.addEnum(EnumParticleTypes.class, name,
            new Class[] { String.class, int.class, boolean.class }, name, id, ignoreRange);
    EnumParticleTypes.PARTICLES.put(type.getParticleID(), type);
    EnumParticleTypes.BY_NAME.put(type.getParticleName(), type);
    return type;
}
项目:MobHunter    文件:ItemMHSword.java   
public ItemMHSword(String itemName, float damage, int... sharpnessDamageLevels)
{
    super(EnumHelper.addToolMaterial(itemName + "Mat", 0, sharpnessDamageLevels[sharpnessDamageLevels.length - 1], 0, damage - 1, 0).setRepairItem(new ItemStack(MHItems.itemMisc, 1, 1)));
    setCreativeTab(MobHunter.MHWEAPON_TAB);
    setUnlocalizedName(itemName);
    setRegistryName(itemName);
    maxSharpness = EnumSharpness.getById(sharpnessDamageLevels.length - 1);
    if(maxSharpness == null) LogHelper.warn("Sword " + getUnlocalizedName() + " has a null sharpness! Something must be wrong!");
    damageLevels = sharpnessDamageLevels;
    String levels = "";
    for(int i = 0; i < damageLevels.length; i++)
    {
        levels += damageLevels[i];
        if(i < damageLevels.length - 1)
            levels += " <- ";
    }
    damageLevelsString = levels;
}
项目:Bonfires    文件:Bonfires.java   
@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
    event.getRegistry().register(new ItemAshPile("ash_pile"));
    event.getRegistry().register(new ItemCoiledSword("coiled_sword", EnumHelper.addToolMaterial("COILED_SWORD", 3, 105, 3, 10, 0)));
    event.getRegistry().register(new ItemEstusFlask("estus_flask", 0, 0, false));
    event.getRegistry().register(new ItemHomewardBone("homeward_bone"));
    event.getRegistry().register(new ItemCoiledSwordFragment("coiled_sword_fragment"));
    event.getRegistry().register(new ItemEstusShard("estus_shard"));
    event.getRegistry().register(new ItemTitaniteShard("titanite_shard"));
    event.getRegistry().register(new ItemLargeTitaniteShard("large_titanite_shard"));
    event.getRegistry().register(new ItemTitaniteChunk("titanite_chunk"));
    event.getRegistry().register(new ItemTitaniteSlab("titanite_slab"));
    event.getRegistry().register(new ItemUndeadBoneShard("undead_bone_shard"));

    if (ashBlock.getRegistryName() != null)
        event.getRegistry().register(new ItemBlock(ashBlock).setRegistryName(ashBlock.getRegistryName()));
    if (ashBonePile.getRegistryName() != null)
        event.getRegistry().register(new ItemBlock(ashBonePile).setRegistryName(ashBonePile.getRegistryName()));
}
项目:LightningCraft    文件:LCItems.java   
/** Set up tool and armor materials */
private static void setupMaterials() {
    // tools
    elecMat = EnumHelper.addToolMaterial("Electricium", 4, 3000, 14.0f, 5.0f, 22);
    elecHammerMat = EnumHelper.addToolMaterial("Electricium Hammer", 4, 3500, 16.0f, 9.0f, 22);
    skyMat = EnumHelper.addToolMaterial("Skyfather", 5, 3500, 18.0f, 6.5f, 30);
    skyHammerMat = EnumHelper.addToolMaterial("Skyfather Hammer", 5, 3500, 18.0f, 12.0f, 30);
    mysticMat = EnumHelper.addToolMaterial("Mystic", 6, 4000, 18.0f, 8.0f, 30);
    mysticHammerMat = EnumHelper.addToolMaterial("Mystic Hammer", 6, 4000, 18.0f, 15.0f, 30);
    kineticMat = EnumHelper.addToolMaterial("Kinetic Shard", 3, 100, 1.0f, 0.0f, 1);

    // special tools
    soulMat = EnumHelper.addToolMaterial("Soul", 1, 150, 4.0F, 1.5F, 10);
    zombieMat = EnumHelper.addToolMaterial("Zombie", 1, 131, 4.0F, 1.0F, 10);
    featherMat = EnumHelper.addToolMaterial("Feather", 1, 131, 4.0F, 1.0F, 10);
    enderMat = EnumHelper.addToolMaterial("Ender", 1, 200, 4.0F, 1.5F, 10);
    blazeMat = EnumHelper.addToolMaterial("Blaze", 1, 150, 4.0F, 1.0F, 10);
    iceMat = EnumHelper.addToolMaterial("Ice", 1, 100, 4.0F, 0.5F, 10);

    // armor
    elecArmor = ArmorHelper.addArmorMaterial("Electricium", RefStrings.MODID + ":elecArmor", 40, new int[]{3, 6, 8, 4}, 25, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 2F);
    skyArmor = ArmorHelper.addArmorMaterial("Skyfather", RefStrings.MODID + ":skyArmor", 50, new int[]{3, 7, 8, 4}, 20, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 2.5F);
    mysticArmor = ArmorHelper.addArmorMaterial("Mystic", RefStrings.MODID + ":mysticArmor", 60, new int[]{4, 7, 8, 4}, 15, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 3F);
    kineticArmor = ArmorHelper.addArmorMaterial("Kinetic", RefStrings.MODID + ":kineticArmor", 4, new int[]{1, 3, 5, 2}, 1, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 0F);
}
项目:Cyclic    文件:MaterialRegistry.java   
private static void registerPurpleMaterial() {
  ArmorMaterial mimicArmor = ArmorMaterial.DIAMOND;
  MaterialRegistry.powerArmorMaterial = EnumHelper.addArmorMaterial(MATERIALNAME, Const.MODRES + MATERIALNAME,
      diamondDurability * 2, // affects DURABILITY . 15 is the same as iron
      new int[] {
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.FEET) + 1,
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.LEGS) + 1,
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.CHEST) + 1,
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.HEAD) + 2
      },
      mimicArmor.getEnchantability() / 4,
      mimicArmor.getSoundEvent(),
      mimicArmor.getToughness() + 2);
  MaterialRegistry.powerArmorMaterial.repairMaterial = new ItemStack(Blocks.OBSIDIAN);
  //now the tool material
  MaterialRegistry.powerToolMaterial = EnumHelper.addToolMaterial(MATERIALNAME,
      ToolMaterial.DIAMOND.getHarvestLevel(),
      ToolMaterial.DIAMOND.getMaxUses() * 4, //was  - 261
      ToolMaterial.DIAMOND.getEfficiencyOnProperMaterial(),
      ToolMaterial.DIAMOND.getDamageVsEntity() * 8, //best draconic evolution sword is 35 base, so this is not that crazy
      ToolMaterial.GOLD.getEnchantability() * 2);
  MaterialRegistry.powerToolMaterial.setRepairItem(MaterialRegistry.powerArmorMaterial.repairMaterial);
}
项目:Cyclic    文件:MaterialRegistry.java   
private static void registerEmeraldMaterial() {
  MaterialRegistry.emeraldArmorMaterial = EnumHelper.addArmorMaterial(emeraldName, Const.MODRES + emeraldName,
      diamondDurability + 30, //was -2 affects DURABILITY 
      new int[] {
          ArmorMaterial.DIAMOND.getDamageReductionAmount(EntityEquipmentSlot.FEET),
          ArmorMaterial.DIAMOND.getDamageReductionAmount(EntityEquipmentSlot.LEGS),
          ArmorMaterial.DIAMOND.getDamageReductionAmount(EntityEquipmentSlot.CHEST),
          ArmorMaterial.DIAMOND.getDamageReductionAmount(EntityEquipmentSlot.HEAD)
      },
      ArmorMaterial.GOLD.getEnchantability(),
      ArmorMaterial.DIAMOND.getSoundEvent(),
      ArmorMaterial.DIAMOND.getToughness() + 1);//was  / 2
  MaterialRegistry.emeraldArmorMaterial.repairMaterial = new ItemStack(Items.EMERALD);
  //max uses is durability ex The number of uses this material allows.
  //as of 1.9.4 :  (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
  MaterialRegistry.emeraldToolMaterial = EnumHelper.addToolMaterial(emeraldName,
      ToolMaterial.DIAMOND.getHarvestLevel(),
      ToolMaterial.DIAMOND.getMaxUses(), //was  - 261
      ToolMaterial.DIAMOND.getEfficiencyOnProperMaterial(),
      ToolMaterial.DIAMOND.getDamageVsEntity(), //was  - 0.25F
      ToolMaterial.GOLD.getEnchantability());
  MaterialRegistry.emeraldToolMaterial.setRepairItem(MaterialRegistry.emeraldArmorMaterial.repairMaterial);
}
项目:It-s-About-Time-Minecraft-Mod    文件:ModItems.java   
public static void initializeItems(){

    timeToolMaterial = EnumHelper.addToolMaterial("timeToolMaterial", 6, 1620, 8.0F, 4.0F, 7);
    pheromoneArmor = EnumHelper.addArmorMaterial("pheromoneArmor", 12, new int[]{2, 4, 2, 1}, 9);

    fossil_Shard = new Item().setUnlocalizedName("iat.fossil_Shard").setTextureName("iat:fossil").setCreativeTab(ItsAboutTime.iatTab);
    rockPick = new ItemRockPick().setUnlocalizedName("iat.rockPick").setTextureName("iat:rockPick").setCreativeTab(ItsAboutTime.iatTab);
    fossil_Broken = new ItemFossilBroken().setUnlocalizedName("iat.fossil_Broken").setCreativeTab(ItsAboutTime.iatTab);
    fossil = new ItemFossil().setUnlocalizedName("iat.fossil").setCreativeTab(ItsAboutTime.iatTab);
    for (int i = 0; i < EnumFossilSkeleton.values().length; i++) {
        EnumFossilSkeleton.values()[i].fossilItem = new Item().setTextureName("iat:fossil").setUnlocalizedName("iat.fossil" + EnumFossilSkeleton.values()[i].name).setCreativeTab(ItsAboutTime.iatTab);
        EnumFossilSkeleton.values()[i].fossilBrokenItem = new Item().setTextureName("iat:fossil").setUnlocalizedName("iat.fossil_Broken" + EnumFossilSkeleton.values()[i].name).setCreativeTab(ItsAboutTime.iatTab);
    }
    amber = new ItemAmber().setUnlocalizedName("iat.amber").setCreativeTab(ItsAboutTime.iatTab);
    plaster_Ball = new Item().setUnlocalizedName("iat.plaster_Ball").setTextureName("iat:plaster").setCreativeTab(ItsAboutTime.iatTab);
    time_Crystal = new ItemTimeCrystal().setUnlocalizedName("iat.time_Crystal").setTextureName("iat:time_Crystal").setCreativeTab(ItsAboutTime.iatTab);
    time_Shovel = new ItemModSpade(timeToolMaterial).setUnlocalizedName("iat.time_Shovel").setTextureName("iat:time_Shovel").setCreativeTab(ItsAboutTime.iatTab);
    time_Pickaxe = new ItemModPickaxe(timeToolMaterial).setUnlocalizedName("iat.time_Pickaxe").setTextureName("iat:time_Pickaxe").setCreativeTab(ItsAboutTime.iatTab);
    time_Axe = new ItemModAxe(timeToolMaterial).setUnlocalizedName("iat.time_Axe").setTextureName("iat:time_Axe").setCreativeTab(ItsAboutTime.iatTab);
    time_Sword = new ItemSword(timeToolMaterial).setUnlocalizedName("iat.time_Sword").setTextureName("iat:time_Sword").setCreativeTab(ItsAboutTime.iatTab);
    time_Hoe = new ItemHoe(timeToolMaterial).setUnlocalizedName("iat.time_Hoe").setTextureName("iat:time_Hoe").setCreativeTab(ItsAboutTime.iatTab);
    pheromoneChest = new ItemPheromoneArmor(pheromoneArmor, 0, 1).setUnlocalizedName("iat.pheromoneCanester").setTextureName("iat:pheromoneCanester").setCreativeTab(ItsAboutTime.iatTab);
    bucket_Time = new ItemBucket(ModBlocks.fluidTimeBlock).setUnlocalizedName("iat.bucket_Time").setTextureName("iat:bucket_Time").setContainerItem(Items.bucket);
    ginkoNuts = new ItemFood(2, 0.2F, false).setPotionEffect(Potion.hunger.id, 30, 0, 0.3F).setUnlocalizedName("iat.ginkoNut").setTextureName("iat:ginko_nut").setCreativeTab(ItsAboutTime.iatTab);
}
项目:BaseMetals    文件:Materials.java   
protected static void registerMaterial(String name, MetalMaterial m){

        allMaterials.put(name, m);

        String enumName = m.getEnumName();
        String texName = m.getName();
        int[] protection = m.getDamageReductionArray();
        int durability = m.getArmorMaxDamageFactor();
        ArmorMaterial am = EnumHelper.addArmorMaterial(enumName, texName, durability, protection, m.getEnchantability(), SoundEvents.ITEM_ARMOR_EQUIP_IRON, (m.hardness > 10 ? (int)(m.hardness / 5) : 0));
        if(am == null){
            // uh-oh
            FMLLog.severe("Failed to create armor material enum for "+m);
        }
        armorMaterialMap.put(m, am);
        FMLLog.info("Created armor material enum "+am);

        ToolMaterial tm = EnumHelper.addToolMaterial(enumName, m.getToolHarvestLevel(), m.getToolDurability(), m.getToolEfficiency(), m.getBaseAttackDamage(), m.getEnchantability());
        if(tm == null){
            // uh-oh
            FMLLog.severe("Failed to create tool material enum for "+m);
        }
        toolMaterialMap.put(m, tm);
        FMLLog.info("Created tool material enum "+tm);
    }
项目:CustomThings    文件:ArmorType.java   
@Override
public void register()
{
    super.register();
    EnumHelper.addArmorMaterial(getMaterialName(), 0, protectionDisplays, enchantability); // dummy, used for enchantability
    items = new Item[4];
    for (int i = 0; i <= 3; i++)
    {
        if (ArrayUtils.contains(armors, i))
        {
            items[i] = new ItemCustomArmor(this, i);
            GameRegistry.registerItem(items[i], name + names[i]);
            addOreDictNames(new ItemStack(items[i]));
        }
    }
    types.add(this);
}
项目:Soul-Forest    文件:InitMaterials.java   
public static void init(){
// EnumTools
toolAquamarine = EnumHelper.addToolMaterial("AQUAMARINE", 3, 3644, 6.5F, 3, 23);
toolTin = EnumHelper.addToolMaterial("TIN", 1, 150, 2.5F, 1, 9);
toolCopper = EnumHelper.addToolMaterial("COPPER", 1, 150, 2.5F, 1, 9);
toolChromite = EnumHelper.addToolMaterial("CHROMITE", 3, 1524, 20.0F, 3, 23);
toolTanzanite = EnumHelper.addToolMaterial("TANZANITE", 3, 1648, 7.5F, 3, 23);
toolBronze = EnumHelper.addToolMaterial("BRONZE", 2, 408, 5.0F, 2, 14);
toolSilver = EnumHelper.addToolMaterial("SILVER", 3, 230, 10.0F, 3, 20);
toolSteel = EnumHelper.addToolMaterial("STEEL", 4, 2104, 11.5F, 4, 15);
toolCobalt = EnumHelper.addToolMaterial("COBALT", 4, 2040, 11.0F, 4, 13);
toolFyrised = EnumHelper.addToolMaterial("FYRISED", 5, 3216, 14.0F, 5, 12);
// EnumArmors
Bronze_Armor = EnumHelper.addArmorMaterial("BRONZE", 10, new int[]{2, 6, 3, 1}, 16);
Slime_Armor = EnumHelper.addArmorMaterial("SLIME", 8, new int[]{2, 4, 3, 2}, 5);
Silver_Armor = EnumHelper.addArmorMaterial("SILVER", 12, new int[]{3, 7, 4, 2}, 23);
Steel_Armor = EnumHelper.addArmorMaterial("STEEL", 38, new int[]{4, 8, 6, 3}, 9);
Cobalt_Armor = EnumHelper.addArmorMaterial("COBALT", 38, new int[]{4, 8, 5, 3}, 9);
Fyrised_Armor = EnumHelper.addArmorMaterial("FYRISED", 45, new int[]{5, 9, 6, 4}, 10);
//EnumTools for War Axes
toolWaraxe = EnumHelper.addToolMaterial("Waraxe", 4, 2144, 12.0F, 8, 10);
System.out.println("[Soul Forest] Materials initialized");
   }
项目:Uranium    文件:CraftEntity.java   
public static void initMappings() {
    for (Map.Entry<Class<? extends Entity>, String> entry : cpw.mods.fml.common.registry.EntityRegistry.entityTypeMap.entrySet()) {
        Class<? extends Entity> entityClass = entry.getKey();
        String entityName = entry.getValue();
        int entityId = getEntityTypeIDfromClass(entityClass);

        Class<? extends org.bukkit.entity.Entity> bukkitEntityClass = CraftEntity.getEntityClass(entityClass);
        EnumHelper.addBukkitEntityType(entityName, bukkitEntityClass, entityId, false);
    }
}
项目:harshencastle    文件:SoulHarsherPickaxe.java   
public SoulHarsherPickaxe()
{
    super(EnumHelper.addToolMaterial("soul_harsher_pickaxe", 3, 2000, 13.5f, 2.5f, 30));
    setUnlocalizedName("soul_harsher_pickaxe");
    setRegistryName("soul_harsher_pickaxe");
    setNoRepair();
}
项目:connor41-etfuturum2    文件:Elytra.java   
public Elytra() {
    super(EnumHelper.addArmorMaterial("elytra", 27, new int[] { 0, 0, 0, 0 }, 0), 0, 1);
    setMaxDamage(432);
    setMaxStackSize(1);
    setTextureName("elytra");
    setUnlocalizedName(Utils.getUnlocalisedName("elytra"));
    setCreativeTab(EtFuturum.enableElytra ? EtFuturum.creativeTab : null);
}
项目:TFCPrimitiveTech    文件:TFCPrimitiveTech.java   
@EventHandler
    public void preInitialize(FMLPreInitializationEvent e)
    {
        instance = this;        

        // Load our settings
        proxy.loadOptions();

        proxy.registerTickHandler();

        ModBlocks.initialise(); 

        FluidList.register();   

        // Register Key Bindings(Client only)
        proxy.registerKeys();
        // Register KeyBinding Handler (Client only)
        proxy.registerKeyBindingHandler();
        // Register Handler (Client only)
        proxy.registerHandlers();
        // Register Tile Entities
        proxy.registerTileEntities(true);
        // Register Sound Handler (Client only)
        proxy.registerSoundHandler();

        woodenClubMaterial = EnumHelper.addToolMaterial("woodenClub", 1,    120, 2, 80, 5);

        ModItems.initialise();


        // Register Gui Handler
        proxy.registerGuiHandler();     
//      proxy.registerWailaHandler();
    }
项目:AdvancedCombat    文件:ACItems.java   
/** add the needed materials */
private static void addMaterials() {
    wood = EnumHelper.addArmorMaterial("Wood Log", RefStrings.MODID + ":wood", 6, new int[]{1, 3, 4, 1}, 5, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0);
    stone = EnumHelper.addArmorMaterial("Stone", RefStrings.MODID + ":stone", 11, new int[]{2, 4, 5, 2}, 8, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0);
    nether = EnumHelper.addArmorMaterial("Nether", RefStrings.MODID + ":nether", 33, new int[]{3, 5, 7, 3}, 8, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 2.5F);
    obsidian = EnumHelper.addArmorMaterial("Obsidian", RefStrings.MODID + ":obsidian", 88, new int[]{3, 6, 8, 4}, 8, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 4);
    stone.setRepairItem(new ItemStack(ACBlocks.advancedStone));
    nether.setRepairItem(new ItemStack(ACBlocks.netherFortressBlock));
    obsidian.setRepairItem(new ItemStack(ACBlocks.reinforcedObsidian));
}
项目:4Space-5    文件:ClientProxyCore.java   
@Override
public void init(FMLInitializationEvent event)
{
    Class[][] commonTypes =
            {
                    { MusicTicker.MusicType.class, ResourceLocation.class, int.class, int.class },
            };
    MUSIC_TYPE_MARS = EnumHelper.addEnum(commonTypes, MusicTicker.MusicType.class, "MARS_JC", new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "galacticraft.musicSpace"), 12000, 24000);
    ClientProxyCore.registerHandlers();
    ClientProxyCore.registerTileEntityRenderers();
    ClientProxyCore.registerBlockHandlers();
    ClientProxyCore.setupCapes();
}
项目:4Space-5    文件:MercuryItems.java   
@Override
public void initItems() {
    mercuryItem = new ItemBasics("mercuryItem", MercuryCore.instance.prefixTexture, new String[] {
            "iridiumCrystals",
            "iridiumPlate",
    });
    armourIridium = new ItemSetArmour(MercuryCore.instance.prefixTexture, EnumHelper.addArmorMaterial("iridium", 15, new int[] { 1, 4, 2, 1 }, 7));
    toolsIridium = new ItemSetTools(MercuryCore.instance.prefixTexture, EnumHelper.addToolMaterial("iridium", 3, 416, 6.0f, 1, 2));
}
项目:Rival-Rebels-Mod    文件:ItemTrollHelmet.java   
public ItemTrollHelmet()
{
    super(EnumHelper.addArmorMaterial("Troll", 5000, new int[] { 0, 0, 0, 0 }, 1000), 0, 0);
    setCreativeTab(RivalRebels.rrarmortab);
    setMaxDamage(5000);
    maxStackSize = 64;
}
项目:ToroQuest    文件:ToolMaterials.java   
protected static void obsidianMaterial() {
    int harvestLevel = 3;
    int durability = 10;
    float miningSpeed = 10f;
    float damageVsEntities = 20f;
    int enchantability = 12;
    OBSIDIAN_MATERIAL = EnumHelper.addToolMaterial("OBSIDIAN", harvestLevel, durability, miningSpeed, damageVsEntities, enchantability);
    OBSIDIAN_MATERIAL.setRepairItem(new ItemStack(Blocks.OBSIDIAN));
}
项目:ToroQuest    文件:ToolMaterials.java   
protected static void fireMaterial() {
    int harvestLevel = 3;
    int durability = 1000;
    float miningSpeed = 8f;
    float damageVsEntities = 9f;
    int enchantability = 20;
    FIRE_MATERIAL = EnumHelper.addToolMaterial("FIRE", harvestLevel, durability, miningSpeed, damageVsEntities, enchantability);
    FIRE_MATERIAL.setRepairItem(new ItemStack(Blocks.MAGMA));
}
项目:NinjaGear    文件:ItemNinjaArmor.java   
public static ArmorMaterial getMaterial() {
    if(ninjaCloth == null) {
        ninjaCloth = EnumHelper.addArmorMaterial("ninjaCloth", "ninja_cloth", 15, new int[]{2, 3, 4, 2}, 12, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 1.0F);
        if(ninjaCloth != null) {
            ninjaCloth.repairMaterial = new ItemStack(Blocks.WOOL, 1, OreDictionary.WILDCARD_VALUE);
        }
    }
    return ninjaCloth == null ? ArmorMaterial.LEATHER : ninjaCloth;
}
项目:InspiringWorld    文件:EnderTreeNormalGen.java   
void applyToVanilla() {
    if (EnderTreeNormalGen.appliedToVanilla) {
        return;
    }
    EnderTreeNormalGen.appliedToVanilla = true;
    try {
        Field fieldTree = ReflectionHelper.findField(Biome.class, "TREE_FEATURE", "field_76757_N");
        EnumHelper.setFailsafeFieldValue(fieldTree, null, this);
    } catch (Exception e) {
        IWTechConfig.logger().warn("InspiringWorld EnderTree generator's reflection failed:", e);
    }
}
项目:InspiringWorld    文件:EnderTreeSwampGen.java   
void applyToVanilla() {
    if (EnderTreeSwampGen.appliedToVanilla) {
        return;
    }
    EnderTreeSwampGen.appliedToVanilla = true;
    try {
        Field fieldSwamp = ReflectionHelper.findField(Biome.class, "SWAMP_FEATURE", "field_76763_Q");
        EnumHelper.setFailsafeFieldValue(fieldSwamp, null, this);
    } catch (Exception e) {
        IWTechConfig.logger().warn("InspiringWorld EnderTree generator's reflection failed:", e);
    }
}
项目:TeleToro    文件:ArmorMaterials.java   
protected static void initEnder() {
    int durability = 5;
    int[] reductionAmounts = { 0, 0, 0, 0 };
    int enchantability = 8;
    SoundEvent soundOnEquip = SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND;
    float toughness = 0;
    ENDER = EnumHelper.addArmorMaterial("ENDER", MODID + ":ender_armor", durability, reductionAmounts, enchantability, soundOnEquip, toughness);
}
项目:ThermosRebased    文件:CraftEntity.java   
public static void initMappings() {
    for (Map.Entry<Class<? extends Entity>, String> entry : cpw.mods.fml.common.registry.EntityRegistry.entityTypeMap.entrySet()) {
        Class<? extends Entity> entityClass = entry.getKey();
        String entityName = entry.getValue();
        int entityId = getEntityTypeIDfromClass(entityClass);

        Class<? extends org.bukkit.entity.Entity> bukkitEntityClass = CraftEntity.getEntityClass(entityClass);
        EnumHelper.addBukkitEntityType(entityName, bukkitEntityClass, entityId, false);
    }
}
项目:Toms-Mod    文件:ToolsInit.java   
@EventHandler
public static void PreLoad(FMLPreInitializationEvent PreEvent) {
    log.info("Start Pre Initialization");
    long tM = System.currentTimeMillis();
    if (!Config.toolsNeedHammer) {
        toolShape = new String[][]{{"MMM", " S ", " S "}, {"MM ", "MS ", " S "}, {" M ", " S ", " S "}, {" MM", " S ", " S "}, {" M ", " M ", " S "}};
    }
    if (Config.enableHardRecipes) {
        log.warn("Hard mode enabled");
        flintToolMaterial = EnumHelper.addToolMaterial("flintToolMaterial", 0, 150, 2F, 1F, 1);
        copperToolMaterial = EnumHelper.addToolMaterial("copperToolMaterial", 1, 300, 2.5F, 1.5F, 4);
        bronzeToolMaterial = EnumHelper.addToolMaterial("bronzeToolMaterial", 2, 512, 3.2F, 2.5F, 8);
        steelToolMaterial = EnumHelper.addToolMaterial("steelToolMaterial", 3, 800, 3.8F, 3F, 10);
    } else {
        flintToolMaterial = EnumHelper.addToolMaterial("flintToolMaterial", 0, 200, 3F, 1.5F, 2);
        copperToolMaterial = EnumHelper.addToolMaterial("copperToolMaterial", 1, 400, 3.5F, 1.8F, 6);
        bronzeToolMaterial = EnumHelper.addToolMaterial("bronzeToolMaterial", 2, 580, 4.2F, 2.5F, 12);
        steelToolMaterial = EnumHelper.addToolMaterial("steelToolMaterial", 3, 900, 4.8F, 3F, 15);
    }
    flint = new ToolGroup(flintToolMaterial, -3.2F, ToolGroup.defaultHead, "", 0).setUnlocalizedName("flint").setCreativeTab(tabTomsModToolsAndCombat);
    copper = new ToolGroup(copperToolMaterial, -2.6F, null, "plateCopper", TMResource.COPPER.getMaterialLevel()).setUnlocalizedName("copper").setCreativeTab(tabTomsModToolsAndCombat);
    bronze = new ToolGroup(bronzeToolMaterial, -2.2F, null, "plateBronze", TMResource.BRONZE.getMaterialLevel()).setUnlocalizedName("bronze").setCreativeTab(tabTomsModToolsAndCombat);
    steel = new ToolGroup(steelToolMaterial, -2.0F, null, "plateSteel", TMResource.STEEL.getMaterialLevel()).setUnlocalizedName("steel").setCreativeTab(tabTomsModToolsAndCombat);
    portableComparator = new PortableComparator().setCreativeTab(tabTomsModToolsAndCombat).setUnlocalizedName("tm.portableComparator").setMaxStackSize(1);
    flint.register();
    copper.register();
    bronze.register();
    steel.register();
    registerItem(portableComparator, portableComparator.getUnlocalizedName().substring(5));
    if (Config.changeDiamondToolsRecipe) {
        diamondHead = new ToolGroup.Head(ToolGroup.defaultHead).setCreativeTab(tabTomsModToolsAndCombat).setUnlocalizedName("tm.diamondHead").setMaxStackSize(1);
        CoreInit.addItemToGameRegistry(diamondHead, diamondHead.getUnlocalizedName().substring(5));
        CoreInit.proxy.runMethod((IMethod) diamondHead);
    }
    hadPreInit = true;
    CoreInit.tryLoadAfterPreInit(log);
    long time = System.currentTimeMillis() - tM;
    log.info("Pre Initialization took in " + time + " milliseconds");
}
项目:Alchemy    文件:ExArmorModifier.java   
public static void init() {
    Tool.load(TemperatureDebugger.Modifier.class);
    try {
        $(ExArmorModifier.class, "BAUBLE_TARGET<<",
                EnumHelper.addEnum(TemperatureDebugger.Modifier.class, "BAUBLE_TARGET",
                new Class<?>[]{ String.class, TemperatureDebugger.ModifierType.class }, "Bauble", TemperatureDebugger.ModifierType.TARGET));
        $(ExArmorModifier.class, "BAUBLE_RATE<<",
                EnumHelper.addEnum(TemperatureDebugger.Modifier.class, "BAUBLE_RATE",
                new Class<?>[]{ String.class, TemperatureDebugger.ModifierType.class }, "Bauble", TemperatureDebugger.ModifierType.RATE));
    } catch (Exception e) {
        AlchemyRuntimeException.onException(
                new RuntimeException("Add Enum Exception: toughasnails.temperature.TemperatureDebugger$Modifier", e));
    }
}
项目:Alchemy    文件:ExTimeModifier.java   
public static void init() {
    Tool.load(TemperatureDebugger.Modifier.class);
    try {
        $(ExTimeModifier.class, "TEMPERATURE_DIFFERENCE_RATE<<",
                EnumHelper.addEnum(TemperatureDebugger.Modifier.class, "TEMPERATURE_DIFFERENCE_RATE",
                new Class<?>[]{ String.class, TemperatureDebugger.ModifierType.class }, "Temperature difference", TemperatureDebugger.ModifierType.RATE));
        $(ExTimeModifier.class, "WEATHER_TARGET<<",
                EnumHelper.addEnum(TemperatureDebugger.Modifier.class, "WEATHER_TARGET",
                new Class<?>[]{ String.class, TemperatureDebugger.ModifierType.class }, "Weather", TemperatureDebugger.ModifierType.TARGET));
    } catch (Exception e) {
        AlchemyRuntimeException.onException(
                new RuntimeException("Add Enum Exception: toughasnails.temperature.TemperatureDebugger$Modifier", e));
    }
}
项目:Alchemy    文件:AlchemyUpdateManager.java   
@Config.Handle(name = HANDLE_JENKINS_CI, type = Type.MAKE)
public static JenkinsCI makeJenkinsCI(String url) {
    if (url.isEmpty())
        return MICKEY;
    String scheme, host;
    int index = url.indexOf(SEPARATOT);
    if (index == -1) {
        scheme = "http";
        host = url;
    } else {
        scheme = url.substring(0, index);
        host = url.substring(index + SEPARATOT.length());
    }
    return EnumHelper.addEnum(JenkinsCI.class, "custom", TYPES, scheme, host);
}
项目:MobHunter    文件:ItemMHPickaxe.java   
public ItemMHPickaxe(String name, int harvestLevel, int maxUses, float efficiency, float damage)
{
    super(EnumHelper.addToolMaterial("Pickaxe" + name, harvestLevel, maxUses, efficiency, damage, 15));
    setCreativeTab(MobHunter.MH_TAB);
    setUnlocalizedName("item" + name + "Pickaxe");
    setRegistryName("item" + name + "Pickaxe");
}
项目:OpenTechnology    文件:ClientProxy.java   
@Override
public void preInit(FMLPreInitializationEvent e) {
    super.preInit(e);

    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRadar.class, new RadarRender());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLDA.class, new TileAntennaRender());

    RenderingRegistry.registerBlockHandler(radarRenderingId, new RenderingRadarHandler());
    RenderingRegistry.registerBlockHandler(LDARenderingId, new RenderingAntennaHandler());
    RenderingRegistry.registerBlockHandler(CableDecorRenderingId, new RenderCableDecorHandler());
    RenderingRegistry.registerBlockHandler(PIMRenderingId, new BlockPIMRender());

    EnumHelper.addRarity("unreal", EnumChatFormatting.OBFUSCATED, "unreal");
}
项目:Thermos    文件:CraftEntity.java   
public static void initMappings() {
    for (Map.Entry<Class<? extends Entity>, String> entry : cpw.mods.fml.common.registry.EntityRegistry.entityTypeMap.entrySet()) {
        Class<? extends Entity> entityClass = entry.getKey();
        String entityName = entry.getValue();
        int entityId = getEntityTypeIDfromClass(entityClass);

        Class<? extends org.bukkit.entity.Entity> bukkitEntityClass = CraftEntity.getEntityClass(entityClass);
        EnumHelper.addBukkitEntityType(entityName, bukkitEntityClass, entityId, false);
    }
}