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
57 public static final Integer[] RI = new Integer[]{
73 private String biomeName;
79 private String weather;
85 private EntityPlayer entityPlayer;
96 * AtomInfoのデータをupdateします
97 * @param par1World Worldのインスタンス
98 * @param par2EntityPlayer EntityPlayerのインスタンス
100 public void update(World par1World, EntityPlayer par2EntityPlayer){
101 //this.world = par1World;
102 //this.entityPlayer = par2EntityPlayer;
104 this.posX = (int) par2EntityPlayer.posX;
105 this.posY = (int) par2EntityPlayer.posY;
106 this.posZ = (int) par2EntityPlayer.posZ;
108 this.biomeName = par1World.getBiomeGenForCoords(posX, posZ).biomeName;
110 if (par1World.isThundering()){
111 this.weather = "Thunder";
112 }else if(par1World.isRaining()){
113 this.weather = "Rain";
115 this.weather = "Sun";
121 public static boolean isGas(int par1){
122 for (int var2:GASES){
132 public static boolean isLiquid(int par1){
133 for (int var2:LIQUIDS){
143 public static boolean isSolid(int par1){
144 if (!isGas(par1) && !isLiquid(par1) && !isUnknown(par1)){
152 public static boolean isUnknown(int par1){
153 for (int var2:UNKNOWN){
163 public static boolean isLanthanoid(int par1){
164 for (int var2:LANTHANOID){
174 public static boolean isActinoid(int par1){
175 for (int var2:ACTINOID){
185 public static boolean isUnofficial(int par1){
186 for (int var2:UNOFFICIAL){
196 public static boolean isRI(int par1){
207 public static boolean isExisting(String par1){
214 * 引数に指定されたBiomeと同等か比較します
215 * @param biomeName 比較するBiomeの名前
216 * @return Biomeが一致しているか
218 public boolean isEquivalentBiome(String biomeName){
219 if(this.biomeName != null){
220 if(this.biomeName.equals(biomeName)){
226 System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");
234 * 引数に指定された天候と同等か比較します
235 * 晴れ:Sun, 雨:Rain, 雷雨:Thunder
236 * @param weather 比較する天候
239 public boolean isEquivalentWeather(String weather){
240 if(this.weather != null){
241 if(this.weather.equals(weather)){
247 System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");
255 * 引数に指定されたY軸より高いか判定します
257 * @return 指定されたY軸より高いか
259 @SideOnly(Side.CLIENT)
260 public boolean isOverY(int par1){
261 if(this.posY >= par1){
271 * 引数に指定されたY軸と同等か判定します
273 * @return 指定されたY軸と同等かどうか
275 @SideOnly(Side.CLIENT)
276 public boolean isEquivalentY(int par1){
277 if(this.posY == par1){
287 * 引数に指定されたY軸より低いか判定します
289 * @return 指定されたY軸より低いか
291 @SideOnly(Side.CLIENT)
292 public boolean isBelowY(int par1){
293 if(this.posY <= par1){