Skip to content
Open

2.0 #132

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
583e9bf
Add support for placeholders
nickuc Jan 14, 2026
b3b8215
Remove advertising
nickuc Jan 14, 2026
bff5171
Improve local variables readability
nickuc Jan 14, 2026
86fd1d4
Update to actions/upload-artifact@v4
nickuc Jan 14, 2026
7e42b27
Add .gitignore
nickuc Jan 14, 2026
1ac3e48
Improve readability of command package
nickuc Jan 15, 2026
7464575
Rename modules name
nickuc Jan 15, 2026
2840f48
Update to Gradle 9.2.1
nickuc Jan 15, 2026
d35b1dd
Use JDK 21 for workflow
nickuc Jan 15, 2026
e8b10e2
fix: don’t cancel PlayerMoveEvent to avoid too many packets
lokspel Feb 9, 2026
0a39fd2
fix(ci): correct path for upload-artifact action
nickuc Feb 10, 2026
b77e2ed
build(deps): update lombok to 1.18.42
nickuc Feb 10, 2026
05b5b9b
build(gradle): update wrapper to 9.3.1
nickuc Feb 10, 2026
cd62b1d
chore: update .gitignore
nickuc Feb 10, 2026
51b6bf8
chore: update repository ownership
nickuc Feb 10, 2026
35b1bca
build(gradle): update wrapper to 9.6.0
nickuc Jun 24, 2026
cbe03e6
build(gradle): update wrapper to 9.6.1
nickuc Jul 8, 2026
b851af7
build(gradle): apply IDEA plugin
nickuc Jul 8, 2026
347234c
fix(bukkit): update PlayerAuthenticateListener constructor call
nickuc Jul 8, 2026
b8e9191
refactor(reflection): replace NMS reflection with Spigot and Paper API
nickuc Jul 8, 2026
e45eec9
fix(security): correct inverted logic in ConsoleFilter
justkoper Jul 25, 2026
55fb42b
refactor(logging): do not filter null messages
nickuc Jul 25, 2026
1680f51
Merge pull request #144 from justkoper/fix/consolefilter-inverted-logic
nickuc Jul 25, 2026
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
12 changes: 8 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '21'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Build with Gradle
run: ./gradlew build --full-stacktrace

- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: openlogin-universal/build/libs/OpenLogin.jar
path: universal/build/libs/OpenLogin.jar
121 changes: 121 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# User-specific stuff
.idea/

*.iml
*.ipr
*.iws

# IntelliJ
out/

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

target/

pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next

release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.flattened-pom.xml

# Common working directory
run/
/.gradle/
/.gitignore

