This commit is contained in:
kento2 2026-07-06 16:43:18 +02:00
parent 650f497a3e
commit 123f276b48
9 changed files with 128 additions and 71 deletions

View file

@ -0,0 +1,29 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="core [runServer]" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="HOST_NATS" value="nats://172.17.0.1:4222" />
</map>
</option>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runServer" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>

135
.idea/workspace.xml generated
View file

@ -4,9 +4,16 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="56c685a1-f609-4ffd-a951-849beb2a7f8d" name="Changes" comment="cleaned up build process"> <list default="true" id="56c685a1-f609-4ffd-a951-849beb2a7f8d" name="Changes" comment=".">
<change afterPath="$PROJECT_DIR$/core-bukkit-impl/run/eula.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../build-logic/convention/src/main/kotlin/scrow/BaseDependenciesConvention.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../build-logic/convention/src/main/kotlin/scrow/BaseDependenciesConvention.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" /> <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/CoreImplPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/CoreImplPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/ScrowAPISurface.java" beforeDir="false" afterPath="$PROJECT_DIR$/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/ScrowAPISurface.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/command/economy/CoinsCommand.java" beforeDir="false" afterPath="$PROJECT_DIR$/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/command/economy/CoinsCommand.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/core-lib/src/main/java/de/kentoj/scrowlib/utils/EnvUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/core-lib/src/main/java/de/kentoj/scrowlib/utils/EnvUtils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gradle/libs.versions.toml" beforeDir="false" afterPath="$PROJECT_DIR$/gradle/libs.versions.toml" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -71,6 +78,34 @@
<item name="Tasks" type="e4a08cd1:TasksNode" /> <item name="Tasks" type="e4a08cd1:TasksNode" />
<item name="publishing" type="c8890929:TasksNode$1" /> <item name="publishing" type="c8890929:TasksNode$1" />
</path> </path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="core" type="f1a62948:ProjectNode" />
<item name="core" type="2d1252cf:ModuleNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
<item name="run paper" type="c8890929:TasksNode$1" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="core" type="f1a62948:ProjectNode" />
<item name="core" type="2d1252cf:ModuleNode" />
<item name="core-lib" type="2d1252cf:ModuleNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="core" type="f1a62948:ProjectNode" />
<item name="core" type="2d1252cf:ModuleNode" />
<item name="core-lib" type="2d1252cf:ModuleNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="core" type="f1a62948:ProjectNode" />
<item name="core" type="2d1252cf:ModuleNode" />
<item name="core-lib" type="2d1252cf:ModuleNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
<item name="publishing" type="c8890929:TasksNode$1" />
</path>
<path> <path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" /> <item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="core" type="f1a62948:ProjectNode" /> <item name="core" type="f1a62948:ProjectNode" />
@ -120,6 +155,7 @@
</component> </component>
<component name="ProblemsViewState"> <component name="ProblemsViewState">
<option name="autoscrollToSource" value="true" /> <option name="autoscrollToSource" value="true" />
<option name="selectedTabId" value="ProjectErrors" />
</component> </component>
<component name="ProjectColorInfo">{ <component name="ProjectColorInfo">{
&quot;customColor&quot;: &quot;&quot;, &quot;customColor&quot;: &quot;&quot;,
@ -140,10 +176,12 @@
"Gradle.core [a].executor": "Run", "Gradle.core [a].executor": "Run",
"Gradle.core [buildEnvironment].executor": "Run", "Gradle.core [buildEnvironment].executor": "Run",
"Gradle.core [build].executor": "Run", "Gradle.core [build].executor": "Run",
"Gradle.core [clean publishCoreLibPublicationToScrowRepository].executor": "Run",
"Gradle.core [clean].executor": "Run", "Gradle.core [clean].executor": "Run",
"Gradle.core [publishAllPublicationsToScrowRepository].executor": "Run", "Gradle.core [publishAllPublicationsToScrowRepository].executor": "Run",
"Gradle.core [publishCoreLibPublicationToScrowRepository].executor": "Run", "Gradle.core [publishCoreLibPublicationToScrowRepository].executor": "Run",
"Gradle.core [publish].executor": "Run", "Gradle.core [publish].executor": "Run",
"Gradle.core [runServer].executor": "Run",
"Gradle.core:core-bukkit-api [build].executor": "Run", "Gradle.core:core-bukkit-api [build].executor": "Run",
"Gradle.core:core-bukkit-api [clean].executor": "Run", "Gradle.core:core-bukkit-api [clean].executor": "Run",
"Gradle.core:core-bukkit-impl [build].executor": "Run", "Gradle.core:core-bukkit-impl [build].executor": "Run",
@ -195,53 +233,10 @@
<command value="./gradlew :core-velocity-impl:shadowJar --info" /> <command value="./gradlew :core-velocity-impl:shadowJar --info" />
<command value="./gradlew :core-velocity-impl:shadowJar --rerun-tasks" /> <command value="./gradlew :core-velocity-impl:shadowJar --rerun-tasks" />
<command value="gradlew buildEnvironment" /> <command value="gradlew buildEnvironment" />
<command value="./gradlew clean publishCoreLibPublicationToScrowRepository" />
</option> </option>
</component> </component>
<component name="RunManager" selected="Gradle.core [publishAllPublicationsToScrowRepository]"> <component name="RunManager" selected="Gradle.core [runServer]">
<configuration name="core [a]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="a" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
<configuration name="core [buildEnvironment]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="buildEnvironment" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
<configuration name="core [build]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true"> <configuration name="core [build]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings> <ExternalSystemSettings>
<option name="executionName" /> <option name="executionName" />
@ -264,18 +259,19 @@
<RunAsTest>false</RunAsTest> <RunAsTest>false</RunAsTest>
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="core [publishAllPublicationsToScrowRepository]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true"> <configuration name="core [clean publishCoreLibPublicationToScrowRepository]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings> <ExternalSystemSettings>
<option name="executionName" /> <option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" /> <option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" /> <option name="scriptParameters" value="" />
<option name="taskDescriptions"> <option name="taskDescriptions">
<list /> <list />
</option> </option>
<option name="taskNames"> <option name="taskNames">
<list> <list>
<option value="publishAllPublicationsToScrowRepository" /> <option value="clean" />
<option value="publishCoreLibPublicationToScrowRepository" />
</list> </list>
</option> </option>
<option name="vmOptions" /> <option name="vmOptions" />
@ -308,6 +304,28 @@
<RunAsTest>false</RunAsTest> <RunAsTest>false</RunAsTest>
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="core:core-lib [publishCoreLibPublicationToScrowRepository]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/core-lib" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="publishCoreLibPublicationToScrowRepository" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
<configuration default="true" type="JetRunConfigurationType"> <configuration default="true" type="JetRunConfigurationType">
<module name="kotlin.scripts.KotlinSettingsScript.build-logic:settings.gradle.kts" /> <module name="kotlin.scripts.KotlinSettingsScript.build-logic:settings.gradle.kts" />
<method v="2"> <method v="2">
@ -319,13 +337,20 @@
<option name="filePath" /> <option name="filePath" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<list>
<item itemvalue="Gradle.core [runServer]" />
<item itemvalue="Gradle.core [build]" />
<item itemvalue="Gradle.core [clean publishCoreLibPublicationToScrowRepository]" />
<item itemvalue="Gradle.core [publish]" />
<item itemvalue="Gradle.core:core-lib [publishCoreLibPublicationToScrowRepository]" />
</list>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Gradle.core [publishAllPublicationsToScrowRepository]" /> <item itemvalue="Gradle.core [runServer]" />
<item itemvalue="Gradle.core [publish]" />
<item itemvalue="Gradle.core [build]" /> <item itemvalue="Gradle.core [build]" />
<item itemvalue="Gradle.core [a]" /> <item itemvalue="Gradle.core [publish]" />
<item itemvalue="Gradle.core [buildEnvironment]" /> <item itemvalue="Gradle.core [clean publishCoreLibPublicationToScrowRepository]" />
<item itemvalue="Gradle.core:core-lib [publishCoreLibPublicationToScrowRepository]" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
@ -367,9 +392,9 @@
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="fix: unable to leave regions when unloaded" /> <MESSAGE value="fix: unable to leave regions when unloaded" />
<MESSAGE value="currently refactoring a lot" /> <MESSAGE value="currently refactoring a lot" />
<MESSAGE value="." />
<MESSAGE value="move some stuff around" /> <MESSAGE value="move some stuff around" />
<MESSAGE value="cleaned up build process" /> <MESSAGE value="cleaned up build process" />
<option name="LAST_COMMIT_MESSAGE" value="cleaned up build process" /> <MESSAGE value="." />
<option name="LAST_COMMIT_MESSAGE" value="." />
</component> </component>
</project> </project>

View file

@ -1,13 +1,12 @@
TODO TODO
- fix publishing
- fix kencommandapi greedy strings & arguments: probably issue with shading - fix kencommandapi greedy strings & arguments: probably issue with shading
- make core-lib-impl: a library -> avoid shading massive core-lib - make core-lib-impl: a library -> avoid shading massive core-lib
- logging in general, log some exceptions to game chat - logging in general, log some exceptions to game chat
- notification: Friend is now offline/online - notification: Friend is now offline/online
- /ignore command - /ignore command
environment modules
----------- -------
- **core-lib**: stateless library - **core-lib**: stateless library
- **core-bukkit-api** stateful api, for minecraft development, depends on core-lib - **core-bukkit-api** stateful api, for minecraft development, depends on core-lib

View file

@ -0,0 +1,3 @@
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://aka.ms/MinecraftEULA).
#Mon Jul 06 16:35:59 CEST 2026
eula=true

View file

@ -18,7 +18,7 @@ public class CoreImplPlugin extends JavaPlugin {
@Override @Override
public void onEnable() { public void onEnable() {
ScrowAPISurface.initScrowAPI(this, true); ScrowAPISurface.initScrowAPI(this);
{ {
ScrowAPI.getCommandApi().register(new CoinsCommand().getRootNode()); ScrowAPI.getCommandApi().register(new CoinsCommand().getRootNode());
ScrowAPI.getCommandApi().register(FriendCommand.create()); ScrowAPI.getCommandApi().register(FriendCommand.create());

View file

@ -19,16 +19,18 @@ import io.nats.client.Nats;
import io.nats.client.Options; import io.nats.client.Options;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.jdbi.v3.core.Jdbi; import org.jdbi.v3.core.Jdbi;
import java.io.IOException; import java.io.IOException;
import java.util.Properties; import java.util.Properties;
@Slf4j
@NoArgsConstructor(access = AccessLevel.NONE) @NoArgsConstructor(access = AccessLevel.NONE)
public class ScrowAPISurface { public class ScrowAPISurface {
public static void initScrowAPI(Plugin plugin, boolean enableDatabase) { public static void initScrowAPI(Plugin plugin) {
ScrowAPI.setCorePlugin(plugin); ScrowAPI.setCorePlugin(plugin);
try { try {
@ -42,15 +44,15 @@ public class ScrowAPISurface {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
if (enableDatabase) { try {
try { Class.forName("org.postgresql.Driver", true, ScrowAPISurface.class.getClassLoader());
Class.forName("org.postgresql.Driver", true, ScrowAPISurface.class.getClassLoader());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
var props = new Properties(); var props = new Properties();
props.setProperty("user", "postgres"); props.setProperty("user", "postgres");
ScrowAPI.setJdbi(Jdbi.create(EnvUtils.envOrThrow("HOST_POSTGRES"), props)); ScrowAPI.setJdbi(Jdbi.create(EnvUtils.envOrThrow("HOST_POSTGRES"), props));
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
} catch (IllegalStateException e) {
log.error("HOST_POSTGRES not set -> Using in-memory database");
} }
ScrowAPI.setPlayerFactory(playerId -> new NetworkPlayerImpl(ScrowAPI.getMessageBroker(), playerId)); ScrowAPI.setPlayerFactory(playerId -> new NetworkPlayerImpl(ScrowAPI.getMessageBroker(), playerId));

View file

@ -10,15 +10,12 @@ import de.kentoj.kencommandapi.api.platform.MessageStyle;
import de.kentoj.scrow.bukkit.ScrowAPI; import de.kentoj.scrow.bukkit.ScrowAPI;
import de.kentoj.scrow.bukkit.scheduler.Tasks; import de.kentoj.scrow.bukkit.scheduler.Tasks;
import de.kentoj.scrowlib.convention.ScrowMessageStyle; import de.kentoj.scrowlib.convention.ScrowMessageStyle;
import lombok.AccessLevel;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@NoArgsConstructor(access = AccessLevel.NONE)
public class CoinsCommand implements CommandExecutor<CommandSender> { public class CoinsCommand implements CommandExecutor<CommandSender> {
@Getter @Getter
private final RootCommandNode<CommandSender> rootNode; private final RootCommandNode<CommandSender> rootNode;
@ -39,7 +36,6 @@ public class CoinsCommand implements CommandExecutor<CommandSender> {
rootNode.addLiteral(getLiteral); rootNode.addLiteral(getLiteral);
} }
@Override @Override
public CompletableFuture<Result<Object, String>> execute(CommandContext<CommandSender> ctx) { public CompletableFuture<Result<Object, String>> execute(CommandContext<CommandSender> ctx) {
var player = ((Player) ctx.getSender()); var player = ((Player) ctx.getSender());

View file

@ -5,6 +5,9 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.NONE) @NoArgsConstructor(access = AccessLevel.NONE)
public class EnvUtils { public class EnvUtils {
/**
* @throws IllegalStateException if the var is not set
*/
public static String envOrThrow(String name) { public static String envOrThrow(String name) {
var env = System.getenv(name); var env = System.getenv(name);
if (env == null) throw new IllegalStateException("environment variable " + name + " not set"); if (env == null) throw new IllegalStateException("environment variable " + name + " not set");

View file

@ -1,7 +1,7 @@
[versions] [versions]
shadow = "9.2.0" shadow = "9.2.0"
run-paper = "2.3.1" run-paper = "2.3.1"
scrow-commandapi = "0.31" scrow-commandapi = "0.32"
postgress = "42.7.12" postgress = "42.7.12"
nats = "2.25.2" nats = "2.25.2"
papermc = "1.21.11-rc3-R0.1-SNAPSHOT" papermc = "1.21.11-rc3-R0.1-SNAPSHOT"