File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
bootstrap/paper/src/main/java/dev/triassic/template/paper
core/src/main/java/dev/triassic/template Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,25 @@ public void onDisable() {
7474
7575 @ Override
7676 public @ NonNull PlatformType platformType () {
77- return PlatformType .PAPER ;
77+ return isFolia () ? PlatformType . FOLIA : PlatformType .PAPER ;
7878 }
7979
8080 @ Override
8181 public @ NonNull CommandManager <Commander > commandManager () {
8282 return this .commandManager ;
8383 }
84+
85+ /**
86+ * Check if the server is running on Folia.
87+ *
88+ * @return {@code true} if running on Folia, otherwise {@code false}
89+ */
90+ public static boolean isFolia () {
91+ try {
92+ Class .forName ("io.papermc.paper.threadedregions.RegionizedServer" );
93+ return true ;
94+ } catch (ClassNotFoundException e ) {
95+ return false ;
96+ }
97+ }
8498}
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ public void initialize() {
6363 this .commandRegistry = new CommandRegistry (this , commandManager );
6464 commandRegistry .registerAll (platformType );
6565
66- logger .info ("Enabled in {}ms" , System .currentTimeMillis () - startTime );
66+ logger .info ("Enabled on {} in {}ms" ,
67+ getPlatformType (), System .currentTimeMillis () - startTime );
6768 }
6869
6970 /**
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ public enum PlatformType {
2222 BUKKIT ("Bukkit" , false ),
2323 BUNGEECORD ("Bungeecord" , true ),
2424 FABRIC ("Fabric" , false ),
25+ FOLIA ("Folia" , false ),
2526 NEOFORGE ("NeoForge" , false ),
2627 PAPER ("Paper" , false ),
2728 VELOCITY ("Velocity" , true );
You can’t perform that action at this time.
0 commit comments