3 import net.minecraft.src.EntityPlayer;
\r
4 import net.minecraft.src.ItemStack;
\r
5 import net.minecraft.src.World;
\r
7 public class AtomInfo {
\r
20 private String biomeName;
\r
26 private String weather;
\r
30 * EntityPlayerのインスタンス
\r
32 private EntityPlayer entityPlayer;
\r
38 private World world;
\r
43 * AtomInfoのデータをupdateします
\r
44 * @param par1World Worldのインスタンス
\r
45 * @param par2EntityPlayer EntityPlayerのインスタンス
\r
47 public void update(World par1World, EntityPlayer par2EntityPlayer){
\r
48 this.world = par1World;
\r
49 this.entityPlayer = par2EntityPlayer;
\r
51 this.posX = (int) par2EntityPlayer.posX;
\r
52 this.posY = (int) par2EntityPlayer.posY;
\r
53 this.posZ = (int) par2EntityPlayer.posZ;
\r
55 this.biomeName = par1World.getBiomeGenForCoords(posX, posZ).biomeName;
\r
57 if (par1World.isThundering()){
\r
58 this.weather = "Thunder";
\r
59 }else if(par1World.isRaining()){
\r
60 this.weather = "Rain";
\r
62 this.weather = "Sun";
\r
69 * 引数に指定されたBiomeと同等か比較します
\r
70 * @param biomeName 比較するBiomeの名前
\r
71 * @return Biomeが一致しているか
\r
73 public boolean isEquivalentBiome(String biomeName){
\r
74 if(this.biomeName != null){
\r
75 if(this.biomeName == biomeName){
\r
81 System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");
\r
89 * 引数に指定された天候と同等か比較します
\r
90 * 晴れ:Sun, 雨:Rain, 雷雨:Thunder
\r
91 * @param weather 比較する天候
\r
92 * @return 天候が一致しているか
\r
94 public boolean isEquivalentWeather(String weather){
\r
95 if(this.weather != null){
\r
96 if(this.weather == weather){
\r
102 System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");
\r
110 * 引数に指定されたY軸より高いか判定します
\r
112 * @return 指定されたY軸より高いか
\r
114 public boolean isOverY(int par1){
\r
115 if(this.posY >= par1){
\r
125 * 引数に指定されたY軸と同等か判定します
\r
127 * @return 指定されたY軸と同等かどうか
\r
129 public boolean isEquivalentY(int par1){
\r
130 if(this.posY >= par1){
\r
140 * 引数に指定されたY軸より低いか判定します
\r
142 * @return 指定されたY軸より低いか
\r
144 public boolean isBelowY(int par1){
\r
145 if(this.posY >= par1){
\r