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


Java TinkerRegistry.addMaterialStats方法代码示例

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


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

示例1: integrateMaterial

import slimeknights.tconstruct.library.TinkerRegistry; //导入方法依赖的package包/类
public static void integrateMaterial(String oreSuffix, @Nullable Material material, Fluid fluid, int headDura, float headSpeed, float headAttack, float handleMod, int handleDura, int extra, int headLevel, BowMaterialStats bowstats, boolean craft, boolean cast) {
    if (material != null) {
        if (TinkerRegistry.getMaterial(material.identifier) != Material.UNKNOWN)
            return;

        TinkerRegistry.addMaterialStats(material, new HeadMaterialStats(headDura, headSpeed, headAttack, headLevel));
        TinkerRegistry.addMaterialStats(material, new HandleMaterialStats(handleMod, handleDura));
        TinkerRegistry.addMaterialStats(material, new ExtraMaterialStats(extra));
        TinkerRegistry.addMaterialStats(material, bowstats);

        Item item = null;
        Field[] items = Items.class.getDeclaredFields();
        for (Field i : items) {
            if (i.getName().equals(StringUtils.uncapitalize(oreSuffix) + "Ingot")) {
                Item r = null;
                try {
                    r = (Item) i.get(i.getType());
                } catch (Exception e) {
                    e.printStackTrace();
                }
                item = r;
            }
        }

        material.setFluid(fluid).setCraftable(craft).setCastable(cast).addItem(item, 1, Material.VALUE_Ingot);
        material.setRepresentativeItem(item);
        proxy.setRenderInfo(material);
    }

    MaterialIntegration integration = new MaterialIntegration(material, fluid, oreSuffix);
    integration.integrate();
    TAIGA.integrateList.add(integration);
}
 
开发者ID:TeamFRM,项目名称:TAIGA,代码行数:34,代码来源:Utils.java

示例2: registerMaterials

import slimeknights.tconstruct.library.TinkerRegistry; //导入方法依赖的package包/类
/** Add the mod's materials */
private static void registerMaterials() {

	// support for both new and old Tinker's versions
	Class traitHolder = null;
	try {
		traitHolder = Class.forName("slimeknights.tconstruct.tools.TinkerTraits");
	} catch (ClassNotFoundException e1) {
		try {
			traitHolder = Class.forName("slimeknights.tconstruct.tools.TinkerMaterials");
		} catch (ClassNotFoundException e2) {}
	}
	AbstractTrait autosmelt = null;
	try {
		autosmelt = (AbstractTrait)traitHolder.getField("autosmelt").get(null);
	} catch (Exception e) {}

	// continue tool integration if there were no errors
	if(autosmelt != null) {
		electricium = registerMaterial("electricium", LCFluids.moltenElectricium, 
				"ingotElectricium", new ItemStack(LCItems.ingot, 1, Ingot.ELEC), lightning1);
		skyfather = registerMaterial("skyfather", LCFluids.moltenSkyfather, 
				"ingotSkyfather", new ItemStack(LCItems.ingot, 1, Ingot.SKY), lightning2, autosmelt);
		mystic = registerMaterial("mystic", LCFluids.moltenMystic, 
				"ingotMystic", new ItemStack(LCItems.ingot, 1, Ingot.MYSTIC), lightning2, autosmelt, repairTrait);

		TinkerRegistry.addMaterialStats(electricium,
				new HeadMaterialStats(800, 8.00f, 7.00f, 4),
				new HandleMaterialStats(0.90f, 50),
				new ExtraMaterialStats(100));

		TinkerRegistry.addMaterialStats(skyfather,
				new HeadMaterialStats(1000, 12.00f, 9.00f, 5),
				new HandleMaterialStats(0.90f, 60),
				new ExtraMaterialStats(100));

		TinkerRegistry.addMaterialStats(mystic,
				new HeadMaterialStats(1200, 15.00f, 11.00f, 6),
				new HandleMaterialStats(0.90f, 70),
				new ExtraMaterialStats(100));

		for(Material m : matList) TinkerSmeltery.registerToolpartMeltingCasting(m);
	} else {
		Log.logger.error("Unable to find Tinker's Construct trait class, aborting tool integration.");
	}
}
 
开发者ID:sblectric,项目名称:LightningCraft,代码行数:47,代码来源:ToolIntegration.java

示例3: stats

import slimeknights.tconstruct.library.TinkerRegistry; //导入方法依赖的package包/类
@Override
public void stats(@Nonnull Material material) {
  TinkerRegistry.addMaterialStats(material, new HeadMaterialStats(306, 6.50f, 2.25f, HarvestLevels.DIAMOND), new HandleMaterialStats(0.75f, 80),
      new ExtraMaterialStats(75), new BowMaterialStats(1.5f, 0.9f, 1f));
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:6,代码来源:TicMaterials.java


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