Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6e18b67
SQLite connection added
RhythmicSys May 2, 2025
9a9ff17
fix a couple issues.
RhythmicSys May 2, 2025
ef2f033
.
RhythmicSys May 4, 2025
62dcdab
add another table for active nicks
RhythmicSys May 6, 2025
64b6afa
compiles but doesn't work
RhythmicSys May 6, 2025
1b63485
now using /nick works, save doesn't
RhythmicSys May 6, 2025
62d0ee4
genuinely not sure what's wrong here
RhythmicSys May 7, 2025
8cc8b3e
it was a syntax error. Anyways, it works, autocomplete is still broken
RhythmicSys May 7, 2025
ad79ee9
aaaaaaaaa
RhythmicSys May 7, 2025
3bf7053
It fixed,,, and I ,, don't know why
RhythmicSys May 8, 2025
2766b6c
Work on commands, but not much has been done
RhythmicSys May 8, 2025
ccc41c2
Work on processing nicknames, Cache, SqlHandler
RhythmicSys May 10, 2025
4bbc09a
this is taking so long
RhythmicSys May 10, 2025
af902a9
committing basic changes
RhythmicSys May 11, 2025
9ac5c13
Brig save and set commands
Peashooter101 May 11, 2025
81ee196
Abstract SubCommand, Brig reset and delete commands
Peashooter101 May 12, 2025
1bd5984
Add leave listener, fix delete subcommand
RhythmicSys May 12, 2025
7b8769b
Implement more feedback messages
RhythmicSys May 12, 2025
902dfb6
Fix nicknames requiring quotes
RhythmicSys May 12, 2025
2ec3b12
Fix SQL issue and allow saving nicknames that are not currently on yo…
RhythmicSys May 14, 2025
7096dec
Brig admin and admin-set commands.
Peashooter101 May 15, 2025
bd33c04
Attempt at extracting nickname checks, it's broken now.
RhythmicSys May 16, 2025
dbc9118
idk why it keeps saying regex error
RhythmicSys May 17, 2025
97b6223
regex error is fixed, slight work on username check
RhythmicSys May 18, 2025
0090152
Change Nickname from a record to a class (needed to be able to set) -…
RhythmicSys May 20, 2025
0357860
Added nick lookup command, incomplete
RhythmicSys May 20, 2025
2426007
rename lookup to who, fix formatting of message, idk what else I did
RhythmicSys May 21, 2025
c1d0b64
start on admin lookup command
RhythmicSys May 27, 2025
4f44316
Admin lookup command works now, refactor Message class to be called L…
RhythmicSys Jun 10, 2025
69f72bc
Admin delete command works
RhythmicSys Jul 26, 2025
c0fe39a
I don't understand
RhythmicSys Jul 28, 2025
2a6fc06
This didn't fix it but I needed to move it anyways
RhythmicSys Jul 28, 2025
e21a984
No longer deletes the data lets go
RhythmicSys Jul 29, 2025
a956aa7
Adjust SQL, move things to be properly async.
RhythmicSys Aug 8, 2025
8668932
Stop migration from preventing the server from starting properly (mov…
RhythmicSys Aug 10, 2025
b27050a
More migration changes - also renamed 'refreshNickname' to 'refreshDi…
RhythmicSys Aug 10, 2025
9cd5b08
Alter save migrator to use a batching system
RhythmicSys Aug 12, 2025
2957e18
Change permission registration
RhythmicSys Aug 12, 2025
92eb0b6
Changed API version
RhythmicSys Aug 12, 2025
3a6f65e
Reorganize Locale
RhythmicSys Aug 13, 2025
0241a47
Fix annotations, add javadocs
RhythmicSys Sep 1, 2025
4614ac6
Fix reload command not refreshing tab list
RhythmicSys Sep 1, 2025
ac225fb
Update README and move username protection options under the nickname…
RhythmicSys Sep 4, 2025
6ffd0fa
Remove cache file that ended up here after I rebased
RhythmicSys Sep 7, 2025
3bd4b8e
Fix incorrect 'Cache' file reference
RhythmicSys Sep 7, 2025
e821685
Fix small changes
RhythmicSys Sep 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
288 changes: 230 additions & 58 deletions README.md

Large diffs are not rendered by default.

21 changes: 6 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<groupId>simplexity</groupId>
<artifactId>SimpleNicks</artifactId>
<version>2.1.2</version>
<version>3.0.0</version>
<packaging>jar</packaging>

<name>SimpleNicks</name>

<properties>
<java.version>1.8</java.version>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down Expand Up @@ -73,21 +73,13 @@
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<repository>
<id>codemc-releases</id>
<url>https://repo.codemc.io/repository/maven-releases/</url>
</repository>
<repository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<version>1.21.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -97,10 +89,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.retrooper</groupId>
<artifactId>packetevents-spigot</artifactId>
<version>2.9.3</version>
<scope>provided</scope>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>6.3.0</version>
</dependency>
</dependencies>
</project>
96 changes: 55 additions & 41 deletions src/main/java/simplexity/simplenicks/SimpleNicks.java
Original file line number Diff line number Diff line change
@@ -1,58 +1,74 @@
package simplexity.simplenicks;

import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import simplexity.simplenicks.commands.CommandHandler;
import simplexity.simplenicks.commands.Delete;
import simplexity.simplenicks.commands.Help;
import simplexity.simplenicks.commands.Reset;
import simplexity.simplenicks.commands.SNReload;
import simplexity.simplenicks.commands.Save;
import simplexity.simplenicks.commands.Set;
import simplexity.simplenicks.commands.SubCommand;
import simplexity.simplenicks.commands.NicknameCommand;
import simplexity.simplenicks.config.ConfigHandler;
import simplexity.simplenicks.config.LocaleHandler;
import simplexity.simplenicks.hooks.SNExpansion;
import simplexity.simplenicks.listener.LeaveListener;
import simplexity.simplenicks.listener.LoginListener;
import simplexity.simplenicks.util.Constants;
import simplexity.simplenicks.util.NickHandler;
import simplexity.simplenicks.util.SNExpansion;
import simplexity.simplenicks.saving.SaveMigrator;
import simplexity.simplenicks.saving.SqlHandler;
import simplexity.simplenicks.util.ColorTag;
import simplexity.simplenicks.util.FormatTag;
import simplexity.simplenicks.util.NickPermission;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

/*command based
[/nick [nickname] or /nick <player> [nickname]]
need to check if it's a valid name
[Alphanumeric, tho a bypass permission would be nice]
need to check if the minimessage formats are allowed- i,e, not allowing hover/click event tag
[assuming I'd make a set of blacklisted tag types, check for those]
need to check length after parsing
PlaceholderAPI placeholder for before parsing, and after
*/

@SuppressWarnings("UnstableApiUsage")
public final class SimpleNicks extends JavaPlugin {

private static final MiniMessage miniMessage = MiniMessage.miniMessage();
private static Plugin instance;
private static final HashMap<String, SubCommand> subCommands = new HashMap<>();
private static MiniMessage defaultResolver;

@Override
public void onEnable() {
instance = this;
registerSubCommands();
this.saveDefaultConfig();
getConfig().options().copyDefaults(true);
saveConfig();
this.getCommand("nick").setExecutor(new CommandHandler());
this.getCommand("snreload").setExecutor(new SNReload());
if (this.getServer().getPluginManager().isPluginEnabled("PlaceholderAPI")) {
new SNExpansion().register();
}
instance.getServer().getPluginManager().registerEvents(new LoginListener(), this);
getServer().getPluginManager().registerEvents(new LoginListener(), this);
getServer().getPluginManager().registerEvents(new LeaveListener(), this);
configReload();
SqlHandler.getInstance().init();
SaveMigrator.migrateFromYml();
this.getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, commands -> {
commands.registrar().register(NicknameCommand.createCommand().build());
});
setUpResolver();
registerPermissions();
}

private void registerPermissions() {
for (NickPermission perm : NickPermission.values()) {
getServer().getPluginManager().addPermission(perm.getPermission());
}
for (ColorTag perm : ColorTag.values()) {
getServer().getPluginManager().addPermission(perm.getPermission());
}
}

private void setUpResolver() {
TagResolver.Builder tagResolver = TagResolver.builder();
for (ColorTag colorTag : ColorTag.values()) {
tagResolver.resolver(colorTag.getTagResolver());
}
for (FormatTag formatTag : FormatTag.values()) {
tagResolver.resolver(formatTag.getTagResolver());
}
TagResolver resolver = tagResolver.build();
defaultResolver = MiniMessage.builder()
.strict(false)
.tags(resolver)
.build();
}

public static MiniMessage getMiniMessage() {
Expand All @@ -63,26 +79,24 @@ public static Plugin getInstance() {
return instance;
}

public static Map<String, SubCommand> getSubCommands() {
return Collections.unmodifiableMap(subCommands);
}

public static Logger getSimpleNicksLogger() {
return instance.getLogger();
}

private void registerSubCommands() {
subCommands.put("reset", new Reset("reset", Constants.NICK_RESET, Constants.NICK_RESET_OTHERS, false));
subCommands.put("help", new Help("help", Constants.NICK_COMMAND, Constants.NICK_OTHERS_COMMAND, true));
subCommands.put("set", new Set("set", Constants.NICK_COMMAND, Constants.NICK_OTHERS_RESTRICTIVE, false));
subCommands.put("save", new Save("save", Constants.NICK_SAVE, Constants.NICK_OTHERS_SAVE, false));
subCommands.put("delete", new Delete("delete", Constants.NICK_DELETE, Constants.NICK_OTHERS_DELETE, false));
public static MiniMessage getDefaultParser() {
return defaultResolver;

}


public static void configReload() {
LocaleHandler.getInstance().loadLocale();
ConfigHandler.getInstance().reloadConfig();
NickHandler.getInstance().loadSavingType();
}

@Override
public void onDisable() {
SqlHandler.getInstance().closeDatabase();
}


}
137 changes: 0 additions & 137 deletions src/main/java/simplexity/simplenicks/commands/CommandHandler.java

This file was deleted.

59 changes: 0 additions & 59 deletions src/main/java/simplexity/simplenicks/commands/Delete.java

This file was deleted.

Loading