当前位置: 首页>>代码示例>>Java>>正文


Java EnumHelper.addEnum方法代码示例

本文整理汇总了Java中net.minecraftforge.common.util.EnumHelper.addEnum方法的典型用法代码示例。如果您正苦于以下问题:Java EnumHelper.addEnum方法的具体用法?Java EnumHelper.addEnum怎么用?Java EnumHelper.addEnum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.util.EnumHelper的用法示例。


在下文中一共展示了EnumHelper.addEnum方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addArmorMaterial

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
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)
	});
}
 
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:18,代码来源:ArmorUtils.java

示例2: getType

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:BiomeManager.java

示例3: getType

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:43,代码来源:BiomeDictionary.java

示例4: init

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
@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();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:ClientProxyCore.java

示例5: getType

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
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;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:19,代码来源:BiomeManager.java

示例6: registerParticleTypes

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
@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;
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:17,代码来源:AlchemyFXType.java

示例7: makeJenkinsCI

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
@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);
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:16,代码来源:AlchemyUpdateManager.java

示例8: init

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
@Override
public void init(FMLInitializationEvent event) {
	Class[][] commonTypes = { { MusicTicker.MusicType.class, ResourceLocation.class, int.class, int.class }, };
	MUSIC_TYPE_SPACE = EnumHelper.addEnum(commonTypes, MusicTicker.MusicType.class, "SNOWSTORM", new ResourceLocation(MercuryCore.ASSET_PREFIX, "4space.musicSpace"), 12000, 24000);

	ClientProxyCore.setupCapes();
	super.init(event);
}
 
开发者ID:4Space,项目名称:4Space-1.7,代码行数:9,代码来源:ClientProxy.java

示例9: initBase

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
public static void initBase(Property...props){
Rarity ALMOST_RARE = EnumHelper.addEnum(Rarity.class, "NEAR_RARE", new Class<?>[]{int.class}, 3);
bashWeight = EnchantmentHelper.build(props[0], "bash.weightless", BaseEnchantment.class, Battlegear.MODID+":bash_weightless", Rarity.UNCOMMON, 3, 15, 30);
      bashPower = EnchantmentHelper.build(props[1], "bash.power", BaseEnchantment.class, Battlegear.MODID+":bash_power", Rarity.COMMON, 5, 10, 40);
      bashDamage = EnchantmentHelper.build(props[2], "bash.damage", BaseEnchantment.class, Battlegear.MODID+":bash_damage", Rarity.VERY_RARE, 3, 15, 50);
      shieldUsage = EnchantmentHelper.build(props[3], "shield.usage", BaseEnchantment.class, Battlegear.MODID+":shield_efficiency", Rarity.RARE, 5, 5, 30);
      shieldRecover = EnchantmentHelper.build(props[4], "shield.recover", BaseEnchantment.class, Battlegear.MODID+":shield_recovery", ALMOST_RARE, 4, 20, 20);
      bowLoot = EnchantmentHelper.build(props[5], "bow.loot", BaseEnchantment.class, Battlegear.MODID+":bow_luck", Rarity.RARE, 10, 50);
      bowCharge = EnchantmentHelper.build(props[6], "bow.charge", BaseEnchantment.class, Battlegear.MODID+":bow_drawnback", Rarity.VERY_RARE, 20, 20);
  }
 
开发者ID:Mine-and-blade-admin,项目名称:Battlegear2,代码行数:11,代码来源:BaseEnchantment.java

示例10: addPattern

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static void addPattern(String name, String id, ItemStack craftingItem) throws ClassNotFoundException {
	EnumHelper.addEnum((Class<Enum<?>>) Class.forName("ganymedes01.etfuturum.tileentities.TileEntityBanner$EnumBannerPattern"), name.toUpperCase(), new Class[] { String.class, String.class, ItemStack.class }, new Object[] { name, id, craftingItem });
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:5,代码来源:BannerPatternHelper.java

示例11: addBanner

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void addBanner(String enumName, String textureName, String id, ItemStack recipeItem){
	final Class<?>[] paramClasses = new Class[] { String.class, String.class, ItemStack.class };
       EnumHelper.addEnum((Class)BannerPattern.class, enumName.toUpperCase(), (Class[])paramClasses, new Object[] { textureName, id, recipeItem });
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:6,代码来源:ModBanners.java

示例12: getType

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
/**
 * Retrieves a Type value by name,
 * if one does not exist already it creates one.
 * This can be used as interm measure for modders to
 * add there 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());
    }
    return ret;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:34,代码来源:BiomeDictionary.java

示例13: createRenderType

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
public static EnumBlockRenderType createRenderType(String name) {
    return EnumHelper.addEnum(EnumBlockRenderType.class, name, new Class[0]);
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:4,代码来源:BlockRenderingRegistry.java

示例14: createHorseArmorType

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
@Nullable
public HorseArmorType createHorseArmorType (int strength, @Nonnull String name, @Nonnull String hash) {
    return EnumHelper.addEnum(HorseArmorType.class, name.toUpperCase().replace(" ", "_"), new Class[] { int.class, String.class, String.class }, strength, name, hash);
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:MMDLib-old,代码行数:5,代码来源:HorseArmorUtils.java

示例15: addPattern

import net.minecraftforge.common.util.EnumHelper; //导入方法依赖的package包/类
public static void addPattern(String name, String id, ItemStack craftingItem) {
    name = "extrafood_" + name;
    id = "ef_" + id;
    EnumHelper.addEnum(TileEntityBanner.EnumBannerPattern.class, name.toUpperCase(), new Class[]{String.class, String.class, ItemStack.class}, new Object[]{name, id, craftingItem});
}
 
开发者ID:TeamDmfMM,项目名称:Extra-Food,代码行数:6,代码来源:Banners.java


注:本文中的net.minecraftforge.common.util.EnumHelper.addEnum方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。