本文整理汇总了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);
}
示例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.");
}
}
示例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));
}