Skip to content

Commit

Permalink
Patch eldo util version and migrate to new localizer creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowdashlabs committed Aug 24, 2024
1 parent 9d8370f commit 6646edf
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 14 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
4 changes: 2 additions & 2 deletions .github/workflows/publish_to_nexus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
java-version: 21
- name: Build with Gradle
run: ./gradlew --build-cache build
- name: Test with Gradle
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
java-version: 21
- name: Build with Gradle
run: ./gradlew --build-cache build
- name: Test with Gradle
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.direnv
1 change: 1 addition & 0 deletions BloodNight-core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run/
5 changes: 5 additions & 0 deletions BloodNight-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.shadow)
alias(libs.plugins.pluginyml)
alias(libs.plugins.runpaper)
}

dependencies {
Expand Down Expand Up @@ -68,6 +69,10 @@ tasks {
from(shadowJar)
destinationDir = File(path.toString())
}

runServer{
minecraftVersion("1.21.1")
}
}

bukkit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,17 @@ public void onPluginEnable(boolean reload) {

configuration = new Configuration(this);

ILocalizer localizer = Localizer.create(this, "de_DE", "en_US", "es_ES", "tr", "zh_CN");

Map<String, String> mobLocaleCodes = SpecialMobRegistry.getRegisteredMobs().stream()
.map(MobFactory::getMobName)
.collect(Collectors.toMap(
k -> "mob." + k,
k -> String.join(" ", k.split("(?<=.)(?=\\p{Lu})"))));
localizer.addLocaleCodes(mobLocaleCodes);
ILocalizer localizer = Localizer.builder(this, "de_DE")
.setIncludedLocales("en_US", "es_ES", "tr", "zh_CN")
.setUserLocale(p -> configuration.getGeneralSettings().language())
.addLocaleCodes(mobLocaleCodes)
.build();

localizer.setLocale(configuration.getGeneralSettings().language());
MessageSender.builder(this)
.prefix(configuration.getGeneralSettings().prefix())
.messageColor(NamedTextColor.GREEN)
Expand Down Expand Up @@ -132,9 +133,9 @@ public void onPluginEnable(boolean reload) {

if (configuration.getGeneralSettings().updateReminder()) {
Updater.lyna(LynaUpdateData.builder(this, 4)
.notifyPermission(Permissions.Admin.RELOAD)
.updateUrl("https://bn.discord.eldoria.de/")
.notifyUpdate(true).build())
.notifyPermission(Permissions.Admin.RELOAD)
.updateUrl("https://bn.discord.eldoria.de/")
.notifyUpdate(true).build())
.start();
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ subprojects {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}
}

Expand Down
5 changes: 3 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pluginManagement {
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
version("eldoutil", "2.1.5")
version("eldoutil", "2.1.6")
library("eldoutil.core", "de.eldoria.util", "core").versionRef("eldoutil")
library("eldoutil.updater", "de.eldoria.util", "updater").versionRef("eldoutil")
library("eldoutil.messaging", "de.eldoria.util", "messaging").versionRef("eldoutil")
Expand All @@ -35,8 +35,9 @@ dependencyResolutionManagement {

plugin("publishdata", "de.chojo.publishdata").version("1.2.5")
plugin("spotless", "com.diffplug.spotless").version("6.25.0")
plugin("shadow", "io.github.goooler.shadow").version("8.1.8")
plugin("shadow", "com.gradleup.shadow").version("8.3.0")
plugin("pluginyml", "net.minecrell.plugin-yml.bukkit").version("0.6.0")
plugin("runpaper", "xyz.jpenilla.run-paper").version("2.3.1")
}
}
}
11 changes: 11 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ pkgs ? import <nixpkgs> {}, ... }:

let
jdk = pkgs.jdk21;
gradle= pkgs.gradle.override { java = jdk; };
in
pkgs.mkShell
{
packages = with pkgs; [jdk gradle];
}

0 comments on commit 6646edf

Please sign in to comment.