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


Java Material类代码示例

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


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

示例1: setRenderInfo

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
public void setRenderInfo(final Material material) {
    if (material.equals(adamant)) metalRender(material, adamantFluid.getColor(), 1f, 0.8f, 0f);
    else if (material.equals(duranite)) metalRender(material, duraniteFluid.getColor(), .4f, .4f, 0);
    else if (material.equals(tiberium)) metalRender(material, tiberiumFluid.getColor(), 1f, .3f, 0f);
    else if (material.equals(palladium)) metalRender(material, palladiumFluid.getColor(), .7f, .6f, 0f);
    else if (material.equals(osram)) metalRender(material, osramFluid.getColor(), .7f, .6f, 0f);
    else if (material.equals(tritonite)) metalRender(material, tritoniteFluid.getColor(), .3f, .3f, 0f);
    else if (material.equals(nucleum)) metalRender(material, nucleumFluid.getColor(), .4f, .6f, .2f);
    else if (material.equals(triberium)) metalRender(material, triberiumFluid.getColor(), 2f, 2f, 0.5f);
    else if (material.equals(solarium)) metalRender(material, solariumFluid.getColor(), 1.5f, 1.5f, 0.5f);
    else if (material.equals(uru)) metalRender(material, uruFluid.getColor(), 1.0f, 1.0f, 0.3f);
    else if (material.equals(imperomite)) metalRender(material, imperomiteFluid.getColor(), 0.4f, 1.0f, 0.7f);
    else if (material.equals(vibranium)) metalRender(material, vibraniumFluid.getColor(), 0.6f, .8f, 1f);
    else if (material.equals(valyrium)) metalRender(material, valyriumFluid.getColor(), .8f, 1.5f, -0.1f);
    else {
        material.setRenderInfo(new MaterialRenderInfo.BlockTexture("taiga:blocks/block/" + material.getIdentifier()));
    }
}
 
开发者ID:TeamFRM,项目名称:TAIGA,代码行数:19,代码来源:ClientProxy.java

示例2: registerMaterial

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
/** Makes a material and registers it */
private static Material registerMaterial(String name, Fluid fluid, String ingot, ItemStack ingotStack, AbstractTrait... traits) {
	Material mat = new Material(name, fluid.getColor());
	mat.setFluid(fluid);
	mat.addItem(ingot, 1, Material.VALUE_Ingot);
	mat.setCraftable(false);
	mat.setRepresentativeItem(ingotStack);
	for(AbstractTrait t : traits) { // make sure the config allows this!
		if(t instanceof TraitAutosmelt && !LCConfig.autoSmelt) continue;
		if(t instanceof TraitRepair && !LCConfig.autoRepair) continue;
		mat.addTrait(t);
	}
	TinkerRegistry.addMaterial(mat);
	matList.add(mat);
	return mat;
}
 
开发者ID:sblectric,项目名称:LightningCraft,代码行数:17,代码来源:ToolIntegration.java

示例3: setRecipe

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
@Override
public void setRecipe(IRecipeLayout recipeLayout, SmeltingRecipeWrapper recipe, IIngredients ingredients) {
    IGuiItemStackGroup items = recipeLayout.getItemStacks();
    items.init(0, true, 6, 3);

    items.set(ingredients);

    IGuiFluidStackGroup fluids = recipeLayout.getFluidStacks();
    fluids.init(0, false, 31, 3, 18, 38, Material.VALUE_Block, false, null);
    fluids.set(ingredients);

    items.init(2, false, 6, 23);
    items.set(2, new ItemStack(Meltery.MELTERY));

}
 
开发者ID:primetoxinz,项目名称:Meltery,代码行数:16,代码来源:SmeltingRecipeCategory.java

