From 70c1354a4a96698758a88c032866288f79de6f5a Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Sat, 24 Aug 2024 08:16:37 -0400 Subject: Initial commit --- .../java/jp/plusplus/fbs/api/FBSRecipeAPI.java | 148 +++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 src/main/java/jp/plusplus/fbs/api/FBSRecipeAPI.java (limited to 'src/main/java/jp/plusplus/fbs/api/FBSRecipeAPI.java') diff --git a/src/main/java/jp/plusplus/fbs/api/FBSRecipeAPI.java b/src/main/java/jp/plusplus/fbs/api/FBSRecipeAPI.java new file mode 100644 index 0000000..0251b7c --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/api/FBSRecipeAPI.java @@ -0,0 +1,148 @@ +package jp.plusplus.fbs.api; + +import jp.plusplus.fbs.FBS; +import jp.plusplus.fbs.Registry; +import net.minecraft.entity.monster.IMob; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; + +/** + * Created by plusplus_F on 2015/09/05. + * 外部からレシピをどうにかしたいときに使ってください。 + * 別にRegistryを直接叩いてもいいけどね。 + */ +public class FBSRecipeAPI { + /** + * アイテムに対し抽出炉で抽出できる魔力量を登録する + * @param item + * @param amount 正の数 + */ + public static void AddManaContainer(ItemStack item, int amount){ + if(amount<=0){ + FBS.logger.error("Error:fault adding mana container. " + item.getDisplayName() + "(" + amount + ")"); + return; + } + Registry.RegisterManaContainer(item, amount); + } + + /** + * 魔術師の作業台でのクラフトレシピを登録する + * @param recipe 登録レシピ + * @param amount 消費魔力量(正の数) + */ + public static void AddCrafting(IRecipe recipe, int amount){ + if(amount<=0){ + FBS.logger.error("Error:fault adding crafting. " + recipe.getRecipeOutput().getDisplayName() + "(" + amount + ")"); + return; + } + Registry.RegisterRecipe(recipe, amount); + } + + /** + * 古書を登録する + * @param title 書物のUnlocalizedタイトル + * @param lv 適性魔術レベル(0 magic){ + if(title==null || lv<=0 || prob<=0 || exp<0 || sanTrial<0 || sanMax<0 || weight<0){ + FBS.logger.error("Error:fault adding book. " + title + "(lv" + lv + ",prob" + prob + ",exp" + exp + "," + sanTrial + "d" + sanMax + ",weight" + weight); + return; + } + Registry.RegisterBook(title, lv, true, prob, exp, sanTrial, sanMax, weight); + + if(type==null || aria<=0 || exp2<=0 || minUse<0 || maxUse type, int trial, int max){ + if(type==null || trial<=0 || max==0){ + FBS.logger.error("Error:fault registering mob. " + type.toString()+","+trial+"d"+max); + return; + } + Registry.RegisterMobSanity(type, trial, max); + } +} -- cgit v1.2.3