11package com .bencodez .advancedcore .api .inventory .anvilinventory ;
22
3- import org .bukkit .Bukkit ;
43import org .bukkit .Material ;
5- import org .bukkit .Server ;
64import org .bukkit .entity .Player ;
75
86import com .bencodez .advancedcore .AdvancedCorePlugin ;
@@ -14,78 +12,9 @@ public class AInventory {
1412
1513 public interface AnvilClickEventHandler {
1614
17- /**
18- * On anvil click.
19- *
20- * @param event the event
21- */
2215 AnvilGUI .Response onAnvilClick (String value , Player player );
2316 }
2417
25- /**
26- * The Enum AnvilSlot.
27- */
28- public enum AnvilSlot {
29-
30- /** The input left. */
31- INPUT_LEFT (0 ),
32-
33- /** The input right. */
34- INPUT_RIGHT (1 ),
35-
36- /** The output. */
37- OUTPUT (2 );
38-
39- /**
40- * By slot.
41- *
42- * @param slot the slot
43- * @return the anvil slot
44- */
45- public static AnvilSlot bySlot (int slot ) {
46- for (AnvilSlot anvilSlot : values ()) {
47- if (anvilSlot .getSlot () == slot ) {
48- return anvilSlot ;
49- }
50- }
51-
52- return null ;
53- }
54-
55- /** The slot. */
56- private int slot ;
57-
58- /**
59- * Instantiates a new anvil slot.
60- *
61- * @param slot the slot
62- */
63- private AnvilSlot (int slot ) {
64- this .slot = slot ;
65- }
66-
67- /**
68- * Gets the slot.
69- *
70- * @return the slot
71- */
72- public int getSlot () {
73- return slot ;
74- }
75- }
76-
77- /**
78- * Gets the version.
79- *
80- * @return the version
81- */
82- public static String getVersion () {
83- Server server = Bukkit .getServer ();
84- final String packageName = server .getClass ().getPackage ().getName ();
85-
86- return packageName .substring (packageName .lastIndexOf ('.' ) + 1 );
87- }
88-
8918 private void open (Player playerToOpen , AnvilClickEventHandler anvilClickEventHandler , String textToStart ,
9019 String title , String [] strings ) {
9120 new AnvilGUI .Builder ().onClose (player -> { // called when the inventory is closing
0 commit comments