There are two methods to register a custom game type: using an expansion jar or a plugin. Using the expansion jar method requires placing the built jar file into the "expansion" folder, similar to how it works with PlaceholderAPI. If you're using the plugin method to register a custom game type, after adding the custom game factory, you will need to call the CustomFishing's reload function to apply the changes.
Using a plugin
BukkitCustomFishingPlugin.getInstance().getGameManager().registerGameType("accurate_click_v2",((id, section)->{GameBasicsbasics= getGameBasics(section);returnnew AbstractGame(id, basics){privatefinalStringbarWidth=section.getString("title.total-width","15~20");privatefinalStringbarSuccess=section.getString("title.success-width","3~4");privatefinalStringbarBody=section.getString("title.body","");privatefinalStringleft=section.getString("title.left","");privatefinalStringright=section.getString("title.right","");privatefinalStringbarPointer=section.getString("title.pointer","");privatefinalStringbarTarget=section.getString("title.target","");privatefinalStringsubtitle=section.getString("subtitle","<gray>Reel in at the most critical moment</gray>");@OverridepublicBiFunction<CustomFishingHook,GameSetting,AbstractGamingPlayer> gamingPlayerProvider(){intminWidth=Integer.parseInt(barWidth.split("~")[0]);intmaxWidth=Integer.parseInt(barWidth.split("~")[1]);intminSuccess=Integer.parseInt(barSuccess.split("~")[0]);intmaxSuccess=Integer.parseInt(barSuccess.split("~")[1]);return(customFishingHook, gameSetting)->new AbstractGamingPlayer(customFishingHook, gameSetting){privatefinalinttotalWidth=RandomUtils.generateRandomInt(minWidth, maxWidth);privatefinalintsuccessWidth=RandomUtils.generateRandomInt(minSuccess, maxSuccess);privatefinalintsuccessPosition=ThreadLocalRandom.current().nextInt((totalWidth - successWidth +1))+1;privateintcurrentIndex=0;privateinttimer=0;privatebooleanface=true;@Overrideprotectedvoid tick(){ timer++;if(timer %((106-(int)settings.difficulty())/5)==0){ movePointer();} showUI();}privatevoid movePointer(){if(face){ currentIndex++;if(currentIndex >= totalWidth -1){ face =false;}}else{ currentIndex--;if(currentIndex <=0){ face =true;}}}privatevoid showUI(){StringBuilderstringBuilder=new StringBuilder();for(inti=1; i <= totalWidth; i++){if(i == currentIndex +1){stringBuilder.append(barPointer);continue;}if(i >= successPosition && i <= successPosition + successWidth -1){stringBuilder.append(barTarget);continue;}stringBuilder.append(barBody);}SparrowHeart.getInstance().sendTitle(getPlayer(),AdventureHelper.miniMessageToJson(left + stringBuilder + right),AdventureHelper.miniMessageToJson(subtitle),0,20,0);}@Overridepublicboolean isSuccessful(){if(isTimeOut)returnfalse;return currentIndex +1<= successPosition + successWidth -1&& currentIndex +1>= successPosition;}};}};}));