Fatal error trying to convert
Писал плагин для craftbukkit и столкнулся с ошибкой Fatal error trying to convert
Я только учусь и подробной информации не нашел
Версия 1.14.4
Главный класс:
package SuperPlugin.main;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;
public class plugin_main extends JavaPlugin {
public void onEnable() {
File config = new File(getDataFolder() + File.separator + "config.yml");
if(!config.exists()) {
getLogger().info("Creating folders and configuration files");
getConfig().options().copyDefaults(true);
saveDefaultConfig();
}
Bukkit.getPluginManager().registerEvents(new Handler(),this);
getCommand("info").setExecutor(new commands(this));
getCommand("heal").setExecutor(new CommandsHeal(this));
craft();
}
public void onDisable() {
}
private void craft() {
ItemStack item = new ItemStack(Material.ENDER_EYE);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.GREEN + "Телепортер");
List<String> lore = new ArrayList<String>();
lore.add("Эндер-телепорт");
meta.setLore(lore);
meta.addEnchant(Enchantment.DAMAGE_ALL, 3, true);
item.setItemMeta(meta);
ShapedRecipe s = new ShapedRecipe(item);
s.shape(new String[] {"A A"," B ","A A"});
s.setIngredient('A', Material.ENDER_PEARL);
s.setIngredient('B', Material.ENDER_EYE);
Bukkit.getServer().addRecipe(s);
}
}
plugin.yml
name: SuperPlugin
main: SuperPlugin.main.plugin_main
author: Drimgo
version: 1.0
api-version: 1.13
commands:
info:
description: "info about player"
usage: /info <player>
heal:
description: "heal player"
usage: /heal
Вот 3 предупреждения:
Description Resource Path Location Type
Name of automatic module 'craftbukkit' is unstable, it is derived from the module's file name. module-info.java /SuperPlugin/src line 2 Java Problem
The constructor ShapedRecipe(ItemStack) is deprecated plugin_main.java /SuperPlugin/src/SuperPlugin/main line 52 Java Problem
The method getPlayer(String) from the type Bukkit is deprecated commands.java /SuperPlugin/src/SuperPlugin/main line 29 Java Problem