summaryrefslogtreecommitdiff
path: root/src/main/java/jp/plusplus/fbs/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/jp/plusplus/fbs/api')
-rw-r--r--src/main/java/jp/plusplus/fbs/api/FBSEntityPropertiesAPI.classbin0 -> 3244 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/FBSEntityPropertiesAPI.java153
-rw-r--r--src/main/java/jp/plusplus/fbs/api/FBSRecipeAPI.classbin0 -> 4601 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/FBSRecipeAPI.java148
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IHarvestable.classbin0 -> 927 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IHarvestable.java67
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IMagicEnchant$ParticleColor.classbin0 -> 520 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IMagicEnchant.classbin0 -> 461 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IMagicEnchant.java44
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IPottery$1.classbin0 -> 1313 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IPottery$PotteryGrade.classbin0 -> 2341 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IPottery$PotterySize.classbin0 -> 2118 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IPottery$PotteryState.classbin0 -> 1979 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IPottery.classbin0 -> 2192 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IPottery.java253
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IResonance.classbin0 -> 499 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/IResonance.java43
-rw-r--r--src/main/java/jp/plusplus/fbs/api/MagicBase.classbin0 -> 5449 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/MagicBase.java188
-rw-r--r--src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.classbin0 -> 1697 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.java55
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/CheckingMonocleEvent.classbin0 -> 1183 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/CheckingMonocleEvent.java35
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/DamageMonocleEvent.classbin0 -> 743 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/DamageMonocleEvent.java23
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/PlayerDecodedBookEvent.classbin0 -> 1108 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/PlayerDecodedBookEvent.java37
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/PlayerSanityEvent.classbin0 -> 1134 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/PlayerSanityEvent.java32
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/PlayerSanityRollEvent.classbin0 -> 920 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/PlayerSanityRollEvent.java24
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent$Post.classbin0 -> 683 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent$Pre.classbin0 -> 680 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent.classbin0 -> 998 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent.java36
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/SpiritTalkEvent.classbin0 -> 1101 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/api/event/SpiritTalkEvent.java30
37 files changed, 1168 insertions, 0 deletions
diff --git a/src/main/java/jp/plusplus/fbs/api/FBSEntityPropertiesAPI.class b/src/main/java/jp/plusplus/fbs/api/FBSEntityPropertiesAPI.class
new file mode 100644
index 0000000..7873baa
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/FBSEntityPropertiesAPI.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/FBSEntityPropertiesAPI.java b/src/main/java/jp/plusplus/fbs/api/FBSEntityPropertiesAPI.java
new file mode 100644
index 0000000..d351f7b
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/FBSEntityPropertiesAPI.java
@@ -0,0 +1,153 @@
+package jp.plusplus.fbs.api;
+
+import jp.plusplus.fbs.Registry;
+import jp.plusplus.fbs.exprop.FBSEntityProperties;
+import jp.plusplus.fbs.exprop.SanityManager;
+import jp.plusplus.fbs.item.enchant.EnchantmentCleverness;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.util.MathHelper;
+
+import javax.swing.text.html.parser.Entity;
+
+/**
+ * Created by plusplus_F on 2015/09/05.
+ * FBS,TFKの独自ステータスに関してはここで弄るといいと思います。
+ */
+public class FBSEntityPropertiesAPI {
+
+ /**
+ * playerの現在の正気度を得る
+ * @param player 対象プレイヤー
+ * @return 現在の正気度
+ */
+ public static int GetSanityPoint(EntityPlayer player){
+ FBSEntityProperties prop=FBSEntityProperties.get(player);
+ return prop.getSanity();
+ }
+
+ /**
+ * playerの最大正気度を得る
+ * @param player 対象プレイヤー
+ * @return 最大正気度
+ */
+ public static int GetMaxSanityPoint(EntityPlayer player){
+ FBSEntityProperties prop=FBSEntityProperties.get(player);
+ return prop.getMaxSanity();
+ }
+
+ /**
+ * プレイヤー1人を対象に発動する。そのプレイヤーに正気度を与える
+ * @param player 対象プレイヤー
+ * @param trial ダイスを振る回数 (0<)
+ * @param max 何面ダイス? (0<)
+ * @param sim 実際に結果を反映させるか否か
+ * @return 変化量
+ */
+ public static int AddSanity(EntityPlayer player, int trial, int max, boolean sim){
+ return SanityManager.addSanity(player, trial, max, sim);
+ }
+
+ /**
+ * プレイヤー1人を対象に発動する。そのプレイヤーの正気度を失わせる
+ * @param player 対象プレイヤー
+ * @param trial ダイスを振る回数 (0<)
+ * @param max 何面ダイス? (0<)
+ * @param sim 実際に結果を反映させるか否か
+ * @return 変化量
+ */
+ public static int LoseSanity(EntityPlayer player, int trial, int max, boolean sim){
+ return SanityManager.loseSanity(player, trial, max, sim);
+ }
+
+ /**
+ * playerの補正無しの魔術レベルを得る
+ * @param player 対象プレイヤー
+ * @return 魔術レベル
+ */
+ public static int GetMagicLevelRaw(EntityPlayer player){
+ FBSEntityProperties prop=FBSEntityProperties.get(player);
+ return prop.getMagicLevel();
+ }
+
+ /**
+ * playerの補正済みの魔術レベルを得る
+ * @param player 対象プレイヤー
+ * @return 魔術レベル
+ */
+ public static int GetMagicLevel(EntityPlayer player){
+ FBSEntityProperties prop=FBSEntityProperties.get(player);
+ int l=prop.getMagicLevel();
+
+ //ポーション効果
+ int peff;
+ if(player.isPotionActive(Registry.potionCleverness)){
+ peff=4*(1+player.getActivePotionEffect(Registry.potionCleverness).getAmplifier());
+ }
+ else{
+ peff=0;
+ }
+
+ //エンチャント補正
+ int eSum= EnchantmentCleverness.getSum(player);
+ int eeff;
+ if(eSum<=5) eeff=5;
+ else if(eSum<=11) eeff=5+MathHelper.floor_float(0.5f*(eSum-5));
+ else eeff=8+MathHelper.floor_float(2.f/14.f*(eSum-11));
+
+ //
+ return l+peff+eeff;
+ }
+
+
+ /**
+ * playerの魔術レベルを設定する
+ * @param player 対象プレイヤー
+ * @param lv 魔術レベル
+ */
+ public static void SetMagicLevel(EntityPlayer player, int lv){
+ FBSEntityProperties prop=FBSEntityProperties.get(player);
+ prop.setMagicLevel(lv);
+ SanityManager.sendPacket(player);
+ }
+
+ /**
+ * playerの魔術経験値を得る
+ * @param player 対象プレイヤー
+ * @return 魔術経験値
+ */
+ public static double GetMagicEXP(EntityPlayer player){
+ FBSEntityProperties prop=FBSEntityProperties.get(player);
+ return prop.getEXP();
+ }
+
+ /**
+ * playerのLvUPに必要な魔術経験値を得る
+ * @param player 対象プレイヤー
+ * @return 必要な魔術経験値
+ */
+ public static double GetNextMagicEXP(EntityPlayer player){
+ FBSEntityProperties prop=FBSEntityProperties.get(player);
+ return prop.getNext();
+ }
+
+ /**
+ * 魔術経験値を与える。レベルアップの判定と処理もされる
+ * @param player 対象プレイヤー
+ * @param exp (0<)
+ * @param sim 実際に結果を反映させるか否か
+ * @return 変化量
+ */
+ public static double AddExp(EntityPlayer player, double exp, boolean sim){
+ return SanityManager.addExp(player, exp, sim);
+ }
+
+ /**
+ * その本が解読したことがあるかどうかを返す
+ * @param player 対象プレイヤー
+ * @param name 対象の書物
+ * @return trueなら解読したことがある
+ */
+ public static boolean IsBookDecoded(EntityPlayer player, String name){
+ return FBSEntityProperties.get(player).isDecoded(name);
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/FBSRecipeAPI.class b/src/main/java/jp/plusplus/fbs/api/FBSRecipeAPI.class
new file mode 100644
index 0000000..034e6e5
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/FBSRecipeAPI.class
Binary files differ
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<lv)
+ * @param prob 解読成功確率(0<prob<=1)
+ * @param exp 基本経験値(0<=exp)
+ * @param sanTrial 正気度ロールXdYのX(0<=)
+ * @param sanMax 正気度ロールXdYのY(0<=)
+ * @param weight 出現時の重み(基本値10)
+ */
+ public static boolean AddBook(String title, int lv, float prob, double exp, int sanTrial, int sanMax, int weight){
+ 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 false;
+ }
+ Registry.RegisterBook(title, lv, false, prob, exp, sanTrial, sanMax, weight);
+ return true;
+ }
+
+ /**
+ * 魔法を登録する。書物も一緒に登録される
+ * @param title 書物のUnlocalizedタイトル
+ * @param lv 適性魔術レベル(0<lv)
+ * @param prob 解読成功確率(0<prob<=1)
+ * @param exp 基本経験値(0<=exp)
+ * @param sanTrial 正気度ロールXdYのX(0<=)
+ * @param sanMax 正気度ロールXdYのY(0<=)
+ * @param weight 出現時の重み(基本値10)
+ * @param type 魔法の種類
+ * @param aria 詠唱tick数
+ * @param exp2 魔法行使の基本経験値
+ * @param minUse 解読時設定される使用回数の最小
+ * @param maxUse 解読時設定される使用回数の最大
+ * @param magic 魔法のクラス
+ */
+ public static void AddMagic(String title, int lv, float prob, double exp, int sanTrial, int sanMax, int weight, String type, int aria, double exp2, int minUse, int maxUse, Class<? extends MagicBase> 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<minUse || magic==null){
+ FBS.logger.error("Error:fault adding magic. " + title + "(aria" + aria + ",exp2" + exp2 + ",use" + minUse + "..." + maxUse + "," + magic.toString());
+ return;
+ }
+ Registry.RegisterMagic(title, type, aria, exp2, minUse, maxUse, magic);
+ }
+
+ /**
+ * TFKの構造物のチェスト内容を登録する
+ * @param id 封印された図書館:0
+ * @param item
+ * @param weight 出現の重み(0<)
+ */
+ public static void AddChestContent(int id, ItemStack item, int weight){
+ if(id<0 || item==null || weight<=0){
+ FBS.logger.error("Error:fault adding chest content. id" + id + "," + item.getDisplayName() + ",weight" + weight);
+ return;
+ }
+ Registry.RegisterChestContent(id, item, weight);
+ }
+
+ /**
+ * 魔法陣を登録する。
+ * 魔法陣は文字列の配列で表され、n*nのサイズである必要がある(nは奇数)。
+ * 使用できる文字は0~9,a-fであり、これは各チャームのメタ値に対応している。
+ * また、空白' 'も使用でき、これはそこにはチャームが無いことを示す。
+ * 魔法陣の中央は常に核が置かれるため、中央の値は無視される。
+ * @param name 登録名
+ * @param charms 魔法陣のチャーム配置
+ */
+ public static void AddMagicCircle(String name, String ... charms){
+ if(name==null || charms==null){
+ FBS.logger.error("Error:fault adding chest content. " + name + "," + charms);
+ return;
+ }
+ Registry.RegisterMagicCircle(name, charms);
+ }
+
+ /**
+ * アイテム使用時のプレイヤーの正気度の変化量を登録する。
+ * @param item
+ * @param trial 正気度ロールXdYのX(0<)
+ * @param max 正気度ロールXdYのY(!=0)
+ */
+ public static void AddItemSanity(ItemStack item, int trial, int max){
+ if(item==null || trial<=0 || max==0){
+ FBS.logger.error("Error:fault registering item. " + item.getDisplayName()+","+trial+"d"+max);
+ return;
+ }
+ Registry.RegisterItemSanity(item, trial, max);
+ }
+
+ /**
+ * Mob攻撃時のプレイヤーの正気度の変化量を登録する。
+ * @param type Mobのクラス
+ * @param trial 正気度ロールXdYのX(0<)
+ * @param max 正気度ロールXdYのY(!=0)
+ */
+ public static void AddMobSanity(Class<? extends IMob> 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);
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/IHarvestable.class b/src/main/java/jp/plusplus/fbs/api/IHarvestable.class
new file mode 100644
index 0000000..0749eca
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IHarvestable.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/IHarvestable.java b/src/main/java/jp/plusplus/fbs/api/IHarvestable.java
new file mode 100644
index 0000000..1b2f7c2
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IHarvestable.java
@@ -0,0 +1,67 @@
+package jp.plusplus.fbs.api;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+import java.util.ArrayList;
+import java.util.Random;
+
+/**
+ * Created by plusplus_F on 2015/11/09.
+ * 右クリックで収穫可能なブロック
+ */
+public interface IHarvestable {
+ /**
+ * 収穫可能な状態にあるか調べる
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ public boolean canHarvest(World world, int x, int y, int z);
+
+ /**
+ * 収穫可能な状態を目指して成長させる
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param rand
+ */
+ public void glow(World world, int x, int y, int z, Random rand);
+
+ /**
+ * 収穫可能なアイテムの一覧を入手する
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ public ArrayList<ItemStack> getHarvestItems(World world, int x, int y, int z);
+
+ /**
+ * プレイヤーによって収穫する
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param player
+ * @param rand
+ * @return
+ */
+ public ArrayList<ItemStack> harvest(World world, int x, int y, int z, Random rand, EntityPlayer player);
+
+ /**
+ * 収穫機など、プレイヤー以外が収穫する
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param rand
+ * @return
+ */
+ public ArrayList<ItemStack> harvest(World world, int x, int y, int z, Random rand);
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/IMagicEnchant$ParticleColor.class b/src/main/java/jp/plusplus/fbs/api/IMagicEnchant$ParticleColor.class
new file mode 100644
index 0000000..ea46b90
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IMagicEnchant$ParticleColor.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/IMagicEnchant.class b/src/main/java/jp/plusplus/fbs/api/IMagicEnchant.class
new file mode 100644
index 0000000..0353f8f
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IMagicEnchant.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/IMagicEnchant.java b/src/main/java/jp/plusplus/fbs/api/IMagicEnchant.java
new file mode 100644
index 0000000..404b378
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IMagicEnchant.java
@@ -0,0 +1,44 @@
+package jp.plusplus.fbs.api;
+
+import net.minecraft.entity.EntityLivingBase;
+
+/**
+ * Created by plusplus_F on 2015/06/22.
+ * 付与魔法とするMagicBaseのサブクラスが実装すべきインターフェース
+ * このインターフェースを実装していると付与魔法として扱われる
+ */
+public interface IMagicEnchant {
+ /**
+ * 対象Entityに何かしらの効果を与える。
+ * これは主に共鳴魔法から呼び出される。
+ * @param entity 付与対象Entity
+ * @param success 魔法の成功可否(true:成功)
+ */
+ public void enchant(EntityLivingBase entity, boolean success);
+
+ /**
+ * ダメージ計算時に実ダメージに乗算される値を返す
+ * @param entity 付与対象となるEntity
+ * @return 実ダメージ値に乗算される補正値(0以上)
+ */
+ public float damageScale(EntityLivingBase entity);
+
+ /**
+ * ダメージ計算時に実ダメージに加算される値を返す
+ * @param entity 付与対象となるEntity
+ * @return 実ダメージ値に加算される補正値(0以上)
+ */
+ public float damageValue(EntityLivingBase entity);
+
+ /**
+ * パーティクルの色を設定する
+ */
+ public ParticleColor setParticleColor();
+
+ public static class ParticleColor{
+ public float red,green,blue;
+ public ParticleColor(){
+ red=green=blue=1;
+ }
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/IPottery$1.class b/src/main/java/jp/plusplus/fbs/api/IPottery$1.class
new file mode 100644
index 0000000..3a0ed2a
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IPottery$1.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/IPottery$PotteryGrade.class b/src/main/java/jp/plusplus/fbs/api/IPottery$PotteryGrade.class
new file mode 100644
index 0000000..2c43117
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IPottery$PotteryGrade.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/IPottery$PotterySize.class b/src/main/java/jp/plusplus/fbs/api/IPottery$PotterySize.class
new file mode 100644
index 0000000..26be3ee
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IPottery$PotterySize.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/IPottery$PotteryState.class b/src/main/java/jp/plusplus/fbs/api/IPottery$PotteryState.class
new file mode 100644
index 0000000..2120a46
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IPottery$PotteryState.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/IPottery.class b/src/main/java/jp/plusplus/fbs/api/IPottery.class
new file mode 100644
index 0000000..f747611
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IPottery.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/IPottery.java b/src/main/java/jp/plusplus/fbs/api/IPottery.java
new file mode 100644
index 0000000..b2d081a
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IPottery.java
@@ -0,0 +1,253 @@
+package jp.plusplus.fbs.api;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+
+import java.util.ArrayList;
+import java.util.Random;
+
+/**
+ * Created by plusplus_F on 2015/08/26.
+ * 陶芸品。ブロックに実装する事。
+ */
+public interface IPottery {
+
+ /**
+ * 指定の値のItemStackを返す
+ * @param state
+ * @param grade
+ * @param size
+ * @param pattern
+ * @param hasEffect
+ * @return
+ */
+ public ItemStack getItemStack(PotteryState state, PotteryGrade grade, PotterySize size, byte pattern, boolean hasEffect);
+
+ /**
+ * Sizeを設定する
+ * @param itemStack
+ * @param size
+ */
+ public void setSize(ItemStack itemStack, PotterySize size);
+
+ /**
+ * サイズを返す
+ * @param nbt
+ * @return
+ */
+ public PotterySize getSize(NBTTagCompound nbt);
+
+
+ /**
+ * 品質を設定する
+ * @param itemStack
+ * @param grade
+ */
+ public void setGrade(ItemStack itemStack, PotteryGrade grade);
+
+ /**
+ * 品質を*ランダムに*設定する
+ * @param itemStack
+ * @param rand
+ */
+ public void setGrade(ItemStack itemStack, Random rand);
+
+ /**
+ * 品質を返す
+ * @param nbt
+ * @return
+ */
+ public PotteryGrade getGrade(NBTTagCompound nbt);
+
+ /**
+ * 模様を設定する
+ * @param itemStack
+ * @param pattern
+ */
+ public void setPattern(ItemStack itemStack, byte pattern);
+
+ /**
+ * 模様を返す
+ * @param nbt
+ * @return
+ */
+ public byte getPattern(NBTTagCompound nbt);
+
+ /**
+ * 状態を設定する
+ * 特殊効果持ちの陶芸品を作る場合、ここでBAKEDに遷移する際にアイテムスタックを弄ること
+ * @param itemStack
+ * @param state
+ */
+ public void setState(ItemStack itemStack, PotteryState state);
+ /**
+ * 状態を返す
+ * @param nbt
+ * @return
+ */
+ public PotteryState getState(NBTTagCompound nbt);
+
+ /**
+ * 効果持ちフラグを設定する
+ * @param itemStack
+ * @param eff
+ * @return
+ */
+ public void setEffect(ItemStack itemStack, boolean eff);
+
+ /**
+ * 魔法の効果を持つか
+ * @param nbt
+ * @return
+ */
+ public boolean hasEffect(NBTTagCompound nbt);
+
+ /**
+ * hasEffect():true時に、窯で焼きあがる際に呼ばれる
+ * 効果持ちのItemStackを返す
+ * @param itemStack
+ * @return
+ */
+ public ItemStack getEnchantedItemStack(ItemStack itemStack, Random rand);
+
+ /**
+ * 描画用メタデータを得る
+ * 2211 0000
+ * 0:模様
+ * 1:大きさ
+ * 2:状態
+ * @param nbt
+ * @return
+ */
+ public int getMetadata(NBTTagCompound nbt);
+
+ /**
+ * モデル描画に使うRLを返す
+ * @param metadata 
+ * @return
+ */
+ public ResourceLocation getResourceLocation(int metadata);
+
+ /**
+ * モデル描画に使うMBを返す
+ * @param metadata
+ * @return
+ */
+ public ModelBase getModel(int metadata);
+
+ /**
+ * ブロックを返す。基本はthisを返す
+ * @return
+ */
+ public Block getBlockType();
+
+ /**
+ * 乾燥にかかる*秒数*を返す
+ * @param nbt
+ * @return
+ */
+ public int getDrySec(NBTTagCompound nbt);
+
+ /**
+ * そのアイテムを売却した際の価格を返す
+ * @param itemStack
+ * @return
+ */
+ public int getMP(ItemStack itemStack);
+
+ /**
+ * 表示されるローカライズされた名前を得る
+ * @param nbt
+ * @return
+ */
+ public String getLocalizedName(NBTTagCompound nbt);
+
+ /**
+ * 「完成品の」取り得る全てのパターンを返す
+ * 返り値はMPやCreativeTabの登録に使われる
+ * @return
+ */
+ public ArrayList<ItemStack> getAllPattern();
+
+ /**
+ * 被弾時に壺が割れる確率を得る
+ * @param itemStack
+ * @return
+ */
+ public float getCrashProbability(ItemStack itemStack);
+
+ public static enum PotteryState{
+ MOLDED(0), DRY(1), BAKED(2), INVALID_VALUE(-1);
+
+ PotteryState(int v){ value=(byte)v; }
+
+ private byte value;
+ public byte getValue(){ return value; }
+
+ public static PotteryState Get(int v){
+ if(v==MOLDED.getValue()) return MOLDED;
+ if(v==DRY.getValue()) return DRY;
+ if(v==BAKED.getValue()) return BAKED;
+ return INVALID_VALUE;
+ }
+ public static String GetLocalizedPrefix(PotteryState state){
+ if(state==MOLDED) return StatCollector.translateToLocal("pottery.fbs.molded");
+ if(state==DRY) return StatCollector.translateToLocal("pottery.fbs.dry");
+ return "";
+ }
+ }
+ public static enum PotterySize{
+ SMALL(0), MEDIUM(1), LARGE(2);
+
+ PotterySize(int v){ value=(byte)v; }
+
+ private byte value;
+ public byte getValue(){ return value; }
+
+ public static PotterySize Get(int v){
+ if(v==SMALL.getValue()) return SMALL;
+ if(v==LARGE.getValue()) return LARGE;
+ return MEDIUM;
+ }
+ public static String GetLocalizedPrefix(PotterySize size){
+ String str;
+ switch (size){
+ case SMALL: str= StatCollector.translateToLocal("pottery.fbs.small"); break;
+ case LARGE: str=StatCollector.translateToLocal("pottery.fbs.large"); break;
+ default: str=""; break;
+ }
+ return str;
+ }
+ }
+ public static enum PotteryGrade{
+ BAD(0), NORMAL(1), GOOD(2), GREAT(3), SOULFUL(4);
+
+ PotteryGrade(int v){ value=(byte)v; }
+
+ private byte value;
+ public byte getValue(){ return value; }
+
+ public static PotteryGrade Get(int v){
+ if(v==BAD.getValue()) return BAD;
+ if(v==GOOD.getValue()) return GOOD;
+ if(v==GREAT.getValue()) return GREAT;
+ if(v==SOULFUL.getValue()) return SOULFUL;
+ return NORMAL;
+ }
+ public static String GetLocalizedPrefix(PotteryGrade grade){
+ String str;
+ switch (grade){
+ case BAD: str=StatCollector.translateToLocal("pottery.fbs.bad"); break;
+ case GOOD: str=StatCollector.translateToLocal("pottery.fbs.good"); break;
+ case GREAT: str=StatCollector.translateToLocal("pottery.fbs.great"); break;
+ case SOULFUL: str=StatCollector.translateToLocal("pottery.fbs.soulful"); break;
+ default: str=""; break;
+ }
+ return str;
+ }
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/IResonance.class b/src/main/java/jp/plusplus/fbs/api/IResonance.class
new file mode 100644
index 0000000..7212d82
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IResonance.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/IResonance.java b/src/main/java/jp/plusplus/fbs/api/IResonance.java
new file mode 100644
index 0000000..234af55
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/IResonance.java
@@ -0,0 +1,43 @@
+package jp.plusplus.fbs.api;
+
+import jp.plusplus.fbs.Registry;
+
+/**
+ * Created by pluslus_F on 2015/06/23.
+ * 魔導書の共鳴の判定と情報提供用のインターフェース
+ * 独自共鳴はこれを実装してRegistryに登録するといいよ
+ */
+public interface IResonance {
+
+ /**
+ * 同じクラスのインスタンスを返す
+ * @return 自身のインスタンス
+ */
+ public IResonance copy();
+
+ /**
+ * 共鳴できるかどうかの判定
+ * @param magics スタッフにセットされた魔法
+ * @return true:共鳴可
+ */
+ public boolean isMatch(Registry.MagicData[] magics);
+
+ /**
+ * 共鳴後の魔法の登録名を返す
+ * @return 共鳴後の魔法の登録名
+ */
+ public String getResonanceMagicName();
+
+ /**
+ * 共鳴後の魔法のクライアント側に表示される名前を返す
+ * @param titles 共鳴に使用されている魔法の登録名
+ * @return ローカライズ後の表示名
+ */
+ public String getDisplayMagicName(String[] titles);
+
+ /**
+ * 共鳴判定時の優先度を返す
+ * @return 優先度(0が最低値)
+ */
+ public int priority();
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/MagicBase.class b/src/main/java/jp/plusplus/fbs/api/MagicBase.class
new file mode 100644
index 0000000..74122e9
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/MagicBase.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/MagicBase.java b/src/main/java/jp/plusplus/fbs/api/MagicBase.java
new file mode 100644
index 0000000..e122b33
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/MagicBase.java
@@ -0,0 +1,188 @@
+package jp.plusplus.fbs.api;
+
+import cpw.mods.fml.common.FMLLog;
+import jp.plusplus.fbs.Registry;
+import jp.plusplus.fbs.exprop.FBSEntityProperties;
+import jp.plusplus.fbs.exprop.SanityManager;
+import jp.plusplus.fbs.tileentity.TileEntityMagicCore;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.entity.EntityClientPlayerMP;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.*;
+import net.minecraft.world.World;
+
+import java.util.List;
+import java.util.Random;
+
+/**
+ * Createdby pluslus_Fon 2015/06/06.
+ * ItemBookSorceryによって発動される魔法の基底クラス
+ * 魔法を追加したくばこのクラスを継承すればよい
+ */
+public abstract class MagicBase {
+ /**
+ * 術者
+ */
+ public EntityPlayer player;
+ /**
+ * 術者のSAN値やら魔術Lvやら
+ */
+ public FBSEntityProperties property;
+ /**
+ * 登録されてい魔法データ
+ */
+ public Registry.MagicData magicData;
+ /**
+ * 登録されている書物データ
+ */
+ public Registry.BookData bookData;
+ /**
+ * worldのインスタンス
+ * 基本的に全て isRemote は false となる
+ */
+ public World world;
+ /**
+ * 乱数を使うならコレ
+ */
+ public Random rand;
+ /**
+ * キチンと詠唱されたか否か
+ * true:詠唱
+ * false:詠唱破棄
+ */
+ public boolean isSpelled;
+ /**
+ * スタッフを用いているか否か
+ * true:用いている
+ */
+ public boolean usingStaff;
+
+
+ /**
+ * 魔法が成功したかを判定する
+ * このメソッドが呼ばれる際、既に各フィールドはセットされている
+ * @return true:成功
+ */
+ public abstract boolean checkSuccess();
+
+ /**
+ * 行使成功時の魔法処理
+ */
+ public abstract void success();
+ /**
+ * 行使失敗時の魔法処理
+ */
+ public abstract void failure();
+
+ /**
+ * 魔法陣の登録名を返す。
+ * nullの場合、その魔法は魔法陣を必要としない
+ * @return 魔法陣の登録名
+ */
+ public String getMagicCircleName(){
+ return "null";
+ }
+
+ /**
+ * 術者が魔法陣の中心にいるか判定する
+ * @param name 対象魔法陣の登録名
+ * @return true:*まほうじんのなかにいる*
+ */
+ public boolean checkMagicCircle(String name){
+ int x= MathHelper.floor_double(player.posX);
+ int y=MathHelper.floor_double(player.posY);
+ int z=MathHelper.floor_double(player.posZ);
+
+ TileEntity e=world.getTileEntity(x,y,z);
+ if(!(e instanceof TileEntityMagicCore)){
+ return false;
+ }
+ return ((TileEntityMagicCore) e).getCircleName().equals(name);
+ }
+
+ /**
+ * 術者の正気度を(trial)D(max)で喪失させる。
+ * @param trial
+ * @param max
+ */
+ protected void sanity(int trial, int max){
+ SanityManager.loseSanity(player, trial, max, true);
+ }
+
+ /**
+ * 術者に失敗時のメッセージを表示させる
+ */
+ public void failureMessage(){
+ player.addChatComponentMessage(new ChatComponentText(String.format(StatCollector.translateToLocal("info.fbs.magic.failure"), magicData.getLocalizedTitle())));
+ }
+
+ /**
+ * 現在の魔術レベルとこの魔法の適正魔術Lvとの差を求める
+ * @return (魔術レベル)-(適性魔術レベル)
+ */
+ public int getLvDiff(){
+ return property.getMagicLevel()-bookData.lv;
+ }
+
+ /**
+ * 術者が触れたブロックの座標を返す
+ * @return
+ */
+ public Vec3 getTouchPosition(){
+ Vec3 stPos = Vec3.createVectorHelper(player.posX, player.posY + player.getEyeHeight(), player.posZ);
+ Vec3 vec=player.getLookVec();
+ vec.xCoord=vec.xCoord*5+stPos.xCoord;
+ vec.yCoord=vec.yCoord*5+stPos.yCoord;
+ vec.zCoord=vec.zCoord*5+stPos.zCoord;
+ MovingObjectPosition movingobjectposition = world.func_147447_a(stPos, vec, false, true, false);
+ if(movingobjectposition!=null){
+ Vec3 p=Vec3.createVectorHelper(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ);
+ return p;
+ }
+
+ return null;
+ }
+
+ /**
+ * 術者が触れたEntityを返す
+ * @return 触れたEntity
+ */
+ public Entity getTouchEntity(){
+ Vec3 stPos = Vec3.createVectorHelper(player.posX, player.posY + player.getEyeHeight(), player.posZ);
+ Vec3 vec=player.getLookVec();
+ vec.xCoord=vec.xCoord*5;
+ vec.yCoord=vec.yCoord*5;
+ vec.zCoord=vec.zCoord*5;
+
+ Vec3 enPos=stPos.addVector(vec.xCoord, vec.yCoord, vec.zCoord);
+
+ AxisAlignedBB aabb=AxisAlignedBB.getBoundingBox(stPos.xCoord, stPos.yCoord, stPos.zCoord, stPos.xCoord+1, stPos.yCoord+1, stPos.zCoord+1);
+ List list = world.getEntitiesWithinAABB(EntityLivingBase.class, aabb.addCoord(vec.xCoord, vec.yCoord, vec.zCoord).expand(1.0D, 1.0D, 1.0D));
+
+ double r=0;
+ Entity ret=null;
+ for (int l = 0; l < list.size(); ++l) {
+ Entity entity1 = (Entity) list.get(l);
+ if(!entity1.isEntityEqual(player) && entity1.canBeCollidedWith()){
+ float f1 = 0.3F;
+ AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double) f1, (double) f1, (double) f1);
+ MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(stPos, enPos);
+
+ if (movingobjectposition1 != null) {
+ double d1 = enPos.distanceTo(movingobjectposition1.hitVec);
+
+ if (d1 < r || r == 0.0D) {
+ ret=entity1;
+ r=d1;
+ }
+ }
+ }
+ }
+
+ return ret;
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.class b/src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.class
new file mode 100644
index 0000000..50e61c4
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.java b/src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.java
new file mode 100644
index 0000000..fedf3ba
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.java
@@ -0,0 +1,55 @@
+package jp.plusplus.fbs.api;
+
+import jp.plusplus.fbs.api.IMagicEnchant;
+import jp.plusplus.fbs.api.MagicBase;
+import net.minecraft.entity.EntityLivingBase;
+
+/**
+ * Created by pluslus_F on 2015/06/22.
+ */
+public abstract class MagicEnchantBase extends MagicBase implements IMagicEnchant {
+ protected int trial, max;
+
+ public MagicEnchantBase(int t, int m){
+ trial=t;
+ max=m;
+ }
+
+ @Override
+ public void success() {
+ enchant(player, true);
+ }
+
+ @Override
+ public void failure() {
+ sanity(trial, max);
+ enchant(player, false);
+ }
+
+ public int getAmplifier(int rate){
+ int t=getLvDiff();
+ if(t<=0) return 1;
+ int a=1+t/rate;
+ return a>5?5:a;
+ }
+ public int getDuration(int base, float rate){
+ int t=getLvDiff();
+ if(t<=0) return 20*base;
+ return (int)(20*(base+t/rate));
+ }
+
+ @Override
+ public float damageScale(EntityLivingBase entity){
+ return 0.f;
+ }
+
+ @Override
+ public float damageValue(EntityLivingBase entity){
+ return 0.f;
+ }
+
+ @Override
+ public ParticleColor setParticleColor(){
+ return new ParticleColor();
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/event/CheckingMonocleEvent.class b/src/main/java/jp/plusplus/fbs/api/event/CheckingMonocleEvent.class
new file mode 100644
index 0000000..b99737a
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/CheckingMonocleEvent.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/event/CheckingMonocleEvent.java b/src/main/java/jp/plusplus/fbs/api/event/CheckingMonocleEvent.java
new file mode 100644
index 0000000..dbbf74f
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/CheckingMonocleEvent.java
@@ -0,0 +1,35 @@
+package jp.plusplus.fbs.api.event;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.event.entity.player.PlayerEvent;
+import net.minecraft.entity.player.EntityPlayer;
+
+/**
+ * Created by plusplus_F on 2016/03/06.
+ *
+ * プレイヤーがモノクルを持っているかの判定イベント
+ */
+public class CheckingMonocleEvent extends PlayerEvent {
+ private boolean has;
+ private ItemStack monocle;
+
+ public CheckingMonocleEvent(EntityPlayer player, ItemStack has) {
+ super(player);
+ this.has=(has!=null);
+ monocle=has;
+ }
+
+ public boolean hasMonocle(){
+ return has;
+ }
+ public ItemStack getMonocle(){
+ return monocle;
+ }
+
+ public void setMonocle(ItemStack itemStack){
+ if(itemStack!=null){
+ has=true;
+ monocle=itemStack;
+ }
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/event/DamageMonocleEvent.class b/src/main/java/jp/plusplus/fbs/api/event/DamageMonocleEvent.class
new file mode 100644
index 0000000..099299f
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/DamageMonocleEvent.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/event/DamageMonocleEvent.java b/src/main/java/jp/plusplus/fbs/api/event/DamageMonocleEvent.java
new file mode 100644
index 0000000..be7237b
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/DamageMonocleEvent.java
@@ -0,0 +1,23 @@
+package jp.plusplus.fbs.api.event;
+
+import net.minecraftforge.event.entity.player.PlayerEvent;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+
+/**
+ * Created by plusplus_F on 2016/03/06.
+ *
+ * モノクルの耐久度を消費するときのイベント
+ */
+public class DamageMonocleEvent extends PlayerEvent {
+ private ItemStack monocle;
+
+ public DamageMonocleEvent(EntityPlayer player, ItemStack monocle) {
+ super(player);
+ this.monocle=monocle;
+ }
+
+ public ItemStack getMonocle(){
+ return monocle;
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/event/PlayerDecodedBookEvent.class b/src/main/java/jp/plusplus/fbs/api/event/PlayerDecodedBookEvent.class
new file mode 100644
index 0000000..4afa0fe
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/PlayerDecodedBookEvent.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/event/PlayerDecodedBookEvent.java b/src/main/java/jp/plusplus/fbs/api/event/PlayerDecodedBookEvent.java
new file mode 100644
index 0000000..7367dfb
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/PlayerDecodedBookEvent.java
@@ -0,0 +1,37 @@
+package jp.plusplus.fbs.api.event;
+
+import jp.plusplus.fbs.Registry;
+import net.minecraftforge.event.entity.player.PlayerEvent;
+import net.minecraft.entity.player.EntityPlayer;
+
+/**
+ * Createdby pluslus_Fon 2015/06/14.
+ * プレイヤーが魔導書を使用した際に呼ばれるイベント
+ */
+public class PlayerDecodedBookEvent extends PlayerEvent {
+ private Registry.BookData bookData;
+ private boolean success;
+
+ public PlayerDecodedBookEvent(EntityPlayer player, Registry.BookData bd, boolean success) {
+ super(player);
+ bookData=bd.copy();
+ this.success=success;
+ }
+
+ @Override
+ public boolean isCancelable() {
+ return true;
+ }
+
+ /**
+ * 使用した書物
+ * @return
+ */
+ public Registry.BookData getBook(){ return bookData; }
+
+ /**
+ * 魔法の行使に成功したか
+ * @return
+ */
+ public boolean isSuccess(){ return success; }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityEvent.class b/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityEvent.class
new file mode 100644
index 0000000..5568b76
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityEvent.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityEvent.java b/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityEvent.java
new file mode 100644
index 0000000..4425ce0
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityEvent.java
@@ -0,0 +1,32 @@
+package jp.plusplus.fbs.api.event;
+
+import net.minecraftforge.event.entity.player.PlayerEvent;
+import net.minecraft.entity.player.EntityPlayer;
+
+/**
+ * Createdby pluslus_Fon 2015/06/05.
+ *
+ * newChangeLVは機能しないので注意
+ */
+public class PlayerSanityEvent extends PlayerEvent {
+ private int changeSanity, changeLv;
+ private double changeExp;
+
+ public int newChangeSanity, newChangeLv;
+ public double newChangeExp;
+
+ public PlayerSanityEvent(EntityPlayer player, int ds, double de, int dl) {
+ super(player);
+ newChangeSanity=changeSanity=ds;
+ newChangeExp=changeExp=de;
+ newChangeLv=changeLv=dl;
+ }
+
+ public boolean isCancelable() {
+ return true;
+ }
+
+ public int getChangeSanity(){ return changeSanity; }
+ public int getChangeLv(){ return changeLv; }
+ public double getChangeEXP(){ return changeExp; }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityRollEvent.class b/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityRollEvent.class
new file mode 100644
index 0000000..9827f8f
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityRollEvent.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityRollEvent.java b/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityRollEvent.java
new file mode 100644
index 0000000..b6bb1b5
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/PlayerSanityRollEvent.java
@@ -0,0 +1,24 @@
+package jp.plusplus.fbs.api.event;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraftforge.event.entity.player.PlayerEvent;
+
+/**
+ * Created by plusplus_F on 2016/03/09.
+ */
+public class PlayerSanityRollEvent extends PlayerEvent {
+ private int trial, max;
+ public int newTrial, newMax;
+
+ public PlayerSanityRollEvent(EntityPlayer player, int trial, int max) {
+ super(player);
+ this.trial=newTrial=trial;
+ this.max=newMax=max;
+ }
+
+ @Override
+ public boolean isCancelable(){ return true; }
+
+ public int getTrial(){ return trial; }
+ public int getMax(){ return max; }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent$Post.class b/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent$Post.class
new file mode 100644
index 0000000..17e6d0c
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent$Post.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent$Pre.class b/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent$Pre.class
new file mode 100644
index 0000000..5fc40c5
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent$Pre.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent.class b/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent.class
new file mode 100644
index 0000000..2530d1b
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent.java b/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent.java
new file mode 100644
index 0000000..d396dd9
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/PlayerUseMagicEvent.java
@@ -0,0 +1,36 @@
+package jp.plusplus.fbs.api.event;
+
+import jp.plusplus.fbs.api.MagicBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.event.entity.player.PlayerEvent;
+
+/**
+ * Created by pluslus_F on 2015/06/18.
+ */
+public class PlayerUseMagicEvent extends PlayerEvent {
+ public MagicBase magic;
+ public ItemStack[] books;
+
+ public PlayerUseMagicEvent(EntityPlayer player, MagicBase mb, ItemStack[] b) {
+ super(player);
+ magic=mb;
+ books=b;
+ }
+
+ @Override
+ public boolean isCancelable(){
+ return true;
+ }
+
+ public static class Pre extends PlayerUseMagicEvent{
+ public Pre(EntityPlayer player, MagicBase mb, ItemStack[] b) {
+ super(player, mb, b);
+ }
+ }
+ public static class Post extends PlayerUseMagicEvent{
+ public Post(EntityPlayer player, MagicBase mb, ItemStack[] b) {
+ super(player, mb, b);
+ }
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/api/event/SpiritTalkEvent.class b/src/main/java/jp/plusplus/fbs/api/event/SpiritTalkEvent.class
new file mode 100644
index 0000000..a34a0e7
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/SpiritTalkEvent.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/api/event/SpiritTalkEvent.java b/src/main/java/jp/plusplus/fbs/api/event/SpiritTalkEvent.java
new file mode 100644
index 0000000..2f00298
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/api/event/SpiritTalkEvent.java
@@ -0,0 +1,30 @@
+package jp.plusplus.fbs.api.event;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.event.entity.player.PlayerEvent;
+
+/**
+ * Created by pluslus_F on 2015/06/17.
+ * 精霊武器との会話イベント
+ */
+public class SpiritTalkEvent extends PlayerEvent {
+ private String character;
+ private String event;
+ private Object[] params;
+ public SpiritTalkEvent(EntityPlayer player, String character, String event, Object ... params) {
+ super(player);
+ this.character=character;
+ this.event=event;
+ this.params=params;
+ }
+
+ @Override
+ public boolean isCancelable() {
+ return true;
+ }
+
+ public String getCharacter(){ return character; }
+ public String getEvent(){ return event; }
+ public Object[] getParams(){ return params; }
+}