1 package pcc.chemicraft.util;
3 import net.minecraft.block.Block;
4 import net.minecraft.entity.player.EntityPlayer;
5 import net.minecraft.world.World;
6 import cpw.mods.fml.common.registry.LanguageRegistry;
7 import cpw.mods.fml.relauncher.Side;
8 import cpw.mods.fml.relauncher.SideOnly;
11 * いろいろなデータを格納しメソッドによってチェックするクラス
12 * 使用する場合はItemAtomInfoContainerを継承することを推奨
16 public final class AtomInfo {
21 public static final Integer[] gases = new Integer[]{
22 1, 2, 7, 8, 9, 10, 17, 18, 36, 54, 86
29 public static final Integer[] liquids = new Integer[]{
37 public static final Integer[] unknown = new Integer[]{
38 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118
42 public static final Integer[] lanthanoid = new Integer[]{
43 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71
47 public static final Integer[] actinoid = new Integer[]{
48 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103
52 public static final Integer[] unofficial = new Integer[]{
53 113, 114, 115, 116, 117, 118
68 private String biomeName;
74 private String weather;
80 private EntityPlayer entityPlayer;
91 * AtomInfoのデータをupdateします
92 * @param par1World Worldのインスタンス
93 * @param par2EntityPlayer EntityPlayerのインスタンス
95 public void update(World par1World, EntityPlayer par2EntityPlayer){
96 //this.world = par1World;
97 //this.entityPlayer = par2EntityPlayer;
99 this.posX = (int) par2EntityPlayer.posX;
100 this.posY = (int) par2EntityPlayer.posY;
101 this.posZ = (int) par2EntityPlayer.posZ;
103 this.biomeName = par1World.getBiomeGenForCoords(posX, posZ).biomeName;
105 if (par1World.isThundering()){
106 this.weather = "Thunder";
107 }else if(par1World.isRaining()){
108 this.weather = "Rain";
110 this.weather = "Sun";
116 public static boolean isGas(int par1){
117 for (int var2:gases){
127 public static boolean isLiquid(int par1){
128 for (int var2:liquids){
138 public static boolean isSolid(int par1){
139 if (!isGas(par1) && !isLiquid(par1) && !isUnknown(par1)){
147 public static boolean isUnknown(int par1){
148 for (int var2:unknown){
158 public static boolean isLanthanoid(int par1){
159 for (int var2:lanthanoid){
169 public static boolean isActinoid(int par1){
170 for (int var2:actinoid){
180 public static boolean isUnofficial(int par1){
181 for (int var2:unofficial){
191 public static boolean isExisting(String par1){
198 * 引数に指定されたBiomeと同等か比較します
199 * @param biomeName 比較するBiomeの名前
200 * @return Biomeが一致しているか
202 public boolean isEquivalentBiome(String biomeName){
203 if(this.biomeName != null){
204 if(this.biomeName.equals(biomeName)){
210 System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");
218 * 引数に指定された天候と同等か比較します
219 * 晴れ:Sun, 雨:Rain, 雷雨:Thunder
220 * @param weather 比較する天候
223 public boolean isEquivalentWeather(String weather){
224 if(this.weather != null){
225 if(this.weather.equals(weather)){
231 System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");
239 * 引数に指定されたY軸より高いか判定します
241 * @return 指定されたY軸より高いか
243 @SideOnly(Side.CLIENT)
244 public boolean isOverY(int par1){
245 if(this.posY >= par1){
255 * 引数に指定されたY軸と同等か判定します
257 * @return 指定されたY軸と同等かどうか
259 @SideOnly(Side.CLIENT)
260 public boolean isEquivalentY(int par1){
261 if(this.posY == par1){
271 * 引数に指定されたY軸より低いか判定します
273 * @return 指定されたY軸より低いか
275 @SideOnly(Side.CLIENT)
276 public boolean isBelowY(int par1){
277 if(this.posY <= par1){