diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 6d6949b..5d6806c 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,24 +1,26 @@ name: Java CI with Gradle -on: [ push, pull_request ] +on: [ pull_request, push ] jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 17 - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build - - name: Upload build artifacts - uses: actions/upload-artifact@v1 - with: - name: build-artifacts - path: build/libs + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v2 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + check-latest: true + - name: Build with Gradle + run: ./gradlew build + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'Command Aliases Artifacts' + path: build/libs diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 691d882..a31ca57 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,26 +6,28 @@ on: - published jobs: - build: - runs-on: ubuntu-latest + publish: + if: github.repository_owner == 'FlashyReese' + runs-on: self-hosted steps: - - name: Checkout sources - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v2 + - name: Set up JDK 21 + uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: 17 - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Upload assets to GitHub + java-version: 21 + check-latest: true + - name: Upload assets to releases run: ./gradlew build publishAllPublicationsToFlashyReeseReleasesRepository env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} BUILD_RELEASE: ${{ github.event.prerelease == false }} - name: Publish to Modrinth & CurseForge - uses: Kir-Antipov/mc-publish@v3.2 + uses: Kir-Antipov/mc-publish@v3.3 with: modrinth-id: dHTBnV1v modrinth-token: ${{ secrets.MODRINTH_TOKEN }} diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 56d02f8..b099933 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -1,24 +1,27 @@ -name: Gradle build on push - Self-Hosted Runner +name: Self-Hosted runner CI with Gradle on: [ push ] jobs: - build: + selfhost-build: + if: github.repository_owner == 'FlashyReese' runs-on: self-hosted steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 17 - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build - - name: Upload build artifacts - uses: actions/upload-artifact@v1 - with: - name: build-artifacts - path: build/libs + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v2 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + check-latest: true + - name: Build with Gradle + run: ./gradlew build + - name: Upload Auild Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'Sodium Extra Artifacts' + path: build/libs diff --git a/build.gradle b/build.gradle index c0dd76b..fc5bb67 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.2-SNAPSHOT' + id 'fabric-loom' version '1.6-SNAPSHOT' id 'maven-publish' id 'io.github.juuxel.loom-quiltflower' version '1.10.0' } @@ -39,32 +39,32 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" // Permissions API - include(modImplementation("me.lucko:fabric-permissions-api:0.2-SNAPSHOT")) + include(modImplementation("me.lucko:fabric-permissions-api:0.3.1")) // LevelDB include(implementation("org.iq80.leveldb:leveldb:0.12")) include(implementation("org.iq80.leveldb:leveldb-api:0.12")) // MySQL - include(implementation("mysql:mysql-connector-java:8.0.29")) + include(implementation("mysql:mysql-connector-java:8.0.33")) // Redis - include(implementation("redis.clients:jedis:4.2.3")) - include(implementation("org.apache.commons:commons-pool2:2.11.1")) + include(implementation("redis.clients:jedis:5.1.2")) + include(implementation("org.apache.commons:commons-pool2:2.12.0")) // Parsing Libraries - include(implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.15.2")) - include(implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.2")) - include(implementation("org.yaml:snakeyaml:2.0")) - include(implementation("com.fasterxml.jackson.core:jackson-core:2.15.2")) - include(implementation("com.fasterxml.jackson.core:jackson-databind:2.15.2")) - include(implementation("com.fasterxml.jackson.core:jackson-annotations:2.15.2")) + include(implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.17.1")) + include(implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.1")) + include(implementation("org.yaml:snakeyaml:2.2")) + include(implementation("com.fasterxml.jackson.core:jackson-core:2.17.1")) + include(implementation("com.fasterxml.jackson.core:jackson-databind:2.17.1")) + include(implementation("com.fasterxml.jackson.core:jackson-annotations:2.17.1")) // Math Evaluator include(implementation("com.fathzer:javaluator:3.0.3")) // Placeholders API - modImplementation include("eu.pb4:placeholder-api:2.1.1+1.20") + modImplementation include("eu.pb4:placeholder-api:2.4.0-pre.1+1.20.5") //modRuntimeOnly "maven.modrinth:lazydfu:0.1.3" //modRuntimeOnly "maven.modrinth:sodium:mc1.19-0.4.2" @@ -82,7 +82,7 @@ processResources { tasks.withType(JavaCompile).configureEach { // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. - it.options.release = 17 + it.options.release = 21 } java { diff --git a/gradle.properties b/gradle.properties index 0246baa..ad1d006 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx2G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.20 - yarn_mappings=1.20+build.1 - loader_version=0.14.21 + minecraft_version=1.20.6 + yarn_mappings=1.20.6+build.1 + loader_version=0.15.11 # Mod Properties mod_version = 1.0.1 @@ -14,4 +14,4 @@ org.gradle.jvmargs=-Xmx2G # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.83.0+1.20 + fabric_version=0.98.0+1.20.6 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7..c1962a7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d..20db9ad 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index 79a61d4..aeb74cb --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/src/main/java/me/flashyreese/mods/commandaliases/command/impl/ArgumentTypeMapper.java b/src/main/java/me/flashyreese/mods/commandaliases/command/impl/ArgumentTypeMapper.java index bf27ec2..8a6596b 100644 --- a/src/main/java/me/flashyreese/mods/commandaliases/command/impl/ArgumentTypeMapper.java +++ b/src/main/java/me/flashyreese/mods/commandaliases/command/impl/ArgumentTypeMapper.java @@ -63,7 +63,7 @@ private void registerArgumentTypes(CommandRegistryAccess registryAccess) { this.argumentMap.put("minecraft:item_stack", ItemStackArgumentType.itemStack(registryAccess)); this.argumentMap.put("minecraft:item_predicate", ItemPredicateArgumentType.itemPredicate(registryAccess)); this.argumentMap.put("minecraft:color", ColorArgumentType.color()); - this.argumentMap.put("minecraft:component", TextArgumentType.text()); + this.argumentMap.put("minecraft:component", TextArgumentType.text(registryAccess)); this.argumentMap.put("minecraft:message", MessageArgumentType.message()); this.argumentMap.put("minecraft:nbt_compound_tag", NbtCompoundArgumentType.nbtCompound()); this.argumentMap.put("minecraft:nbt_tag", NbtElementArgumentType.nbtElement()); @@ -88,11 +88,11 @@ private void registerArgumentTypes(CommandRegistryAccess registryAccess) { this.argumentMap.put("minecraft:time", TimeArgumentType.time()); // Todo: Allow entire registry keys by creating registry map - this.argumentMap.put("minecraft:entry.attribute_key", RegistryEntryArgumentType.registryEntry(registryAccess, RegistryKeys.ATTRIBUTE)); - this.argumentMap.put("minecraft:entry.status_effect_key", RegistryEntryArgumentType.registryEntry(registryAccess, RegistryKeys.STATUS_EFFECT)); - this.argumentMap.put("minecraft:entry.enchantment_type", RegistryEntryArgumentType.registryEntry(registryAccess, RegistryKeys.ENCHANTMENT)); - this.argumentMap.put("minecraft:entry.biome_key", RegistryEntryArgumentType.registryEntry(registryAccess, RegistryKeys.BIOME)); - this.argumentMap.put("minecraft:entry.entity_type_key", RegistryEntryArgumentType.registryEntry(registryAccess, RegistryKeys.ENTITY_TYPE)); + this.argumentMap.put("minecraft:entry.attribute_key", RegistryEntryReferenceArgumentType.registryEntry(registryAccess, RegistryKeys.ATTRIBUTE)); + this.argumentMap.put("minecraft:entry.status_effect_key", RegistryEntryReferenceArgumentType.registryEntry(registryAccess, RegistryKeys.STATUS_EFFECT)); + this.argumentMap.put("minecraft:entry.enchantment_type", RegistryEntryReferenceArgumentType.registryEntry(registryAccess, RegistryKeys.ENCHANTMENT)); + this.argumentMap.put("minecraft:entry.biome_key", RegistryEntryReferenceArgumentType.registryEntry(registryAccess, RegistryKeys.BIOME)); + this.argumentMap.put("minecraft:entry.entity_type_key", RegistryEntryReferenceArgumentType.registryEntry(registryAccess, RegistryKeys.ENTITY_TYPE)); this.argumentMap.put("minecraft:entry_predicate.biome_key", RegistryEntryPredicateArgumentType.registryEntryPredicate(registryAccess, RegistryKeys.BIOME)); this.argumentMap.put("minecraft:entry_predicate.poi_type_key", RegistryEntryPredicateArgumentType.registryEntryPredicate(registryAccess, RegistryKeys.POINT_OF_INTEREST_TYPE)); diff --git a/src/main/java/me/flashyreese/mods/commandaliases/command/impl/FunctionProcessor.java b/src/main/java/me/flashyreese/mods/commandaliases/command/impl/FunctionProcessor.java index 7a93f3e..af4f1bf 100644 --- a/src/main/java/me/flashyreese/mods/commandaliases/command/impl/FunctionProcessor.java +++ b/src/main/java/me/flashyreese/mods/commandaliases/command/impl/FunctionProcessor.java @@ -40,7 +40,7 @@ public void registerFunctions() { if (commandSource instanceof ServerCommandSource serverCommandSource) { return serverCommandSource.getName(); } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { - return clientCommandSource.getPlayer().getEntityName(); + return clientCommandSource.getPlayer().getNameForScoreboard(); } return null; }); @@ -59,9 +59,9 @@ public void registerFunctions() { }); this.functionMap.put("is_online", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { - return String.valueOf(serverCommandSource.getWorld().getPlayers().stream().anyMatch(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input))); + return String.valueOf(serverCommandSource.getWorld().getPlayers().stream().anyMatch(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input))); } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { - return String.valueOf(clientCommandSource.getWorld().getPlayers().stream().anyMatch(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input))); + return String.valueOf(clientCommandSource.getWorld().getPlayers().stream().anyMatch(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input))); } return "false"; }); @@ -92,13 +92,13 @@ public void registerFunctions() { this.functionMap.put("get_dimension", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { Optional optionalPlayer = serverCommandSource.getWorld().getPlayers().stream() - .filter(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return optionalPlayer.get().getEntityWorld().getRegistryKey().getValue().toString(); } } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { Optional optionalPlayer = clientCommandSource.getWorld().getPlayers().stream() - .filter(clientPlayerEntity -> clientPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(clientPlayerEntity -> clientPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return optionalPlayer.get().getEntityWorld().getRegistryKey().getValue().toString(); } @@ -108,13 +108,13 @@ public void registerFunctions() { this.functionMap.put("get_world", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { Optional optionalPlayer = serverCommandSource.getWorld().getPlayers().stream() - .filter(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return optionalPlayer.get().getEntityWorld().getDimension().effects().toString(); } } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { Optional optionalPlayer = clientCommandSource.getWorld().getPlayers().stream() - .filter(clientPlayerEntity -> clientPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(clientPlayerEntity -> clientPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return optionalPlayer.get().getEntityWorld().getDimension().effects().toString(); } @@ -124,13 +124,13 @@ public void registerFunctions() { this.functionMap.put("get_block_pos_x", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { Optional optionalPlayer = serverCommandSource.getWorld().getPlayers().stream() - .filter(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getBlockX()); } } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { Optional optionalPlayer = clientCommandSource.getWorld().getPlayers().stream() - .filter(clientPlayerEntity -> clientPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(clientPlayerEntity -> clientPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getBlockX()); } @@ -140,13 +140,13 @@ public void registerFunctions() { this.functionMap.put("get_block_pos_y", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { Optional optionalPlayer = serverCommandSource.getWorld().getPlayers().stream() - .filter(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getBlockY()); } } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { Optional optionalPlayer = clientCommandSource.getWorld().getPlayers().stream() - .filter(clientPlayerEntity -> clientPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(clientPlayerEntity -> clientPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getBlockY()); } @@ -156,13 +156,13 @@ public void registerFunctions() { this.functionMap.put("get_block_pos_z", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { Optional optionalPlayer = serverCommandSource.getWorld().getPlayers().stream() - .filter(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getBlockZ()); } } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { Optional optionalPlayer = clientCommandSource.getWorld().getPlayers().stream() - .filter(clientPlayerEntity -> clientPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(clientPlayerEntity -> clientPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getBlockZ()); } @@ -172,13 +172,13 @@ public void registerFunctions() { this.functionMap.put("get_yaw", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { Optional optionalPlayer = serverCommandSource.getWorld().getPlayers().stream() - .filter(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getYaw()); } } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { Optional optionalPlayer = clientCommandSource.getWorld().getPlayers().stream() - .filter(clientPlayerEntity -> clientPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(clientPlayerEntity -> clientPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getYaw()); } @@ -188,13 +188,13 @@ public void registerFunctions() { this.functionMap.put("get_pitch", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { Optional optionalPlayer = serverCommandSource.getWorld().getPlayers().stream() - .filter(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getPitch()); } } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { Optional optionalPlayer = clientCommandSource.getWorld().getPlayers().stream() - .filter(clientPlayerEntity -> clientPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(clientPlayerEntity -> clientPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getPitch()); } @@ -204,13 +204,13 @@ public void registerFunctions() { this.functionMap.put("get_pos_x", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { Optional optionalPlayer = serverCommandSource.getWorld().getPlayers().stream() - .filter(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getX()); } } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { Optional optionalPlayer = clientCommandSource.getWorld().getPlayers().stream() - .filter(clientPlayerEntity -> clientPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(clientPlayerEntity -> clientPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getX()); } @@ -220,13 +220,13 @@ public void registerFunctions() { this.functionMap.put("get_pos_y", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { Optional optionalPlayer = serverCommandSource.getWorld().getPlayers().stream() - .filter(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getY()); } } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { Optional optionalPlayer = clientCommandSource.getWorld().getPlayers().stream() - .filter(clientPlayerEntity -> clientPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(clientPlayerEntity -> clientPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getY()); } @@ -236,13 +236,13 @@ public void registerFunctions() { this.functionMap.put("get_pos_z", (commandSource, input) -> { if (commandSource instanceof ServerCommandSource serverCommandSource) { Optional optionalPlayer = serverCommandSource.getWorld().getPlayers().stream() - .filter(serverPlayerEntity -> serverPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(serverPlayerEntity -> serverPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getZ()); } } else if (commandSource instanceof FabricClientCommandSource clientCommandSource) { Optional optionalPlayer = clientCommandSource.getWorld().getPlayers().stream() - .filter(clientPlayerEntity -> clientPlayerEntity.getEntityName().equals(input)).findFirst(); + .filter(clientPlayerEntity -> clientPlayerEntity.getNameForScoreboard().equals(input)).findFirst(); if (optionalPlayer.isPresent()) { return String.valueOf(optionalPlayer.get().getZ()); }