Refactor for Multi-Platform Support, Support Fabric#28
Conversation
RhythmicSys
left a comment
There was a problem hiding this comment.
Number of things to be addressed and changed
| */ | ||
| public class Exceptions { | ||
|
|
||
| private static String strip(String miniMessage) { |
There was a problem hiding this comment.
Stripping the locale messages doesn't make sense, it prevents people from being able to change their message colors in config.
| return new DynamicCommandExceptionType( | ||
| nick -> () -> strip(SimpleNicksCore.get().miniMessage().stripTags( | ||
| LocaleMessage.ERROR_INVALID_NICK_LENGTH.getMessage() | ||
| .replace("<value>", String.valueOf(ConfigHandler.getInstance().getMaxLength())) |
There was a problem hiding this comment.
Please use the minimessage option 'placeholder' and not replace
| nick -> () -> strip(SimpleNicksCore.get().miniMessage().stripTags( | ||
| LocaleMessage.ERROR_INVALID_NICK_LENGTH.getMessage() | ||
| .replace("<value>", String.valueOf(ConfigHandler.getInstance().getMaxLength())) | ||
| .replace("<name>", nick.toString()) |
There was a problem hiding this comment.
Please use the minimessage option 'placeholder' and not replace
| return new DynamicCommandExceptionType( | ||
| nick -> () -> strip( | ||
| LocaleMessage.ERROR_INVALID_NICK.getMessage() | ||
| .replace("<regex>", ConfigHandler.getInstance().getRegexString()) |
There was a problem hiding this comment.
Please use the minimessage option 'placeholder' and not replace
| return new DynamicCommandExceptionType( | ||
| name -> () -> strip( | ||
| LocaleMessage.ERROR_INVALID_PLAYER.getMessage() | ||
| .replace("<player_name>", name.toString()) |
There was a problem hiding this comment.
Please use the minimessage option 'placeholder' and not replace
| * Interface shared by all Fabric /nick subcommands, mirroring the Paper {@code SubCommand} | ||
| * but typed to Fabric's {@link CommandSourceStack}. | ||
| */ | ||
| public interface FabricSubCommand { |
There was a problem hiding this comment.
I think that ideally, all the commands rest in the core section, and then we can have platform specific setups for the actual messaging of the player
| * Registered via {@code CommandRegistrationCallback} in | ||
| * {@link simplexity.simplenicks.fabric.SimpleNicksFabric}. | ||
| */ | ||
| public class FabricNicknameCommand { |
There was a problem hiding this comment.
I think that ideally, all the commands rest in the core section, and then we can have platform specific setups for the actual messaging of the player
| import simplexity.simplenicks.util.NickPermission; | ||
|
|
||
| @SuppressWarnings("UnstableApiUsage") | ||
| public class NicknameCommand { |
There was a problem hiding this comment.
I think that ideally, all the commands rest in the core section, and then we can have platform specific setups for the actual messaging of the player
| @@ -13,44 +13,33 @@ public class SNMiniExpansion { | |||
|
|
|||
There was a problem hiding this comment.
miniplaceholder support should be on fabric as well, this might be able to be pulled into core
|
|
||
| public static void configReload() { | ||
| ConfigHandler.getInstance().reloadConfig(); | ||
| @SuppressWarnings("deprecation") |
There was a problem hiding this comment.
Redundant warning suppression
|
Additional issue, when trying to get info on a player that does not exist, this stacktrace is sent to the console: This isn't really a huge issue but this should be caught and handled rather than sent to console in this state |
Overview
This PR splits SimpleNicks into three modules: core, paper, and fabric.
Core should contain all general logic for this plugin.
Paper and Fabric should have their own adapters for any platform specific operations.
Testing
The platforms should have parity between them. They should not differ in how they function.
Regression test the Paper build and verify we still support Paper 1.21.5-26.1.2. Check for feature parity on Fabric.
Fabric requires Fabric API as a dependency. This plugin should support Fabric 26.1.x (26.1-26.1.2).
Semver
The versioning of the platforms should be the same across both for major and minor.
I believe that the patch should differ between the platforms so that issues with fabric or paper individually will not hold releasing or creating no change releases.
Releasing
We are resolving issues we note on the Paper side. They appear to be pre-existing but we are not entirely sure.
Unsure if this should be released as v4.0.0 or v3.3.0 for both Paper and Fabric.
Issues
Closes #27 - Requests for Fabric Support