Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit efb6c2a

Browse files
committed
Update build configuration and enhance command functionalities
- Upgrade Paperweight plugin version to 2.0.0-beta.18 - Update project version to 2.0 - Add support for git properties in build.gradle - Implement version and update commands in NextCoreCommand - Enhance server info command with detailed server statistics - Introduce debug logging options in config.yml
1 parent 5072379 commit efb6c2a

File tree

10 files changed

+267
-1173
lines changed

10 files changed

+267
-1173
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
plugins {
22
id 'java-library'
33
id 'maven-publish'
4-
id "io.papermc.paperweight.userdev" version "2.0.0-beta.17"
4+
id "io.papermc.paperweight.userdev" version "2.0.0-beta.18"
55
id "com.gradleup.shadow" version "8.3.8"
6+
id 'com.gorylenko.gradle-git-properties' version '2.4.1'
67
}
78

89
group = 'gg.nextforge'
9-
version = '1.0'
10+
version = '2.0'
1011

1112
repositories {
1213
mavenCentral()
14+
mavenLocal()
15+
}
16+
17+
gitProperties {
18+
failOnNoGitDirectory = false // kein Fehler, falls kein .git da ist
19+
dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" // optional: Timestamp-Format
20+
keys = ['git.commit.id', 'git.branch'] // nur die Keys, die du brauchst
21+
}
22+
23+
sourceSets {
24+
main {
25+
resources {
26+
srcDir "${buildDir}/generated/gitProperties"
27+
}
28+
}
1329
}
1430

1531
dependencies {
@@ -28,9 +44,11 @@ subprojects {
2844
apply plugin: 'maven-publish'
2945
apply plugin: 'io.papermc.paperweight.userdev'
3046
apply plugin: 'com.gradleup.shadow'
47+
apply plugin: 'com.gorylenko.gradle-git-properties'
3148

3249
repositories {
3350
mavenCentral()
51+
mavenLocal()
3452
}
3553

3654
dependencies {
@@ -58,15 +76,21 @@ subprojects {
5876

5977
java {
6078
// Use Java 21
61-
sourceCompatibility = JavaVersion.VERSION_21
62-
targetCompatibility = JavaVersion.VERSION_21
79+
sourceCompatibility = JavaVersion.VERSION_23
80+
targetCompatibility = JavaVersion.VERSION_23
6381
toolchain {
64-
languageVersion.set(JavaLanguageVersion.of(21))
82+
languageVersion.set(JavaLanguageVersion.of(23))
6583
}
6684
withJavadocJar()
6785
withSourcesJar()
6886
}
6987

88+
javadoc {
89+
options.encoding = 'UTF-8'
90+
failOnError = false
91+
options.addStringOption('Xdoclint:none', '-quiet')
92+
}
93+
7094
tasks {
7195
compileJava {
7296
options.encoding = "UTF-8"

src/main/java/gg/nextforge/NextCorePlugin.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
package gg.nextforge;
22

3-
import gg.nextforge.command.builtin.NPCCommand;
43
import gg.nextforge.command.builtin.NextCoreCommand;
54
import gg.nextforge.config.ConfigFile;
6-
import gg.nextforge.config.ConfigManager;
75
import gg.nextforge.console.ConsoleHeader;
86
import gg.nextforge.plugin.NextForgePlugin;
97
import gg.nextforge.scheduler.CoreScheduler;
108
import gg.nextforge.scheduler.ScheduledTask;
119
import gg.nextforge.updater.CoreAutoUpdater;
1210
import lombok.Getter;
13-
import org.checkerframework.checker.units.qual.N;
1411

1512
import java.io.IOException;
1613
import java.util.UUID;
1714

1815
@Getter
1916
public class NextCorePlugin extends NextForgePlugin {
2017

18+
long serverUptime;
19+
boolean debugMode;
2120
ConfigFile configFile;
2221
ConfigFile messagesFile;
22+
CoreAutoUpdater updater;
2323
ScheduledTask updateCheckTask;
2424

2525
@Override
@@ -39,23 +39,28 @@ public void enable(boolean isReload) {
3939
return;
4040
}
4141

42+
this.serverUptime = System.currentTimeMillis();
43+
4244
configFile = getConfigManager().loadConfig("config.yml");
45+
if (configFile.getBoolean("debug_mode", false)) {
46+
this.debugMode = true;
47+
getSLF4JLogger().info("[NextForge] Debug mode is enabled. This will log additional information to the console.");
48+
} else {
49+
this.debugMode = false;
50+
}
4351
messagesFile = getConfigManager().loadConfig("messages.yml");
4452

45-
getTextManager().placeholder("prefix", p -> {
46-
return messagesFile.getString("general.prefix", "<dark_gray>[<gradient:aqua:dark_aqua>ɴᴇxᴛᴄᴏʀᴇ<dark_gray>]</gradient></dark_gray>");
47-
});
53+
getTextManager().placeholder("prefix", _ -> messagesFile.getString("general.prefix", "<dark_gray>[<gradient:aqua:dark_aqua>ɴᴇxᴛᴄᴏʀᴇ<dark_gray>]</gradient></dark_gray>"));
4854

4955
new NextCoreCommand(this);
50-
new NPCCommand(this, getNpcManager());
5156

5257
ConsoleHeader.send(this);
5358

5459
getSLF4JLogger().info("[NextForge] {} v{} is running as the core plugin.", getName(), getPluginVersion());
5560

5661
getSLF4JLogger().info("[NextForge] Initializing {} v{}...", getName(), getPluginVersion());
5762

58-
CoreAutoUpdater updater = new CoreAutoUpdater(getDataFolder().getParentFile());
63+
this.updater = new CoreAutoUpdater(getDataFolder().getParentFile());
5964

6065
int checkMillis = configFile.getInt("updater.check_interval", 7200000);
6166
int checkTicks = checkMillis / 50;

0 commit comments

Comments
 (0)