# Build directory
/build/
/bukkit/build/
/common/build/
/universal/build/
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
subprojects {
apply plugin: 'idea'
apply plugin: 'java'

group = 'com.nickuc.openlogin'
version = '1.6.7'

sourceCompatibility = 1.8
targetCompatibility = 1.8
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

javadoc {
options.encoding = 'UTF-8'
Expand All @@ -16,7 +20,7 @@ subprojects {
}

dependencies {
def lombok = 'org.projectlombok:lombok:1.18.24'
def lombok = 'org.projectlombok:lombok:1.18.42'
compileOnly lombok
annotationProcessor lombok
testCompileOnly lombok
Expand Down
2 changes: 1 addition & 1 deletion openlogin-bukkit/build.gradle → bukkit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
implementation project(':openlogin-common')
implementation project(':common')

implementation 'org.bstats:bstats-bukkit:3.0.0'
implementation 'com.tcoded:FoliaLib:0.3.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void onEnable() {
sendMessage(c + "/ \\_//| |_) | __/ /\\ / /__| (_) | (_| | | | | |");
sendMessage(c + "\\___/ | .__/ \\___\\_\\ \\/\\____/\\___/ \\__, |_|_| |_|");
sendMessage(c + " |_| |___/ ");
sendMessage(c + "By: www.nickuc.com / github.com/nickuc/OpeNLogin - V " + getDescription().getVersion());
sendMessage(c + "By: www.nickuc.com / github.com/nickuc-com/OpeNLogin - V " + getDescription().getVersion());
sendMessage("");

Server server = getServer();
Expand All @@ -107,8 +107,8 @@ public void onEnable() {
if (newUserfile.getParentFile().mkdirs()) {
newUserfile.createNewFile();
}
} catch (IOException e) {
e.printStackTrace();
} catch (IOException exception) {
exception.printStackTrace();
}
}

Expand Down Expand Up @@ -141,7 +141,7 @@ public void onEnable() {
LoggerFilterManager.setup(getLogger());

// setup listeners
setupListeners(newUser);
setupListeners();

// start login queue task
LoginQueue.startTask(this);
Expand Down Expand Up @@ -176,19 +176,20 @@ private boolean setupDatabase() {
if (rs.next()) {
registeredUsers = rs.getInt("COUNT(*)");
}
} catch (Exception e) {
} catch (Exception exception) {
exception.printStackTrace();
sendMessage("§cFailed to update the register count.");
}
pluginSettings = new PluginSettings(database);
return true;
} catch (SQLException e) {
e.printStackTrace();
} catch (SQLException exception) {
exception.printStackTrace();
sendMessage("§cFailed to start database. Shutting down server...");
return false;
}
}

private void setupListeners(boolean newUser) {
private void setupListeners() {
PluginManager pm = getServer().getPluginManager();
pm.registerEvents(new PlayerGeneralListeners(this), this);
pm.registerEvents(new PlayerJoinListeners(this), this);
Expand All @@ -214,13 +215,13 @@ public void detectUpdates() {
tagName = latestVersion = tagName.split("\",")[0];
}
}
} catch (IOException e) {
} catch (IOException exception) {
sendMessage("§cFailed to find new updates.");
sendMessage("§cDownload the latest version at: https://github.com/nickuc/OpeNLogin/releases");
sendMessage("§cDownload the latest version at: https://github.com/nickuc-com/OpeNLogin/releases");
}
if (tagName == null) {
sendMessage("§cFailed to find new updates: invalid response.");
sendMessage("§cDownload the latest version at: https://github.com/nickuc/OpeNLogin/releases");
sendMessage("§cDownload the latest version at: https://github.com/nickuc-com/OpeNLogin/releases");
} else {
String currentVersion = "v" + getDescription().getVersion();
updateAvailable = !currentVersion.equals(tagName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
package com.nickuc.openlogin.bukkit.command;

import com.nickuc.openlogin.bukkit.OpenLoginBukkit;
import com.nickuc.openlogin.bukkit.command.executors.OpenLoginCommand;
import com.nickuc.openlogin.bukkit.command.ext.OpenLoginCommand;
import com.nickuc.openlogin.common.manager.LoginManagement;
import com.nickuc.openlogin.common.settings.Messages;
import lombok.NonNull;
Expand All @@ -34,17 +34,17 @@
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public abstract class BukkitAbstractCommand implements CommandExecutor {
public abstract class BukkitCommand implements CommandExecutor {

protected final OpenLoginBukkit plugin;
private final boolean requireAuth;
private final String permission;

public BukkitAbstractCommand(OpenLoginBukkit plugin, @NonNull String command) {
public BukkitCommand(OpenLoginBukkit plugin, @NonNull String command) {
this(plugin, false, command);
}

public BukkitAbstractCommand(OpenLoginBukkit plugin, boolean requireAuth, @NonNull String command) {
public BukkitCommand(OpenLoginBukkit plugin, boolean requireAuth, @NonNull String command) {
this.plugin = plugin;
this.requireAuth = requireAuth;
this.permission = "openlogin.command." + command.toLowerCase();
Expand All @@ -63,16 +63,16 @@ public boolean onCommand(CommandSender sender, Command cmd, String lb, String[]
return true;
}
} else if (!sender.hasPermission(permission)) {
sender.sendMessage(Messages.INSUFFICIENT_PERMISSIONS.asString());
sender.sendMessage(Messages.INSUFFICIENT_PERMISSIONS.asString(permission));
return true;
}

if (loginManagement.isUnlocked(name)) {
plugin.getFoliaLib().runAsync(task -> {
try {
perform(sender, lb, args);
} catch (Exception e) {
e.printStackTrace();
} catch (Exception exception) {
exception.printStackTrace();
plugin.sendMessage("§cFailed to perform the command '" + lb + "', sender: " + sender.getName());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
package com.nickuc.openlogin.bukkit.command;

import com.nickuc.openlogin.bukkit.OpenLoginBukkit;
import com.nickuc.openlogin.bukkit.command.executors.*;
import com.nickuc.openlogin.bukkit.command.ext.*;
import com.nickuc.openlogin.common.security.filter.LoggerFilterManager;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.bukkit.command.PluginCommand;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.HashSet;
import java.util.Set;

Expand Down Expand Up @@ -68,12 +67,11 @@ public void register() {
LoggerFilterManager.addOpenLoginCommand("/" + alias.toLowerCase());
}

Constructor<?> constructor = command.clasz.getConstructor(OpenLoginBukkit.class);
BukkitAbstractCommand bukkitCommand = (BukkitAbstractCommand) constructor.newInstance(plugin);
Constructor<?> constructor = command.clazz.getConstructor(OpenLoginBukkit.class);
BukkitCommand bukkitCommand = (BukkitCommand) constructor.newInstance(plugin);
pluginCommand.setExecutor(bukkitCommand);
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException |
InvocationTargetException e) {
e.printStackTrace();
} catch (ReflectiveOperationException event) {
event.printStackTrace();
}
}
}
Expand All @@ -88,8 +86,6 @@ public enum Commands {
UNREGISTER("unregister", UnregisterCommand.class);

private final String name;
private final Class<?> clasz;

private final Class<?> clazz;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
* SOFTWARE.
*/

package com.nickuc.openlogin.bukkit.command.executors;
package com.nickuc.openlogin.bukkit.command.ext;

import com.nickuc.openlogin.bukkit.OpenLoginBukkit;
import com.nickuc.openlogin.bukkit.command.BukkitAbstractCommand;
import com.nickuc.openlogin.bukkit.command.BukkitCommand;
import com.nickuc.openlogin.common.manager.AccountManagement;
import com.nickuc.openlogin.common.model.Account;
import com.nickuc.openlogin.common.security.hashing.BCrypt;
Expand All @@ -37,7 +37,7 @@
import java.util.Objects;
import java.util.Optional;

public class ChangePasswordCommand extends BukkitAbstractCommand {
public class ChangePasswordCommand extends BukkitCommand {

public ChangePasswordCommand(OpenLoginBukkit plugin) {
super(plugin, true, "changepassword");
Expand Down Expand Up @@ -103,7 +103,7 @@ private void performPlayer(Player sender, String lb, String[] args) {

private void performConsole(CommandSender sender, String lb, String[] args) {
if (!sender.hasPermission("openlogin.admin")) {
sender.sendMessage(Messages.INSUFFICIENT_PERMISSIONS.asString());
sender.sendMessage(Messages.INSUFFICIENT_PERMISSIONS.asString("openlogin.admin"));
return;
}

Expand Down
Loading
Loading