File tree Expand file tree Collapse file tree 4 files changed +35
-10
lines changed
src/main/java/dev/felnull/bettergui Expand file tree Collapse file tree 4 files changed +35
-10
lines changed Original file line number Diff line number Diff line change 66
77 <groupId >dev.felnull</groupId >
88 <artifactId >BetterGUI</artifactId >
9- <version >1.0.3 </version >
9+ <version >1.0.4 </version >
1010 <packaging >jar</packaging >
1111
1212 <name >BetterGUI</name >
Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ public void onShiftLeftClick(InventoryClickEvent e){}
2626 public void onDropClick (InventoryClickEvent e ){}
2727 public void onControlDropClick (InventoryClickEvent e ){}
2828 public void onOffhandClick (InventoryClickEvent e ){}
29- public void onWindowBorderRightClick (InventoryClickEvent e ){}
30- public void onWindowBorderLeftClick (InventoryClickEvent e ){}
3129 public void onNumberClick (InventoryClickEvent e ){}
3230 public void onCreativeClick (InventoryClickEvent e ){}
3331
Original file line number Diff line number Diff line change 44import dev .felnull .bettergui .listener .GUIClickListener ;
55import org .bukkit .Bukkit ;
66import org .bukkit .event .HandlerList ;
7+ import org .bukkit .event .inventory .InventoryClickEvent ;
78import org .bukkit .inventory .Inventory ;
89import org .bukkit .inventory .InventoryHolder ;
910import org .bukkit .inventory .ItemStack ;
@@ -48,4 +49,14 @@ public ItemStack getItemStack(int slot){
4849 public void close (){
4950 HandlerList .unregisterAll (listener );
5051 }
52+
53+ public void onWindowBorderRightClick (InventoryClickEvent e ){}
54+
55+ public void onWindowBorderLeftClick (InventoryClickEvent e ){}
56+
57+ public void onOutsideWindowRightClick (InventoryClickEvent e ){}
58+
59+ public void onOutsideWindowLeftClick (InventoryClickEvent e ){}
60+
61+ public void onOutsideWindowClick (InventoryClickEvent e ){}
5162}
Original file line number Diff line number Diff line change @@ -42,12 +42,6 @@ public void onClick(InventoryClickEvent e){
4242 case SHIFT_LEFT :
4343 item .onShiftLeftClick (e );
4444 break ;
45- case WINDOW_BORDER_RIGHT :
46- item .onWindowBorderRightClick (e );
47- break ;
48- case WINDOW_BORDER_LEFT :
49- item .onWindowBorderLeftClick (e );
50- break ;
5145 case DROP :
5246 item .onDropClick (e );
5347 break ;
@@ -64,8 +58,30 @@ public void onClick(InventoryClickEvent e){
6458 item .onCreativeClick (e );
6559 break ;
6660 }
67- e .setCancelled (true );
61+ switch (e .getClick ()){
62+ case WINDOW_BORDER_RIGHT :
63+ page .onWindowBorderRightClick (e );
64+ break ;
65+ case WINDOW_BORDER_LEFT :
66+ page .onWindowBorderLeftClick (e );
67+ break ;
68+ case RIGHT :
69+ if (e .getSlot () == -999 ){
70+ page .onOutsideWindowClick (e );
71+ page .onOutsideWindowRightClick (e );
72+ }
73+ break ;
74+ case LEFT :
75+ if (e .getSlot () == -999 ){
76+ page .onOutsideWindowClick (e );
77+ page .onOutsideWindowLeftClick (e );
78+ }
79+ break ;
80+ }
81+
6882 }
83+
84+ e .setCancelled (true );
6985 }
7086
7187 @ EventHandler
You can’t perform that action at this time.
0 commit comments