Skip to content

Refactor for Multi-Platform Support, Support Fabric#28

Open
Peashooter101 wants to merge 19 commits into
masterfrom
feat/multi-platform
Open

Refactor for Multi-Platform Support, Support Fabric#28
Peashooter101 wants to merge 19 commits into
masterfrom
feat/multi-platform

Conversation

@Peashooter101

Copy link
Copy Markdown
Member

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

@Peashooter101 Peashooter101 self-assigned this Jun 5, 2026
@Peashooter101 Peashooter101 requested a review from RhythmicSys June 5, 2026 12:42

@RhythmicSys RhythmicSys left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number of things to be addressed and changed

*/
public class Exceptions {

private static String strip(String miniMessage) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the minimessage option 'placeholder' and not replace

return new DynamicCommandExceptionType(
nick -> () -> strip(
LocaleMessage.ERROR_INVALID_NICK.getMessage()
.replace("<regex>", ConfigHandler.getInstance().getRegexString())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the minimessage option 'placeholder' and not replace

return new DynamicCommandExceptionType(
name -> () -> strip(
LocaleMessage.ERROR_INVALID_PLAYER.getMessage()
.replace("<player_name>", name.toString())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant warning suppression

@RhythmicSys

Copy link
Copy Markdown
Member

Additional issue, when trying to get info on a player that does not exist, this stacktrace is sent to the console:

[22:19:11] [Server thread/WARN]: Couldn't find profile with name: testinginging
com.mojang.authlib.exceptions.MinecraftClientHttpException: Couldn't find any profile with name testinginging
	at knot//com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:103)
	at knot//com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:56)
	at knot//com.mojang.authlib.yggdrasil.YggdrasilGameProfileRepository.findProfileByName(YggdrasilGameProfileRepository.java:110)
	at knot//net.minecraft.server.players.CachedUserNameToIdResolver.lookupGameProfile(CachedUserNameToIdResolver.java:73)
	at knot//net.minecraft.server.players.CachedUserNameToIdResolver.get(CachedUserNameToIdResolver.java:134)
	at knot//net.minecraft.commands.arguments.GameProfileArgument.lambda$parse$0(GameProfileArgument.java:66)
	at knot//net.minecraft.commands.arguments.GameProfileArgument.getGameProfiles(GameProfileArgument.java:32)
	at knot//simplexity.simplenicks.fabric.commands.subcommands.admin.FabricAdminLookupSubCommand.execute(FabricAdminLookupSubCommand.java:46)
	at knot//com.mojang.brigadier.context.ContextChain.runExecutable$mixinextras$wrapped$10(ContextChain.java:73)
	at knot//com.mojang.brigadier.context.ContextChain.mixinextras$bridge$runExecutable$mixinextras$wrapped$10$11(ContextChain.java)
	at knot//com.mojang.brigadier.context.ContextChain.wrapMethod$zep000$fabric-entity-events-v1$onRunExecutable(ContextChain.java:1057)
	at knot//com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java)
	at knot//net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:29)
	at knot//net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13)
	at knot//net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8)
	at knot//net.minecraft.commands.execution.CommandQueueEntry.execute$mixinextras$wrapped$8(CommandQueueEntry.java:8)
	at knot//net.minecraft.commands.execution.CommandQueueEntry.mixinextras$bridge$execute$mixinextras$wrapped$8$9(CommandQueueEntry.java)
	at knot//net.minecraft.commands.execution.CommandQueueEntry.wrapMethod$zeo000$fabric-entity-events-v1$onExecute(CommandQueueEntry.java:549)
	at knot//net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java)
	at knot//net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:106)
	at knot//net.minecraft.commands.Commands.executeCommandInContext(Commands.java:432)
	at knot//net.minecraft.commands.Commands.performCommand(Commands.java:364)
	at knot//net.minecraft.server.network.ServerGamePacketListenerImpl.performUnsignedChatCommand(ServerGamePacketListenerImpl.java:1627)
	at knot//net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$0(ServerGamePacketListenerImpl.java:1615)
	at knot//net.minecraft.server.TickTask.run(TickTask.java:18)
	at knot//net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:173)
	at knot//net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23)
	at knot//net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:934)
	at knot//net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:197)
	at knot//net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:147)
	at knot//net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:916)
	at knot//net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:910)
	at knot//net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:156)
	at knot//net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:881)
	at knot//net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:780)
	at knot//net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321)
	at java.base/java.lang.Thread.run(Thread.java:1474)

This isn't really a huge issue but this should be caught and handled rather than sent to console in this state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fabric support

2 participants