Compare commits
18 Commits
ver/1.15.2
...
ver/1.21.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6988bec0ee | ||
|
|
68193885f5 | ||
|
|
eba57d2c30 | ||
|
|
f61f8a2ebb | ||
|
|
34852bf543 | ||
|
|
4e2340e8fd | ||
|
|
33aa25b2e0 | ||
|
|
0a5314ecb3 | ||
|
|
480a5fca27 | ||
|
|
59d89107c5 | ||
|
|
6be3d577c7 | ||
|
|
3aa2e99752 | ||
|
|
c548038547 | ||
|
|
5b03eb1aa4 | ||
|
|
aeaa4c4ca2 | ||
|
|
ad25e7ef02 | ||
|
|
f849bcaf04 | ||
|
|
62342de306 |
35
.gitignore
vendored
35
.gitignore
vendored
@@ -37,6 +37,8 @@ target/
|
||||
gradle-app.setting
|
||||
.gradletasknamecache
|
||||
.gradle
|
||||
build/
|
||||
*/build/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
@@ -47,6 +49,37 @@ gradle-app.setting
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
# virtual machine crash logs
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
|
||||
# Paper/Akarin specific
|
||||
paper-api/
|
||||
paper-server/
|
||||
.paper-nms/
|
||||
.paper-nms.at
|
||||
.paper-nms.mixin
|
||||
.paper-nms.plugin
|
||||
.paper-nms.remapped
|
||||
.paper-nms.remapped.notch
|
||||
.paper-nms.remapped.spigot
|
||||
.paper-nms.remapped.yarn
|
||||
.paper-nms.remapped.mojang
|
||||
.paper-nms.remapped.obf
|
||||
.paper-nms.remapped.srg
|
||||
.paper-nms.remapped.tsrg
|
||||
.paper-nms.remapped.tiny
|
||||
.paper-nms.remapped.csrg
|
||||
.paper-nms.remapped.proguard
|
||||
.paper-nms.remapped.retroguard
|
||||
.paper-nms.remapped.specialsource
|
||||
.paper-nms.remapped.asm
|
||||
.paper-nms.remapped.fernflower
|
||||
.paper-nms.remapped.cfr
|
||||
.paper-nms.remapped.procyon
|
||||
.paper-nms.remapped.quiltflower
|
||||
|
||||
# OS specific
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
|
||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,4 +1,4 @@
|
||||
[submodule "Tuinity"]
|
||||
path = Tuinity
|
||||
url = https://github.com/Spottedleaf/Tuinity
|
||||
branch = ver/1.15.2
|
||||
branch = master
|
||||
|
||||
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@@ -4,7 +4,7 @@ pipeline {
|
||||
environment {
|
||||
DISCORD_WEBHOOK_URL = credentials('3e8105ad-8e03-4550-bc66-a27438ec6fb3')
|
||||
CHANGES = getChanges(currentBuild)
|
||||
ARTIFACT = "http://ci.josephworks.net/job/Akarin/job/1.16.3/${currentBuild.id}/artifact/target/akarin-1.16.3-launcher.jar"
|
||||
ARTIFACT = "http://ci.josephworks.net/job/Akarin/job/1.16.5/${currentBuild.id}/artifact/target/akarin-1.16.5-launcher.jar"
|
||||
}
|
||||
stages {
|
||||
stage('Initialize') {
|
||||
|
||||
29
NOTES.md
Normal file
29
NOTES.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Development Notes
|
||||
|
||||
## Patching System
|
||||
Modern Paper forks (including Purpur) use a file-based patching system:
|
||||
|
||||
### API Patches
|
||||
- Located in `purpur-api/paper-patches/files/`
|
||||
- Contains patches for API source files
|
||||
|
||||
### Server Patches
|
||||
1. Minecraft Patches (`purpur-server/minecraft-patches/`)
|
||||
- `features/` - Feature-specific patches
|
||||
- `sources/` - Direct source code modifications
|
||||
|
||||
2. Paper Patches (`purpur-server/paper-patches/`)
|
||||
- `features/` - Feature-specific patches
|
||||
- `files/` - Source code modifications
|
||||
|
||||
### Historical Patches
|
||||
The `patches/` directory contains only historical patches from older versions:
|
||||
- 1-20-6 (dropped)
|
||||
- 1-21-1 (dropped)
|
||||
- 1-21-3 (dropped)
|
||||
- Some unapplied patches
|
||||
|
||||
## Reference
|
||||
- Purpur reference implementation can be found at `~/purpur-reference`
|
||||
- Clean Purpur clone at `~/purpur-clean`
|
||||
- Version: 1.21.4
|
||||
@@ -7,7 +7,7 @@
|
||||
[](https://akarin.app/)
|
||||
[](https://discord.gg/fw2pJAj)
|
||||
[](https://bstats.org/plugin/bukkit/Torch)
|
||||

|
||||

|
||||
[](https://www.patreon.com/akarinproject)
|
||||
</div>
|
||||
|
||||
@@ -51,7 +51,6 @@ git submodule update --init --recursive
|
||||
Demo Servers
|
||||
---
|
||||
|
||||
* [Fair Server](https://fairserver.ru)
|
||||
* [Wolfx](https://wolfx.jp/)
|
||||
* [Pioneercraft](https://www.pioneercraft.pw/)
|
||||
|
||||
|
||||
2
Tuinity
2
Tuinity
Submodule Tuinity updated: 03ad94df5d...5b6d8beec8
90
build.gradle.kts
Normal file
90
build.gradle.kts
Normal file
@@ -0,0 +1,90 @@
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("io.papermc.paperweight.patcher") version "2.0.0-beta.14"
|
||||
}
|
||||
|
||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||
|
||||
paperweight {
|
||||
upstreams.paper {
|
||||
ref = providers.gradleProperty("paperCommit")
|
||||
|
||||
patchFile {
|
||||
path = "paper-server/build.gradle.kts"
|
||||
outputFile = file("akarin-server/build.gradle.kts")
|
||||
patchFile = file("akarin-server/build.gradle.kts.patch")
|
||||
}
|
||||
patchFile {
|
||||
path = "paper-api/build.gradle.kts"
|
||||
outputFile = file("akarin-api/build.gradle.kts")
|
||||
patchFile = file("akarin-api/build.gradle.kts.patch")
|
||||
}
|
||||
patchDir("paperApi") {
|
||||
upstreamPath = "paper-api"
|
||||
excludes = setOf("build.gradle.kts")
|
||||
patchesDir = file("akarin-api/paper-patches")
|
||||
outputDir = file("paper-api")
|
||||
}
|
||||
patchDir("paperServer") {
|
||||
upstreamPath = "paper-server"
|
||||
excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
|
||||
patchesDir = file("akarin-server/paper-patches")
|
||||
outputDir = file("paper-server")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java-library")
|
||||
apply(plugin = "maven-publish")
|
||||
|
||||
extensions.configure<JavaPluginExtension> {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release = 21
|
||||
options.isFork = true
|
||||
}
|
||||
tasks.withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
tasks.withType<ProcessResources> {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
tasks.withType<Test> {
|
||||
testLogging {
|
||||
showStackTraces = true
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
events(TestLogEvent.STANDARD_OUT)
|
||||
}
|
||||
}
|
||||
tasks.withType<AbstractArchiveTask>().configureEach {
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
maven("https://jitpack.io")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("printMinecraftVersion") {
|
||||
doLast {
|
||||
println(providers.gradleProperty("mcVersion").get().trim())
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("printAkarinVersion") {
|
||||
doLast {
|
||||
println(project.version)
|
||||
}
|
||||
}
|
||||
11
gradle.properties
Normal file
11
gradle.properties
Normal file
@@ -0,0 +1,11 @@
|
||||
group = io.akarin
|
||||
version = 1.21.4-R0.1-SNAPSHOT
|
||||
mcVersion = 1.21.4
|
||||
|
||||
paperCommit = 8eb8e44ac32a99f53da7af50e800ac8831030580
|
||||
|
||||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.configuration-cache.problems = warn
|
||||
org.gradle.jvmargs = -Xmx3G
|
||||
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
249
gradlew
vendored
Executable file
249
gradlew
vendored
Executable file
@@ -0,0 +1,249 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# 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
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
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.
|
||||
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
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
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
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
92
gradlew.bat
vendored
Normal file
92
gradlew.bat
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] POM Changes
|
||||
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index a2387a667efba33135197d40efe879fc9f635d2f..13d0bb7355a8f6c1a33feb3be60f61aa60dd5f9c 100644
|
||||
index 821df3413345c613eccff158f8081cf9ba848a14..ea2fecb9a8bbc5fbd6c2fec6fbdf4a630ed828aa 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -3,18 +3,18 @@
|
||||
@@ -23,7 +23,7 @@ index a2387a667efba33135197d40efe879fc9f635d2f..13d0bb7355a8f6c1a33feb3be60f61aa
|
||||
|
||||
- <artifactId>tuinity-api</artifactId>
|
||||
+ <artifactId>akarin-api</artifactId>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
- <name>Tuinity-API</name>
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Add server configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index cf20e75419b011e819c63fc8453f250b849cb2c7..c90456e198afdacc21b6980c415c3048fdc7f7a2 100644
|
||||
index b3e7b2a8eaa3980e34bc74a846320b7871dc6e4b..216148af0c136a5243ac7e5f10133df59651e9fe 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1404,6 +1404,14 @@ public interface Server extends PluginMessageRecipient {
|
||||
@@ -1603,6 +1603,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
}
|
||||
// Tuinity end - add config to timings report
|
||||
|
||||
185
patches-1.16.5/api/0003-Remove-Streams-using-IntelliJ-IDEA.patch
Normal file
185
patches-1.16.5/api/0003-Remove-Streams-using-IntelliJ-IDEA.patch
Normal file
@@ -0,0 +1,185 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=E3=84=97=E3=84=A0=CB=8B=20=E3=84=91=E3=84=A7=CB=8A?=
|
||||
<tsao-chi@the-lingo.org>
|
||||
Date: Fri, 19 Jun 2020 19:55:56 +0800
|
||||
Subject: [PATCH] Remove Streams using IntelliJ IDEA
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
index ecd149157d4fb80444f34bf5633d74bcdb63dec5..966287589d7cbf4d626dcdf162ed8cea53cb0b34 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
@@ -60,7 +60,9 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
||||
|
||||
@Override
|
||||
public void sendMessage(@NotNull String message) {
|
||||
- senders.forEach((sender) -> sender.sendMessage(message));
|
||||
+ for (CommandSender sender : senders) {
|
||||
+ sender.sendMessage(message);
|
||||
+ }
|
||||
}
|
||||
|
||||
public void addConsoleIfNeeded() {
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java.orig b/src/main/java/co/aikar/timings/TimingsReportListener.java.orig
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ef58a6c00f444bd498a2d8fc4e457236f393954f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java.orig
|
||||
@@ -0,0 +1,77 @@
|
||||
+package co.aikar.timings;
|
||||
+
|
||||
+import com.google.common.collect.Lists;
|
||||
+import org.apache.commons.lang.Validate;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+import org.bukkit.command.ConsoleCommandSender;
|
||||
+import org.bukkit.command.MessageCommandSender;
|
||||
+import org.bukkit.command.RemoteConsoleCommandSender;
|
||||
+
|
||||
+import java.util.List;
|
||||
+import java.util.UUID;
|
||||
+
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+@SuppressWarnings("WeakerAccess")
|
||||
+public class TimingsReportListener implements MessageCommandSender {
|
||||
+ private final List<CommandSender> senders;
|
||||
+ private final Runnable onDone;
|
||||
+ private String timingsURL;
|
||||
+
|
||||
+ public TimingsReportListener(@NotNull CommandSender senders) {
|
||||
+ this(senders, null);
|
||||
+ }
|
||||
+ public TimingsReportListener(@NotNull CommandSender sender, @Nullable Runnable onDone) {
|
||||
+ this(Lists.newArrayList(sender), onDone);
|
||||
+ }
|
||||
+ public TimingsReportListener(@NotNull List<CommandSender> senders) {
|
||||
+ this(senders, null);
|
||||
+ }
|
||||
+ public TimingsReportListener(@NotNull List<CommandSender> senders, @Nullable Runnable onDone) {
|
||||
+ Validate.notNull(senders);
|
||||
+ Validate.notEmpty(senders);
|
||||
+
|
||||
+ this.senders = Lists.newArrayList(senders);
|
||||
+ this.onDone = onDone;
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public String getTimingsURL() {
|
||||
+ return timingsURL;
|
||||
+ }
|
||||
+
|
||||
+ public void done() {
|
||||
+ done(null);
|
||||
+ }
|
||||
+
|
||||
+ public void done(@Nullable String url) {
|
||||
+ this.timingsURL = url;
|
||||
+ if (onDone != null) {
|
||||
+ onDone.run();
|
||||
+ }
|
||||
+ for (CommandSender sender : senders) {
|
||||
+ if (sender instanceof TimingsReportListener) {
|
||||
+ ((TimingsReportListener) sender).done();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendMessage(@NotNull String message) {
|
||||
+ senders.forEach((sender) -> sender.sendMessage(message));
|
||||
+ }
|
||||
+
|
||||
+ public void addConsoleIfNeeded() {
|
||||
+ boolean hasConsole = false;
|
||||
+ for (CommandSender sender : this.senders) {
|
||||
+ if (sender instanceof ConsoleCommandSender || sender instanceof RemoteConsoleCommandSender) {
|
||||
+ hasConsole = true;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!hasConsole) {
|
||||
+ this.senders.add(Bukkit.getConsoleSender());
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
|
||||
index a02a02aa0c87e0f0ed9e509e4dcab01565b3d92a..0c3fef0b4fd7f0ba4e37600e5acc886838e1db13 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
|
||||
@@ -13,7 +13,9 @@ import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
+import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
diff --git a/src/main/java/io/papermc/paper/tag/BaseTag.java b/src/main/java/io/papermc/paper/tag/BaseTag.java
|
||||
index 4b8552e4e4c07b197fa9431fa911535b0222561e..09276e7fd18c4d82c77d19550ace1c6000f21cb7 100644
|
||||
--- a/src/main/java/io/papermc/paper/tag/BaseTag.java
|
||||
+++ b/src/main/java/io/papermc/paper/tag/BaseTag.java
|
||||
@@ -2,6 +2,7 @@ package io.papermc.paper.tag;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bukkit.Keyed;
|
||||
+import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Tag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -84,7 +85,17 @@ public abstract class BaseTag<T extends Keyed, C extends BaseTag<T, C>> implemen
|
||||
|
||||
@NotNull
|
||||
public C add(@NotNull Predicate<T> filter) {
|
||||
- return add(getAllPossibleValues().stream().filter(globalPredicates.stream().reduce(Predicate::or).orElse(t -> true)).filter(filter).collect(Collectors.toSet()));
|
||||
+ Set<T> set = new HashSet<>();
|
||||
+ for (T material : getAllPossibleValues()) {
|
||||
+ for(Predicate<T> tPredicate : globalPredicates) {
|
||||
+ if (tPredicate.test(material)) {
|
||||
+ if (filter.test(material)) {
|
||||
+ set.add(material);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return add(set);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -124,7 +135,17 @@ public abstract class BaseTag<T extends Keyed, C extends BaseTag<T, C>> implemen
|
||||
|
||||
@NotNull
|
||||
public C not(@NotNull Predicate<T> filter) {
|
||||
- not(getAllPossibleValues().stream().filter(globalPredicates.stream().reduce(Predicate::or).orElse(t -> true)).filter(filter).collect(Collectors.toSet()));
|
||||
+ Set<T> set = new HashSet<>();
|
||||
+ for (T material : getAllPossibleValues()) {
|
||||
+ for(Predicate<T> tPredicate : globalPredicates) {
|
||||
+ if (tPredicate.test(material)) {
|
||||
+ if (filter.test(material)) {
|
||||
+ set.add(material);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ not(set);
|
||||
return (C) this;
|
||||
}
|
||||
|
||||
@@ -145,7 +166,14 @@ public abstract class BaseTag<T extends Keyed, C extends BaseTag<T, C>> implemen
|
||||
|
||||
@NotNull
|
||||
public C ensureSize(@NotNull String label, int size) {
|
||||
- long actual = this.tagged.stream().filter(globalPredicates.stream().reduce(Predicate::or).orElse(t -> true)).count();
|
||||
+ long actual = 0L;
|
||||
+ for (T material : this.tagged) {
|
||||
+ for(Predicate<T> tPredicate : globalPredicates) {
|
||||
+ if (tPredicate.test(material)) {
|
||||
+ actual++;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
if (size != actual) {
|
||||
throw new IllegalStateException(key.toString() + ": " + label + " - Expected " + size + " values, got " + actual);
|
||||
}
|
||||
@@ -6,25 +6,25 @@ Subject: [PATCH] Akarin POM changes
|
||||
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 66517f30fc00b86d1e3539e700f8c643aaada85e..5c2fc340f281297f6dc9e01d084d21f565008e6f 100644
|
||||
index e83e4241a56fe131a75fe21cc1518992c089da2c..a65381073fc6d4546280e36bb18a0b2dd54cfa93 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -1,11 +1,11 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
- <artifactId>tuinity</artifactId>
|
||||
+ <artifactId>akarin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
||||
- <name>Tuinity-Server</name>
|
||||
- <url>https://github.com/Spottedleaf/Tuinity</url>
|
||||
+ <name>Akarin-Server</name>
|
||||
+ <url>https://github.com/Akarin-project/Akarin</url>
|
||||
|
||||
<properties>
|
||||
<!-- <skipTests>true</skipTests> Paper - This [was] not going to end well -->
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@@ -17,16 +17,16 @@
|
||||
@@ -19,16 +19,16 @@
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
@@ -45,7 +45,18 @@ index 66517f30fc00b86d1e3539e700f8c643aaada85e..5c2fc340f281297f6dc9e01d084d21f5
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
@@ -163,7 +163,7 @@
|
||||
@@ -172,6 +172,10 @@
|
||||
<id>spigotmc-public</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
+ <repository>
|
||||
+ <id>velocity</id>
|
||||
+ <url>https://repo.velocitypowered.com/snapshots/</url>
|
||||
+ </repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
@@ -183,7 +187,7 @@
|
||||
|
||||
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
|
||||
<build>
|
||||
@@ -54,7 +65,7 @@ index 66517f30fc00b86d1e3539e700f8c643aaada85e..5c2fc340f281297f6dc9e01d084d21f5
|
||||
<defaultGoal>install</defaultGoal> <!-- Paper -->
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -171,7 +171,7 @@
|
||||
@@ -191,7 +195,7 @@
|
||||
<artifactId>gitdescribe-maven-plugin</artifactId>
|
||||
<version>1.3</version>
|
||||
<configuration>
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Akarin configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index b09981e9bd2d24a0f0e291fabfbbbf0b3887a80b..501dacb4584412dd84e36421e113a1f068693e47 100644
|
||||
index 5dfa0658838c4801cdf260eae8b98163f729e5af..841a8d2b392acdcef90592b841cbbcb2237c6901 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -231,6 +231,7 @@ public class TimingsExport extends Thread {
|
||||
@@ -207,50 +207,70 @@ index 0000000000000000000000000000000000000000..2ac8f02a97429f04f3e5c9206ec228ed
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 1f1243ae8371a3e76ebfdee91b327db832767c4a..201ce4a0411f9ddc775053130a7ca62f7412d5f3 100644
|
||||
index 2644b190813cc934914aeab78fbd6515d1a37c4a..1dc0f83847df72824af11a18b73906bc23e3d376 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -195,6 +195,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@@ -19,6 +19,8 @@ import java.util.Optional;
|
||||
import java.util.function.BooleanSupplier;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.annotation.Nullable;
|
||||
+
|
||||
+import io.akarin.server.Config;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -176,7 +178,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
|
||||
// Paper end
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((File) options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
+ io.akarin.server.Config.init((File) options.valueOf("akarin-settings")); // Akarin - Server Config
|
||||
|
||||
this.setSpawnAnimals(dedicatedserverproperties.spawnAnimals);
|
||||
this.setSpawnNPCs(dedicatedserverproperties.spawnNpcs);
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
-
|
||||
+ Config.init((java.io.File) options.valueOf("akarin-settings")); // Akarin - Server Config
|
||||
+
|
||||
this.setPVP(dedicatedserverproperties.pvp);
|
||||
this.setAllowFlight(dedicatedserverproperties.allowFlight);
|
||||
this.setResourcePack(dedicatedserverproperties.resourcePack, this.ba());
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 6ae9ec627e0cf2b3b464a8d86e08a6deba713675..655e0b5e52e22a1ac1ff3718ad5ab3ab61ef7e41 100644
|
||||
index 970c1be5477a01ab9c6d79e84c519e22775564ff..4020533364aa6a2075b700a3f98385b55146ace3 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -89,6 +89,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -18,6 +18,8 @@ import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
import javax.annotation.Nullable;
|
||||
+
|
||||
+import io.akarin.server.Config;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -95,6 +97,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
public final ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
|
||||
public final com.tuinity.tuinity.config.TuinityConfig.WorldConfig tuinityConfig; // Tuinity - Server Config
|
||||
+ public final io.akarin.server.Config.WorldConfig akarinConfig; // Akarin - Server Config
|
||||
+ public final Config.WorldConfig akarinConfig; // Akarin - Server Config
|
||||
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
public static BlockPosition lastPhysicsProblem; // Spigot
|
||||
@@ -140,6 +141,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper
|
||||
this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
|
||||
this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(worlddata.getName()); // Tuinity - Server Config
|
||||
+ this.akarinConfig = new io.akarin.server.Config.WorldConfig(worlddata.getName()); // Akarin - Server Config
|
||||
@@ -187,6 +190,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper
|
||||
this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
|
||||
this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config
|
||||
+ this.akarinConfig = new Config.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Akarin - Server Config
|
||||
this.generator = gen;
|
||||
if (dimensionmanager.world == null) dimensionmanager.world = (WorldServer) this; // Paper
|
||||
this.world = new CraftWorld((WorldServer) this, gen, env);
|
||||
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 760752eaeb07af551cd3cfd36be064c048a05d5b..8863a778a8c34513bc02e42376ebce295d515393 100644
|
||||
index f994e99ebc8fe22e6f6b45f6379ec410a598789f..edaf09bb3fbcc1752f16e893a761cec1497acca2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -816,6 +816,7 @@ public final class CraftServer implements Server {
|
||||
@@ -865,6 +865,7 @@ public final class CraftServer implements Server {
|
||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||
com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((File) console.options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
+ io.akarin.server.Config.init((File) console.options.valueOf("akarin-settings")); // Akarin - Server Config
|
||||
for (WorldServer world : console.getWorlds()) {
|
||||
world.worldData.setDifficulty(config.difficulty);
|
||||
world.worldDataServer.setDifficulty(config.difficulty);
|
||||
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
|
||||
@@ -845,6 +846,7 @@ public final class CraftServer implements Server {
|
||||
@@ -900,6 +901,7 @@ public final class CraftServer implements Server {
|
||||
world.spigotConfig.init(); // Spigot
|
||||
world.paperConfig.init(); // Paper
|
||||
world.tuinityConfig.init(); // Tuinity - Server Config
|
||||
@@ -258,7 +278,7 @@ index 760752eaeb07af551cd3cfd36be064c048a05d5b..8863a778a8c34513bc02e42376ebce29
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -2147,6 +2149,14 @@ public final class CraftServer implements Server {
|
||||
@@ -2357,6 +2359,14 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
// Tuinity end - add config to timings report
|
||||
|
||||
@@ -274,7 +294,7 @@ index 760752eaeb07af551cd3cfd36be064c048a05d5b..8863a778a8c34513bc02e42376ebce29
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index cce21aaf3ba8c5049334e17b238aaf44d64db5fe..6464c181bbe35c4621b3b7eac6da47dc50de4e87 100644
|
||||
index 0f6cb508a170360b6479f9c34048412453fbb89d..86a7d9c33fc156d689b8966dd3f02d6ce015fc58 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -146,6 +146,14 @@ public class Main {
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Akarin brand changes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3c9392077ca0deed8ee4ffa12fa9c615786d1aca..e71e00b087f9e20ab5d3758b2ea901636ebb7fec 100644
|
||||
index 7ac34a8959a797bf2af96f3f402fa65cffe3d666..48809d971d626d6a9cbfcfe9ea868c084dd55677 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1630,7 +1630,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1520,7 +1520,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
@@ -19,10 +19,10 @@ index 3c9392077ca0deed8ee4ffa12fa9c615786d1aca..e71e00b087f9e20ab5d3758b2ea90163
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 8863a778a8c34513bc02e42376ebce295d515393..7f952a860c524aafea7094048a102478d8c2beec 100644
|
||||
index edaf09bb3fbcc1752f16e893a761cec1497acca2..49fb2625774f63fddf599423e8937fdc79b5b13a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -205,7 +205,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -232,7 +232,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
@@ -6,14 +6,14 @@ Subject: [PATCH] Akarin Metrics
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 24641501aeae0f2c2c5ce877775c7b971fb051bf..246696a0862c9a57329a7ea6a9eb7da00adb60b0 100644
|
||||
index 52c0ab1ce46e1f3233ef746d9bc699356fa9fae4..0bc9847c8a7ad894f82ed2f00aa18b62efffaecf 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -581,7 +581,7 @@ public class Metrics {
|
||||
@@ -593,7 +593,7 @@ public class Metrics {
|
||||
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
|
||||
// Only start Metrics, if it's enabled in the config
|
||||
if (config.getBoolean("enabled", true)) {
|
||||
- Metrics metrics = new Metrics("Paper", serverUUID, logFailedRequests, Bukkit.getLogger());
|
||||
- Metrics metrics = new Metrics("Tuinity", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page
|
||||
+ Metrics metrics = new Metrics("Torch", serverUUID, logFailedRequests, Bukkit.getLogger()); // Akarin
|
||||
|
||||
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable the Snooper
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index e71e00b087f9e20ab5d3758b2ea901636ebb7fec..2cb12e02e836f34ed80e93d4426bd994146e26c8 100644
|
||||
index 48809d971d626d6a9cbfcfe9ea868c084dd55677..22516d0244044660fb9af8d70898687cb42d91f9 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1275,6 +1275,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1314,6 +1314,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
//} // Paper
|
||||
|
||||
this.methodProfiler.enter("snooper");
|
||||
@@ -17,7 +17,7 @@ index e71e00b087f9e20ab5d3758b2ea901636ebb7fec..2cb12e02e836f34ed80e93d4426bd994
|
||||
if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && !this.snooper.d() && this.ticks > 100) { // Spigot
|
||||
this.snooper.a();
|
||||
}
|
||||
@@ -1282,6 +1284,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1321,6 +1323,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && this.ticks % 6000 == 0) { // Spigot
|
||||
this.snooper.b();
|
||||
}
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Avoid double I/O operation on load player file
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
||||
index 350ac42d6b45a1023f6254de7706818775b7957b..65cc7b2052fcb6f349dad9177ba975d75d720462 100644
|
||||
index b5cf60495b85c6ae6c32ee8a1c65d80e59fdce3d..1f77b251d7e7b0f023793cbf0876fc067caa75c1 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
||||
@@ -165,7 +165,8 @@ public class WorldNBTStorage implements IPlayerFileData {
|
||||
@@ -49,7 +49,8 @@ public class WorldNBTStorage {
|
||||
File file = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat");
|
||||
// Spigot Start
|
||||
boolean usingWrongFile = false;
|
||||
@@ -17,14 +17,14 @@ index 350ac42d6b45a1023f6254de7706818775b7957b..65cc7b2052fcb6f349dad9177ba975d7
|
||||
+ boolean normalFile = file.exists() && file.isFile(); // Akarin - ensures normal file
|
||||
+ if ( org.bukkit.Bukkit.getOnlineMode() && !normalFile ) // Paper - Check online mode first // Akarin - ensures normal file
|
||||
{
|
||||
file = new File( this.playerDir, UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + entityhuman.getName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
|
||||
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + entityhuman.getName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
|
||||
if ( file.exists() )
|
||||
@@ -176,7 +177,7 @@ public class WorldNBTStorage implements IPlayerFileData {
|
||||
@@ -60,7 +61,7 @@ public class WorldNBTStorage {
|
||||
}
|
||||
// Spigot End
|
||||
|
||||
- if (file.exists() && file.isFile()) {
|
||||
+ if (normalFile) { // Akarin - avoid double I/O operation
|
||||
nbttagcompound = NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file)));
|
||||
nbttagcompound = NBTCompressedStreamTools.a(file);
|
||||
}
|
||||
// Spigot Start
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Don't trigger Lootable Refresh for non player interaction
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java
|
||||
index 3b394c2726e0fbe595641a022e59c8967d525f82..aa5300b0fae4728c15c431147ad28b39968fb160 100644
|
||||
index c6df2318762dc6542e73f18ed9a3172ee31d96ee..f276080edd1f425467f5c6ce10231402d9f88001 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityLootable.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityLootable.java
|
||||
@@ -49,6 +49,7 @@ public abstract class TileEntityLootable extends TileEntityContainer {
|
||||
@@ -50,6 +50,7 @@ public abstract class TileEntityLootable extends TileEntityContainer {
|
||||
}
|
||||
|
||||
public void d(@Nullable EntityHuman entityhuman) {
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Never drop items on command "/give"
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/CommandGive.java b/src/main/java/net/minecraft/server/CommandGive.java
|
||||
index 81b26bb4d094f8aede9d5432671936ab3ee42c84..1f3097c9450b5903c35d3b36fd642ddd131786d7 100644
|
||||
index 1d22c45af884a917e77e02c272fcbae74794200c..7c55c48610c5629c2cfd2ca537c4de82cd3c8137 100644
|
||||
--- a/src/main/java/net/minecraft/server/CommandGive.java
|
||||
+++ b/src/main/java/net/minecraft/server/CommandGive.java
|
||||
@@ -36,6 +36,7 @@ public class CommandGive {
|
||||
@@ -35,6 +35,7 @@ public class CommandGive {
|
||||
boolean flag = entityplayer.inventory.pickup(itemstack);
|
||||
EntityItem entityitem;
|
||||
|
||||
@@ -6,29 +6,40 @@ Subject: [PATCH] Save Json list asynchronously
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
|
||||
index c97be42dd7b4c6ea2cadcc97f47185c7f02e2cce..370841cad06121651d0c981c23f3a5e268dc3f59 100644
|
||||
index 8da5f976109accc84b26ec4045776aa8a9799f3d..8d00a54ed22dd974dadc7159c7c3d7265ec42649 100644
|
||||
--- a/src/main/java/net/minecraft/server/JsonList.java
|
||||
+++ b/src/main/java/net/minecraft/server/JsonList.java
|
||||
@@ -168,6 +168,7 @@ public class JsonList<K, V extends JsonListEntry<K>> {
|
||||
@@ -146,6 +146,7 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
}
|
||||
|
||||
public void save() throws IOException {
|
||||
+ Runnable runnable = () -> { // Akarin - Save json list async
|
||||
this.removeStaleEntries(); // Paper - remove expired values before saving
|
||||
Collection<V> collection = this.d.values();
|
||||
String s = this.b.toJson(collection);
|
||||
@@ -176,10 +177,13 @@ public class JsonList<K, V extends JsonListEntry<K>> {
|
||||
JsonArray jsonarray = new JsonArray();
|
||||
|
||||
@@ -155,11 +156,13 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
jsonlistentry.getClass();
|
||||
return (JsonObject) SystemUtils.a(jsonobject, jsonlistentry::a); // CraftBukkit - decompile error
|
||||
}).forEach(jsonarray::add);
|
||||
+ try {
|
||||
BufferedWriter bufferedwriter = Files.newWriter(this.c, StandardCharsets.UTF_8);
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
bufferedwriter = Files.newWriter(this.c, StandardCharsets.UTF_8);
|
||||
bufferedwriter.write(s);
|
||||
JsonList.b.toJson(jsonarray, bufferedwriter);
|
||||
+
|
||||
} catch (Throwable throwable1) {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
@@ -177,6 +180,11 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||||
}
|
||||
|
||||
}
|
||||
+ } catch (IOException e) { // Akarin - Save json list async
|
||||
+ JsonList.LOGGER.warn("Failed to save " + this.c, e); // Akarin - Save json list async
|
||||
} finally {
|
||||
IOUtils.closeQuietly(bufferedwriter);
|
||||
}
|
||||
-
|
||||
+ }
|
||||
+ }; // Akarin - Save json list async
|
||||
+ MCUtil.scheduleAsyncTask(runnable); // Akarin - Save json list async
|
||||
|
||||
}
|
||||
|
||||
public void load() throws FileNotFoundException {
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Swaps the predicate order of collision
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 5c9d5682100a627f1e494449bc0cdb884d136494..f5b8ada739afc9f8c0246e98947fe188b1231438 100644
|
||||
index 2ec48858be8eb2c522c9685b43bd36b3b581cf8b..da9761e2cf0b1d77758f023824768c2279ec5983 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1641,8 +1641,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -1618,8 +1618,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
public void pickup(EntityHuman entityhuman) {}
|
||||
|
||||
public void collide(Entity entity) {
|
||||
@@ -17,6 +17,6 @@ index 5c9d5682100a627f1e494449bc0cdb884d136494..f5b8ada739afc9f8c0246e98947fe188
|
||||
if (!this.isSameVehicle(entity)) {
|
||||
- if (!entity.noclip && !this.noclip) {
|
||||
+ if (true || !entity.noclip && !this.noclip) { // Akarin - Moved up
|
||||
if (this.world.paperConfig.onlyPlayersCollide && !(entity instanceof EntityPlayer || this instanceof EntityPlayer)) return; // Paper
|
||||
double d0 = entity.locX() - this.locX();
|
||||
double d1 = entity.locZ() - this.locZ();
|
||||
double d2 = MathHelper.a(d0, d1);
|
||||
@@ -0,0 +1,89 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sotr <i@omc.hk>
|
||||
Date: Wed, 15 Apr 2020 04:16:44 +0700
|
||||
Subject: [PATCH] Remove stream for ender teleport
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/akarin/server/IndexedBlockPosition.java b/src/main/java/io/akarin/server/IndexedBlockPosition.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..83bf1d4cab653a9edcc8352609433a8fd12bd1b3
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/akarin/server/IndexedBlockPosition.java
|
||||
@@ -0,0 +1,35 @@
|
||||
+package io.akarin.server;
|
||||
+
|
||||
+import net.minecraft.server.BlockPosition;
|
||||
+
|
||||
+public class IndexedBlockPosition {
|
||||
+ private final int index;
|
||||
+ private final BlockPosition position;
|
||||
+
|
||||
+ public IndexedBlockPosition(int index, BlockPosition position) {
|
||||
+ this.index = index;
|
||||
+ this.position = position;
|
||||
+ }
|
||||
+
|
||||
+ public static IndexedBlockPosition of(int index, BlockPosition position) {
|
||||
+ return new IndexedBlockPosition(index, position);
|
||||
+ }
|
||||
+
|
||||
+ public int index() {
|
||||
+ return index;
|
||||
+ }
|
||||
+
|
||||
+ public BlockPosition get() {
|
||||
+ return position;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int hashCode() {
|
||||
+ return position.hashCode();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean equals(Object obj) {
|
||||
+ return position.equals(obj);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/BehaviorInteractDoor.java b/src/main/java/net/minecraft/server/BehaviorInteractDoor.java
|
||||
index 685351f11497a33ef4ba99055fa7da3a8de18af2..979c75e5b91a9e4f3f85664a60cc0aa82314a136 100644
|
||||
--- a/src/main/java/net/minecraft/server/BehaviorInteractDoor.java
|
||||
+++ b/src/main/java/net/minecraft/server/BehaviorInteractDoor.java
|
||||
@@ -1,7 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
+import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
+import io.akarin.server.IndexedBlockPosition;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index da9761e2cf0b1d77758f023824768c2279ec5983..94b44a44ca71c43215953d4ac8ca49733959246b 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -3095,7 +3095,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
WorldServer worldserver = (WorldServer) this.world;
|
||||
|
||||
this.setPositionRotation(d0, d1, d2, this.yaw, this.pitch);
|
||||
- this.recursiveStream().forEach((entity) -> {
|
||||
+ this.collectPassengers().forEach((entity) -> {
|
||||
worldserver.chunkCheck(entity);
|
||||
entity.az = true;
|
||||
Iterator iterator = new java.util.ArrayList<>(entity.passengers).iterator(); // Tuinity - copy list to guard against CME
|
||||
@@ -3342,6 +3342,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
public Stream<Entity> recursiveStream() {
|
||||
return Stream.concat(Stream.of(this), com.google.common.collect.ImmutableList.copyOf(this.passengers).stream().flatMap(Entity::recursiveStream)); // Paper
|
||||
}
|
||||
+ // Akarin start - non-stream version
|
||||
+ public List<Entity> collectPassengers() {
|
||||
+ List<Entity> result = Lists.newArrayList(this);
|
||||
+ for (Entity passenger : this.passengers)
|
||||
+ result.addAll(passenger.collectPassengers());
|
||||
+ return result;
|
||||
+ }
|
||||
+ // Akarin end
|
||||
|
||||
public boolean hasSinglePlayerPassenger() {
|
||||
Set<Entity> set = Sets.newHashSet();
|
||||
@@ -0,0 +1,118 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sotr <i@omc.hk>
|
||||
Date: Wed, 15 Apr 2020 04:28:25 +0700
|
||||
Subject: [PATCH] Cache hashcode for BlockPosition
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
|
||||
index e811295b4d6afcd920f60e0ce5440e43300d9085..5b39fca67855e9d7b266ef496330c2d16c1caced 100644
|
||||
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
|
||||
@@ -2,8 +2,9 @@ package net.minecraft.server;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.mojang.serialization.Codec;
|
||||
-import java.util.stream.IntStream;
|
||||
+
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
+import java.util.stream.IntStream;
|
||||
|
||||
@Immutable
|
||||
public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
|
||||
@@ -28,6 +29,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
|
||||
return b < 0 || b >= 256;
|
||||
}
|
||||
// Paper end
|
||||
+ protected int hash; // Akarin - cache hashcode
|
||||
|
||||
public BaseBlockPosition(int i, int j, int k) {
|
||||
this.a = i;
|
||||
@@ -52,8 +54,20 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
|
||||
}
|
||||
|
||||
public final int hashCode() { // Paper
|
||||
- return (this.getY() + this.getZ() * 31) * 31 + this.getX();
|
||||
+ // Akarin start - cache hashcode
|
||||
+ int result = hash; // Make the situation not too bad when it is modified by multiple threads
|
||||
+ if (result == 0) {
|
||||
+ result = (this.getY() + this.getZ() * 31) * 31 + this.getX(); // Paper
|
||||
+ hash = result;
|
||||
+ }
|
||||
+ return result;
|
||||
+ // return (this.getY() + this.getZ() * 31) * 31 + this.getX();
|
||||
+ }
|
||||
+
|
||||
+ public final void recalcHashCode() {
|
||||
+ hash = 0;
|
||||
}
|
||||
+ // Akarin end
|
||||
|
||||
public int compareTo(BaseBlockPosition baseblockposition) {
|
||||
return this.getY() == baseblockposition.getY() ? (this.getZ() == baseblockposition.getZ() ? this.getX() - baseblockposition.getX() : this.getZ() - baseblockposition.getZ()) : this.getY() - baseblockposition.getY();
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
index 2291135eaef64c403183724cb6e413cd7e472672..c1bd8e558963169d0adc3c0a7d6cfec19e1d1c98 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
@@ -453,6 +453,7 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
((BaseBlockPosition)this).a = i; // Tuinity - force inline
|
||||
((BaseBlockPosition)this).b = j; // Tuinity - force inline
|
||||
((BaseBlockPosition)this).e = k; // Tuinity - force inline
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -466,6 +467,7 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
((BaseBlockPosition)this).a = baseblockposition.a; // Tuinity - force inline
|
||||
((BaseBlockPosition)this).b = baseblockposition.b; // Tuinity - force inline
|
||||
((BaseBlockPosition)this).e = baseblockposition.e; // Tuinity - force inline
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -473,6 +475,7 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
((BaseBlockPosition)this).a = (int)(i >> 38); // Tuinity - force inline
|
||||
((BaseBlockPosition)this).b = (int)((i << 52) >> 52); // Tuinity - force inline
|
||||
((BaseBlockPosition)this).e = (int)((i << 26) >> 38); // Tuinity - force inline
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -492,6 +495,7 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
((BaseBlockPosition)this).a += enumdirection.getAdjacentX(); // Tuinity - force inline
|
||||
((BaseBlockPosition)this).b += enumdirection.getAdjacentY(); // Tuinity - force inline
|
||||
((BaseBlockPosition)this).e += enumdirection.getAdjacentZ(); // Tuinity - force inline
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -524,24 +528,30 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
// only expose set on the mutable blockpos
|
||||
public final void setX(int value) {
|
||||
((BaseBlockPosition)this).a = value;
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
}
|
||||
public final void setY(int value) {
|
||||
((BaseBlockPosition)this).b = value;
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
}
|
||||
public final void setZ(int value) {
|
||||
((BaseBlockPosition)this).e = value;
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
}
|
||||
|
||||
public final void o(int i) {
|
||||
((BaseBlockPosition)this).a = i; // need cast thanks to name conflict
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
}
|
||||
|
||||
public final void p(int i) {
|
||||
((BaseBlockPosition)this).b = i;
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
}
|
||||
|
||||
public final void q(int i) {
|
||||
((BaseBlockPosition)this).e = i;
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
}
|
||||
// Tuinity end
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Remove a few more streams
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
||||
index e0378f486c5d191d55114701d4d519e0d0af5726..e70f4928f81a06d3c15862fc7bdc43dc5fba928e 100644
|
||||
index 7f3887b0894aca0f972922f434382646a6ad6174..4f74922bf0b364bf1ab84460f2a01302a1ea596c 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
||||
@@ -188,9 +188,15 @@ public abstract class ChunkMapDistance {
|
||||
@@ -192,9 +192,15 @@ public abstract class ChunkMapDistance {
|
||||
while (longiterator.hasNext()) {
|
||||
long j = longiterator.nextLong();
|
||||
|
||||
@@ -24,7 +24,7 @@ index e0378f486c5d191d55114701d4d519e0d0af5726..e70f4928f81a06d3c15862fc7bdc43dc
|
||||
PlayerChunk playerchunk = playerchunkmap.getUpdatingChunk(j);
|
||||
|
||||
if (playerchunk == null) {
|
||||
@@ -206,6 +212,22 @@ public abstract class ChunkMapDistance {
|
||||
@@ -210,6 +216,22 @@ public abstract class ChunkMapDistance {
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -48,10 +48,10 @@ index e0378f486c5d191d55114701d4d519e0d0af5726..e70f4928f81a06d3c15862fc7bdc43dc
|
||||
|
||||
this.l.clear();
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
index 9c31edade247baac6811ef3ec98e88a332bcffba..eb3f45d8b707002ebeca20a6857ed41473cdeb3e 100644
|
||||
index 6e77dc89f5441f0f483571fee9aa9f34b6d1dd1c..33097f23326a033bc82a64315e296c8990b28b7f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
@@ -92,12 +92,23 @@ public class EntityTNTPrimed extends Entity {
|
||||
@@ -93,12 +93,23 @@ public class EntityTNTPrimed extends Entity {
|
||||
PacketPlayOutEntityVelocity velocityPacket = new PacketPlayOutEntityVelocity(this);
|
||||
PacketPlayOutEntityTeleport positionPacket = new PacketPlayOutEntityTeleport(this);
|
||||
|
||||
@@ -76,10 +76,10 @@ index 9c31edade247baac6811ef3ec98e88a332bcffba..eb3f45d8b707002ebeca20a6857ed414
|
||||
}
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
index b5ee8da43ccb7630c8b333824d7ca24788b45322..a904434211ac6c4645b996294e5018945d266a1f 100644
|
||||
index bf9732058c7e55e8f1ed38b3b5e8831e6b21706c..ab6dcc3a19f4a1de86fe36802c13fc484cbb2e88 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
@@ -562,11 +562,20 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@@ -589,11 +589,20 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
if (optional.isPresent()) {
|
||||
WorldServer worldserver = (WorldServer) this.world;
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Modify default configs
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index 8444819f071b13e98ba07032520016a664b7b9bc..a349f56548ece94ec591933e13f77ed3b9f20fb7 100644
|
||||
index c56e7fb18f9a56c8025eb70a524f028b5942da37..4163fcf06f0c4bb448dd186d0756e02e96b66a8e 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -202,7 +202,7 @@ public class PaperConfig {
|
||||
@@ -201,7 +201,7 @@ public class PaperConfig {
|
||||
|
||||
public static String timingsServerName;
|
||||
private static void timings() {
|
||||
@@ -17,4 +17,4 @@ index 8444819f071b13e98ba07032520016a664b7b9bc..a349f56548ece94ec591933e13f77ed3
|
||||
+ boolean timings = getBoolean("timings.enabled", false); // Akarin don't profile by default
|
||||
boolean verboseTimings = getBoolean("timings.verbose", true);
|
||||
TimingsManager.privacy = getBoolean("timings.server-name-privacy", false);
|
||||
TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses"));
|
||||
TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses", "settings.velocity-support.secret"));
|
||||
42
patches-1.16.5/server/0016-Update-Log4j.patch
Normal file
42
patches-1.16.5/server/0016-Update-Log4j.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Yiyu Si <1486864380@qq.com>
|
||||
Date: Thu, 17 Mar 2022 22:49:37 +0800
|
||||
Subject: [PATCH] Update Log4j
|
||||
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index a65381073fc6d4546280e36bb18a0b2dd54cfa93..570b3ddd0f5eaa3157227c2ec511ab6ff2354a22 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -71,19 +71,19 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
- <version>2.8.1</version>
|
||||
+ <version>2.17.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-slf4j-impl</artifactId>
|
||||
- <version>2.8.1</version>
|
||||
+ <version>2.17.1</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-iostreams</artifactId>
|
||||
- <version>2.8.1</version>
|
||||
+ <version>2.17.1</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<!-- included in minecraft-server -->
|
||||
@@ -277,7 +277,7 @@
|
||||
<exclude>META-INF/MANIFEST.MF</exclude>
|
||||
<exclude>com.mojang.authlib.yggdrasil.YggdrasilGameProfileRepository</exclude>
|
||||
<exclude>com.mojang.datafixers.util.Either</exclude>
|
||||
- <exclude>org.apache.logging.log4j/**</exclude>
|
||||
+ <exclude>org/apache/logging/log4j/**</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
@@ -1,87 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=E3=84=97=E3=84=A0=CB=8B=20=E3=84=91=E3=84=A7=CB=8A?=
|
||||
<tsao-chi@the-lingo.org>
|
||||
Date: Fri, 19 Jun 2020 19:55:56 +0800
|
||||
Subject: [PATCH] Remove Streams using IntelliJ IDEA
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
index bf3e059fe06aae361b2ded451914ed19b5e970c5..8c49d67e2656dcac0758c0908897736b49435bf8 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
@@ -58,7 +58,9 @@ public class TimingsReportListener implements MessageCommandSender {
|
||||
|
||||
@Override
|
||||
public void sendMessage(@NotNull String message) {
|
||||
- senders.forEach((sender) -> sender.sendMessage(message));
|
||||
+ for (CommandSender sender : senders) {
|
||||
+ sender.sendMessage(message);
|
||||
+ }
|
||||
}
|
||||
|
||||
public void addConsoleIfNeeded() {
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
|
||||
index c91ea2a0679a7f3a5627b5a008e0b39df3332889..53c36e30e8f500c9bf58e6b12585d44cc5c9e9e2 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
|
||||
@@ -14,7 +14,9 @@ import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
+import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -115,7 +117,16 @@ public class MaterialSetTag implements Tag<Material> {
|
||||
}
|
||||
@NotNull
|
||||
public MaterialSetTag add(@NotNull Predicate<Material> filter) {
|
||||
- add(Stream.of(Material.values()).filter(((Predicate<Material>) Material::isLegacy).negate()).filter(filter).collect(Collectors.toList()));
|
||||
+ List<Material> list = new ArrayList<>();
|
||||
+ Predicate<Material> predicate = ((Predicate<Material>) Material::isLegacy).negate();
|
||||
+ for (Material material : Material.values()) {
|
||||
+ if (predicate.test(material)) {
|
||||
+ if (filter.test(material)) {
|
||||
+ list.add(material);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ add(list);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -139,7 +150,16 @@ public class MaterialSetTag implements Tag<Material> {
|
||||
|
||||
@NotNull
|
||||
public MaterialSetTag not(@NotNull Predicate<Material> filter) {
|
||||
- not(Stream.of(Material.values()).filter(((Predicate<Material>) Material::isLegacy).negate()).filter(filter).collect(Collectors.toList()));
|
||||
+ List<Material> list = new ArrayList<>();
|
||||
+ Predicate<Material> predicate = ((Predicate<Material>) Material::isLegacy).negate();
|
||||
+ for (Material material : Material.values()) {
|
||||
+ if (predicate.test(material)) {
|
||||
+ if (filter.test(material)) {
|
||||
+ list.add(material);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ not(list);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -181,7 +201,13 @@ public class MaterialSetTag implements Tag<Material> {
|
||||
|
||||
@NotNull
|
||||
public MaterialSetTag ensureSize(@NotNull String label, int size) {
|
||||
- long actual = this.materials.stream().filter(((Predicate<Material>) Material::isLegacy).negate()).count();
|
||||
+ long actual = 0L;
|
||||
+ Predicate<Material> predicate = ((Predicate<Material>) Material::isLegacy).negate();
|
||||
+ for (Material material : this.materials) {
|
||||
+ if (predicate.test(material)) {
|
||||
+ actual++;
|
||||
+ }
|
||||
+ }
|
||||
if (size != actual) {
|
||||
throw new IllegalStateException(label + " - Expected " + size + " materials, got " + actual);
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sotr <i@omc.hk>
|
||||
Date: Wed, 15 Apr 2020 03:51:50 +0700
|
||||
Subject: [PATCH] Optimize door interact with pathfinding
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/akarin/server/IndexedBlockPosition.java b/src/main/java/io/akarin/server/IndexedBlockPosition.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..83bf1d4cab653a9edcc8352609433a8fd12bd1b3
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/akarin/server/IndexedBlockPosition.java
|
||||
@@ -0,0 +1,35 @@
|
||||
+package io.akarin.server;
|
||||
+
|
||||
+import net.minecraft.server.BlockPosition;
|
||||
+
|
||||
+public class IndexedBlockPosition {
|
||||
+ private final int index;
|
||||
+ private final BlockPosition position;
|
||||
+
|
||||
+ public IndexedBlockPosition(int index, BlockPosition position) {
|
||||
+ this.index = index;
|
||||
+ this.position = position;
|
||||
+ }
|
||||
+
|
||||
+ public static IndexedBlockPosition of(int index, BlockPosition position) {
|
||||
+ return new IndexedBlockPosition(index, position);
|
||||
+ }
|
||||
+
|
||||
+ public int index() {
|
||||
+ return index;
|
||||
+ }
|
||||
+
|
||||
+ public BlockPosition get() {
|
||||
+ return position;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int hashCode() {
|
||||
+ return position.hashCode();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean equals(Object obj) {
|
||||
+ return position.equals(obj);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/BehaviorInteractDoor.java b/src/main/java/net/minecraft/server/BehaviorInteractDoor.java
|
||||
index 01d9c2d92c580c9fabbb8bb4e8c93f3cc511ccf9..3db22c5f4df6fe68474839c3889ffbe5440f54dc 100644
|
||||
--- a/src/main/java/net/minecraft/server/BehaviorInteractDoor.java
|
||||
+++ b/src/main/java/net/minecraft/server/BehaviorInteractDoor.java
|
||||
@@ -1,7 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
+import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
+import io.akarin.server.IndexedBlockPosition;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -19,32 +21,63 @@ public class BehaviorInteractDoor extends Behavior<EntityLiving> {
|
||||
BehaviorController<?> behaviorcontroller = entityliving.getBehaviorController();
|
||||
PathEntity pathentity = (PathEntity) behaviorcontroller.getMemory(MemoryModuleType.PATH).get();
|
||||
List<GlobalPos> list = (List) behaviorcontroller.getMemory(MemoryModuleType.INTERACTABLE_DOORS).get();
|
||||
+ // Akarin start - remove stream
|
||||
+ /*
|
||||
List<BlockPosition> list1 = (List) pathentity.d().stream().map((pathpoint) -> {
|
||||
return new BlockPosition(pathpoint.a, pathpoint.b, pathpoint.c);
|
||||
}).collect(Collectors.toList());
|
||||
- Set<BlockPosition> set = this.a(worldserver, list, list1);
|
||||
+ */
|
||||
+
|
||||
+ List<PathPoint> points = pathentity.getPoints();
|
||||
+ java.util.Map<BlockPosition, Integer> list1 = new java.util.HashMap<BlockPosition, Integer>(points.size());
|
||||
+ for (int index = 0; index < points.size(); index++) {
|
||||
+ PathPoint point = points.get(index);
|
||||
+ list1.put(new BlockPosition(point.a, point.b, point.c), index);
|
||||
+ }
|
||||
+
|
||||
+ // Akarin end
|
||||
+ Set<io.akarin.server.IndexedBlockPosition> set = this.a(worldserver, list, list1); // Akarin - IndexedBlockPosition
|
||||
int j = pathentity.f() - 1;
|
||||
|
||||
this.a(worldserver, list1, set, j, entityliving, behaviorcontroller);
|
||||
}
|
||||
|
||||
- private Set<BlockPosition> a(WorldServer worldserver, List<GlobalPos> list, List<BlockPosition> list1) {
|
||||
+ private Set<io.akarin.server.IndexedBlockPosition> a(WorldServer worldserver, List<GlobalPos> list, java.util.Map<BlockPosition, Integer> list1) { // Akarin - List -> Map, IndexedBlockPosition
|
||||
+ // Akarin start - remove stream
|
||||
+ /*
|
||||
Stream stream = list.stream().filter((globalpos) -> {
|
||||
return globalpos.getDimensionManager() == worldserver.getWorldProvider().getDimensionManager();
|
||||
}).map(GlobalPos::getBlockPosition);
|
||||
|
||||
list1.getClass();
|
||||
return (Set) stream.filter(list1::contains).collect(Collectors.toSet());
|
||||
+ */
|
||||
+
|
||||
+ Set<io.akarin.server.IndexedBlockPosition> set = Sets.newHashSet();
|
||||
+ DimensionManager manager = worldserver.getWorldProvider().getDimensionManager();
|
||||
+
|
||||
+ for (GlobalPos globalPos : list) {
|
||||
+ if (globalPos.getDimensionManager() == manager) {
|
||||
+ BlockPosition position = globalPos.getBlockPosition();
|
||||
+ Integer index = list1.get(position);
|
||||
+ if (index != null) // contains
|
||||
+ set.add(IndexedBlockPosition.of(index, position));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return set;
|
||||
+ // Akarin end
|
||||
}
|
||||
|
||||
- private void a(WorldServer worldserver, List<BlockPosition> list, Set<BlockPosition> set, int i, EntityLiving entityliving, BehaviorController<?> behaviorcontroller) {
|
||||
- set.forEach((blockposition) -> {
|
||||
- int j = list.indexOf(blockposition);
|
||||
+ private void a(WorldServer worldserver, java.util.Map<BlockPosition, Integer> list, Set<io.akarin.server.IndexedBlockPosition> set, int i, EntityLiving entityliving, BehaviorController<?> behaviorcontroller) { // Akarin - List -> Map, IndexedBlockPosition
|
||||
+ set.forEach((indexedblockposition) -> { // Akarin - IndexedBlockPosition
|
||||
+ BlockPosition blockposition = indexedblockposition.get(); // Akarin - IndexedBlockPosition
|
||||
+ // int j = list.indexOf(blockposition); // Akarin - IndexedBlockPosition
|
||||
IBlockData iblockdata = worldserver.getType(blockposition);
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
if (TagsBlock.WOODEN_DOORS.isTagged(block) && block instanceof BlockDoor) {
|
||||
- boolean flag = j >= i;
|
||||
+ boolean flag = indexedblockposition.index() >= i; // Akarin - IndexedBlockPosition
|
||||
|
||||
// CraftBukkit start - entities opening doors
|
||||
org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entityliving.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(entityliving.world, blockposition));
|
||||
@@ -74,14 +107,14 @@ public class BehaviorInteractDoor extends Behavior<EntityLiving> {
|
||||
a(worldserver, list, i, entityliving, behaviorcontroller);
|
||||
}
|
||||
|
||||
- public static void a(WorldServer worldserver, List<BlockPosition> list, int i, EntityLiving entityliving, BehaviorController<?> behaviorcontroller) {
|
||||
+ public static void a(WorldServer worldserver, java.util.Map<BlockPosition, Integer> list, int i, EntityLiving entityliving, BehaviorController<?> behaviorcontroller) { // Akarin - List -> Map
|
||||
behaviorcontroller.getMemory(MemoryModuleType.OPENED_DOORS).ifPresent((set) -> {
|
||||
Iterator iterator = set.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
GlobalPos globalpos = (GlobalPos) iterator.next();
|
||||
BlockPosition blockposition = globalpos.getBlockPosition();
|
||||
- int j = list.indexOf(blockposition);
|
||||
+ int j = list.getOrDefault(blockposition, -1); // Akarin - List -> Map
|
||||
|
||||
if (worldserver.getWorldProvider().getDimensionManager() != globalpos.getDimensionManager()) {
|
||||
iterator.remove();
|
||||
diff --git a/src/main/java/net/minecraft/server/BehaviorSleep.java b/src/main/java/net/minecraft/server/BehaviorSleep.java
|
||||
index dfe0f66500ab2ea733fd5ef84d7d80f32e2dfaab..46eb633084a2eb48cb0a42c5df2b69b9e93b22e1 100644
|
||||
--- a/src/main/java/net/minecraft/server/BehaviorSleep.java
|
||||
+++ b/src/main/java/net/minecraft/server/BehaviorSleep.java
|
||||
@@ -57,7 +57,7 @@ public class BehaviorSleep extends Behavior<EntityLiving> {
|
||||
protected void a(WorldServer worldserver, EntityLiving entityliving, long i) {
|
||||
if (i > this.a) {
|
||||
entityliving.getBehaviorController().getMemory(MemoryModuleType.OPENED_DOORS).ifPresent((set) -> {
|
||||
- BehaviorInteractDoor.a(worldserver, (List) ImmutableList.of(), 0, entityliving, entityliving.getBehaviorController());
|
||||
+ BehaviorInteractDoor.a(worldserver, com.google.common.collect.ImmutableMap.of(), 0, entityliving, entityliving.getBehaviorController()); // Akarin - List -> Map
|
||||
});
|
||||
entityliving.entitySleep(((GlobalPos) entityliving.getBehaviorController().getMemory(MemoryModuleType.HOME).get()).getBlockPosition());
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sotr <i@omc.hk>
|
||||
Date: Wed, 15 Apr 2020 04:16:44 +0700
|
||||
Subject: [PATCH] Remove stream for ender teleport
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index f5b8ada739afc9f8c0246e98947fe188b1231438..33b456d4348c503cc94557d623c537a8aed8f9ec 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -3092,7 +3092,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
WorldServer worldserver = (WorldServer) this.world;
|
||||
|
||||
this.setPositionRotation(d0, d1, d2, this.yaw, this.pitch);
|
||||
- this.cg().forEach((entity) -> {
|
||||
+ this.collectPassengers().forEach((entity) -> { // Akarin - remove stream
|
||||
worldserver.chunkCheck(entity);
|
||||
entity.aF = true;
|
||||
entity.a(Entity::teleportAndSync);
|
||||
@@ -3342,6 +3342,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
public Stream<Entity> cg() {
|
||||
return Stream.concat(Stream.of(this), this.passengers.stream().flatMap(Entity::cg));
|
||||
}
|
||||
+ // Akarin start - non-stream version
|
||||
+ public List<Entity> collectPassengers() {
|
||||
+ List<Entity> result = Lists.newArrayList(this);
|
||||
+ for (Entity passenger : this.passengers)
|
||||
+ result.addAll(passenger.collectPassengers());
|
||||
+ return result;
|
||||
+ }
|
||||
+ // Akarin end
|
||||
|
||||
public boolean hasSinglePlayerPassenger() {
|
||||
Set<Entity> set = Sets.newHashSet();
|
||||
@@ -1,72 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sotr <i@omc.hk>
|
||||
Date: Wed, 15 Apr 2020 04:28:25 +0700
|
||||
Subject: [PATCH] Cache hashcode for BlockPosition
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
|
||||
index a0450a7ddf21659c5636b3f298e6bf4f0a93fc4d..c4227ff056f906c6ea1fec0330d2db84409a6482 100644
|
||||
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
|
||||
@@ -19,6 +19,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
|
||||
return y < 0 || y >= 256;
|
||||
}
|
||||
// Paper end
|
||||
+ protected int hash; // Akarin - cache hashcode
|
||||
|
||||
public BaseBlockPosition(int i, int j, int k) {
|
||||
this.x = i;
|
||||
@@ -43,8 +44,20 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
|
||||
}
|
||||
|
||||
public final int hashCode() { // Paper
|
||||
- return (this.y + this.z * 31) * 31 + this.x; // Paper
|
||||
+ // Akarin start - cache hashcode
|
||||
+ int result = hash; // Make the situation not too bad when it is modified by multiple threads
|
||||
+ if (result == 0) {
|
||||
+ result = (this.y + this.z * 31) * 31 + this.x; // Paper
|
||||
+ hash = result;
|
||||
+ }
|
||||
+ return result;
|
||||
+ // return (this.getY() + this.getZ() * 31) * 31 + this.getX();
|
||||
+ }
|
||||
+
|
||||
+ public final void recalcHashCode() {
|
||||
+ hash = 0;
|
||||
}
|
||||
+ // Akarin end
|
||||
|
||||
public int compareTo(BaseBlockPosition baseblockposition) {
|
||||
return this.getY() == baseblockposition.getY() ? (this.getZ() == baseblockposition.getZ() ? this.getX() - baseblockposition.getX() : this.getZ() - baseblockposition.getZ()) : this.getY() - baseblockposition.getY();
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
index 7e69f9fb7a1865003c1d09a7ee05c17e1e5d4445..fccd966e627e3d706b4ed12fc101545ac4d13266 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
@@ -443,6 +443,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
this.y = j;
|
||||
this.z = k;
|
||||
// Paper end
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -483,16 +484,19 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
public final void setX(final int x) { this.o(x); } // Paper - OBFHELPER
|
||||
public void o(int i) {
|
||||
this.x = i; // Paper change to x
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
}
|
||||
|
||||
public final void setY(final int y) { this.p(y); } // Paper - OBFHELPER
|
||||
public void p(int i) {
|
||||
this.y = i; // Paper change to y
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
}
|
||||
|
||||
public final void setZ(final int z) { this.q(z); } // Paper - OBFHELPER
|
||||
public void q(int i) {
|
||||
this.z = i; // Paper change to z
|
||||
+ this.recalcHashCode(); // Akarin - cache hashcode
|
||||
}
|
||||
|
||||
@Override
|
||||
26
scripts/init.sh
Executable file
26
scripts/init.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Initialize Paper upstream for Akarin
|
||||
|
||||
(
|
||||
set -e
|
||||
PS1="$"
|
||||
|
||||
paperCommit=$(grep -oP 'paperCommit = \K[a-f0-9]+' gradle.properties)
|
||||
|
||||
if [ ! -d ".gradle/caches/paperweight/upstreams/paper" ]; then
|
||||
mkdir -p .gradle/caches/paperweight/upstreams/paper
|
||||
fi
|
||||
|
||||
cd .gradle/caches/paperweight/upstreams/paper
|
||||
|
||||
if [ ! -d ".git" ]; then
|
||||
git init
|
||||
git remote add origin https://github.com/PaperMC/Paper.git
|
||||
fi
|
||||
|
||||
git fetch origin $paperCommit
|
||||
git checkout -f $paperCommit
|
||||
|
||||
echo "Paper upstream initialized at commit $paperCommit"
|
||||
) || exit 1
|
||||
37
settings.gradle.kts
Normal file
37
settings.gradle.kts
Normal file
@@ -0,0 +1,37 @@
|
||||
import java.util.Locale
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
|
||||
}
|
||||
|
||||
rootProject.name = "akarin"
|
||||
for (name in listOf("akarin-api", "akarin-server", "paper-api")) {
|
||||
val projName = name.lowercase(Locale.ENGLISH)
|
||||
include(projName)
|
||||
findProject(":$projName")!!.projectDir = file(name)
|
||||
}
|
||||
|
||||
optionalInclude("test-plugin")
|
||||
|
||||
fun optionalInclude(name: String, op: (ProjectDescriptor.() -> Unit)? = null) {
|
||||
val settingsFile = file("$name.settings.gradle.kts")
|
||||
if (settingsFile.exists()) {
|
||||
apply(from = settingsFile)
|
||||
findProject(":$name")?.let { op?.invoke(it) }
|
||||
} else {
|
||||
settingsFile.writeText(
|
||||
"""
|
||||
// Uncomment to enable the '$name' project
|
||||
// include(":$name")
|
||||
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
}
|
||||
2
test-plugin.settings.gradle.kts
Normal file
2
test-plugin.settings.gradle.kts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Uncomment to enable the 'test-plugin' project
|
||||
// include(":test-plugin")
|
||||
Reference in New Issue
Block a user