File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
src/main/java/com/sentropic/guiapi Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11/* target /
22/* .idea /
3+ GUI-API.iml
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ public final class GUIAPI extends JavaPlugin {
1717 @ Override
1818 public void onEnable () {
1919 if (singleton != null ) { throw new IllegalStateException (); }
20+ singleton = this ;
21+
2022 saveDefaultConfig ();
2123 reloadConfig ();
2224 // TODO add config for character widths
@@ -28,8 +30,6 @@ public void onEnable() {
2830 protocolManager = ProtocolLibrary .getProtocolManager ();
2931 packetListener = new PacketListener (this , PacketType .Play .Server .TITLE );
3032 protocolManager .addPacketListener (packetListener );
31-
32- singleton = this ;
3333 }
3434
3535 @ Override
@@ -46,6 +46,5 @@ public void onDisable() {
4646 }
4747
4848 public static GUIAPI getPlugin () { return singleton ; }
49-
50- public static GUIManager getGuiManager () { return guiManager ; }
49+ public static GUIManager getGUIManager () { return guiManager ; }
5150}
Original file line number Diff line number Diff line change 77import org .jetbrains .annotations .NotNull ;
88
99import java .util .*;
10+ import java .util .function .Predicate ;
1011
1112public class GUI {
1213 public static boolean sendingPacket = false ;
@@ -89,6 +90,10 @@ public boolean remove(String id) {
8990 return success ;
9091 }
9192
93+ public boolean removeIf (Predicate <GUIComponent > predicate ) {
94+ return guiComponents .removeIf (predicate );
95+ }
96+
9297 private void build () {
9398 StringBuilder builder = new StringBuilder ("[{\" text\" :\" " );
9499 int offset = 0 ;
You can’t perform that action at this time.
0 commit comments