當前位置: 首頁>>代碼示例>>Java>>正文


Java CastingRecipe類代碼示例

本文整理匯總了Java中slimeknights.tconstruct.library.smeltery.CastingRecipe的典型用法代碼示例。如果您正苦於以下問題:Java CastingRecipe類的具體用法?Java CastingRecipe怎麽用?Java CastingRecipe使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CastingRecipe類屬於slimeknights.tconstruct.library.smeltery包,在下文中一共展示了CastingRecipe類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerTableCasting

import slimeknights.tconstruct.library.smeltery.CastingRecipe; //導入依賴的package包/類
public static void registerTableCasting() {
  for (CastQueue cast : TiCQueues.getCastQueue()) {
    if (cast.getFluid() == null) {
      FluidStack fluid = getFluidForItems(cast.getItem());
      if (fluid != null) {
        cast.setFluid(fluid.getFluid());
        cast.setAmount(cast.getAmount() * fluid.amount);
      }
    }
    if (cast.getFluid() == null) {
      Log.warn("Item used in cast recipe '" + cast.getItem() + "' doesn't smelt into a fluid");
    } else {
      TinkerRegistry.registerTableCasting(new CastingRecipe(cast.getResult(), Prep.isValid(cast.getCast()) ? RecipeMatch.ofNBT(cast.getCast()) : null,
          cast.getFluid(), (int) Math.ceil(cast.getAmount()), cast.isConsumeCast(), false));
      Log.debug("Tinkers.registerTableCasting: " + cast.getResult() + ", " + cast.getCast() + ", " + cast.getFluid().getName() + ", " + cast.getAmount());
    }
  }
  TiCQueues.getCastQueue().clear();
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:20,代碼來源:TicRegistration.java

示例2: init

import slimeknights.tconstruct.library.smeltery.CastingRecipe; //導入依賴的package包/類
@Optional.Method(modid = "tconstruct")
public static void init()
{
	TinkerRegistry.registerMelting(new MeltingRecipe(RecipeMatch.of(ModBlocks.butter, 1000), ModFluids.liquid_butter, 300));
	TinkerRegistry.registerBasinCasting(new CastingRecipe(new ItemStack(ModBlocks.butter), ModFluids.liquid_butter, 1000, 60));

	if (Loader.isModLoaded("xlfoodmod"))
	{
		TinkerRegistry.registerMelting(new MeltingRecipe(RecipeMatch.of(ItemListxlfoodmod.butter, 250), ModFluids.liquid_butter, 200));
		TinkerRegistry.registerTableCasting(new CastingRecipe(new ItemStack(ItemListxlfoodmod.butter), RecipeMatch.of(TinkerSmeltery.castIngot), ModFluids.liquid_butter, 250, 15));
	}
}
 
開發者ID:DarkMorford,項目名稱:BetterThanWeagles,代碼行數:13,代碼來源:IntegrationTinkers.java

示例3: matches

import slimeknights.tconstruct.library.smeltery.CastingRecipe; //導入依賴的package包/類
protected boolean matches(ICastingRecipe recipe) {
    // If we're matching the cast, check that...
    if(CastingRecipe.class.isAssignableFrom(recipe.getClass())) {
        CastingRecipe castingRecipe = (CastingRecipe)recipe;

        // Be a little over-paranoid with this:
        ItemStack result = castingRecipe.getResult();
        if(what == null || result == null || !result.isItemEqualIgnoreDurability(what)) return false;

        // If that's all we needed to check
        if(with == null && cast == null) return true;

        if (cast != null &&
                (castingRecipe.cast.getInputs().size() != 1 || // We have one cast input, and that it matches
                        !castingRecipe.cast.getInputs().get(0).isItemEqualIgnoreDurability(cast))) return false;

        // Check our fluids as well...
        return !(with != null && !castingRecipe.getFluid().isFluidEqual(with));
    }
    else if(BucketCastingRecipe.class.isAssignableFrom(recipe.getClass())) {
        // Make sure we're checking a bucket...
        if(cast != null && !ItemUtility.areItemsEquivalent(cast.getItem(), Items.BUCKET)) return false;

        // If we have no fluid to match, return true here...
        if(with == null) return true;

        // Otherwise, match on everything
        return recipe.matches(new ItemStack(Items.BUCKET), with.getFluid());
    }

    // If we made it here... give up all hope:
    return false;
}
 
開發者ID:legendblade,項目名稱:CraftingHarmonics,代碼行數:34,代碼來源:RemoveSmelteryCast.java

示例4: init

import slimeknights.tconstruct.library.smeltery.CastingRecipe; //導入依賴的package包/類
@Override
public void init() throws OperationException {
    recipe = new CastingRecipe(what, cast != null ? RecipeMatch.ofNBT(cast) : null, with, consumeCast, switchOutput);
}
 
開發者ID:legendblade,項目名稱:CraftingHarmonics,代碼行數:5,代碼來源:AddSmelteryBasinCast.java

示例5: init

import slimeknights.tconstruct.library.smeltery.CastingRecipe; //導入依賴的package包/類
@Override
public void init() throws OperationException {
    recipe = new CastingRecipe(what, RecipeMatch.ofNBT(cast), with, consumeCast, switchOutput);
}
 
開發者ID:legendblade,項目名稱:CraftingHarmonics,代碼行數:5,代碼來源:AddSmelteryTableCast.java


注:本文中的slimeknights.tconstruct.library.smeltery.CastingRecipe類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。