OSDN Git Service

適当にコミット
[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 import setBlockSupport.SetBlockSupport;\r
9 \r
10 public class CommandSetTile extends CommandBase {\r
11 \r
12         @Override\r
13         public String getCommandName() {\r
14                 return "setTile";\r
15         }\r
16 \r
17         @Override\r
18         public void processCommand(ICommandSender var1, String[] var2) {\r
19                 try{\r
20                         EntityPlayer player = (EntityPlayer)var1;\r
21                         World wolrd = player.worldObj;\r
22                         if(var2.length > 0){\r
23                                 try{\r
24                                         if(Integer.parseInt(var2[0]) < 4096 && Block.blocksList[Integer.parseInt(var2[0])] != null || Integer.parseInt(var2[0]) == 0){\r
25                                                 if(var2.length > 1){\r
26                                                         SetBlockSupport.square(wolrd, (int)player.posX, (int)player.posY, (int)player.posZ, Integer.parseInt(var2[0]), Integer.parseInt(var2[1]), 12, 12);\r
27                                                 }else{\r
28                                                         SetBlockSupport.square(wolrd, (int)player.posX, (int)player.posY, (int)player.posZ, Integer.parseInt(var2[0]), 0, 12, 12);\r
29                                                 }\r
30                                         }else{\r
31                                                 var1.sendChatToPlayer("\u00a7cBlockが存在しないか指定された数が4096を超えています。");\r
32                                         }\r
33                                 }catch(NumberFormatException e){\r
34                                         var1.sendChatToPlayer("\u00a7c指定された文字は数値ではありません。");\r
35                                 }\r
36                         }else{\r
37                                 var1.sendChatToPlayer("\u00a7cBlockIDを指定してください。(Metadataも可能)");\r
38                         }\r
39                 }catch(ClassCastException e){\r
40 \r
41                 }\r
42         }\r
43 \r
44 }\r