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
41 * AtomInfoのデータをupdateします
\r
42 * @param par1World Worldのインスタンス
\r
43 * @param par2EntityPlayer EntityPlayerのインスタンス
\r
45 public void update(World par1World, EntityPlayer par2EntityPlayer){
\r
46 this.world = par1World;
\r
47 this.entityPlayer = par2EntityPlayer;
\r
49 this.posX = (int) par2EntityPlayer.posX;
\r
50 this.posY = (int) par2EntityPlayer.posY;
\r
51 this.posZ = (int) par2EntityPlayer.posZ;
\r
53 this.biomeName = par1World.getBiomeGenForCoords(posX, posZ).biomeName;
\r
55 if (par1World.isThundering()){
\r
56 this.weather = "Thunder";
\r
57 }else if(par1World.isRaining()){
\r
58 this.weather = "Rain";
\r
60 this.weather = "Sun";
\r
67 * 引数に指定されたBiomeと同等か比較します
\r
68 * @param biomeName 比較するBiomeの名前
\r
69 * @return Biomeが一致しているか
\r
71 public boolean isEquivalentBiome(String biomeName){
\r
72 if(this.biomeName != null){
\r
73 if(this.biomeName == biomeName){
\r
79 System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");
\r
87 * 引数に指定された天候と同等か比較します
\r
88 * 晴れ:Sun, 雨:Rain, 雷雨:Thunder
\r
89 * @param weather 比較する天候
\r
90 * @return 天候が一致しているか
\r
92 public boolean isEquivalentWeather(String weather){
\r
93 if(this.weather != null){
\r
94 if(this.weather == weather){
\r
100 System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");
\r
108 * 引数に指定されたY軸より高いか判定します
\r
110 * @return 指定されたY軸より高いか
\r
112 public boolean isOverY(int par1){
\r
113 if(this.posY >= par1){
\r
123 * 引数に指定されたY軸と同等か判定します
\r
125 * @return 指定されたY軸と同等かどうか
\r
127 public boolean isEquivalentY(int par1){
\r
128 if(this.posY >= par1){
\r
138 * 引数に指定されたY軸より低いか判定します
\r
140 * @return 指定されたY軸より低いか
\r
142 public boolean isBelowY(int par1){
\r
143 if(this.posY >= par1){
\r