Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
public static void registerMyItem(Class<? extends MyItem> clazz, Item item, String iconPatch, String unlocalizedName, int id, EnumArmorMaterial material, int armorType, CreativeTabs tab, String name, ModelInfo[] modelInfo)
{
try {
item = clazz.getConstructor(clazz).newInstance(id, material, 0, armorType, modelInfo).setIconPatch(iconPatch).setCreativeTab(tab).setUnlocalizedName(unlocalizedName);
LanguageRegistry.addName(item, name);
armorList.add(item);
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (SecurityException e) {
e.printStackTrace();
}
}
java.lang.NoSuchMethodException: itemTest.ItemExtendsExample.<init>(itemTest.ItemExtendsExample)
Я не пойму что здесь есть paramsAgravaine написал(а):Код:public void register(Class<? extends Item> clazz){ item = clazz.getConstructor(params.class).newInstance(params); }
public ArmorExtendsExample(int id, EnumArmorMaterial mat, int par3, int par4) {
super(id, mat, par3, par4);
}
armor = clazz.getConstructor(Integer.class, EnumArmorMaterial.class, Integer.class, Integer.class)