33import java .util .ArrayList ;
44import java .util .List ;
55
6+ import org .bukkit .Bukkit ;
67import org .bukkit .Material ;
78import org .bukkit .NamespacedKey ;
89import org .bukkit .enchantments .Enchantment ;
1516import org .bukkit .inventory .meta .ItemMeta ;
1617
1718import com .loohp .interactionvisualizer .InteractionVisualizer ;
19+ import com .loohp .interactionvisualizer .Utils .MCVersion ;
1820
1921import net .md_5 .bungee .api .ChatColor ;
2022import net .md_5 .bungee .api .chat .TextComponent ;
@@ -29,14 +31,16 @@ public void onJoinPluginActive(PlayerJoinEvent event) {
2931 }
3032
3133 public Debug () {
32- InteractionVisualizer .plugin .getServer ().resetRecipes ();
33-
3434 if (InteractionVisualizer .plugin .getConfig ().contains ("Special.b" )) {
3535 if (!InteractionVisualizer .plugin .getConfig ().getBoolean ("Special.b" )) {
3636 return ;
3737 }
3838 }
3939
40+ try {
41+ Bukkit .removeRecipe (new NamespacedKey (InteractionVisualizer .plugin , "nana_bone" ));
42+ } catch (Exception e ) {}
43+
4044 ItemStack bone = new ItemStack (Material .BONE , 1 );
4145 ItemMeta meta = bone .getItemMeta ();
4246 TextComponent text = new TextComponent ("Nana's Bone" );
@@ -54,14 +58,14 @@ public Debug() {
5458 bone .addUnsafeEnchantment (Enchantment .ARROW_DAMAGE , 1 );
5559
5660 @ SuppressWarnings ("deprecation" )
57- ShapedRecipe recipe = InteractionVisualizer .version .isLegacy () ? new ShapedRecipe (bone ) : new ShapedRecipe (new NamespacedKey (InteractionVisualizer .plugin , "nana_bone" ), bone );
61+ ShapedRecipe recipe = InteractionVisualizer .version .isLegacy () && ! InteractionVisualizer . version . equals ( MCVersion . V1_12 ) ? new ShapedRecipe (bone ) : new ShapedRecipe (new NamespacedKey (InteractionVisualizer .plugin , "nana_bone" ), bone );
5862
5963 recipe .shape ("$$#" , "$%$" , "#$$" );
6064 recipe .setIngredient ('#' , Material .BONE_BLOCK );
6165 recipe .setIngredient ('%' , Material .BLAZE_ROD );
6266 recipe .setIngredient ('$' , Material .BONE );
6367
64- InteractionVisualizer . plugin . getServer () .addRecipe (recipe );
68+ Bukkit .addRecipe (recipe );
6569 }
6670
6771}
0 commit comments