OSDN Git Service

バグ特定ができないのでコミットしとく
[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 \r
116 }\r