示例4: init

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
public static void init() {
    for(Material material: TinkerRegistry.getAllMaterials()) {
        if(material.hasFluid()) {
            registerOredictMelting(material.getFluid(), StringUtils.capitalize(material.identifier));
        }
    }
    registerOredictMelting(TinkerFluids.gold,"Gold");
    registerMelting(Items.CLAY_BALL, TinkerFluids.clay, Material.VALUE_Ingot);
    registerMelting(Blocks.CLAY, TinkerFluids.clay, Material.VALUE_BrickBlock);
}
 
开发者ID:primetoxinz,项目名称:Meltery,代码行数:11,代码来源:MelteryHandler.java

示例5: registerOredictMelting

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
public static void registerOredictMelting(Fluid fluid, String ore) {
    ImmutableSet.Builder<Pair<List<ItemStack>, Integer>> builder = ImmutableSet.builder();
    Pair<List<ItemStack>, Integer> nuggetOre = Pair.of(OreDictionary.getOres("nugget" + ore), Material.VALUE_Nugget);
    Pair<List<ItemStack>, Integer> ingotOre = Pair.of(OreDictionary.getOres("ingot" + ore), Material.VALUE_Ingot);
    Pair<List<ItemStack>, Integer> dustOre = Pair.of(OreDictionary.getOres("dust" + ore), Material.VALUE_Ingot);

    builder.add(nuggetOre, ingotOre, dustOre);
    Set<Pair<List<ItemStack>, Integer>> knownOres = builder.build();
    // register oredicts
    for(Pair<List<ItemStack>, Integer> pair : knownOres) {
        if(!pair.getLeft().isEmpty())
            registerMelting(new MelteryRecipe(RecipeMatch.of(pair.getLeft(), pair.getRight()), fluid));
    }
}
 
开发者ID:primetoxinz,项目名称:Meltery,代码行数:15,代码来源:MelteryHandler.java

示例6: metalRender

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
private void metalRender(final Material material, final int f, final float shine, final float brightness, final float hueshift) {
    material.setRenderInfo(new MaterialRenderInfo.AbstractMaterialRenderInfo() {
        @Override
        public TextureAtlasSprite getTexture(TextureAtlasSprite baseTexture, String location) {
            return new MetalTextureTexture("taiga:materials/" + material.getIdentifier(), baseTexture, location, f, shine, brightness, hueshift);
        }
    });
}
 
开发者ID:TeamFRM,项目名称:TAIGA,代码行数:9,代码来源:ClientProxy.java

示例7: insertDefaults

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
@Override
public void insertDefaults() {
  if(materials.isEmpty()) {
    for(Material material : TinkerRegistry.getAllMaterialsWithStats(MaterialTypes.HEAD)) {
      HeadMaterialStats stat = material.getStats(MaterialTypes.HEAD);
      materials.computeIfAbsent(material.getIdentifier(), s -> {
        setNeedsSaving();
        return stat.harvestLevel;
      });
    }
  }
}
 
开发者ID:SlimeKnights,项目名称:HarvestTweaks,代码行数:13,代码来源:TinkerConfig.java

示例8: registerMelting

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
public static void registerMelting() {
	for (ItemOre ore : OreRegistry.getItemOreRegistry()) {
		if (FluidRegistry.isFluidRegistered(ore.getOre().getName())) {
			Fluid fluid = FluidRegistry.getFluid(ore.getOre().getName());
			TinkerRegistry.registerMelting(new ItemStack(ore, 1, 1), fluid, 2*Material.VALUE_Ingot);
		}
	}
}
 
开发者ID:MikeLydeamore,项目名称:ExNihiloAdscensio,代码行数:9,代码来源:CompatTConstruct.java

