OSDN Git Service

GUIのSlot追加
[chemicraft/chemicraft.git] / common / chemicraft / Auxiliary.java
1 package chemicraft;\r
2 \r
3 import net.minecraft.src.Block;\r
4 import net.minecraft.src.Item;\r
5 import net.minecraft.src.ItemStack;\r
6 import cpw.mods.fml.common.registry.LanguageRegistry;\r
7 \r
8 public class Auxiliary {\r
9 \r
10         /**\r
11          * 補助クラス\r
12          * @author mozipi\r
13          *\r
14          */\r
15         class NameAuxiliary {\r
16 \r
17                 /**\r
18                  * 名前を設定します\r
19                  * @param object\r
20                  * @param Name\r
21                  */\r
22                 public void addName(Object object,Object name){\r
23                         LanguageRegistry.addName(object, (String) name);\r
24                 }\r
25 \r
26 \r
27 \r
28                 /**\r
29                  * 名前を設定します(ItemStack版)\r
30                  * @param object\r
31                  * @param name\r
32                  * @param meta\r
33                  */\r
34                 public void addName(ItemStack itemstack,Object name){\r
35                         LanguageRegistry.addName(itemstack, (String) name);\r
36                 }\r
37 \r
38 \r
39 \r
40                 /**\r
41                  * 指定言語にそって名前を追加します\r
42                  * @param object\r
43                  * @param lang\r
44                  * @param name\r
45                  */\r
46                 public void addName(Object object,String lang,Object name){\r
47                         LanguageRegistry.instance().addNameForObject(object, lang, (String) name);\r
48                 }\r
49 \r
50 \r
51 \r
52                 /**\r
53                  * 指定言語にそって名前を追加します(ItemStack版)\r
54                  * @param object\r
55                  * @param lang\r
56                  * @param name\r
57                  */\r
58                 public void addName(ItemStack object,String lang,Object name){\r
59                         LanguageRegistry.instance().addNameForObject(object, lang, (String) name);\r
60                 }\r
61 \r
62 \r
63 \r
64                 /**\r
65                  * メタデータごとに名前を追加します(Block版)\r
66                  * @param object\r
67                  * @param name\r
68                  */\r
69                 public void addName(Block object,Object[] name){\r
70                         for(int i=0;i<name.length;i++){\r
71                                 LanguageRegistry.addName(new ItemStack(object,0,i), (String) name[i]);\r
72                         }\r
73                 }\r
74 \r
75 \r
76 \r
77                 /**\r
78                  * メタデータごとに名前を追加します(Item版)\r
79                  * @param object\r
80                  * @param name\r
81                  */\r
82                 public void addName(Item object,Object[] name){\r
83                         for(int i=0;i<name.length;i++){\r
84                                 LanguageRegistry.addName(new ItemStack(object,0,i), (String) name[i]);\r
85                         }\r
86                 }\r
87 \r
88 \r
89 \r
90                 /**\r
91                  * 指定された言語にそってメタデータごとに名前を設定します(Block版)\r
92                  * @param object\r
93                  * @param name\r
94                  */\r
95                 public void addName(Block object,String lang,Object[] name){\r
96                         for(int i=0;i<name.length;i++){\r
97                                 LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, (String) name[i]);\r
98                         }\r
99                 }\r
100 \r
101 \r
102 \r
103                 /**\r
104                  * 指定された言語にそってメタデータごとに名前を設定します(Item版)\r
105                  * @param object\r
106                  * @param name\r
107                  */\r
108                 public void addName(Item object,String lang, Object[] name){\r
109                         for(int i=0;i<name.length;i++){\r
110                                 LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, (String) name[i]);\r
111                         }\r
112                 }\r
113 \r
114                 /**\r
115                  * 指定された言語にそってメタデータごとに名前を設定します(Block版)\r
116                  * また、配列の前に任意の文字列を追加できます。\r
117                  * @param object\r
118                  * @param name\r
119                  */\r
120                 public void addName(Block object,String lang, String string, Object[] name){\r
121                         for(int i=0;i<name.length;i++){\r
122                                 LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, string + (String) name[i]);\r
123                         }\r
124                 }\r
125 \r
126 \r
127 \r
128                 /**\r
129                  * 指定された言語にそってメタデータごとに名前を設定します(Item版)\r
130                  * また、配列の前に任意の文字列を追加できます。\r
131                  * @param object\r
132                  * @param name\r
133                  */\r
134                 public void addName(Item object,String lang, String string, Object[] name){\r
135                         for(int i=0;i<name.length;i++){\r
136                                 LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, string + (String) name[i]);\r
137                         }\r
138                 }\r
139 \r
140                 /**\r
141                  * 指定された言語にそってメタデータごとに名前を設定します(Block版)\r
142                  * また、配列の後ろに任意の文字列を追加できます。\r
143                  * @param object\r
144                  * @param name\r
145                  */\r
146                 public void addName(Block object,String lang, Object[] name, String string){\r
147                         for(int i=0;i<name.length;i++){\r
148                                 LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, (String) name[i] + string);\r
149                         }\r
150                 }\r
151 \r
152 \r
153 \r
154                 /**\r
155                  * 指定された言語にそってメタデータごとに名前を設定します(Item版)\r
156                  * また、配列の後ろに任意の文字列を追加できます。\r
157                  * @param object\r
158                  * @param name\r
159                  */\r
160                 public void addName(Item object,String lang, Object[] name, String string){\r
161                         for(int i=0;i<name.length;i++){\r
162                                 LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, (String) name[i] + string);\r
163                         }\r
164                 }\r
165 \r
166         }\r
167 \r
168 }\r