當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。