Skip to content

Commit 865cb38

Browse files
committed
Merge branch 'api-8' into api-9
2 parents 42ca56c + 7e6c50f commit 865cb38

File tree

8 files changed

+33
-10
lines changed

8 files changed

+33
-10
lines changed

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ javadocPublishRoot=https://jd.spongepowered.org/
88

99
org.gradle.parallel=true
1010

11-
adventureVersion=4.11.0
12-
caffeineVersion=3.1.1
13-
checkstyleVersion=10.3.4
11+
adventureVersion=4.12.0
12+
caffeineVersion=3.1.2
13+
checkstyleVersion=10.5.0
1414
configurateVersion=4.1.2
1515
errorproneVersion=2.16
1616
gsonVersion=2.8.9

gradle/wrapper/gradle-wrapper.jar

818 Bytes
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac

gradlew.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

settings.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ pluginManagement {
1010
val indraVersion = "3.0.1"
1111
id("org.spongepowered.gradle.event-impl-gen") version "7.0.0"
1212
id("org.spongepowered.gradle.sponge.dev") version "2.1.1"
13-
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.6"
13+
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7"
1414
id("net.ltgt.errorprone") version "3.0.1"
1515
id("net.kyori.indra.publishing") version indraVersion
1616
id("net.kyori.indra.publishing.sonatype") version indraVersion
1717
id("net.kyori.indra.checkstyle") version indraVersion
1818
id("net.kyori.indra.crossdoc") version indraVersion
1919
}
2020
}
21+
plugins {
22+
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.3.0")
23+
}
2124

2225
if (JavaVersion.current() < JavaVersion.VERSION_11) {
2326
throw GradleException("SpongeAPI requires at least Java 11 to build, but you have ${JavaVersion.current()}.")

src/main/java/org/spongepowered/api/data/Keys.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ public final class Keys {
947947
public static final Key<Value<Ticks>> FUSE_DURATION = Keys.key(ResourceKey.sponge("fuse_duration"), Ticks.class);
948948

949949
/**
950-
* The {@link GameMode} a {@link Humanoid} has.
950+
* The {@link GameMode} a {@link ServerPlayer} has.
951951
*/
952952
public static final Key<Value<GameMode>> GAME_MODE = Keys.key(ResourceKey.sponge("game_mode"), GameMode.class);
953953

@@ -2206,6 +2206,11 @@ public final class Keys {
22062206
*/
22072207
public static final Key<Value<Integer>> POWER = Keys.key(ResourceKey.sponge("power"), Integer.class);
22082208

2209+
/**
2210+
* The previous {@link GameMode} of a {@link ServerPlayer}. Readonly.
2211+
*/
2212+
public static final Key<Value<GameMode>> PREVIOUS_GAME_MODE = Keys.key(ResourceKey.sponge("previous_game_mode"), GameMode.class);
2213+
22092214
/**
22102215
* A {@link Beacon}'s primary effect.
22112216
*/

src/main/java/org/spongepowered/api/entity/living/player/server/ServerPlayer.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,15 @@ default Value.Mutable<GameMode> gameMode() {
344344
return this.requireValue(Keys.GAME_MODE).asMutable();
345345
}
346346

347+
/**
348+
* {@link Keys#PREVIOUS_GAME_MODE}
349+
*
350+
* @return The previous game mode of the player
351+
*/
352+
default Value<GameMode> previousGameMode() {
353+
return this.requireValue(Keys.PREVIOUS_GAME_MODE);
354+
}
355+
347356
/**
348357
* {@link Keys#STATISTICS}
349358
*

0 commit comments

Comments
 (0)