mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-23 01:27:42 +01:00
Fabric 1.20.2 by Kopo (#3217)
* Upgrade Gradle to 8.3 * Fabric 1.20.2 * Fix some Gradle warnings
This commit is contained in:
parent
2313b0b257
commit
366faaba45
@ -11,13 +11,13 @@ buildscript {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "com.github.johnrengelman.shadow" version "7.1.2" apply false
|
||||
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
|
||||
id "java"
|
||||
id 'java-library'
|
||||
id "jacoco"
|
||||
id "checkstyle"
|
||||
id "org.sonarqube" version "4.3.1.3277"
|
||||
id 'fabric-loom' version '1.1-SNAPSHOT' apply false
|
||||
id 'fabric-loom' version '1.3-SNAPSHOT' apply false
|
||||
}
|
||||
|
||||
apply plugin: 'nebula-aggregate-javadocs'
|
||||
@ -45,7 +45,7 @@ allprojects {
|
||||
|
||||
// Fix for UTF-8 files showing with wrong encoding when compiled on Windows machines.
|
||||
compileJava { options.encoding = "UTF-8" }
|
||||
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
|
||||
tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' }
|
||||
javadoc { options.encoding = 'UTF-8' }
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ subprojects {
|
||||
testImplementation.extendsFrom shadow // Include shadowed dependencies in test classpath
|
||||
}
|
||||
// Test classes available to other modules
|
||||
task testJar(type: Jar) {
|
||||
tasks.register('testJar', Jar) {
|
||||
archiveClassifier.set("test")
|
||||
from sourceSets.test.output
|
||||
}
|
||||
@ -176,8 +176,8 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
plugins.withType(JacocoPlugin) {
|
||||
tasks["test"].finalizedBy 'jacocoTestReport'
|
||||
plugins.withType(JacocoPlugin).configureEach {
|
||||
tasks.named("test").get().finalizedBy 'jacocoTestReport'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,9 +8,9 @@ dependencies {
|
||||
|
||||
shadow "net.playeranalytics:platform-abstraction-layer-api:$palVersion"
|
||||
|
||||
minecraft "com.mojang:minecraft:1.20-rc1"
|
||||
mappings "net.fabricmc:yarn:1.20-rc1+build.2:v2"
|
||||
modImplementation "net.fabricmc:fabric-loader:0.14.21"
|
||||
minecraft "com.mojang:minecraft:1.20.2"
|
||||
mappings "net.fabricmc:yarn:1.20.2+build.1:v2"
|
||||
modImplementation "net.fabricmc:fabric-loader:0.14.22"
|
||||
modImplementation('me.lucko:fabric-permissions-api:0.3-SNAPSHOT')
|
||||
|
||||
// Fabric API
|
||||
@ -24,7 +24,7 @@ dependencies {
|
||||
]
|
||||
|
||||
apiModules.forEach {
|
||||
modImplementation(fabricApi.module(it, "0.83.0+1.20"))
|
||||
modImplementation(fabricApi.module(it, "0.89.1+1.20.2"))
|
||||
}
|
||||
|
||||
testImplementation project(path: ":common", configuration: 'testArtifacts')
|
||||
|
@ -30,7 +30,7 @@ import com.djrapitops.plan.utilities.logging.ErrorContext;
|
||||
import com.djrapitops.plan.utilities.logging.ErrorLogger;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
|
||||
import net.minecraft.network.NetworkState;
|
||||
import net.minecraft.network.packet.c2s.handshake.ConnectionIntent;
|
||||
import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket;
|
||||
import net.minecraft.server.dedicated.MinecraftDedicatedServer;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
@ -126,8 +126,8 @@ public class PlayerOnlineListener implements FabricListener {
|
||||
|
||||
private void onHandshake(HandshakeC2SPacket packet) {
|
||||
try {
|
||||
if (packet.getIntendedState() == NetworkState.LOGIN) {
|
||||
String address = packet.getAddress();
|
||||
if (packet.intendedState() == ConnectionIntent.LOGIN) {
|
||||
String address = packet.address();
|
||||
if (address != null && address.contains("\u0000")) {
|
||||
address = address.substring(0, address.indexOf('\u0000'));
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public class FabricPingCounter extends TaskSystem.Task implements FabricListener
|
||||
}
|
||||
|
||||
private int getPing(ServerPlayerEntity player) {
|
||||
return player.pingMilliseconds;
|
||||
return player.networkHandler.getLatency();
|
||||
}
|
||||
|
||||
public void onPlayerJoin(ServerPlayerEntity player) {
|
||||
|
BIN
Plan/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
Plan/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
19
Plan/gradlew
vendored
19
Plan/gradlew
vendored
@ -83,10 +83,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
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"'
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@ -133,10 +131,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@ -197,6 +198,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
|
||||
|
Loading…
Reference in New Issue
Block a user