[SOLVED] Проблема с рецептами

Статус
Закрыто для дальнейших ответов.

Zemf4you

Активный участник
Пользователь
Баллы
76
Имя в Minecraft
zemf4you
Кастомные рецепты.
Где может быть ошибка?
Java:
ShapedRecipe sh = new ShapedRecipe(chest);
      sh.shape(new String[]{"S0S", "SSS", "SSS"}).setIngredient('S', Material.DIRT);
      Bukkit.addRecipe(sh);
      ShapedRecipe sh2 = new ShapedRecipe(legg);
      sh2.shape(new String[]{"SSS", "S0S", "S0S"}).setIngredient('S', Material.DIRT);
      Bukkit.addRecipe(sh2);
      ShapedRecipe sh3 = new ShapedRecipe(hel);
      sh3.shape(new String[]{"SSS", "S0S", "000"}).setIngredient('S', Material.DIRT);
      Bukkit.addRecipe(sh3);
      ShapedRecipe sh4 = new ShapedRecipe(hel);
      sh4.shape(new String[]{"000", "SSS", "S0S"}).setIngredient('S', Material.DIRT);
      Bukkit.addRecipe(sh4);
      ShapedRecipe sh5 = new ShapedRecipe(boot);
      sh5.shape(new String[]{"S0S", "S0S", "000"}).setIngredient('S', Material.DIRT);
      Bukkit.addRecipe(sh5);
      ShapedRecipe sh6 = new ShapedRecipe(boot);
      sh6.shape(new String[]{"000", "S0S", "S0S"}).setIngredient('S', Material.DIRT);
      Bukkit.addRecipe(sh6);
      ShapedRecipe sh7 = new ShapedRecipe(axe);
      sh6.shape(new String[]{"0SS", "0BS", "0B0"}).setIngredient('S', Material.DIRT).setIngredient('B', Material.STICK);
      Bukkit.addRecipe(sh7);
      ShapedRecipe sh8 = new ShapedRecipe(axe);
      sh6.shape(new String[]{"SS0", "SB0", "0B0"}).setIngredient('S', Material.DIRT).setIngredient('B', Material.STICK);
      Bukkit.addRecipe(sh8);
      ShapedRecipe sh9 = new ShapedRecipe(sword);
      sh6.shape(new String[]{"0S0", "0S0", "0B0"}).setIngredient('S', Material.DIRT).setIngredient('B', Material.STICK);
      Bukkit.addRecipe(sh9);
      ShapedRecipe sh10 = new ShapedRecipe(sword);
      sh6.shape(new String[]{"S00", "S00", "B00"}).setIngredient('S', Material.DIRT).setIngredient('B', Material.STICK);
      Bukkit.addRecipe(sh10);
      ShapedRecipe sh11 = new ShapedRecipe(sword);
      sh6.shape(new String[]{"00S", "00S", "00B"}).setIngredient('S', Material.DIRT).setIngredient('B', Material.STICK);
      Bukkit.addRecipe(sh11);
      super.onEnable();
 
вон там

p.s. ты может больше подробностей напишешь или нах надо?
прости, можешь сказать, какие нужны подробности?
на всякий случай кину ошибку в логе:
Код:
[Server thread/ERROR]: Error occurred while enabling Armor4Gods v1.2 (Is it up to date?)
java.lang.NullPointerException
    at org.*********ventory.ShapedRecipe.getShape(ShapedRecipe.java:137) ~[spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at org.bukkit.craftbukkit.v1_9_R2.inventory.CraftShapedRecipe.fromBukkitRecipe(CraftShapedRecipe.java:30) ~[spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at org.bukkit.craftbukkit.v1_9_R2.CraftServer.addRecipe(CraftServer.java:1098) ~[spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at org.bukkit.Bukkit.addRecipe(Bukkit.java:601) ~[spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at armor4gods.Main.onEnable(Main.java:94) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:292) ~[spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at org.bukkit.craftbukkit.v1_9_R2.CraftServer.loadPlugin(CraftServer.java:361) [spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at org.bukkit.craftbukkit.v1_9_R2.CraftServer.enablePlugins(CraftServer.java:321) [spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at net.minecraft.server.v1_9_R2.MinecraftServer.t(MinecraftServer.java:416) [spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at net.minecraft.server.v1_9_R2.MinecraftServer.l(MinecraftServer.java:381) [spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at net.minecraft.server.v1_9_R2.MinecraftServer.a(MinecraftServer.java:336) [spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at net.minecraft.server.v1_9_R2.DedicatedServer.init(DedicatedServer.java:268) [spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at net.minecraft.server.v1_9_R2.MinecraftServer.run(MinecraftServer.java:532) [spigot-1.9.4-R0.1-SNAPSHOT-latest.jar:git-Spigot-4af49dc-c5e9a16]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_152]
 
Проблема решена. Т.к. лень было писать всё несколько раз, копировал и не заметил, что повторяюсь с sh6, а добавляю с 6 до 11.

ShapedRecipe sh6 = new ShapedRecipe(boot);
sh6.shape(new String[]{"000", "S0S", "S0S"}).setIngredient('S', Material.DIRT);
Bukkit.addRecipe(sh6);
ShapedRecipe sh7 = new ShapedRecipe(axe);
sh6.shape(new String[]{"0SS", "0BS", "0B0"}).setIngredient('S', Material.DIRT).setIngredient('B', Material.STICK);
Bukkit.addRecipe(sh7);
ShapedRecipe sh8 = new ShapedRecipe(axe);
sh6.shape(new String[]{"SS0", "SB0", "0B0"}).setIngredient('S', Material.DIRT).setIngredient('B', Material.STICK);
Bukkit.addRecipe(sh8);
ShapedRecipe sh9 = new ShapedRecipe(sword);
sh6.shape(new String[]{"0S0", "0S0", "0B0"}).setIngredient('S', Material.DIRT).setIngredient('B', Material.STICK);
Bukkit.addRecipe(sh9);
ShapedRecipe sh10 = new ShapedRecipe(sword);
sh6.shape(new String[]{"S00", "S00", "B00"}).setIngredient('S', Material.DIRT).setIngredient('B', Material.STICK);
Bukkit.addRecipe(sh10);
ShapedRecipe sh11 = new ShapedRecipe(sword);
sh6.shape(new String[]{"00S", "00S", "00B"}).setIngredient('S', Material.DIRT).setIngredient('B', Material.STICK);
Bukkit.addRecipe(sh11);

P.S. - тот, кто будет глядеть - воздух я тоже указал. Делайте по аналогии
 
Статус
Закрыто для дальнейших ответов.
Назад
Верх