示例9: onToolBuild

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
@SubscribeEvent
public void onToolBuild(TinkerToolEvent.OnItemBuilding event) {
  // we build a dummy tool tag to get the base modifier amount, unchanged by traits
  List<Material> materials = Lists.newArrayList();
  for(int i = 0; i < event.tool.getRequiredComponents().size(); i++) {
    materials.add(Material.UNKNOWN);
  }
  NBTTagCompound baseTag = event.tool.buildTag(materials);

  int modifiers = baseTag.getInteger(Tags.FREE_MODIFIERS);
  int modifierDelta = Config.getStartingModifiers() - modifiers;

  // set free modifiers
  NBTTagCompound toolTag = TagUtil.getToolTag(event.tag);
  modifiers = toolTag.getInteger(Tags.FREE_MODIFIERS);
  modifiers += modifierDelta;
  modifiers = Math.max(0, modifiers);
  toolTag.setInteger(Tags.FREE_MODIFIERS, modifiers);
  TagUtil.setToolTag(event.tag, toolTag);

  if(TinkerUtil.getModifierTag(event.tag, TinkerToolLeveling.modToolLeveling.getModifierIdentifier()).hasNoTags()) {
    TinkerToolLeveling.modToolLeveling.apply(event.tag);
  }

  if(!TinkerUtil.hasModifier(event.tag, TinkerToolLeveling.modToolLeveling.getModifierIdentifier())) {
    TinkerToolLeveling.modToolLeveling.apply(event.tag);
  }
}
 
开发者ID:SlimeKnights,项目名称:TinkersToolLeveling,代码行数:29,代码来源:EventHandler.java

示例10: getMaterial

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
/**
 * Gets the given material from the registry, or null if it's unknown
 * @param identifier    The identifier to get
 * @return              The material, or null if it doesn't exist
 */
public static Material getMaterial(String identifier) {
    Material material = TinkerRegistry.getMaterial(identifier);
    if(material == Material.UNKNOWN) return null;

    return material;
}
 
开发者ID:legendblade,项目名称:CraftingHarmonics,代码行数:12,代码来源:ReflectedTinkerRegistry.java

示例11: traits

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
@Override
public void traits(@Nonnull Material material) {
  material.addTrait(new TraitTeleport(1, 1));
  material.addTrait(new TraitTeleport(1, 2), MaterialTypes.HANDLE);
  material.addTrait(new TraitTeleport(1, 3), MaterialTypes.EXTRA);
  material.addTrait(new TraitTeleport(3, 0), MaterialTypes.HEAD);
  material.addTrait(TinkerTraits.poisonous, MaterialTypes.PROJECTILE);
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:9,代码来源:TicMaterials.java

示例12: integrate

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
public static void integrate(Alloy alloy, Fluid fluid) {
  if (TRAITS.get(alloy) != null) {
    Material material = new Material(alloy.getBaseName(), alloy.getColor());
    material.addCommonItems(alloy.getOreName());
    TRAITS.get(alloy).traits(material);
    TinkerRegistry.integrate(new MaterialIntegration(material, fluid, alloy.getOreName()).toolforge());
    TRAITS.get(alloy).stats(material);
  } else {
    NBTTagCompound tag = new NBTTagCompound();
    tag.setString("fluid", fluid.getName());
    tag.setString("ore", alloy.getOreName());
    tag.setBoolean("toolforge", true);
    FMLInterModComms.sendMessage("tconstruct", "integrateSmeltery", tag);
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:16,代码来源:TicMaterials.java

示例13: registerMaterials

import slimeknights.tconstruct.library.materials.Material; //导入依赖的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

示例14: stats

import slimeknights.tconstruct.library.materials.Material; //导入依赖的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

示例15: register

import slimeknights.tconstruct.library.materials.Material; //导入依赖的package包/类
public static void register() {
  Material material = TinkerRegistry.getMaterial(Alloy.VIBRANT_ALLOY.getBaseName());
  ItemStack itemstackWithMaterial = TinkerTools.largePlate.getItemstackWithMaterial(material);
  TraitPickup.instance.addRecipeMatch(new RecipeMatch.ItemCombination(1, itemstackWithMaterial));
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:6,代码来源:TicModifiers.java


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