OSDN Git Service

MathHelperPlusクラスのパッケージを変更。
[chemicraft/chemicraft.git] / common / chemicraft / debug / CommandSetTile.java
1 package chemicraft.debug;\r
2 \r
3 import net.minecraft.src.Block;\r
4 import net.minecraft.src.CommandBase;\r
5 import net.minecraft.src.EntityPlayer;\r
6 import net.minecraft.src.ICommandSender;\r
7 import net.minecraft.src.World;\r
8 \r
9 public class CommandSetTile extends CommandBase {\r
10 \r
11         @Override\r
12         public String getCommandName() {\r
13                 return "setTile";\r
14         }\r
15 \r
16         @Override\r
17         public void processCommand(ICommandSender var1, String[] var2) {\r
18                 try{\r
19                         EntityPlayer player = (EntityPlayer)var1;\r
20                         World wolrd = player.worldObj;\r
21                         if(var2.length > 0){\r
22                                 try{\r
23                                         if(Integer.parseInt(var2[0]) < 4096 && Block.blocksList[Integer.parseInt(var2[0])] != null || Integer.parseInt(var2[0]) == 0){\r
24                                                 if(var2.length > 1){\r
25                                                         SetBlockSupport.square(wolrd, (int)player.posX, (int)player.posY, (int)player.posZ, Integer.parseInt(var2[0]), Integer.parseInt(var2[1]), 12, 12);\r
26                                                 }else{\r
27                                                         SetBlockSupport.square(wolrd, (int)player.posX, (int)player.posY, (int)player.posZ, Integer.parseInt(var2[0]), 0, 12, 12);\r
28                                                 }\r
29                                         }else{\r
30                                                 var1.sendChatToPlayer("\u00a7cBlockが存在しないか指定された数が4096を超えています。");\r
31                                         }\r
32                                 }catch(NumberFormatException e){\r
33                                         var1.sendChatToPlayer("\u00a7c指定された文字は数値ではありません。");\r
34                                 }\r
35                         }else{\r
36                                 var1.sendChatToPlayer("\u00a7cBlockIDを指定してください。(Metadataも可能)");\r
37                         }\r
38                 }catch(ClassCastException e){\r
39 \r
40                 }\r
41         }\r
42 \r
43 }\r