@@ -44,7 +44,7 @@ public boolean onLoad() {
4444 for (DialogManagerType type : DialogManagerType .values ()) {
4545 if (type .isAvailable ()) {
4646 dialogManager = type .create (getPlugin ());
47- logger .log (LogLevel .INFO , "Using " + type .getRequirement () + " for BetterDialogs" );
47+ logger .log (LogLevel .INFO , "Using " + type .name () + " for BetterDialogs" );
4848 return true ;
4949 }
5050 }
@@ -54,7 +54,7 @@ public boolean onLoad() {
5454 DialogManagerType type = DialogManagerType .valueOf (dialogManagerName .toUpperCase ());
5555 if (type .isAvailable ()) {
5656 dialogManager = type .create (getPlugin ());
57- logger .log (LogLevel .INFO , "Using " + type .getRequirement () + " for BetterDialogs" );
57+ logger .log (LogLevel .INFO , "Using " + type .name () + " for BetterDialogs" );
5858 return true ;
5959 } else {
6060 logger .log (LogLevel .WARN , "The specified dialog manager '" + dialogManagerName + "' is not available." );
@@ -91,12 +91,10 @@ public void onDisable() {
9191
9292 private enum DialogManagerType {
9393 PAPER (
94- "Paper 1.21.7+" ,
9594 () -> Platform .PAPER .isPlatform () && VersionUtils .isAtLeast (21 , 7 ),
9695 plugin -> new PaperDialogManager (plugin , "betterdialogs" )
9796 ),
9897 PACKETEVENTS (
99- "PocketEvents" ,
10098 () -> Bukkit .getPluginManager ().getPlugin ("packetevents" ) != null ,
10199 plugin -> new PocketEventsDialogManager ("betterdialogs" ) {
102100 @ Override
@@ -112,25 +110,18 @@ protected UUID getPlayerId(Object player) {
112110 }
113111 ),
114112 SPIGOT (
115- "Spigot 1.21.6+" ,
116113 () -> Validate .isClassLoaded ("net.md_5.bungee.api.dialog.Dialog" ),
117114 plugin -> new SpigotDialogManager (plugin , "betterdialogs" )
118115 );
119116
120- private final String requirement ;
121117 private final BooleanSupplier isAvailable ;
122118 private final Function <Plugin , DialogManager <?, ?, ?, ?, ?>> constructor ;
123119
124- DialogManagerType (String requirement , BooleanSupplier isAvailable , Function <Plugin , DialogManager <?, ?, ?, ?, ?>> constructor ) {
125- this .requirement = requirement ;
120+ DialogManagerType (BooleanSupplier isAvailable , Function <Plugin , DialogManager <?, ?, ?, ?, ?>> constructor ) {
126121 this .isAvailable = isAvailable ;
127122 this .constructor = constructor ;
128123 }
129124
130- public String getRequirement () {
131- return requirement ;
132- }
133-
134125 public boolean isAvailable () {
135126 return isAvailable .getAsBoolean ();
136127 }
0 commit comments