mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-19 14:59:29 +00:00
Gale 1.21.4
This commit is contained in:
14
.gitattributes
vendored
14
.gitattributes
vendored
@@ -1,7 +1,11 @@
|
|||||||
* text=auto
|
#
|
||||||
|
# https://help.github.com/articles/dealing-with-line-endings/
|
||||||
|
#
|
||||||
|
# Linux start script should use lf
|
||||||
|
/gradlew text eol=lf
|
||||||
|
|
||||||
*.sh text eol=lf
|
# These are Windows script files and should use crlf
|
||||||
gradlew text eol=lf
|
*.bat text eol=crlf
|
||||||
*.bat text eol=crlf
|
|
||||||
|
|
||||||
*.jar binary
|
# Binary files should be left untouched
|
||||||
|
*.jar binary
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/setup-java@main
|
- uses: actions/setup-java@main
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'zulu'
|
||||||
java-version: 21
|
java-version: 21
|
||||||
|
|
||||||
- name: Running tests before push
|
- name: Running tests before push
|
||||||
@@ -59,7 +59,7 @@ jobs:
|
|||||||
cd Gale
|
cd Gale
|
||||||
if ! git diff --quiet; then
|
if ! git diff --quiet; then
|
||||||
echo "Running tests...."
|
echo "Running tests...."
|
||||||
./gradlew applyPatches
|
./gradlew applyAllPatches
|
||||||
./gradlew createMojmapPaperclipJar
|
./gradlew createMojmapPaperclipJar
|
||||||
./gradlew rebuildPatches
|
./gradlew rebuildPatches
|
||||||
fi
|
fi
|
||||||
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
@@ -1,5 +1,7 @@
|
|||||||
name: Build Gale
|
name: Build Gale
|
||||||
|
|
||||||
on: [ push, pull_request ]
|
on: [ push, pull_request ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -8,8 +10,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Git repository
|
- name: Checkout Git repository
|
||||||
uses: actions/checkout@main
|
uses: actions/checkout@main
|
||||||
- name: Validate Gradle wrapper
|
|
||||||
uses: gradle/actions/wrapper-validation@main
|
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/actions/setup-gradle@main
|
uses: gradle/actions/setup-gradle@main
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
@@ -17,16 +17,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
distribution: zulu
|
distribution: zulu
|
||||||
java-version: 21
|
java-version: 21
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
- name: Grant execute permission for gradlew
|
||||||
run: chmod +x gradlew
|
run: chmod +x gradlew
|
||||||
- name: Configure Git user details
|
- name: Configure Git user details
|
||||||
run: git config --global user.email "no-reply@github.com" && git config --global user.name "Github Actions"
|
run: git config --global user.email "no-reply@github.com" && git config --global user.name "Github Actions"
|
||||||
|
|
||||||
- name: Apply patches
|
- name: Apply patches
|
||||||
run: ./gradlew applyPatches
|
run: ./gradlew applyAllPatches
|
||||||
- name: Create Paperclip jar
|
- name: Create Paperclip jar
|
||||||
run: ./gradlew createMojmapPaperclipJar
|
run: ./gradlew createMojmapPaperclipJar
|
||||||
|
|
||||||
- name: Upload Paperclip jar
|
- name: Upload Paperclip jar
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
with:
|
with:
|
||||||
name: Gale
|
name: Gale
|
||||||
path: build/libs/gale-paperclip-*-mojmap.jar
|
path: gale-server/build/libs/gale-paperclip-*-mojmap.jar
|
||||||
|
|||||||
64
.gitignore
vendored
64
.gitignore
vendored
@@ -1,54 +1,30 @@
|
|||||||
.gradle/
|
|
||||||
build/
|
|
||||||
|
|
||||||
# Eclipse stuff
|
|
||||||
.classpath
|
|
||||||
.project
|
|
||||||
.settings/
|
|
||||||
|
|
||||||
# VSCode stuff
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
# netbeans
|
|
||||||
nbproject/
|
|
||||||
nbactions.xml
|
|
||||||
|
|
||||||
# we use maven!
|
|
||||||
build.xml
|
|
||||||
|
|
||||||
# maven
|
|
||||||
target/
|
|
||||||
dependency-reduced-pom.xml
|
|
||||||
|
|
||||||
# vim
|
|
||||||
.*.sw[a-p]
|
|
||||||
|
|
||||||
# various other potential build files
|
|
||||||
build/
|
|
||||||
bin/
|
|
||||||
dist/
|
|
||||||
manifest.mf
|
|
||||||
|
|
||||||
# Mac filesystem dust
|
# Mac filesystem dust
|
||||||
.DS_Store/
|
.DS_Store/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# intellij
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
out/
|
|
||||||
|
|
||||||
# Linux temp files
|
# Linux temp files
|
||||||
*~
|
*~
|
||||||
|
|
||||||
# other stuff
|
# vim
|
||||||
run/
|
.*.sw[a-p]
|
||||||
|
|
||||||
gale-server
|
|
||||||
gale-api
|
|
||||||
paper-api-generator
|
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
*.iml
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# Gradle
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
.gradle
|
||||||
|
build
|
||||||
|
|
||||||
|
# Gale
|
||||||
|
build-data
|
||||||
|
run
|
||||||
|
|
||||||
|
gale-api/build.gradle.kts
|
||||||
|
gale-server/build.gradle.kts
|
||||||
|
gale-server/src/minecraft
|
||||||
|
paper-api
|
||||||
|
paper-api-generator
|
||||||
|
paper-server
|
||||||
|
paper-api-generator.settings.gradle
|
||||||
|
|||||||
@@ -8,4 +8,7 @@
|
|||||||
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
||||||
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
||||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||||
|
# To import minecraft data files, like the default chat type, use `mc_data` as the prefix:
|
||||||
|
# mc_data chat_type/chat.json
|
||||||
|
# mc_data dimension_type/overworld.json
|
||||||
|
#
|
||||||
|
|||||||
118
build.gradle.kts
118
build.gradle.kts
@@ -1,31 +1,41 @@
|
|||||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||||
import io.papermc.paperweight.util.path
|
|
||||||
import kotlin.io.path.deleteRecursively
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("io.papermc.paperweight.patcher") version "1.7.7"
|
id("io.papermc.paperweight.patcher") version "2.0.0-beta.11"
|
||||||
}
|
|
||||||
|
|
||||||
allprojects {
|
|
||||||
apply(plugin = "java")
|
|
||||||
apply(plugin = "maven-publish")
|
|
||||||
|
|
||||||
java {
|
|
||||||
toolchain {
|
|
||||||
languageVersion.set(JavaLanguageVersion.of(21))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
tasks.withType<JavaCompile>().configureEach {
|
apply(plugin = "java-library")
|
||||||
|
apply(plugin = "maven-publish")
|
||||||
|
|
||||||
|
extensions.configure<JavaPluginExtension> {
|
||||||
|
toolchain {
|
||||||
|
languageVersion = JavaLanguageVersion.of(21)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven(paperMavenPublicUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
"testRuntimeOnly"("org.junit.platform:junit-platform-launcher")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<AbstractArchiveTask>().configureEach {
|
||||||
|
isPreserveFileTimestamps = false
|
||||||
|
isReproducibleFileOrder = true
|
||||||
|
}
|
||||||
|
tasks.withType<JavaCompile> {
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
options.release.set(21)
|
options.release = 21
|
||||||
|
options.isFork = true
|
||||||
}
|
}
|
||||||
tasks.withType<Javadoc> {
|
tasks.withType<Javadoc> {
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
@@ -40,60 +50,36 @@ subprojects {
|
|||||||
events(TestLogEvent.STANDARD_OUT)
|
events(TestLogEvent.STANDARD_OUT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven(paperMavenPublicUrl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven(paperMavenPublicUrl) {
|
|
||||||
content {
|
|
||||||
onlyForConfigurations(configurations.paperclip.name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
|
|
||||||
decompiler("org.vineflower:vineflower:1.10.1")
|
|
||||||
paperclip("io.papermc:paperclip:3.0.3")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paperweight {
|
paperweight {
|
||||||
serverProject.set(project(":gale-server")) // Gale - build changes
|
upstreams.paper {
|
||||||
|
ref = providers.gradleProperty("paperRef")
|
||||||
|
|
||||||
remapRepo.set(paperMavenPublicUrl)
|
patchFile {
|
||||||
decompileRepo.set(paperMavenPublicUrl)
|
path = "paper-server/build.gradle.kts"
|
||||||
|
outputFile = file("gale-server/build.gradle.kts") // Gale - build changes
|
||||||
usePaperUpstream(providers.gradleProperty("paperRef")) {
|
patchFile = file("gale-server/build.gradle.kts.patch") // Gale - build changes
|
||||||
withPaperPatcher {
|
|
||||||
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
|
|
||||||
apiOutputDir.set(layout.projectDirectory.dir("gale-api")) // Gale - build changes
|
|
||||||
|
|
||||||
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
|
||||||
serverOutputDir.set(layout.projectDirectory.dir("gale-server")) // Gale - build changes
|
|
||||||
}
|
}
|
||||||
|
patchFile {
|
||||||
patchTasks.register("generatedApi") {
|
path = "paper-api/build.gradle.kts"
|
||||||
isBareDirectory = true
|
outputFile = file("gale-api/build.gradle.kts") // Gale - build changes
|
||||||
upstreamDirPath = "paper-api-generator/generated"
|
patchFile = file("gale-api/build.gradle.kts.patch") // Gale - build changes
|
||||||
patchDir = layout.projectDirectory.dir("patches/generated-api")
|
}
|
||||||
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
|
patchDir("paperApi") {
|
||||||
|
upstreamPath = "paper-api"
|
||||||
|
excludes = setOf("build.gradle.kts")
|
||||||
|
patchesDir = file("gale-api/paper-patches") // Gale - build changes
|
||||||
|
outputDir = file("paper-api")
|
||||||
|
}
|
||||||
|
patchDir("paperApiGenerator") {
|
||||||
|
upstreamPath = "paper-api-generator"
|
||||||
|
patchesDir = file("gale-api-generator/paper-patches") // Gale - build changes
|
||||||
|
outputDir = file("paper-api-generator")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uncomment while updating for a new Minecraft version
|
|
||||||
//tasks.withType<io.papermc.paperweight.tasks.CollectATsFromPatches> {
|
|
||||||
// extraPatchDir.set(layout.projectDirectory.dir("patches/unapplied/server"))
|
|
||||||
//}
|
|
||||||
// tasks.withType<io.papermc.paperweight.tasks.RebuildGitPatches> {
|
|
||||||
// filterPatches.set(false)
|
|
||||||
// }
|
|
||||||
|
|
||||||
tasks.register("printMinecraftVersion") {
|
tasks.register("printMinecraftVersion") {
|
||||||
doLast {
|
doLast {
|
||||||
println(providers.gradleProperty("mcVersion").get().trim())
|
println(providers.gradleProperty("mcVersion").get().trim())
|
||||||
@@ -107,11 +93,12 @@ tasks.register("printGaleVersion") { // Gale - branding changes
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gale start - branding changes - package license into jar
|
// Gale start - branding changes - package license into jar
|
||||||
// Based on io.papermc.paperweight.taskcontainers.BundlerJarTasks
|
// Based on io.papermc.paperweight.taskcontainers.PaperclipTasks
|
||||||
tasks.named("createMojmapPaperclipJar") {
|
/*
|
||||||
|
tasks.named("createMojmapBundlerJar") {
|
||||||
doLast {
|
doLast {
|
||||||
|
|
||||||
// Based on io.papermc.paperweight.taskcontainers.BundlerJarTasks
|
// Based on io.papermc.paperweight.taskcontainers.PaperclipTasks
|
||||||
val jarName = listOfNotNull(
|
val jarName = listOfNotNull(
|
||||||
project.name,
|
project.name,
|
||||||
"paperclip",
|
"paperclip",
|
||||||
@@ -119,7 +106,7 @@ tasks.named("createMojmapPaperclipJar") {
|
|||||||
"mojmap"
|
"mojmap"
|
||||||
).joinToString("-") + ".jar"
|
).joinToString("-") + ".jar"
|
||||||
|
|
||||||
// Based on io.papermc.paperweight.taskcontainers.BundlerJarTasks
|
// Based on io.papermc.paperweight.taskcontainers.PaperclipTasks
|
||||||
val zipFile = layout.buildDirectory.file("libs/$jarName").path
|
val zipFile = layout.buildDirectory.file("libs/$jarName").path
|
||||||
|
|
||||||
val rootDir = io.papermc.paperweight.util.findOutputDir(zipFile)
|
val rootDir = io.papermc.paperweight.util.findOutputDir(zipFile)
|
||||||
@@ -141,4 +128,5 @@ tasks.named("createMojmapPaperclipJar") {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// Gale end - branding changes - package license into jar
|
// Gale end - branding changes - package license into jar
|
||||||
|
|||||||
84
gale-api/build.gradle.kts.patch
Normal file
84
gale-api/build.gradle.kts.patch
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
--- a/paper-api/build.gradle.kts
|
||||||
|
+++ b/paper-api/build.gradle.kts
|
||||||
|
@@ -103,6 +_,20 @@
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
srcDir(generatedApiPath)
|
||||||
|
+ // Gale start - project setup
|
||||||
|
+ srcDir(file("../paper-api/src/main/java"))
|
||||||
|
+ }
|
||||||
|
+ resources {
|
||||||
|
+ srcDir(file("../paper-api/src/main/resources"))
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ test {
|
||||||
|
+ java {
|
||||||
|
+ srcDir(file("../paper-api/src/test/java"))
|
||||||
|
+ }
|
||||||
|
+ resources {
|
||||||
|
+ srcDir(file("../paper-api/src/test/resources"))
|
||||||
|
+ // Gale end - project setup
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -150,6 +_,16 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+// Gale start - hide irrelevant compilation warnings
|
||||||
|
+tasks.withType<JavaCompile> {
|
||||||
|
+ val compilerArgs = options.compilerArgs
|
||||||
|
+ compilerArgs.add("-Xlint:-module")
|
||||||
|
+ compilerArgs.add("-Xlint:-removal")
|
||||||
|
+ compilerArgs.add("-Xlint:-dep-ann")
|
||||||
|
+ compilerArgs.add("--add-modules=jdk.incubator.vector") // Gale - Pufferfish - SIMD support
|
||||||
|
+}
|
||||||
|
+// Gale end - hide irrelevant compilation warnings
|
||||||
|
+
|
||||||
|
tasks.jar {
|
||||||
|
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
|
||||||
|
into("META-INF/maven/${project.group}/${project.name}")
|
||||||
|
@@ -159,6 +_,12 @@
|
||||||
|
"Automatic-Module-Name" to "org.bukkit"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Gale start - package license into jar
|
||||||
|
+ from("${project.projectDir}/LICENSE.txt") {
|
||||||
|
+ into("")
|
||||||
|
+ }
|
||||||
|
+ // Gale end - package license into jar
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class Services {
|
||||||
|
@@ -169,7 +_,7 @@
|
||||||
|
|
||||||
|
tasks.withType<Javadoc> {
|
||||||
|
val options = options as StandardJavadocDocletOptions
|
||||||
|
- options.overview = "src/main/javadoc/overview.html"
|
||||||
|
+ options.overview = "../paper-api/src/main/javadoc/overview.html" // Gale - project setup
|
||||||
|
options.use()
|
||||||
|
options.isDocFilesSubDirs = true
|
||||||
|
options.links(
|
||||||
|
@@ -202,16 +_,19 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
// workaround for https://github.com/gradle/gradle/issues/4046
|
||||||
|
- inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
|
||||||
|
+ inputs.dir("../paper-api/src/main/javadoc").withPropertyName("javadoc-sourceset") // Gale - project setup
|
||||||
|
val fsOps = services.fileSystemOperations
|
||||||
|
doLast {
|
||||||
|
fsOps.copy {
|
||||||
|
- from("src/main/javadoc") {
|
||||||
|
+ from("../paper-api/src/main/javadoc") { // Gale - project setup
|
||||||
|
include("**/doc-files/**")
|
||||||
|
}
|
||||||
|
into("build/docs/javadoc")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ options.addStringOption("Xdoclint:none", "-quiet") // Gale - hide irrelevant compilation warnings
|
||||||
|
+ options.addStringOption("-add-modules", "jdk.incubator.vector") // Gale - Pufferfish - SIMD support
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.test {
|
||||||
@@ -45,23 +45,6 @@ index 94a9ed024d3859793618152ea559a168bbcbb5e2..e60008693e017bec1b4eb49c84be3898
|
|||||||
Public License instead of this License. But first, please read
|
Public License instead of this License. But first, please read
|
||||||
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
+<https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
+<https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
||||||
index 0225bbd7773527a34e267a0404ba7db7809d8e5a..f7ec84606d8e6c3c3af5ba5fe85fea4c35952c2e 100644
|
|
||||||
--- a/build.gradle.kts
|
|
||||||
+++ b/build.gradle.kts
|
|
||||||
@@ -166,6 +166,12 @@ tasks.jar {
|
|
||||||
"Automatic-Module-Name" to "org.bukkit"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // Gale start - package license into jar
|
|
||||||
+ from("${project.projectDir}/LICENSE.txt") {
|
|
||||||
+ into("")
|
|
||||||
+ }
|
|
||||||
+ // Gale end - package license into jar
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Javadoc> {
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||||
index 652ff54e7c50412503725d628bfe72ed03059790..b68770f6992b044d13e67d9affa6933c90ca8fb8 100644
|
index 652ff54e7c50412503725d628bfe72ed03059790..b68770f6992b044d13e67d9affa6933c90ca8fb8 100644
|
||||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||||
@@ -13,10 +13,10 @@ As part of: Paper (https://github.com/PaperMC/Paper)
|
|||||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
index 0b78564256ebc647ebac402e549d86ab6e307c8d..dac3a43ccbfffe19f6429cc8df5479fc3c233793 100644
|
index 041ebeb28378c2f81ccbc586fea9583e059cfbd7..3d986e21674591f9a04b36231086085232c4d198 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
@@ -2281,6 +2281,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2315,6 +2315,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|||||||
Gale - https://galemc.org
|
Gale - https://galemc.org
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
||||||
index 3e747abde6fefae90f1c15cb00158bc5303cbe50..fd9c06853a503aa787c4d93801714024465a7ee2 100644
|
index 73b125979e2f2dfd13cbf689a90b29cc68a36e09..d8dfaf5041ccf3f360e0bd94bf03580a8b3d9a38 100644
|
||||||
--- a/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
--- a/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
||||||
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
||||||
@@ -22,8 +22,7 @@ public class FullServerTickHandler extends TimingHandler {
|
@@ -22,8 +22,7 @@ public class FullServerTickHandler extends TimingHandler {
|
||||||
@@ -12,26 +12,6 @@ By: Kevin Raneri <kevin.raneri@gmail.com>
|
|||||||
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
||||||
index f7ec84606d8e6c3c3af5ba5fe85fea4c35952c2e..3c50294a0a68fd8e9fd4028d41495ad3b9781b1e 100644
|
|
||||||
--- a/build.gradle.kts
|
|
||||||
+++ b/build.gradle.kts
|
|
||||||
@@ -154,6 +154,7 @@ tasks.withType<JavaCompile> {
|
|
||||||
compilerArgs.add("-Xlint:-module")
|
|
||||||
compilerArgs.add("-Xlint:-removal")
|
|
||||||
compilerArgs.add("-Xlint:-dep-ann")
|
|
||||||
+ compilerArgs.add("--add-modules=jdk.incubator.vector") // Gale - Pufferfish - SIMD support
|
|
||||||
}
|
|
||||||
// Gale end - hide irrelevant compilation warnings
|
|
||||||
|
|
||||||
@@ -224,6 +225,7 @@ tasks.withType<Javadoc> {
|
|
||||||
}
|
|
||||||
|
|
||||||
options.addStringOption("Xdoclint:none", "-quiet") // Gale - hide irrelevant compilation warnings
|
|
||||||
+ options.addStringOption("-add-modules", "jdk.incubator.vector") // Gale - Pufferfish - SIMD support
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.test {
|
|
||||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..90d87374e9dddd79aeca3e05f9cd6c82eb3aad27
|
index 0000000000000000000000000000000000000000..90d87374e9dddd79aeca3e05f9cd6c82eb3aad27
|
||||||
@@ -110,7 +110,7 @@ index 0000000000000000000000000000000000000000..00b16e4aacba50996b81fac81c3f78b6
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
|
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
|
||||||
index 55a46db9d73885ea967ac929013906b687e476bb..a4cd1c4dc937c9905e91739e6760bf0bc772cabe 100644
|
index 6995f9cc08d162e3adcd3a28f6bfa6d329661999..844ad65edd5ac9eb7ccce08905972ad0ba18ea69 100644
|
||||||
--- a/src/main/java/org/bukkit/map/MapPalette.java
|
--- a/src/main/java/org/bukkit/map/MapPalette.java
|
||||||
+++ b/src/main/java/org/bukkit/map/MapPalette.java
|
+++ b/src/main/java/org/bukkit/map/MapPalette.java
|
||||||
@@ -45,7 +45,7 @@ public final class MapPalette {
|
@@ -45,7 +45,7 @@ public final class MapPalette {
|
||||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||||
index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..92d20e70d26318fbaed8adffd21c6b77336eb9c5 100644
|
index b412aaf08901d169ac9fc89b36f9d6ccb95c53d3..8acf45815b5841e3b2082a8bc5b7974e85cdd7f9 100644
|
||||||
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||||
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||||
@@ -56,6 +56,13 @@ public final class JavaPluginLoader implements PluginLoader {
|
@@ -56,6 +56,13 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||||
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||||
index 95f0b3186e313c7fbd5c8531d52b82a69e525f94..b9ccc3dda46ab0e759faff9a299798dd75a310eb 100644
|
index 7d21ee64c9b9c14412a1eddb63fae812a91e7d9c..1ee59ed42de64ae1a0a580b3f640cdcb5f51c71b 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||||
@@ -2153,6 +2153,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
@@ -2154,6 +2154,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||||
boolean listPlayer(@NotNull Player other);
|
boolean listPlayer(@NotNull Player other);
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|||||||
Gale - https://galemc.org
|
Gale - https://galemc.org
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||||
index 391a1e3e07657a404520c1462507a2c731f32b27..f56c771c92194587b586f3ada344fe540cd231eb 100644
|
index 9eecd3a68a36d06c66d5f2cdc98c048fe8737337..a500bb9bc428c5fcefff3950503645a91e5d0161 100644
|
||||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||||
@@ -2409,6 +2409,37 @@ public final class Bukkit {
|
@@ -2407,6 +2407,37 @@ public final class Bukkit {
|
||||||
return server.getTPS();
|
return server.getTPS();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,12 +49,12 @@ index 391a1e3e07657a404520c1462507a2c731f32b27..f56c771c92194587b586f3ada344fe54
|
|||||||
* Get a sample of the servers last tick times (in nanos)
|
* Get a sample of the servers last tick times (in nanos)
|
||||||
*
|
*
|
||||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
index dac3a43ccbfffe19f6429cc8df5479fc3c233793..38fbc6e4ff6f0b08813a6a37dfcca24ec58c543f 100644
|
index 3d986e21674591f9a04b36231086085232c4d198..e5c767dbcf8f987b4ab3abf631c66830ca2f9858 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
@@ -2060,6 +2060,31 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2095,6 +2095,31 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
@NotNull
|
*/
|
||||||
public double[] getTPS();
|
public double @NotNull [] getTPS();
|
||||||
|
|
||||||
+ // Gale start - specific interval TPS API
|
+ // Gale start - specific interval TPS API
|
||||||
+
|
+
|
||||||
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||||
index f56c771c92194587b586f3ada344fe540cd231eb..0dd0d3e2faf82432b621bad95d5d31f7d581ef2b 100644
|
index a500bb9bc428c5fcefff3950503645a91e5d0161..7d125129860799c523a36ca039d6b34ed4103ffb 100644
|
||||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||||
@@ -2409,8 +2409,30 @@ public final class Bukkit {
|
@@ -2407,8 +2407,30 @@ public final class Bukkit {
|
||||||
return server.getTPS();
|
return server.getTPS();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,12 +72,12 @@ index f56c771c92194587b586f3ada344fe540cd231eb..0dd0d3e2faf82432b621bad95d5d31f7
|
|||||||
* Gets the average server TPS over the last 1 minute
|
* Gets the average server TPS over the last 1 minute
|
||||||
*
|
*
|
||||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
index 38fbc6e4ff6f0b08813a6a37dfcca24ec58c543f..e8346ff64783c505456cc7cd2ed91bc2b063e365 100644
|
index e5c767dbcf8f987b4ab3abf631c66830ca2f9858..cbc50c83c1ad3b271fbeba8cb921eb95cae61e16 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
@@ -2060,8 +2060,27 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2095,8 +2095,27 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
@NotNull
|
*/
|
||||||
public double[] getTPS();
|
public double @NotNull [] getTPS();
|
||||||
|
|
||||||
+ // Gale start - Purpur - 5 second TPS average
|
+ // Gale start - Purpur - 5 second TPS average
|
||||||
+ /**
|
+ /**
|
||||||
@@ -23,10 +23,10 @@ The above copyright notice and this permission notice shall be included in all c
|
|||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||||
index a1d517e2415a1d4710da39ef5994fe2fbd411db4..68971f1503913175e941ec24db54ab12f023737d 100644
|
index 7d125129860799c523a36ca039d6b34ed4103ffb..64fc2553da938f6df56c3e99ca2707d65dc75eda 100644
|
||||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||||
@@ -3017,6 +3017,20 @@ public final class Bukkit {
|
@@ -3014,6 +3014,20 @@ public final class Bukkit {
|
||||||
}
|
}
|
||||||
// Paper end - Folia region threading API
|
// Paper end - Folia region threading API
|
||||||
|
|
||||||
@@ -48,10 +48,10 @@ index a1d517e2415a1d4710da39ef5994fe2fbd411db4..68971f1503913175e941ec24db54ab12
|
|||||||
public static Server.Spigot spigot() {
|
public static Server.Spigot spigot() {
|
||||||
return server.spigot();
|
return server.spigot();
|
||||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
index edcd3ce45053568cb90ca7f69ffc23cb1a782d4e..dc02eb4016e3452ccf7b18a52309f921aac6278a 100644
|
index cbc50c83c1ad3b271fbeba8cb921eb95cae61e16..afc439982d086090576a9c321eb36c021421c4e3 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
@@ -2660,4 +2660,29 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2694,4 +2694,29 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
*/
|
*/
|
||||||
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
|
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
|
||||||
// Paper end - API to check if the server is sleeping
|
// Paper end - API to check if the server is sleeping
|
||||||
@@ -3,6 +3,8 @@ From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|||||||
Date: Tue, 29 Nov 2022 15:16:54 +0100
|
Date: Tue, 29 Nov 2022 15:16:54 +0100
|
||||||
Subject: [PATCH] Dev import deobfuscation fixes
|
Subject: [PATCH] Dev import deobfuscation fixes
|
||||||
|
|
||||||
|
Removed since Paper 1.21.4, hardfork
|
||||||
|
|
||||||
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
Gale - https://galemc.org
|
Gale - https://galemc.org
|
||||||
|
|
||||||
@@ -3,6 +3,8 @@ From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|||||||
Date: Wed, 23 Nov 2022 20:18:05 +0100
|
Date: Wed, 23 Nov 2022 20:18:05 +0100
|
||||||
Subject: [PATCH] Remove iterators from Inventory#contains
|
Subject: [PATCH] Remove iterators from Inventory#contains
|
||||||
|
|
||||||
|
Removed since 1.21.4
|
||||||
|
|
||||||
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
Gale - https://galemc.org
|
Gale - https://galemc.org
|
||||||
|
|
||||||
@@ -3,6 +3,8 @@ From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|||||||
Date: Tue, 29 Nov 2022 15:55:05 +0100
|
Date: Tue, 29 Nov 2022 15:55:05 +0100
|
||||||
Subject: [PATCH] Fix cow rotation when shearing mooshroom
|
Subject: [PATCH] Fix cow rotation when shearing mooshroom
|
||||||
|
|
||||||
|
Removed since Gale 1.21.4, fixed in Minecraft 1.21.2 24w36a
|
||||||
|
|
||||||
License: MIT (https://opensource.org/licenses/MIT)
|
License: MIT (https://opensource.org/licenses/MIT)
|
||||||
Gale - https://galemc.org
|
Gale - https://galemc.org
|
||||||
|
|
||||||
@@ -3,6 +3,8 @@ From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|||||||
Date: Fri, 23 Dec 2022 15:30:58 +0100
|
Date: Fri, 23 Dec 2022 15:30:58 +0100
|
||||||
Subject: [PATCH] Fix MC-110386
|
Subject: [PATCH] Fix MC-110386
|
||||||
|
|
||||||
|
Removed since Gale 1.21.4, fixed in Minecraft 1.21.2 24w33a
|
||||||
|
|
||||||
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
Gale - https://galemc.org
|
Gale - https://galemc.org
|
||||||
|
|
||||||
1
gale-archived-patches/ver/README.md
Normal file
1
gale-archived-patches/ver/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# Note
|
||||||
127
gale-server/build.gradle.kts.patch
Normal file
127
gale-server/build.gradle.kts.patch
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
--- a/paper-server/build.gradle.kts
|
||||||
|
+++ b/paper-server/build.gradle.kts
|
||||||
|
@@ -21,8 +_,21 @@
|
||||||
|
// macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java")
|
||||||
|
// gitFilePatches = true
|
||||||
|
|
||||||
|
+ // Gale start - project setup
|
||||||
|
+ val gale = forks.register("gale") {
|
||||||
|
+ upstream.patchDir("paperServer") {
|
||||||
|
+ upstreamPath = "paper-server"
|
||||||
|
+ excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
|
||||||
|
+ patchesDir = rootDirectory.dir("gale-server/paper-patches")
|
||||||
|
+ outputDir = rootDirectory.dir("paper-server")
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ activeFork = gale
|
||||||
|
+ // Gale end - project setup
|
||||||
|
+
|
||||||
|
paper {
|
||||||
|
- reobfMappingsPatch = layout.projectDirectory.file("../build-data/reobf-mappings-patch.tiny")
|
||||||
|
+ paperServerDir = upstreamsDirectory().map { it.dir("paper/paper-server") } // Gale - project setup
|
||||||
|
}
|
||||||
|
|
||||||
|
spigot {
|
||||||
|
@@ -105,7 +_,22 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-val log4jPlugins = sourceSets.create("log4jPlugins")
|
||||||
|
+// Gale start - project setup
|
||||||
|
+sourceSets {
|
||||||
|
+ main {
|
||||||
|
+ java { srcDir("../paper-server/src/main/java") }
|
||||||
|
+ resources { srcDir("../paper-server/src/main/resources") }
|
||||||
|
+ }
|
||||||
|
+ test {
|
||||||
|
+ java { srcDir("../paper-server/src/test/java") }
|
||||||
|
+ resources { srcDir("../paper-server/src/test/resources") }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+val log4jPlugins = sourceSets.create("log4jPlugins") {
|
||||||
|
+ java { srcDir("../paper-server/src/log4jPlugins/java") }
|
||||||
|
+}
|
||||||
|
+// Gale end - project setup
|
||||||
|
configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||||
|
extendsFrom(configurations.compileClasspath.get())
|
||||||
|
}
|
||||||
|
@@ -123,7 +_,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
- implementation(project(":paper-api"))
|
||||||
|
+ implementation(project(":gale-api")) // Gale - project setup - Depend on own API
|
||||||
|
implementation("ca.spottedleaf:concurrentutil:0.0.2")
|
||||||
|
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
||||||
|
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
||||||
|
@@ -180,6 +_,16 @@
|
||||||
|
implementation("me.lucko:spark-paper:1.10.119-SNAPSHOT")
|
||||||
|
}
|
||||||
|
|
||||||
|
+// Gale start - hide irrelevant compilation warnings
|
||||||
|
+tasks.withType<JavaCompile> {
|
||||||
|
+ val compilerArgs = options.compilerArgs
|
||||||
|
+ compilerArgs.add("-Xlint:-module")
|
||||||
|
+ compilerArgs.add("-Xlint:-removal")
|
||||||
|
+ compilerArgs.add("-Xlint:-dep-ann")
|
||||||
|
+ compilerArgs.add("--add-modules=jdk.incubator.vector") // Gale - Pufferfish - SIMD support
|
||||||
|
+}
|
||||||
|
+// Gale end - hide irrelevant compilation warnings
|
||||||
|
+
|
||||||
|
tasks.jar {
|
||||||
|
manifest {
|
||||||
|
val git = Git(rootProject.layout.projectDirectory.path)
|
||||||
|
@@ -192,14 +_,14 @@
|
||||||
|
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
|
||||||
|
attributes(
|
||||||
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
|
- "Implementation-Title" to "Paper",
|
||||||
|
+ "Implementation-Title" to "Gale", // Gale - branding changes
|
||||||
|
"Implementation-Version" to implementationVersion,
|
||||||
|
"Implementation-Vendor" to date,
|
||||||
|
- "Specification-Title" to "Paper",
|
||||||
|
+ "Specification-Title" to "Gale", // Gale - branding changes
|
||||||
|
"Specification-Version" to project.version,
|
||||||
|
- "Specification-Vendor" to "Paper Team",
|
||||||
|
- "Brand-Id" to "papermc:paper",
|
||||||
|
- "Brand-Name" to "Paper",
|
||||||
|
+ "Specification-Vendor" to "GaleMC Team", // Gale - branding changes
|
||||||
|
+ "Brand-Id" to "galemc:gale", // Gale - branding changes
|
||||||
|
+ "Brand-Name" to "Gale", // Gale - branding changes
|
||||||
|
"Build-Number" to (build ?: ""),
|
||||||
|
"Build-Time" to buildTime.toString(),
|
||||||
|
"Git-Branch" to gitBranch,
|
||||||
|
@@ -285,6 +_,8 @@
|
||||||
|
val memoryGb = providers.gradleProperty("paper.runMemoryGb").getOrElse("2")
|
||||||
|
minHeapSize = "${memoryGb}G"
|
||||||
|
maxHeapSize = "${memoryGb}G"
|
||||||
|
+ jvmArgs("--enable-preview") // Gale - enable preview features for development runs
|
||||||
|
+ jvmArgs("--add-modules=jdk.incubator.vector") // Gale - Pufferfish - SIMD support
|
||||||
|
|
||||||
|
doFirst {
|
||||||
|
workingDir.mkdirs()
|
||||||
|
@@ -330,3 +_,22 @@
|
||||||
|
classpath(tasks.createReobfPaperclipJar.flatMap { it.outputZip })
|
||||||
|
mainClass.set(null as String?)
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+// Gale start - package license into jar
|
||||||
|
+tasks.register<Copy>("copyLicense") {
|
||||||
|
+ from(layout.projectDirectory.file("LICENSE.txt"))
|
||||||
|
+ into(layout.buildDirectory.dir("tmp/copiedlicense"))
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+tasks.processResources {
|
||||||
|
+ dependsOn("copyLicense")
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+sourceSets {
|
||||||
|
+ main {
|
||||||
|
+ resources {
|
||||||
|
+ srcDir(layout.buildDirectory.dir("tmp/copiedlicense"))
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+// Gale end - package license into jar
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Mon, 26 Dec 2022 13:47:08 +0100
|
||||||
|
Subject: [PATCH] Gale branding changes
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
No license is given for images. Images are copyright (©) Martijn Muijsers, all rights reserved.
|
||||||
|
License for non-image files: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/damagesource/DamageSource.java b/net/minecraft/world/damagesource/DamageSource.java
|
||||||
|
index 48c9b26e023ad236b0bcb6441e8aee8f107ae381..aea139e47a0866c63c0fc6728840e5ad92a26403 100644
|
||||||
|
--- a/net/minecraft/world/damagesource/DamageSource.java
|
||||||
|
+++ b/net/minecraft/world/damagesource/DamageSource.java
|
||||||
|
@@ -66,7 +66,7 @@ public class DamageSource {
|
||||||
|
|
||||||
|
public DamageSource customEventDamager(Entity entity) {
|
||||||
|
if (this.directEntity != null) {
|
||||||
|
- throw new IllegalStateException("Cannot set custom event damager when direct entity is already set (report a bug to Paper)");
|
||||||
|
+ throw new IllegalStateException("Cannot set custom event damager when direct entity is already set (report a bug to Paper, if you think this is a Gale bug, please report it at https://github.com/GaleMC/Gale/issues)"); // Gale - branding changes
|
||||||
|
}
|
||||||
|
DamageSource damageSource = this.cloneInstance();
|
||||||
|
damageSource.customEventDamager = entity;
|
||||||
|
diff --git a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
|
index dad7f94b611cf0fc68b1a3878c458233f6bb6d61..3abb8aefcca325e28f0af07bd859be74f0aee08d 100644
|
||||||
|
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
|
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
|
@@ -283,7 +283,13 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||||
|
|
||||||
|
// Paper start
|
||||||
|
private static void printOversizedLog(String msg, Path file, int x, int z) {
|
||||||
|
- org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.");
|
||||||
|
+ // Gale start - branding changes
|
||||||
|
+ /*
|
||||||
|
+ We do not want people to report thread issues to Paper,
|
||||||
|
+ but we do want people to report thread issues to Gale.
|
||||||
|
+ */
|
||||||
|
+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER OR GALE - You may ask for help on Discord, but do not file an issue. These error messages can not be removed. - If you think this is a Gale bug, please report it at https://github.com/GaleMC/Gale/issues)");
|
||||||
|
+ // Gale end - branding changes
|
||||||
|
}
|
||||||
|
|
||||||
|
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Wed, 23 Nov 2022 21:05:47 +0100
|
||||||
|
Subject: [PATCH] Gale configuration
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Paper config files"
|
||||||
|
By: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||||
|
As part of: Paper (https://github.com/PaperMC/Paper)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
|
index 107aa863bd4448628b013d0ccd49b6a956aeffef..d7916d4d4cec9ac376c8b7b4c3432fddd55a1940 100644
|
||||||
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
|
@@ -300,6 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
public volatile boolean abnormalExit; // Paper - Improved watchdog support
|
||||||
|
public volatile Thread shutdownThread; // Paper - Improved watchdog support
|
||||||
|
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
|
||||||
|
+ public final org.galemc.gale.configuration.GaleConfigurations galeConfigurations; // Gale - Gale configuration
|
||||||
|
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||||
|
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
|
||||||
|
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||||
|
@@ -471,6 +472,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
||||||
|
// CraftBukkit end
|
||||||
|
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
|
||||||
|
+ this.galeConfigurations = services.galeConfigurations(); // Gale - Gale configuration
|
||||||
|
}
|
||||||
|
|
||||||
|
private void readScoreboard(DimensionDataStorage dataStorage) {
|
||||||
|
diff --git a/net/minecraft/server/Services.java b/net/minecraft/server/Services.java
|
||||||
|
index ee760cc9d6756c40f13fe6459725dcfc200b9630..e5635bf48da1079f9e7dd57155fce2cd3f44f3df 100644
|
||||||
|
--- a/net/minecraft/server/Services.java
|
||||||
|
+++ b/net/minecraft/server/Services.java
|
||||||
|
@@ -11,13 +11,13 @@ import net.minecraft.server.players.GameProfileCache;
|
||||||
|
import net.minecraft.util.SignatureValidator;
|
||||||
|
|
||||||
|
public record Services(
|
||||||
|
- MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations // Paper - add paper configuration files
|
||||||
|
+ MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations, @javax.annotation.Nullable org.galemc.gale.configuration.GaleConfigurations galeConfigurations // Paper - add paper configuration files // Gale - Gale configuration
|
||||||
|
) {
|
||||||
|
public static final String USERID_CACHE_FILE = "usercache.json"; // Paper - private -> public
|
||||||
|
|
||||||
|
// Paper start - add paper configuration files
|
||||||
|
public Services(MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache) {
|
||||||
|
- this(sessionService, servicesKeySet, profileRepository, profileCache, null);
|
||||||
|
+ this(sessionService, servicesKeySet, profileRepository, profileCache, null, null); // Gale - Gale configuration
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@@ -25,6 +25,12 @@ public record Services(
|
||||||
|
return java.util.Objects.requireNonNull(this.paperConfigurations);
|
||||||
|
}
|
||||||
|
// Paper end - add paper configuration files
|
||||||
|
+ // Gale start - Gale configuration
|
||||||
|
+ @Override
|
||||||
|
+ public org.galemc.gale.configuration.GaleConfigurations galeConfigurations() {
|
||||||
|
+ return java.util.Objects.requireNonNull(this.galeConfigurations);
|
||||||
|
+ }
|
||||||
|
+ // Gale end - Gale configuration
|
||||||
|
|
||||||
|
public static Services create(YggdrasilAuthenticationService authenticationService, File profileRepository, File userCacheFile, joptsimple.OptionSet optionSet) throws Exception { // Paper - add optionset to load paper config files; add userCacheFile parameter
|
||||||
|
MinecraftSessionService minecraftSessionService = authenticationService.createMinecraftSessionService();
|
||||||
|
@@ -34,7 +40,10 @@ public record Services(
|
||||||
|
final java.nio.file.Path legacyConfigPath = ((File) optionSet.valueOf("paper-settings")).toPath();
|
||||||
|
final java.nio.file.Path configDirPath = ((File) optionSet.valueOf("paper-settings-directory")).toPath();
|
||||||
|
io.papermc.paper.configuration.PaperConfigurations paperConfigurations = io.papermc.paper.configuration.PaperConfigurations.setup(legacyConfigPath, configDirPath, profileRepository.toPath(), (File) optionSet.valueOf("spigot-settings"));
|
||||||
|
- return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations);
|
||||||
|
+ // Gale start - Gale configuration
|
||||||
|
+ org.galemc.gale.configuration.GaleConfigurations galeConfigurations = org.galemc.gale.configuration.GaleConfigurations.setup(configDirPath);
|
||||||
|
+ return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations, galeConfigurations);
|
||||||
|
+ // Gale end - Gale configuration
|
||||||
|
// Paper end - load paper config files from cli options
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
index 97a294d2f5c1ddf0af7ffec3e1425eb329c5751b..0655b169a1cb418aacc5761680d84a8bd9aed3c9 100644
|
||||||
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
@@ -212,6 +212,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
||||||
|
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||||
|
// Paper end - initialize global and world-defaults configuration
|
||||||
|
+ // Gale start - Gale configuration
|
||||||
|
+ galeConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
||||||
|
+ galeConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||||
|
+ // Gale end - Gale configuration
|
||||||
|
this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
||||||
|
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||||
|
if (this.convertOldUsers()) {
|
||||||
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
|
index ebeeb63c3dca505a3ce8b88feaa5d2ca20ec24a2..13db4411e5bd635315b27b92a3e97bf286d14577 100644
|
||||||
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
|
@@ -588,7 +588,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
|
org.bukkit.generator.BiomeProvider biomeProvider // CraftBukkit
|
||||||
|
) {
|
||||||
|
// CraftBukkit start
|
||||||
|
- super(serverLevelData, dimension, server.registryAccess(), levelStem.type(), false, isDebug, biomeZoomSeed, server.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> server.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(levelStorageAccess.levelDirectory.path(), serverLevelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), serverLevelData.getGameRules())), dispatcher); // Paper - create paper world configs; Async-Anti-Xray: Pass executor
|
||||||
|
+ super(serverLevelData, dimension, server.registryAccess(), levelStem.type(), false, isDebug, biomeZoomSeed, server.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> server.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(levelStorageAccess.levelDirectory.path(), serverLevelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), serverLevelData.getGameRules())), spigotConfig -> server.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(levelStorageAccess.levelDirectory.path(), serverLevelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), serverLevelData.getGameRules())), dispatcher); // Paper - create paper world configs; Async-Anti-Xray: Pass executor // Gale - Gale configuration
|
||||||
|
this.pvpMode = server.isPvpAllowed();
|
||||||
|
this.levelStorageAccess = levelStorageAccess;
|
||||||
|
this.uuid = org.bukkit.craftbukkit.util.WorldUUID.getUUID(levelStorageAccess.levelDirectory.path().toFile());
|
||||||
|
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||||
|
index 2bbebb4335d927f240abcac67a5b423e38dc33d7..b9c930210f750aa9594d3acae584a8d11983a210 100644
|
||||||
|
--- a/net/minecraft/world/level/Level.java
|
||||||
|
+++ b/net/minecraft/world/level/Level.java
|
||||||
|
@@ -168,6 +168,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
|
return this.paperConfig;
|
||||||
|
}
|
||||||
|
// Paper end - add paper world config
|
||||||
|
+ // Gale start - Gale configuration
|
||||||
|
+ private final org.galemc.gale.configuration.GaleWorldConfiguration galeConfig;
|
||||||
|
+ public org.galemc.gale.configuration.GaleWorldConfiguration galeConfig() {
|
||||||
|
+ return this.galeConfig;
|
||||||
|
+ }
|
||||||
|
+ // Gale end - Gale configuration
|
||||||
|
|
||||||
|
public final io.papermc.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||||
|
public static BlockPos lastPhysicsProblem; // Spigot
|
||||||
|
@@ -840,6 +846,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
|
org.bukkit.World.Environment env, // CraftBukkit
|
||||||
|
java.util.function.Function<org.spigotmc.SpigotWorldConfig, // Spigot - create per world config
|
||||||
|
io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, // Paper - create paper world config
|
||||||
|
+ java.util.function.Function<org.spigotmc.SpigotWorldConfig, // Gale - Gale configuration
|
||||||
|
+ org.galemc.gale.configuration.GaleWorldConfiguration> galeWorldConfigCreator, // Gale - Gale configuration
|
||||||
|
java.util.concurrent.Executor executor // Paper - Anti-Xray
|
||||||
|
) {
|
||||||
|
// Paper start - getblock optimisations - cache world height/sections
|
||||||
|
@@ -853,6 +861,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
|
// Paper end - getblock optimisations - cache world height/sections
|
||||||
|
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
|
||||||
|
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||||
|
+ this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration
|
||||||
|
this.generator = gen;
|
||||||
|
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Sat, 26 Nov 2022 10:47:56 +0100
|
||||||
|
Subject: [PATCH] Gale commands
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Paper command"
|
||||||
|
By: Zach Brown <zach.brown@destroystokyo.com>
|
||||||
|
As part of: Paper (https://github.com/PaperMC/Paper)
|
||||||
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
index 0655b169a1cb418aacc5761680d84a8bd9aed3c9..f4a8c7fe830495434f06d45c1a4505e4ea536804 100644
|
||||||
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
@@ -226,6 +226,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
|
||||||
|
thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
|
||||||
|
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||||
|
+ org.galemc.gale.command.GaleCommands.registerCommands(this); // Gale - Gale commands - register commands
|
||||||
|
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
||||||
|
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||||
|
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -98,28 +98,28 @@ public class Main {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/util/Mth.java b/src/main/java/net/minecraft/util/Mth.java
|
diff --git a/net/minecraft/util/Mth.java b/net/minecraft/util/Mth.java
|
||||||
index f298cdfcf1539e467f57f9f7789de3cf2ca54665..3468b7fbc7440f220fce8039f237658a593df296 100644
|
index d5d8134da9423cec199cf44762460104677194d6..e0eed27cb33348fcb46858c40014b5fe5dbaf426 100644
|
||||||
--- a/src/main/java/net/minecraft/util/Mth.java
|
--- a/net/minecraft/util/Mth.java
|
||||||
+++ b/src/main/java/net/minecraft/util/Mth.java
|
+++ b/net/minecraft/util/Mth.java
|
||||||
@@ -58,18 +58,15 @@ public class Mth {
|
@@ -58,18 +58,15 @@ public class Mth {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int floor(float value) {
|
public static int floor(float value) {
|
||||||
- int i = (int)value;
|
- int i = (int)value;
|
||||||
- return value < (float)i ? i - 1 : i;
|
- return value < i ? i - 1 : i;
|
||||||
+ return (int) Math.floor(value); // Gale - use platform math functions
|
+ return (int) Math.floor(value); // Gale - use platform math functions
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int floor(double value) {
|
public static int floor(double value) {
|
||||||
- int i = (int)value;
|
- int i = (int)value;
|
||||||
- return value < (double)i ? i - 1 : i;
|
- return value < i ? i - 1 : i;
|
||||||
+ return (int) Math.floor(value); // Gale - use platform math functions
|
+ return (int) Math.floor(value); // Gale - use platform math functions
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long lfloor(double value) {
|
public static long lfloor(double value) {
|
||||||
- long l = (long)value;
|
- long l = (long)value;
|
||||||
- return value < (double)l ? l - 1L : l;
|
- return value < l ? l - 1L : l;
|
||||||
+ return (long) Math.floor(value); // Gale - use platform math functions
|
+ return (long) Math.floor(value); // Gale - use platform math functions
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,13 +129,13 @@ index f298cdfcf1539e467f57f9f7789de3cf2ca54665..3468b7fbc7440f220fce8039f237658a
|
|||||||
|
|
||||||
public static int ceil(float value) {
|
public static int ceil(float value) {
|
||||||
- int i = (int)value;
|
- int i = (int)value;
|
||||||
- return value > (float)i ? i + 1 : i;
|
- return value > i ? i + 1 : i;
|
||||||
+ return (int) Math.ceil(value); // Gale - use platform math functions
|
+ return (int) Math.ceil(value); // Gale - use platform math functions
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int ceil(double value) {
|
public static int ceil(double value) {
|
||||||
- int i = (int)value;
|
- int i = (int)value;
|
||||||
- return value > (double)i ? i + 1 : i;
|
- return value > i ? i + 1 : i;
|
||||||
+ return (int) Math.ceil(value); // Gale - use platform math functions
|
+ return (int) Math.ceil(value); // Gale - use platform math functions
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,17 +143,17 @@ index f298cdfcf1539e467f57f9f7789de3cf2ca54665..3468b7fbc7440f220fce8039f237658a
|
|||||||
@@ -123,15 +118,7 @@ public class Mth {
|
@@ -123,15 +118,7 @@ public class Mth {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double absMax(double a, double b) {
|
public static double absMax(double x, double y) {
|
||||||
- if (a < 0.0) {
|
- if (x < 0.0) {
|
||||||
- a = -a;
|
- x = -x;
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- if (b < 0.0) {
|
- if (y < 0.0) {
|
||||||
- b = -b;
|
- y = -y;
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- return Math.max(a, b);
|
- return Math.max(x, y);
|
||||||
+ return Math.max(Math.abs(a), Math.abs(b)); // Gale - use platform math functions
|
+ return Math.max(Math.abs(x), Math.abs(y)); // Gale - use platform math functions
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int floorDiv(int dividend, int divisor) {
|
public static int floorDiv(int dividend, int divisor) {
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Tue, 29 Aug 2023 22:29:08 +0200
|
||||||
|
Subject: [PATCH] Faster floating-point positive modulo
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/util/Mth.java b/net/minecraft/util/Mth.java
|
||||||
|
index e0eed27cb33348fcb46858c40014b5fe5dbaf426..85c329437f27fc2fc143d2873572f8d3cf30660d 100644
|
||||||
|
--- a/net/minecraft/util/Mth.java
|
||||||
|
+++ b/net/minecraft/util/Mth.java
|
||||||
|
@@ -149,14 +149,26 @@ public class Mth {
|
||||||
|
return Math.floorMod(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
- public static float positiveModulo(float numerator, float denominator) {
|
||||||
|
+ public static float positiveModuloForAnyDenominator(float numerator, float denominator) { // Gale - faster floating-point positive modulo
|
||||||
|
return (numerator % denominator + denominator) % denominator;
|
||||||
|
}
|
||||||
|
|
||||||
|
- public static double positiveModulo(double numerator, double denominator) {
|
||||||
|
+ public static double positiveModuloForAnyDenominator(double numerator, double denominator) { // Gale - faster floating-point positive modulo
|
||||||
|
return (numerator % denominator + denominator) % denominator;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Gale start - faster floating-point positive modulo
|
||||||
|
+ public static float positiveModuloForPositiveIntegerDenominator(float numerator, float denominator) {
|
||||||
|
+ var modulo = numerator % denominator;
|
||||||
|
+ return modulo < 0 ? modulo + denominator : modulo;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public static double positiveModuloForPositiveIntegerDenominator(double numerator, double denominator) {
|
||||||
|
+ var modulo = numerator % denominator;
|
||||||
|
+ return modulo < 0 ? modulo + denominator : modulo;
|
||||||
|
+ }
|
||||||
|
+ // Gale end - faster floating-point positive modulo
|
||||||
|
+
|
||||||
|
public static boolean isMultipleOf(int number, int multiple) {
|
||||||
|
return number % multiple == 0;
|
||||||
|
}
|
||||||
|
diff --git a/net/minecraft/world/level/levelgen/blending/Blender.java b/net/minecraft/world/level/levelgen/blending/Blender.java
|
||||||
|
index 01e5b29d6e9a5c53c0e23b61ed0c1d7be1a0fe08..314a189e2099e3688fd23e7100120abea6886ccd 100644
|
||||||
|
--- a/net/minecraft/world/level/levelgen/blending/Blender.java
|
||||||
|
+++ b/net/minecraft/world/level/levelgen/blending/Blender.java
|
||||||
|
@@ -144,7 +144,7 @@ public class Blender {
|
||||||
|
private static double heightToOffset(double height) {
|
||||||
|
double d = 1.0;
|
||||||
|
double d1 = height + 0.5;
|
||||||
|
- double d2 = Mth.positiveModulo(d1, 8.0);
|
||||||
|
+ double d2 = Mth.positiveModuloForPositiveIntegerDenominator(d1, 8.0); // Gale - faster floating-point positive modulo
|
||||||
|
return 1.0 * (32.0 * (d1 - 128.0) - 3.0 * (d1 - 120.0) * d2 + 3.0 * d2 * d2) / (128.0 * (32.0 - 3.0 * d2));
|
||||||
|
}
|
||||||
|
|
||||||
@@ -36,11 +36,11 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
diff --git a/net/minecraft/world/item/crafting/ShapelessRecipe.java b/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
||||||
index 12f95bee2a69fd5df7c4a165537e01299e60c5f6..6567b103b27db2841d67c8f296ba6c57781b2b65 100644
|
index d601b54b1de2f2ae44fe2b20c8116c71a6340e45..03df50182a13978c88b05eff13e33de325de08c4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
--- a/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
+++ b/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
||||||
@@ -31,8 +31,15 @@ public class ShapelessRecipe implements CraftingRecipe {
|
@@ -23,8 +23,15 @@ public class ShapelessRecipe implements CraftingRecipe {
|
||||||
final List<Ingredient> ingredients;
|
final List<Ingredient> ingredients;
|
||||||
@Nullable
|
@Nullable
|
||||||
private PlacementInfo placementInfo;
|
private PlacementInfo placementInfo;
|
||||||
@@ -56,10 +56,10 @@ index 12f95bee2a69fd5df7c4a165537e01299e60c5f6..6567b103b27db2841d67c8f296ba6c57
|
|||||||
this.group = group;
|
this.group = group;
|
||||||
this.category = category;
|
this.category = category;
|
||||||
this.result = result;
|
this.result = result;
|
||||||
@@ -80,6 +87,28 @@ public class ShapelessRecipe implements CraftingRecipe {
|
@@ -72,6 +79,28 @@ public class ShapelessRecipe implements CraftingRecipe {
|
||||||
}
|
|
||||||
|
|
||||||
public boolean matches(CraftingInput input, Level world) {
|
@Override
|
||||||
|
public boolean matches(CraftingInput input, Level level) {
|
||||||
+ // Gale start - Airplane - simpler ShapelessRecipe comparison for vanilla
|
+ // Gale start - Airplane - simpler ShapelessRecipe comparison for vanilla
|
||||||
+ if (!this.isBukkit) {
|
+ if (!this.isBukkit) {
|
||||||
+ java.util.List<Ingredient> ingredients = com.google.common.collect.Lists.newArrayList(this.ingredients.toArray(new Ingredient[0]));
|
+ java.util.List<Ingredient> ingredients = com.google.common.collect.Lists.newArrayList(this.ingredients.toArray(new Ingredient[0]));
|
||||||
@@ -85,15 +85,3 @@ index 12f95bee2a69fd5df7c4a165537e01299e60c5f6..6567b103b27db2841d67c8f296ba6c57
|
|||||||
// Paper start - Improve exact choice recipe ingredients & unwrap ternary
|
// Paper start - Improve exact choice recipe ingredients & unwrap ternary
|
||||||
if (input.ingredientCount() != this.ingredients.size()) {
|
if (input.ingredientCount() != this.ingredients.size()) {
|
||||||
return false;
|
return false;
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
|
|
||||||
index 7c989318dc7ad89bb0d9143fcaac1e4bba6f5907..a90b294a99072ab576e61ddacb60a036cb7f0f5a 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
|
|
||||||
@@ -44,6 +44,6 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe
|
|
||||||
data.add(this.toNMS(i, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftRecipe.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.ShapelessRecipe(this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data)));
|
|
||||||
+ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftRecipe.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.ShapelessRecipe(this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data, true))); // Gale - Airplane - simpler ShapelessRecipe comparison for vanilla
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -30,12 +30,12 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
index 6c2d4d6f3a36ab452dfd3c33f66e54f152906639..507a7f2116b020a5af4b8fff15b73dba9904874f 100644
|
index af71a71ff11b418a43728fd464b1e673d593140f..689fede25ae3f73ebe897ab9b8abd70ead032f06 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
--- a/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
+++ b/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
@@ -58,6 +58,45 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
@@ -49,6 +49,45 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||||
super(type, world);
|
super(entityType, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Gale start - Airplane - reduce projectile chunk loading
|
+ // Gale start - Airplane - reduce projectile chunk loading
|
||||||
@@ -77,33 +77,6 @@ index 6c2d4d6f3a36ab452dfd3c33f66e54f152906639..507a7f2116b020a5af4b8fff15b73dba
|
|||||||
+ }
|
+ }
|
||||||
+ // Gale end - Airplane - reduce projectile chunk loading
|
+ // Gale end - Airplane - reduce projectile chunk loading
|
||||||
+
|
+
|
||||||
public void setOwner(@Nullable Entity entity) {
|
public void setOwner(@Nullable Entity owner) {
|
||||||
if (entity != null) {
|
if (owner != null) {
|
||||||
this.ownerUUID = entity.getUUID();
|
this.ownerUUID = owner.getUUID();
|
||||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
index b82bb95b524c95cdefb81abef906eded0717e9a1..eabe9e6a7f99a7ad1f2a9f210f8a7489a89dc4cc 100644
|
|
||||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
@@ -33,7 +33,21 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
|
||||||
public SmallOptimizations smallOptimizations;
|
|
||||||
public class SmallOptimizations extends ConfigurationPart {
|
|
||||||
|
|
||||||
- public int dummyValue = 0;
|
|
||||||
+ // Gale start - Airplane - reduce projectile chunk loading
|
|
||||||
+ public MaxProjectileChunkLoads maxProjectileChunkLoads;
|
|
||||||
+ public class MaxProjectileChunkLoads extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public int perTick = 10;
|
|
||||||
+
|
|
||||||
+ public PerProjectile perProjectile;
|
|
||||||
+ public class PerProjectile extends ConfigurationPart {
|
|
||||||
+ public int max = 10;
|
|
||||||
+ public boolean resetMovementAfterReachLimit = false;
|
|
||||||
+ public boolean removeFromWorldAfterReachLimit = false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+ // Gale end - Airplane - reduce projectile chunk loading
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -6,11 +6,11 @@ Subject: [PATCH] Predict Halloween
|
|||||||
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
Gale - https://galemc.org
|
Gale - https://galemc.org
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
diff --git a/net/minecraft/world/entity/ambient/Bat.java b/net/minecraft/world/entity/ambient/Bat.java
|
||||||
index 60c2868f255d372226e0c1389caaa5477bbef41e..05ab901becfc7ffe4e4483ac2c7acb2e2a72490f 100644
|
index 5ebe7b1dce367d5c5e1136b97b2b9f6737595201..62085eecd2bb55721208c5fd126aaae56a50ed6b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
--- a/net/minecraft/world/entity/ambient/Bat.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
+++ b/net/minecraft/world/entity/ambient/Bat.java
|
||||||
@@ -242,12 +242,66 @@ public class Bat extends AmbientCreature {
|
@@ -243,11 +243,66 @@ public class Bat extends AmbientCreature {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,12 +52,12 @@ index 60c2868f255d372226e0c1389caaa5477bbef41e..05ab901becfc7ffe4e4483ac2c7acb2e
|
|||||||
+ // and `nextHalloweenEnd` will adjust to the epoch ms of date of next year
|
+ // and `nextHalloweenEnd` will adjust to the epoch ms of date of next year
|
||||||
+ // These two fields will not change during current Halloween period.
|
+ // These two fields will not change during current Halloween period.
|
||||||
private static boolean isHalloween() {
|
private static boolean isHalloween() {
|
||||||
- LocalDate localdate = LocalDate.now();
|
- LocalDate localDate = LocalDate.now();
|
||||||
- int i = localdate.get(ChronoField.DAY_OF_MONTH);
|
- int i = localDate.get(ChronoField.DAY_OF_MONTH);
|
||||||
- int j = localdate.get(ChronoField.MONTH_OF_YEAR);
|
- int i1 = localDate.get(ChronoField.MONTH_OF_YEAR);
|
||||||
|
- return i1 == 10 && i >= 20 || i1 == 11 && i <= 3;
|
||||||
+ long currentEpochMillis = System.currentTimeMillis();
|
+ long currentEpochMillis = System.currentTimeMillis();
|
||||||
|
+
|
||||||
- return j == 10 && i >= 20 || j == 11 && i <= 3;
|
|
||||||
+ if (currentEpochMillis > nextHalloweenEnd) {
|
+ if (currentEpochMillis > nextHalloweenEnd) {
|
||||||
+ // Update prediction
|
+ // Update prediction
|
||||||
+
|
+
|
||||||
@@ -18,11 +18,11 @@ ThreadUnsafeRandom is initialized too late and some of our patches
|
|||||||
require it to be initialized earlier. By moving it to the superclass, we
|
require it to be initialized earlier. By moving it to the superclass, we
|
||||||
initialize it earlier, ensuring that it is available sooner.
|
initialize it earlier, ensuring that it is available sooner.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index af783a62991cf996cf488ac7bdb7335082609337..d0b36a5340776e18469b35e0459b3b5d26c051c2 100644
|
index 93b0265e3b1ea133877682721ff28d735d9b688b..e43fa760210cb4c956b2143a65452eecf5f923f4 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -843,8 +843,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -841,8 +841,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paper start - optimise random ticking
|
// Paper start - optimise random ticking
|
||||||
@@ -31,11 +31,11 @@ index af783a62991cf996cf488ac7bdb7335082609337..d0b36a5340776e18469b35e0459b3b5d
|
|||||||
private void optimiseRandomTick(final LevelChunk chunk, final int tickSpeed) {
|
private void optimiseRandomTick(final LevelChunk chunk, final int tickSpeed) {
|
||||||
final LevelChunkSection[] sections = chunk.getSections();
|
final LevelChunkSection[] sections = chunk.getSections();
|
||||||
final int minSection = ca.spottedleaf.moonrise.common.util.WorldUtil.getMinSection((ServerLevel)(Object)this);
|
final int minSection = ca.spottedleaf.moonrise.common.util.WorldUtil.getMinSection((ServerLevel)(Object)this);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||||
index 37ed8ec7cac117e674d39a3dbc3ce8b99e4459e9..5419efc40cd27c532acff423edaa259edacd862a 100644
|
index 73678ed00529af2369c66900c948de5fb46cc128..c4563e827a8333d57aabce1ff8e4c28d7e3a295b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/net/minecraft/world/level/Level.java
|
||||||
@@ -185,6 +185,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -181,6 +181,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
public final Map<ServerExplosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
public final Map<ServerExplosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
||||||
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
|
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
|
||||||
|
|
||||||
@@ -51,23 +51,23 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 2b8c4ee8ad8eb96060e82911c07b01f7b01a4329..370d8ab3cb7f4b066d94b2f4eeda794b79179fa7 100644
|
index 9500fc2f841819b0d40e8a6e48353bb28b6dbe49..5c8d76b80c6cefd87088282e59f5f0f72a4f1611 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -468,6 +468,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
@@ -495,6 +495,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||||
|
long l = gameTime - this.lastInhabitedUpdate;
|
||||||
this.lastInhabitedUpdate = i;
|
this.lastInhabitedUpdate = gameTime;
|
||||||
if (!this.level.isDebug()) {
|
if (!this.level.isDebug()) {
|
||||||
+ this.level.resetIceAndSnowTick(); // Gale - Airplane - optimize random calls in chunk ticking - reset ice & snow tick random
|
+ this.level.resetIceAndSnowTick(); // Gale - Airplane - optimize random calls in chunk ticking - reset ice & snow tick random
|
||||||
if (this.level.tickRateManager().runsNormally()) {
|
if (this.level.tickRateManager().runsNormally()) {
|
||||||
List<LevelChunk> list = this.tickingChunks;
|
List<LevelChunk> list = this.tickingChunks;
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index d0b36a5340776e18469b35e0459b3b5d26c051c2..b424fe78d3c9410e6d6378a7f104cfd5069f0d1e 100644
|
index e43fa760210cb4c956b2143a65452eecf5f923f4..b35fe7112f2ad94e85e98931c403b3ffa8608382 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -892,6 +892,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -890,13 +890,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
}
|
}
|
||||||
// Paper end - optimise random ticking
|
// Paper end - optimise random ticking
|
||||||
|
|
||||||
@@ -75,32 +75,31 @@ index d0b36a5340776e18469b35e0459b3b5d26c051c2..b424fe78d3c9410e6d6378a7f104cfd5
|
|||||||
+
|
+
|
||||||
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
|
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
|
||||||
final ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom simpleRandom = this.simpleRandom; // Paper - optimise random ticking
|
final ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom simpleRandom = this.simpleRandom; // Paper - optimise random ticking
|
||||||
ChunkPos chunkcoordintpair = chunk.getPos();
|
ChunkPos pos = chunk.getPos();
|
||||||
@@ -899,7 +901,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
boolean isRaining = this.isRaining();
|
||||||
int j = chunkcoordintpair.getMinBlockX();
|
int minBlockX = pos.getMinBlockX();
|
||||||
int k = chunkcoordintpair.getMinBlockZ();
|
int minBlockZ = pos.getMinBlockZ();
|
||||||
|
- if (!this.paperConfig().environment.disableThunder && isRaining && this.isThundering() && this.spigotConfig.thunderChance > 0 && simpleRandom.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder // Paper - optimise random ticking
|
||||||
- if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && simpleRandom.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder // Paper - optimise random ticking
|
+ if (!this.paperConfig().environment.disableThunder && isRaining && this.isThundering() && this.spigotConfig.thunderChance > 0 /*&& simpleRandom.nextInt(this.spigotConfig.thunderChance) == 0*/ && chunk.shouldDoLightning(this.random)) { // Spigot // Paper - Option to disable thunder // Paper - optimise random ticking // Gale - Airplane - optimize random calls in chunk ticking - replace random with shouldDoLightning
|
||||||
+ if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 /*&& simpleRandom.nextInt(this.spigotConfig.thunderChance) == 0*/ && chunk.shouldDoLightning(this.random)) { // Spigot // Paper - Option to disable thunder // Paper - optimise random ticking // Gale - Airplane - optimize random calls in chunk ticking - replace random with shouldDoLightning
|
BlockPos blockPos = this.findLightningTargetAround(this.getBlockRandomPos(minBlockX, 0, minBlockZ, 15));
|
||||||
BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
|
if (this.isRainingAt(blockPos)) {
|
||||||
|
DifficultyInstance currentDifficultyAt = this.getCurrentDifficultyAt(blockPos);
|
||||||
if (this.isRainingAt(blockposition)) {
|
@@ -922,7 +924,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
@@ -927,7 +929,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
|
- if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
|
||||||
+ if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Option to disable ice and snow // Gale - Airplane - optimize random calls in chunk ticking - optimize further random ticking
|
+ if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Option to disable ice and snow // Gale - Airplane - optimize random calls in chunk ticking - optimize further random ticking
|
||||||
for (int l = 0; l < randomTickSpeed; ++l) {
|
for (int i = 0; i < randomTickSpeed; i++) {
|
||||||
if (simpleRandom.nextInt(48) == 0) { // Paper - optimise random ticking
|
if (simpleRandom.nextInt(48) == 0) { // Paper - optimise random ticking
|
||||||
this.tickPrecipitation(this.getBlockRandomPos(j, 0, k, 15));
|
this.tickPrecipitation(this.getBlockRandomPos(minBlockX, 0, minBlockZ, 15));
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 09a6d7410bc029889ce4b89ab149a52f31468b9b..3f6d60601cbfc138ab004e38bf442d985192fd3f 100644
|
index 3a7707427691a7862499a7efa3b39ead1ef78013..95972e7d5e0357ff5884f1cb2f7596c5029f999d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -86,6 +86,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
@@ -125,6 +125,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||||
private final LevelChunkTicks<Fluid> fluidTicks;
|
}
|
||||||
private LevelChunk.UnsavedListener unsavedListener;
|
// Paper end - get block chunk optimisation
|
||||||
|
|
||||||
+ // Gale start - Airplane - optimize random calls in chunk ticking - instead of using a random every time the chunk is ticked, define when lightning strikes preemptively
|
+ // Gale start - Airplane - optimize random calls in chunk ticking - instead of using a random every time the chunk is ticked, define when lightning strikes preemptively
|
||||||
+ private int lightningTick;
|
+ private int lightningTick;
|
||||||
@@ -114,10 +113,10 @@ index 09a6d7410bc029889ce4b89ab149a52f31468b9b..3f6d60601cbfc138ab004e38bf442d98
|
|||||||
+ }
|
+ }
|
||||||
+ // Gale end - Airplane - optimize random calls in chunk ticking - instead of using a random every time the chunk is ticked, define when lightning strikes preemptively
|
+ // Gale end - Airplane - optimize random calls in chunk ticking - instead of using a random every time the chunk is ticked, define when lightning strikes preemptively
|
||||||
+
|
+
|
||||||
public LevelChunk(Level world, ChunkPos pos) {
|
public LevelChunk(Level level, ChunkPos pos) {
|
||||||
this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null);
|
this(level, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, null, null, null);
|
||||||
}
|
}
|
||||||
@@ -119,6 +131,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
@@ -161,6 +173,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||||
this.debug = !empty && this.level.isDebug();
|
this.debug = !empty && this.level.isDebug();
|
||||||
this.defaultBlockState = empty ? VOID_AIR_BLOCKSTATE : AIR_BLOCKSTATE;
|
this.defaultBlockState = empty ? VOID_AIR_BLOCKSTATE : AIR_BLOCKSTATE;
|
||||||
// Paper end - get block chunk optimisation
|
// Paper end - get block chunk optimisation
|
||||||
@@ -125,4 +124,4 @@ index 09a6d7410bc029889ce4b89ab149a52f31468b9b..3f6d60601cbfc138ab004e38bf442d98
|
|||||||
+ this.lightningTick = this.level.simpleRandom.nextInt(100000) << 1; // Gale - Airplane - optimize random calls in chunk ticking - initialize lightning tick
|
+ this.lightningTick = this.level.simpleRandom.nextInt(100000) << 1; // Gale - Airplane - optimize random calls in chunk ticking - initialize lightning tick
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start
|
public LevelChunk(ServerLevel level, ProtoChunk chunk, @Nullable LevelChunk.PostLoadProcessor postLoad) {
|
||||||
@@ -30,28 +30,28 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
|
||||||
index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..35ffcd82df6af65a9c1b9a1a6acdd8b7567b8645 100644
|
index 4b5ffd278e0e9d47100e5452949e8d757bbfece4..c7a77b16ba032eb24b070fd6a5f0f824b3cbcc1a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
--- a/net/minecraft/world/entity/monster/EnderMan.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
+++ b/net/minecraft/world/entity/monster/EnderMan.java
|
||||||
@@ -307,11 +307,18 @@ public class EnderMan extends Monster implements NeutralMob {
|
@@ -309,11 +309,18 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||||
private boolean teleport(double x, double y, double z) {
|
private boolean teleport(double x, double y, double z) {
|
||||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(x, y, z);
|
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos(x, y, z);
|
||||||
|
|
||||||
- while (blockposition_mutableblockposition.getY() > this.level().getMinY() && !this.level().getBlockState(blockposition_mutableblockposition).blocksMotion()) {
|
- while (mutableBlockPos.getY() > this.level().getMinY() && !this.level().getBlockState(mutableBlockPos).blocksMotion()) {
|
||||||
+ // Gale start - Airplane - single chunk lookup
|
+ // Gale start - Airplane - single chunk lookup
|
||||||
+ net.minecraft.world.level.chunk.LevelChunk chunk = this.level().getChunkIfLoaded(blockposition_mutableblockposition);
|
+ net.minecraft.world.level.chunk.LevelChunk chunk = this.level().getChunkIfLoaded(mutableBlockPos);
|
||||||
+ if (chunk == null) {
|
+ if (chunk == null) {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ while (blockposition_mutableblockposition.getY() > this.level().getMinY() && !chunk.getBlockState(blockposition_mutableblockposition).blocksMotion()) {
|
+ while (mutableBlockPos.getY() > this.level().getMinY() && !chunk.getBlockState(mutableBlockPos).blocksMotion()) {
|
||||||
+ // Gale end - Airplane - single chunk lookup
|
+ // Gale end - Airplane - single chunk lookup
|
||||||
blockposition_mutableblockposition.move(Direction.DOWN);
|
mutableBlockPos.move(Direction.DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
- BlockState iblockdata = this.level().getBlockState(blockposition_mutableblockposition);
|
- BlockState blockState = this.level().getBlockState(mutableBlockPos);
|
||||||
+ BlockState iblockdata = chunk.getBlockState(blockposition_mutableblockposition); // Gale - Airplane - single chunk lookup
|
+ BlockState blockState = chunk.getBlockState(mutableBlockPos); // Gale - Airplane - single chunk lookup
|
||||||
boolean flag = iblockdata.blocksMotion();
|
boolean flag = blockState.blocksMotion();
|
||||||
boolean flag1 = iblockdata.getFluidState().is(FluidTags.WATER);
|
boolean isWater = blockState.getFluidState().is(FluidTags.WATER);
|
||||||
|
if (flag && !isWater) {
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Wed, 23 Nov 2022 20:12:48 +0100
|
||||||
|
Subject: [PATCH] Reduce acquire POI for stuck entities
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Skip POI finding if stuck in vehicle"
|
||||||
|
By: Paul Sauve <paul@technove.co>
|
||||||
|
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
* Airplane copyright *
|
||||||
|
|
||||||
|
Airplane
|
||||||
|
Copyright (C) 2020 Technove LLC
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
|
index b9174ae7e3a3e2de2d570b95ab5012ac3c3a2eda..751e91a922b20c96f27885c3eb085ec4ae39091b 100644
|
||||||
|
--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
|
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
|
@@ -28,6 +28,13 @@ import org.apache.commons.lang3.mutable.MutableLong;
|
||||||
|
public class AcquirePoi {
|
||||||
|
public static final int SCAN_RANGE = 48;
|
||||||
|
|
||||||
|
+ // Gale start - Airplane - reduce acquire POI for stuck entities
|
||||||
|
+ private static void addAdditionalTimeToMutableLongIfMobIsStuck(MutableLong mutableLong, net.minecraft.server.level.ServerLevel level, PathfinderMob mob) {
|
||||||
|
+ long stuckEntityAdditionalWaitTime = level.galeConfig().smallOptimizations.reducedIntervals.acquirePoiForStuckEntity;
|
||||||
|
+ mutableLong.add(stuckEntityAdditionalWaitTime <= 0L ? 0L : mob.getNavigation().isStuck() ? stuckEntityAdditionalWaitTime : 0L);
|
||||||
|
+ }
|
||||||
|
+ // Gale end - Airplane - reduce acquire POI for stuck entities
|
||||||
|
+
|
||||||
|
public static BehaviorControl<PathfinderMob> create(
|
||||||
|
Predicate<Holder<PoiType>> acquirablePois,
|
||||||
|
MemoryModuleType<GlobalPos> acquiringMemory,
|
||||||
|
@@ -65,12 +72,13 @@ public class AcquirePoi {
|
||||||
|
return false;
|
||||||
|
} else if (mutableLong.getValue() == 0L) {
|
||||||
|
mutableLong.setValue(level.getGameTime() + level.random.nextInt(20));
|
||||||
|
+ addAdditionalTimeToMutableLongIfMobIsStuck(mutableLong, level, mob); // Gale - Airplane - reduce acquire POI for stuck entities
|
||||||
|
return false;
|
||||||
|
} else if (level.getGameTime() < mutableLong.getValue()) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
mutableLong.setValue(time + 20L + level.getRandom().nextInt(20));
|
||||||
|
- if (mob.getNavigation().isStuck()) mutableLong.add(200); // Paper - Perf: Wait an additional 10s to check again if they're stuck // TODO Modifies Vanilla behavior, add config option
|
||||||
|
+ addAdditionalTimeToMutableLongIfMobIsStuck(mutableLong, level, mob); // Paper - Perf: Wait an additional 10s to check again if they're stuck // TODO Modifies Vanilla behavior, add config option // Gale - Airplane - reduce acquire POI for stuck entities
|
||||||
|
PoiManager poiManager = level.getPoiManager();
|
||||||
|
map.long2ObjectEntrySet().removeIf(entry -> !entry.getValue().isStillValid(time));
|
||||||
|
Predicate<BlockPos> predicate1 = pos -> {
|
||||||
@@ -30,28 +30,28 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
diff --git a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||||
index 52982c1e6a4da36392569c791853279f5f9ac31a..b51a04d3e006bc770006cff790791bc0f6bee77d 100644
|
index 2f8920d8ee765d057a22d76f24f7d7dc1b0b17ca..17a08a3af468093668a41f154c2beb69c6617efa 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
--- a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
+++ b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||||
@@ -75,9 +75,18 @@ public class TargetingConditions {
|
@@ -75,9 +75,18 @@ public class TargetingConditions {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.range > 0.0) {
|
if (this.range > 0.0) {
|
||||||
- double d = this.testInvisible ? target.getVisibilityPercent(tester) : 1.0;
|
- double d = this.testInvisible ? target.getVisibilityPercent(entity) : 1.0;
|
||||||
- double e = Math.max(this.range * d, 2.0);
|
- double max = Math.max(this.range * d, 2.0);
|
||||||
+ // Gale start - Airplane - check targeting range before getting visibility
|
+ // Gale start - Airplane - check targeting range before getting visibility
|
||||||
+ // d = invisibility percent, e = follow range adjusted for invisibility, f = distance
|
+ // d = invisibility percent, max = follow range adjusted for invisibility, d1 = distance
|
||||||
double f = tester.distanceToSqr(target.getX(), target.getY(), target.getZ());
|
double d1 = entity.distanceToSqr(target.getX(), target.getY(), target.getZ());
|
||||||
+ double followRangeRaw = this.range;
|
+ double followRangeRaw = this.range;
|
||||||
+
|
+
|
||||||
+ if (f > followRangeRaw * followRangeRaw) { // the actual follow range will always be this value or smaller, so if the distance is larger then it never will return true after getting invis
|
+ if (d1 > followRangeRaw * followRangeRaw) { // the actual follow range will always be this value or smaller, so if the distance is larger then it never will return true after getting invis
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ double d = this.testInvisible ? target.getVisibilityPercent(tester) : 1.0;
|
+ double d = this.testInvisible ? target.getVisibilityPercent(entity) : 1.0;
|
||||||
+ double e = Math.max(followRangeRaw * d, 2.0);
|
+ double max = Math.max(followRangeRaw * d, 2.0);
|
||||||
+ // Gale end - Airplane - check targeting range before getting visibility
|
+ // Gale end - Airplane - check targeting range before getting visibility
|
||||||
if (f > e * e) {
|
if (d1 > max * max) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -30,11 +30,24 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
index b1af5a5eafcd7e090beb36b1a1734e3f1a063f03..fbb1b17ade83e0fe043765369d53e140771778c9 100644
|
index bd888ef719b9bfc93bace0b1d0fb771ac659f515..5d1e83658bb9646cf56885627256f0be7a84831e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
@@ -2115,6 +2115,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -215,7 +215,7 @@ public final class ActivationRange {
|
||||||
|
}
|
||||||
|
// special cases.
|
||||||
|
if (entity instanceof final LivingEntity living) {
|
||||||
|
- if (living.onClimbable() || living.jumping || living.hurtTime > 0 || !living.activeEffects.isEmpty() || living.isFreezing()) {
|
||||||
|
+ if (living.onClimbableCached() || living.jumping || living.hurtTime > 0 || !living.activeEffects.isEmpty() || living.isFreezing()) { // Gale - Airplane - cache on climbable check - use cached
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (entity instanceof final Mob mob && mob.getTarget() != null) {
|
||||||
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
index 00caebfabfc459eed86f0e6e2cc3f4b628f7ef99..d17020508a1f8d6c7da630b89a11db9bf7d1748f 100644
|
||||||
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
@@ -2015,6 +2015,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
return this.lastClimbablePos;
|
return this.lastClimbablePos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,16 +68,3 @@ index b1af5a5eafcd7e090beb36b1a1734e3f1a063f03..fbb1b17ade83e0fe043765369d53e140
|
|||||||
public boolean onClimbable() {
|
public boolean onClimbable() {
|
||||||
if (this.isSpectator()) {
|
if (this.isSpectator()) {
|
||||||
return false;
|
return false;
|
||||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
index 1d438ef44cbe4d1eedfba36d8fe5d2ad53464921..9cee5e8b9188b094a2428da5d9cf42db1c18f7a3 100644
|
|
||||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
@@ -295,7 +295,7 @@ public class ActivationRange
|
|
||||||
if ( entity instanceof LivingEntity )
|
|
||||||
{
|
|
||||||
LivingEntity living = (LivingEntity) entity;
|
|
||||||
- if ( living.onClimbable() || living.jumping || living.hurtTime > 0 || living.activeEffects.size() > 0 || living.isFreezing()) // Paper
|
|
||||||
+ if ( living.onClimbableCached() || living.jumping || living.hurtTime > 0 || living.activeEffects.size() > 0 || living.isFreezing()) // Paper // Gale - Airplane - cache on climbable check - use cached
|
|
||||||
{
|
|
||||||
return 1; // Paper
|
|
||||||
}
|
|
||||||
@@ -39,12 +39,12 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java b/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
diff --git a/net/minecraft/world/phys/shapes/EntityCollisionContext.java b/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
||||||
index a94fbedaf0297c006c561a145913bb91f2d0a817..121d155be5213cb4d9a4258b4b9a27ca3f335209 100644
|
index dafcba6eeba62a5e35ad53c9b38605a17139d8b0..a8ad7c304eca5a1b5b8247077fcb148d760d6ac9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
--- a/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
||||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
+++ b/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
||||||
@@ -19,23 +19,33 @@ public class EntityCollisionContext implements CollisionContext {
|
@@ -19,25 +19,35 @@ public class EntityCollisionContext implements CollisionContext {
|
||||||
return defaultValue;
|
return canAscend;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
+ // Gale start - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
+ // Gale start - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
||||||
@@ -53,32 +53,34 @@ index a94fbedaf0297c006c561a145913bb91f2d0a817..121d155be5213cb4d9a4258b4b9a27ca
|
|||||||
private final double entityBottom;
|
private final double entityBottom;
|
||||||
private final ItemStack heldItem;
|
private final ItemStack heldItem;
|
||||||
private final Predicate<FluidState> canStandOnFluid;
|
private final Predicate<FluidState> canStandOnFluid;
|
||||||
+ */
|
+ */
|
||||||
+ // Gale end - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
+ // Gale end - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
||||||
@Nullable
|
@Nullable
|
||||||
private final Entity entity;
|
private final Entity entity;
|
||||||
|
|
||||||
protected EntityCollisionContext(boolean descending, double minY, ItemStack heldItem, Predicate<FluidState> walkOnFluidPredicate, @Nullable Entity entity) {
|
protected EntityCollisionContext(
|
||||||
|
boolean descending, double entityBottom, ItemStack heldItem, Predicate<FluidState> canStandOnFluid, @Nullable Entity entity
|
||||||
|
) {
|
||||||
+ // Gale start - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
+ // Gale start - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
||||||
+ /*
|
+ /*
|
||||||
this.descending = descending;
|
this.descending = descending;
|
||||||
this.entityBottom = minY;
|
this.entityBottom = entityBottom;
|
||||||
this.heldItem = heldItem;
|
this.heldItem = heldItem;
|
||||||
this.canStandOnFluid = walkOnFluidPredicate;
|
this.canStandOnFluid = canStandOnFluid;
|
||||||
+ */
|
+ */
|
||||||
+ // Gale end - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
+ // Gale end - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
||||||
this.entity = entity;
|
this.entity = entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
protected EntityCollisionContext(Entity entity, boolean collidesWithFluid) {
|
protected EntityCollisionContext(Entity entity, boolean canStandOnFluid) {
|
||||||
+ // Gale start - Airplane - make EntityCollisionContext a live representation - remove unneeded things
|
+ // Gale start - Airplane - make EntityCollisionContext a live representation - remove unneeded things
|
||||||
+ /*
|
+ /*
|
||||||
this(
|
this(
|
||||||
entity.isDescending(),
|
entity.isDescending(),
|
||||||
entity.getY(),
|
entity.getY(),
|
||||||
@@ -43,16 +53,31 @@ public class EntityCollisionContext implements CollisionContext {
|
@@ -45,16 +55,31 @@ public class EntityCollisionContext implements CollisionContext {
|
||||||
collidesWithFluid ? state -> true : (entity instanceof LivingEntity ? ((LivingEntity)entity)::canStandOnFluid : state -> false),
|
canStandOnFluid ? fluidState -> true : (entity instanceof LivingEntity ? ((LivingEntity)entity)::canStandOnFluid : fluidState -> false),
|
||||||
entity
|
entity
|
||||||
);
|
);
|
||||||
+ */
|
+ */
|
||||||
@@ -99,19 +101,19 @@ index a94fbedaf0297c006c561a145913bb91f2d0a817..121d155be5213cb4d9a4258b4b9a27ca
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canStandOnFluid(FluidState stateAbove, FluidState state) {
|
public boolean canStandOnFluid(FluidState fluid1, FluidState fluid2) {
|
||||||
- return this.canStandOnFluid.test(state) && !stateAbove.getType().isSame(state.getType());
|
- return this.canStandOnFluid.test(fluid2) && !fluid1.getType().isSame(fluid2.getType());
|
||||||
+ // Gale start - Airplane - make EntityCollisionContext a live representation
|
+ // Gale start - Airplane - make EntityCollisionContext a live representation
|
||||||
+ Entity entity = this.entity;
|
+ Entity entity = this.entity;
|
||||||
+ if (entity instanceof LivingEntity livingEntity) {
|
+ if (entity instanceof LivingEntity livingEntity) {
|
||||||
+ return livingEntity.canStandOnFluid(state) && !stateAbove.getType().isSame(state.getType());
|
+ return livingEntity.canStandOnFluid(fluid2) && !fluid1.getType().isSame(fluid2.getType());
|
||||||
+ }
|
+ }
|
||||||
+ return false;
|
+ return false;
|
||||||
+ // Gale end - Airplane - make EntityCollisionContext a live representation
|
+ // Gale end - Airplane - make EntityCollisionContext a live representation
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -62,12 +87,12 @@ public class EntityCollisionContext implements CollisionContext {
|
@@ -64,12 +89,12 @@ public class EntityCollisionContext implements CollisionContext {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDescending() {
|
public boolean isDescending() {
|
||||||
@@ -120,8 +122,8 @@ index a94fbedaf0297c006c561a145913bb91f2d0a817..121d155be5213cb4d9a4258b4b9a27ca
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAbove(VoxelShape shape, BlockPos pos, boolean defaultValue) {
|
public boolean isAbove(VoxelShape shape, BlockPos pos, boolean canAscend) {
|
||||||
- return this.entityBottom > (double)pos.getY() + shape.max(Direction.Axis.Y) - 1.0E-5F;
|
- return this.entityBottom > pos.getY() + shape.max(Direction.Axis.Y) - 1.0E-5F;
|
||||||
+ return (this.entity == null ? -Double.MAX_VALUE : entity.getY()) > (double) pos.getY() + shape.max(Direction.Axis.Y) - (double) 1.0E-5F; // Gale - Airplane - make EntityCollisionContext a live representation
|
+ return (this.entity == null ? -Double.MAX_VALUE : entity.getY()) > (double) pos.getY() + shape.max(Direction.Axis.Y) - (double) 1.0E-5F; // Gale - Airplane - make EntityCollisionContext a live representation
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Wed, 23 Nov 2022 22:26:37 +0100
|
||||||
|
Subject: [PATCH] Better checking for useless move packets
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Better checking for useless move packets"
|
||||||
|
By: Paul Sauve <paul@technove.co>
|
||||||
|
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
* Airplane copyright *
|
||||||
|
|
||||||
|
Airplane
|
||||||
|
Copyright (C) 2020 Technove LLC
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
||||||
|
index 0fb253aa55a24b56b17f524b3261c5b75c7d7e59..d985555a029d06ffc73dd10115df47b83c9afafd 100644
|
||||||
|
--- a/net/minecraft/server/level/ServerEntity.java
|
||||||
|
+++ b/net/minecraft/server/level/ServerEntity.java
|
||||||
|
@@ -179,19 +179,25 @@ public class ServerEntity {
|
||||||
|
packet = ClientboundEntityPositionSyncPacket.of(this.entity);
|
||||||
|
flag3 = true;
|
||||||
|
flag4 = true;
|
||||||
|
- } else if ((!flag2 || !flag) && !(this.entity instanceof AbstractArrow)) {
|
||||||
|
- if (flag2) {
|
||||||
|
- packet = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short)l, (short)l1, (short)l2, this.entity.onGround());
|
||||||
|
- flag3 = true;
|
||||||
|
- } else if (flag) {
|
||||||
|
- packet = new ClientboundMoveEntityPacket.Rot(this.entity.getId(), b, b1, this.entity.onGround());
|
||||||
|
- flag4 = true;
|
||||||
|
- }
|
||||||
|
+ // Gale start - Airplane - better checking for useless move packets
|
||||||
|
} else {
|
||||||
|
- packet = new ClientboundMoveEntityPacket.PosRot(this.entity.getId(), (short)l, (short)l1, (short)l2, b, b1, this.entity.onGround());
|
||||||
|
- flag3 = true;
|
||||||
|
- flag4 = true;
|
||||||
|
+ if (flag2 || flag || this.entity instanceof AbstractArrow) {
|
||||||
|
+ if ((!flag2 || !flag) && !(this.entity instanceof AbstractArrow)) {
|
||||||
|
+ if (flag2) {
|
||||||
|
+ packet = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) l, (short) l1, (short) l2, this.entity.onGround());
|
||||||
|
+ flag3 = true;
|
||||||
|
+ } else if (flag) {
|
||||||
|
+ packet = new ClientboundMoveEntityPacket.Rot(this.entity.getId(), b, b1, this.entity.onGround());
|
||||||
|
+ flag4 = true;
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ packet = new ClientboundMoveEntityPacket.PosRot(this.entity.getId(), (short) l, (short) l1, (short) l2, b, b1, this.entity.onGround());
|
||||||
|
+ flag3 = true;
|
||||||
|
+ flag4 = true;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
+ // Gale end - Airplane - better checking for useless move packets
|
||||||
|
|
||||||
|
if (this.entity.hasImpulse || this.trackDelta || this.entity instanceof LivingEntity && ((LivingEntity)this.entity).isFallFlying()) {
|
||||||
|
Vec3 deltaMovement = this.entity.getDeltaMovement();
|
||||||
@@ -30,14 +30,14 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
diff --git a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||||
index aee0147649d458b87d92496eda0c1723ebe570d2..7e9243f76f77df2f2c5744d2dd17187c215d6e08 100644
|
index d0ab3db7bbd2942db19f473474371b20ce822608..3f080b15543bf8c5fa0774b62d7f12e13b82511a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
--- a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
+++ b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||||
@@ -121,6 +121,7 @@ public abstract class MoveToBlockGoal extends Goal {
|
@@ -119,6 +119,7 @@ public abstract class MoveToBlockGoal extends Goal {
|
||||||
for (int m = 0; m <= l; m = m > 0 ? -m : 1 - m) {
|
for (int i4 = 0; i4 <= i3; i4 = i4 > 0 ? -i4 : 1 - i4) {
|
||||||
for (int n = m < l && m > -l ? l : 0; n <= l; n = n > 0 ? -n : 1 - n) {
|
for (int i5 = i4 < i3 && i4 > -i3 ? i3 : 0; i5 <= i3; i5 = i5 > 0 ? -i5 : 1 - i5) {
|
||||||
mutableBlockPos.setWithOffset(blockPos, m, k - 1, n);
|
mutableBlockPos.setWithOffset(blockPos, i4, i2 - 1, i5);
|
||||||
+ if (!this.mob.level().hasChunkAt(mutableBlockPos)) continue; // Gale - Airplane - block goal does not load chunks - if this block isn't loaded, continue
|
+ if (!this.mob.level().hasChunkAt(mutableBlockPos)) continue; // Gale - Airplane - block goal does not load chunks - if this block isn't loaded, continue
|
||||||
if (this.mob.isWithinRestriction(mutableBlockPos) && this.isValidTarget(this.mob.level(), mutableBlockPos)) {
|
if (this.mob.isWithinRestriction(mutableBlockPos) && this.isValidTarget(this.mob.level(), mutableBlockPos)) {
|
||||||
this.blockPos = mutableBlockPos;
|
this.blockPos = mutableBlockPos;
|
||||||
@@ -30,11 +30,11 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index cd4461c175e88b9dd6f05a8bcd9363de60725370..44028368322ac91a4f6848f632d51d34269cb64a 100644
|
index 3594240116d3b61dbf838490df7a30345d7d8925..72da610c4d0301ddf2940bbc067430d05ff46684 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -403,6 +403,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -360,6 +360,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return this.originWorld;
|
return this.originWorld;
|
||||||
}
|
}
|
||||||
// Paper end - Entity origin API
|
// Paper end - Entity origin API
|
||||||
@@ -42,19 +42,19 @@ index cd4461c175e88b9dd6f05a8bcd9363de60725370..44028368322ac91a4f6848f632d51d34
|
|||||||
public float getBukkitYaw() {
|
public float getBukkitYaw() {
|
||||||
return this.yRot;
|
return this.yRot;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
index 94d04a20f97405e02d7cccaabadc7a7e86e336f7..edd791da70fd7e18c42133dcd771f212cb25abab 100644
|
index 4c808c7ef336de74048f40bd1cc8b14131a9325d..beebe81e13c99c6ddd9ffb2c7a3fdd74cb9c7afa 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
@@ -23,9 +23,11 @@ public class AttributeMap {
|
@@ -23,9 +23,11 @@ public class AttributeMap {
|
||||||
private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
||||||
private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
||||||
private final AttributeSupplier supplier;
|
private final AttributeSupplier supplier;
|
||||||
+ private final java.util.function.Function<Holder<Attribute>, AttributeInstance> createInstance; // Gale - Airplane - reduce entity allocations
|
+ private final java.util.function.Function<Holder<Attribute>, AttributeInstance> createInstance; // Gale - Airplane - reduce entity allocations
|
||||||
|
|
||||||
public AttributeMap(AttributeSupplier defaultAttributes) {
|
public AttributeMap(AttributeSupplier supplier) {
|
||||||
this.supplier = defaultAttributes;
|
this.supplier = supplier;
|
||||||
+ this.createInstance = attributex -> this.supplier.createInstance(this::onAttributeModified, attributex); // Gale - Airplane - reduce entity allocations
|
+ this.createInstance = holder -> this.supplier.createInstance(this::onAttributeModified, holder); // Gale - Airplane - reduce entity allocations
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onAttributeModified(AttributeInstance instance) {
|
private void onAttributeModified(AttributeInstance instance) {
|
||||||
@@ -62,7 +62,7 @@ index 94d04a20f97405e02d7cccaabadc7a7e86e336f7..edd791da70fd7e18c42133dcd771f212
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public AttributeInstance getInstance(Holder<Attribute> attribute) {
|
public AttributeInstance getInstance(Holder<Attribute> attribute) {
|
||||||
- return this.attributes.computeIfAbsent(attribute, attributex -> this.supplier.createInstance(this::onAttributeModified, attributex));
|
- return this.attributes.computeIfAbsent(attribute, holder -> this.supplier.createInstance(this::onAttributeModified, (Holder<Attribute>)holder));
|
||||||
+ return this.attributes.computeIfAbsent(attribute, this.createInstance); // Gale - Airplane - reduce entity allocations - cache lambda, as for some reason java allocates it anyways
|
+ return this.attributes.computeIfAbsent(attribute, this.createInstance); // Gale - Airplane - reduce entity allocations - cache lambda, as for some reason java allocates it anyways
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Wed, 23 Nov 2022 23:13:56 +0100
|
||||||
|
Subject: [PATCH] Remove lambda from ticking guard
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Remove lambda from ticking guard"
|
||||||
|
By: Paul Sauve <paul@technove.co>
|
||||||
|
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
* Airplane copyright *
|
||||||
|
|
||||||
|
Airplane
|
||||||
|
Copyright (C) 2020 Technove LLC
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
|
index b35fe7112f2ad94e85e98931c403b3ffa8608382..2caeb69306a42d02b7a5c27e00fb969e392ac6ba 100644
|
||||||
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
|
@@ -794,7 +794,19 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
|
entity.stopRiding();
|
||||||
|
}
|
||||||
|
|
||||||
|
- this.guardEntityTick(this::tickNonPassenger, entity);
|
||||||
|
+ // Gale start - Airplane - remove lambda from ticking guard - copied from guardEntityTick
|
||||||
|
+ try {
|
||||||
|
+ this.tickNonPassenger(entity); // Gale - Airplane - remove lambda from ticking guard - changed
|
||||||
|
+ } catch (Throwable var6) {
|
||||||
|
+ // Paper start - Prevent block entity and entity crashes
|
||||||
|
+ final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||||
|
+ MinecraftServer.LOGGER.error(msg, var6);
|
||||||
|
+ getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, var6))); // Paper - ServerExceptionEvent
|
||||||
|
+ entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD);
|
||||||
|
+ // Paper end - Prevent block entity and entity crashes
|
||||||
|
+ }
|
||||||
|
+ this.moonrise$midTickTasks(); // Paper - rewrite chunk system
|
||||||
|
+ // Gale end - Airplane - remove lambda from ticking guard - copied from guardEntityTick
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||||
|
index c4563e827a8333d57aabce1ff8e4c28d7e3a295b..51fa382b930ccbeb605064488ab4df985df94ed6 100644
|
||||||
|
--- a/net/minecraft/world/level/Level.java
|
||||||
|
+++ b/net/minecraft/world/level/Level.java
|
||||||
|
@@ -1506,10 +1506,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
|
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||||
|
MinecraftServer.LOGGER.error(msg, var6);
|
||||||
|
getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, var6))); // Paper - ServerExceptionEvent
|
||||||
|
- entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD);
|
||||||
|
+ entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD); // Gale - Airplane - remove lambda from ticking guard - diff on change ServerLevel#tick
|
||||||
|
// Paper end - Prevent block entity and entity crashes
|
||||||
|
}
|
||||||
|
- this.moonrise$midTickTasks(); // Paper - rewrite chunk system
|
||||||
|
+ this.moonrise$midTickTasks(); // Paper - rewrite chunk system // Gale - Airplane - remove lambda from ticking guard - diff on change ServerLevel#tick
|
||||||
|
}
|
||||||
|
|
||||||
|
// Paper start - Option to prevent armor stands from doing entity lookups
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Thu, 24 Nov 2022 01:19:12 +0100
|
||||||
|
Subject: [PATCH] SIMD support
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Add SIMD utilities"
|
||||||
|
By: Kevin Raneri <kevin.raneri@gmail.com>
|
||||||
|
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
index baa92ab485928b2e57adb14af00f7e6120694184..3cd6e63ea6c18a26ef1aa394cf53d9e3463f8e50 100644
|
||||||
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
@@ -231,6 +231,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||||
|
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||||
|
|
||||||
|
+ // Gale start - Pufferfish - SIMD support
|
||||||
|
+ // Initialize vectorization
|
||||||
|
+ try {
|
||||||
|
+ gg.pufferfish.pufferfish.simd.SIMDDetection.initialize();
|
||||||
|
+ } catch (Throwable ignored) {}
|
||||||
|
+ // Gale end - Pufferfish - SIMD support
|
||||||
|
+
|
||||||
|
this.setPvpAllowed(properties.pvp);
|
||||||
|
this.setFlightAllowed(properties.allowFlight);
|
||||||
|
this.setMotd(properties.motd);
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Mon, 26 Dec 2022 02:11:29 +0100
|
||||||
|
Subject: [PATCH] Make book writing configurable
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Add option to disable books"
|
||||||
|
By: Kevin Raneri <kevin.raneri@gmail.com>
|
||||||
|
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
* Pufferfish description *
|
||||||
|
|
||||||
|
Books are commonly the target of duping-related exploits. If you
|
||||||
|
anticipate that your server will be an early target of duping attacks in
|
||||||
|
the event that new exploits are found, you may want to consider removing
|
||||||
|
the ability for non-privileged players to edit books. This patch allows
|
||||||
|
you to easily disable books, should you want to preemptively remove this
|
||||||
|
functionality before additional exploits are found.
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
index d248671b2e1c6256fc4d74320bdb29ca078bad0b..089a903607c0d16dc2744981a6dcb23115df010d 100644
|
||||||
|
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
@@ -1161,6 +1161,11 @@ public class ServerGamePacketListenerImpl
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleEditBook(ServerboundEditBookPacket packet) {
|
||||||
|
+ // Gale start - Pufferfish - make book writing configurable
|
||||||
|
+ if (!(org.galemc.gale.configuration.GaleGlobalConfiguration.get().gameplayMechanics.enableBookWriting || this.player.getBukkitEntity().hasPermission(org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions.writeBooks) || this.player.getBukkitEntity().hasPermission("pufferfish.usebooks"))) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // Gale end - Pufferfish - make book writing configurable
|
||||||
|
// Paper start - Book size limits
|
||||||
|
final io.papermc.paper.configuration.type.number.IntOr.Disabled pageMax = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax;
|
||||||
|
if (!this.cserver.isPrimaryThread() && pageMax.enabled()) {
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Wed, 23 Nov 2022 23:32:51 +0100
|
||||||
|
Subject: [PATCH] Optimize entity coordinate key
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Optimize entity coordinate key"
|
||||||
|
By: Kevin Raneri <kevin.raneri@gmail.com>
|
||||||
|
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
* Pufferfish description *
|
||||||
|
|
||||||
|
When executing getCoordinateKey for entities (a hotpath), the JVM is
|
||||||
|
required to repeatedly cast doubles to longs. The performance impact of
|
||||||
|
this depends on the CPU architecture, but generally switching between
|
||||||
|
FPU and ALU incurs a significant performance hit. The casted/rounded
|
||||||
|
data is already available in the blockPosition struct, so we use that
|
||||||
|
instead of re-doing the casting.
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
|
index 72da610c4d0301ddf2940bbc067430d05ff46684..0bbac68dbd891da8892ba40fc18578c4f9e67c11 100644
|
||||||
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
|
@@ -225,7 +225,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
public double yo;
|
||||||
|
public double zo;
|
||||||
|
private Vec3 position;
|
||||||
|
- private BlockPos blockPosition;
|
||||||
|
+ public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public
|
||||||
|
private ChunkPos chunkPosition;
|
||||||
|
private Vec3 deltaMovement = Vec3.ZERO;
|
||||||
|
private float yRot;
|
||||||
@@ -27,23 +27,23 @@ damage in the first place. This check doesn't improve performance much
|
|||||||
but is so much cheaper than the suffocation check that it's worth
|
but is so much cheaper than the suffocation check that it's worth
|
||||||
keeping it.
|
keeping it.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 206a1461178706e56f4b3c92c9121dd4177edd4c..244857d69b52e1689d932cab914ed8c1331e96d3 100644
|
index d17020508a1f8d6c7da630b89a11db9bf7d1748f..1fbc971f4bb2473dc67021b4cec9228109e0c43b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -463,7 +463,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -448,7 +448,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
|
if (this.isAlive()) {
|
||||||
if (world1 instanceof ServerLevel) {
|
boolean flag = this instanceof Player;
|
||||||
worldserver1 = (ServerLevel) world1;
|
if (this.level() instanceof ServerLevel serverLevel1) {
|
||||||
- if (this.isInWall()) {
|
- if (this.isInWall()) {
|
||||||
+ // Gale start - Pufferfish - reduce in wall checks
|
+ // Gale start - Pufferfish - reduce in wall checks
|
||||||
+ long checkStuckInWallInterval = this.level().galeConfig().smallOptimizations.reducedIntervals.checkStuckInWall;
|
+ long checkStuckInWallInterval = this.level().galeConfig().smallOptimizations.reducedIntervals.checkStuckInWall;
|
||||||
+ if ((checkStuckInWallInterval <= 1 || (tickCount % checkStuckInWallInterval == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) {
|
+ if ((checkStuckInWallInterval <= 1 || (tickCount % checkStuckInWallInterval == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) {
|
||||||
+ // Gale end - Pufferfish - reduce in wall checks
|
+ // Gale end - Pufferfish - reduce in wall checks
|
||||||
this.hurtServer(worldserver1, this.damageSources().inWall(), 1.0F);
|
this.hurtServer(serverLevel1, this.damageSources().inWall(), 1.0F);
|
||||||
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||||
double d1 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
|
double d = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
|
||||||
@@ -1432,6 +1435,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -1354,6 +1357,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
return this.getHealth() <= 0.0F;
|
return this.getHealth() <= 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,17 +57,5 @@ index 206a1461178706e56f4b3c92c9121dd4177edd4c..244857d69b52e1689d932cab914ed8c1
|
|||||||
+ // Gale end - Pufferfish - reduce in wall checks
|
+ // Gale end - Pufferfish - reduce in wall checks
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public boolean hurtServer(ServerLevel world, DamageSource source, float amount) {
|
public boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) {
|
||||||
if (this.isInvulnerableTo(world, source)) {
|
if (this.isInvulnerableTo(level, damageSource)) {
|
||||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
index 8a0416775d00148bf3478b51d92b00d9d485c667..08a02055b535c024cc806db17bb45fd333a56929 100644
|
|
||||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
@@ -53,6 +53,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
|
||||||
public class ReducedIntervals extends ConfigurationPart {
|
|
||||||
|
|
||||||
public int acquirePoiForStuckEntity = 60; // Gale - Airplane - reduce acquire POI for stuck entities
|
|
||||||
+ public int checkStuckInWall = 10; // Gale - Pufferfish - reduce in wall checks
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -12,10 +12,10 @@ By: Kevin Raneri <kevin.raneri@gmail.com>
|
|||||||
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
|
diff --git a/net/minecraft/network/chat/SignedMessageChain.java b/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
index 300929a406905f5ff1ede664d5b99fb0938d4d2e..987e595ba3d19b081f22891f01dc25fbabb5bb9f 100644
|
index f6eed34b2fd72ab74cc9dc4b99ca184d512c0a66..23872fac07fa36f10ef090df2423c978998dcb99 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
|
--- a/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
|
+++ b/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
@@ -45,7 +45,7 @@ public class SignedMessageChain {
|
@@ -45,7 +45,7 @@ public class SignedMessageChain {
|
||||||
SignedMessageLink signedMessageLink = SignedMessageChain.this.nextLink;
|
SignedMessageLink signedMessageLink = SignedMessageChain.this.nextLink;
|
||||||
if (signedMessageLink == null) {
|
if (signedMessageLink == null) {
|
||||||
@@ -25,18 +25,3 @@ index 300929a406905f5ff1ede664d5b99fb0938d4d2e..987e595ba3d19b081f22891f01dc25fb
|
|||||||
this.setChainBroken();
|
this.setChainBroken();
|
||||||
throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.OUT_OF_ORDER_CHAT, org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes
|
throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.OUT_OF_ORDER_CHAT, org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes
|
||||||
} else {
|
} else {
|
||||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
||||||
index d180ea6099d8fed3cf19f0f32bbfced7df57c9d7..8075e5c17f469f1bf5b7758a1334943d6ed8383f 100644
|
|
||||||
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
||||||
@@ -41,4 +41,10 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
|
|
||||||
public boolean enableBookWriting = true; // Gale - Pufferfish - make book writing configurable
|
|
||||||
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public Misc misc;
|
|
||||||
+ public class Misc extends ConfigurationPart {
|
|
||||||
+
|
|
||||||
+ public boolean verifyChatOrder = true; // Gale - Pufferfish - make chat order verification configurable
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Mon, 7 Aug 2023 21:35:57 +0200
|
||||||
|
Subject: [PATCH] Make ender dragon respawn attempt after placing end crystals
|
||||||
|
configurable
|
||||||
|
|
||||||
|
The original Pufferfish description has been included below for reference,
|
||||||
|
but please note that on Gale, there is no need to disable end crystal
|
||||||
|
spawning for performance: Gale already contains other performance
|
||||||
|
enhancements that make the end crystal checks very fast.
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Option to disable end crystal dragon respawning"
|
||||||
|
By: Kevin Raneri <kevin.raneri@gmail.com>
|
||||||
|
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
* Pufferfish description *
|
||||||
|
|
||||||
|
On servers that expect end crystal fights in the end dimension,
|
||||||
|
disabling this will prevent the server from performing an expensive
|
||||||
|
search to attempt respawning the ender dragon whenever a player places
|
||||||
|
an end crystal.
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/item/EndCrystalItem.java b/net/minecraft/world/item/EndCrystalItem.java
|
||||||
|
index 1bc4c8be71b445f64134548a85fd81442298c0f1..a1570503d3e4dcc9f1cd0b119ab2e60f7c63b6d8 100644
|
||||||
|
--- a/net/minecraft/world/item/EndCrystalItem.java
|
||||||
|
+++ b/net/minecraft/world/item/EndCrystalItem.java
|
||||||
|
@@ -49,10 +49,12 @@ public class EndCrystalItem extends Item {
|
||||||
|
// CraftBukkit end
|
||||||
|
level.addFreshEntity(endCrystal);
|
||||||
|
level.gameEvent(context.getPlayer(), GameEvent.ENTITY_PLACE, blockPos);
|
||||||
|
+ if (level.galeConfig().gameplayMechanics.tryRespawnEnderDragonAfterEndCrystalPlace) { // Gale - Pufferfish - make ender dragon respawn attempt after placing end crystals configurable
|
||||||
|
EndDragonFight dragonFight = ((ServerLevel)level).getDragonFight();
|
||||||
|
if (dragonFight != null) {
|
||||||
|
dragonFight.tryRespawn(aboveBlockPosition); // Paper - Perf: Do crystal-portal proximity check before entity lookup
|
||||||
|
}
|
||||||
|
+ } // Gale - Pufferfish - make ender dragon respawn attempt after placing end crystals configurable
|
||||||
|
}
|
||||||
|
|
||||||
|
context.getItemInHand().shrink(1);
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Mon, 26 Dec 2022 07:30:30 +0100
|
||||||
|
Subject: [PATCH] Make saving fireworks configurable
|
||||||
|
|
||||||
|
License: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Don't save Fireworks"
|
||||||
|
By: Aikar <aikar@aikar.co>
|
||||||
|
As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||||
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
* EmpireCraft description *
|
||||||
|
|
||||||
|
Fireworks can bug out and not detonate, and an automated
|
||||||
|
launcher can very easily fill a chunk.
|
||||||
|
|
||||||
|
Prevent saving Fireworks so that chunk unloads will wipe a chunks fireworks in this case.
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||||
|
index 774ca9e0b56fd175ae246051de762d0c4256ca58..7f370f938d84240d763f60e51cddc705b3eaf5ea 100644
|
||||||
|
--- a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||||
|
+++ b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||||
|
@@ -364,4 +364,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
||||||
|
double d1 = entity.position().z - this.position().z;
|
||||||
|
return DoubleDoubleImmutablePair.of(d, d1);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Gale start - EMC - make saving fireworks configurable
|
||||||
|
+ @Override
|
||||||
|
+ public boolean shouldBeSaved() {
|
||||||
|
+ return this.level().galeConfig().smallOptimizations.saveFireworks;
|
||||||
|
+ }
|
||||||
|
+ // Gale end - EMC - make saving fireworks configurable
|
||||||
|
}
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Thu, 24 Nov 2022 23:03:52 +0100
|
||||||
|
Subject: [PATCH] Reduce hopper item checks
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Improve Hopper Performance"
|
||||||
|
By: Aikar <aikar@aikar.co>
|
||||||
|
As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||||
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
* EmpireCraft description *
|
||||||
|
|
||||||
|
Only do an item "suck in" action once per second
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
|
index 52a7ed0d991758bad0dcedcb7f97fb15ac6c6d04..45c152856c46d11f3bd790a01fac89a7c3b68af1 100644
|
||||||
|
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
|
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
|
@@ -143,7 +143,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||||
|
+ return; // Gale - EMC - reduce hopper item checks
|
||||||
|
}
|
||||||
|
+ // Gale start - EMC - reduce hopper item checks
|
||||||
|
+ if (level().galeConfig().smallOptimizations.reducedIntervals.checkNearbyItem.hopper.minecart.temporaryImmunity.checkForMinecartNearItemWhileInactive) {
|
||||||
|
+ this.markNearbyHopperCartsAsImmune();
|
||||||
|
+ }
|
||||||
|
+ // Gale end - EMC - reduce hopper item checks
|
||||||
|
}
|
||||||
|
// Paper end - EAR 2
|
||||||
|
|
||||||
|
@@ -227,9 +233,29 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||||
|
+ return; // Gale - EMC - reduce hopper item checks
|
||||||
|
+ }
|
||||||
|
+ this.markNearbyHopperCartsAsImmune(); // Gale - EMC - reduce hopper item checks
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Gale start - EMC - reduce hopper item checks
|
||||||
|
+ private void markNearbyHopperCartsAsImmune() {
|
||||||
|
+ var config = this.level().galeConfig().smallOptimizations.reducedIntervals.checkNearbyItem.hopper.minecart;
|
||||||
|
+ // No need to mark hopper minecarts as immune if they can pull every tick anyway
|
||||||
|
+ if (config.interval <= 1) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ if (config.temporaryImmunity.duration > 0 && this.isAlive() && this.onGround && !this.isRemoved() && (config.temporaryImmunity.nearbyItemMaxAge == -1 || this.age <= config.temporaryImmunity.nearbyItemMaxAge) && this.age % Math.max(1, config.temporaryImmunity.checkForMinecartNearItemInterval) == 0 && config.temporaryImmunity.maxItemHorizontalDistance >= 0 && config.temporaryImmunity.maxItemVerticalDistance >= 0) {
|
||||||
|
+ net.minecraft.world.phys.AABB aabb = this.getBoundingBox().inflate(config.temporaryImmunity.maxItemHorizontalDistance, config.temporaryImmunity.maxItemVerticalDistance, config.temporaryImmunity.maxItemHorizontalDistance);
|
||||||
|
+ for (Entity entity : this.level().getEntities(this, aabb)) {
|
||||||
|
+ if (entity instanceof net.minecraft.world.entity.vehicle.MinecartHopper hopper) {
|
||||||
|
+ hopper.pickupImmunity = net.minecraft.server.MinecraftServer.currentTick + config.temporaryImmunity.duration;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ // Gale end - EMC - reduce hopper item checks
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockPos getBlockPosBelowThatAffectsMyMovement() {
|
||||||
|
diff --git a/net/minecraft/world/entity/vehicle/MinecartHopper.java b/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
||||||
|
index 8341e7f01606fca90e69384c16fc19bb9e20d1b7..c5a3dc3e704a9f6d67d9049e49cd1b33b6994766 100644
|
||||||
|
--- a/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
||||||
|
+++ b/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
||||||
|
@@ -21,6 +21,7 @@ import net.minecraft.world.level.block.state.properties.RailShape;
|
||||||
|
public class MinecartHopper extends AbstractMinecartContainer implements Hopper {
|
||||||
|
private boolean enabled = true;
|
||||||
|
private boolean consumedItemThisFrame = false;
|
||||||
|
+ public int pickupImmunity = 0; // Gale - EMC - reduce hopper item checks
|
||||||
|
|
||||||
|
public MinecartHopper(EntityType<? extends MinecartHopper> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
@@ -149,4 +150,12 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
|
||||||
|
+ // Gale start - EMC - reduce hopper item checks
|
||||||
|
+ private long tickAttempts = 0;
|
||||||
|
+ @Override
|
||||||
|
+ public long getAndIncrementAttemptCounter() {
|
||||||
|
+ return tickAttempts++;
|
||||||
|
+ }
|
||||||
|
+ // Gale end EMC - - reduce hopper item checks
|
||||||
|
+
|
||||||
|
}
|
||||||
|
diff --git a/net/minecraft/world/level/block/entity/Hopper.java b/net/minecraft/world/level/block/entity/Hopper.java
|
||||||
|
index 5f042e294db605827000123252b0df646968f897..e1cc15f28fe8da23b74ff4504c5b2da2236fda3f 100644
|
||||||
|
--- a/net/minecraft/world/level/block/entity/Hopper.java
|
||||||
|
+++ b/net/minecraft/world/level/block/entity/Hopper.java
|
||||||
|
@@ -11,6 +11,8 @@ public interface Hopper extends Container {
|
||||||
|
return SUCK_AABB;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ long getAndIncrementAttemptCounter(); // Gale - EMC - reduce hopper item checks
|
||||||
|
+
|
||||||
|
double getLevelX();
|
||||||
|
|
||||||
|
double getLevelY();
|
||||||
|
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
|
index 5cd1326ad5d046c88b2b3449d610a78fa880b4cd..276cb0dffaa253a6c13b4c68d8c703732118d0d1 100644
|
||||||
|
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
|
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
|
@@ -540,7 +540,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
boolean flag = hopper.isGridAligned() && blockState.isCollisionShapeFullBlock(level, blockPos) && !blockState.is(BlockTags.DOES_NOT_BLOCK_HOPPERS);
|
||||||
|
- if (!flag) {
|
||||||
|
+ if (!flag && shouldSuckIn(level, hopper)) { // Gale - EMC - reduce hopper item checks
|
||||||
|
for (ItemEntity itemEntity : getItemsAtAndAbove(level, hopper)) {
|
||||||
|
if (addItem(hopper, itemEntity)) {
|
||||||
|
return true;
|
||||||
|
@@ -816,6 +816,31 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||||
|
return stack1.getCount() < stack1.getMaxStackSize() && ItemStack.isSameItemSameComponents(stack1, stack2); // Paper - Perf: Optimize Hoppers; used to return true for full itemstacks?!
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Gale start - EMC - reduce hopper item checks
|
||||||
|
+ private long tickAttempts = 0;
|
||||||
|
+ @Override
|
||||||
|
+ public long getAndIncrementAttemptCounter() {
|
||||||
|
+ return tickAttempts++;
|
||||||
|
+ }
|
||||||
|
+ private static boolean shouldSuckIn(Level level, Hopper hopper) {
|
||||||
|
+ int suckInterval;
|
||||||
|
+ if (hopper instanceof net.minecraft.world.entity.vehicle.MinecartHopper minecartHopper) {
|
||||||
|
+ if (minecartHopper.pickupImmunity > net.minecraft.server.MinecraftServer.currentTick) {
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ suckInterval = level.galeConfig().smallOptimizations.reducedIntervals.checkNearbyItem.hopper.minecart.interval;
|
||||||
|
+ } else {
|
||||||
|
+ suckInterval = level.galeConfig().smallOptimizations.reducedIntervals.checkNearbyItem.hopper.interval;
|
||||||
|
+ }
|
||||||
|
+ if (suckInterval <= 1) {
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ final int hopperId = (int) hopper.getLevelX() + (int) hopper.getLevelY() + (int) hopper.getLevelZ();
|
||||||
|
+ return (hopper.getAndIncrementAttemptCounter() + hopperId) % suckInterval == 0;
|
||||||
|
+ }
|
||||||
|
+ // Gale end - EMC - reduce hopper item checks
|
||||||
|
+
|
||||||
|
@Override
|
||||||
|
public double getLevelX() {
|
||||||
|
return this.worldPosition.getX() + 0.5;
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Thu, 24 Nov 2022 23:15:49 +0100
|
||||||
|
Subject: [PATCH] Reduce villager item re-pickup
|
||||||
|
|
||||||
|
License: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Slow down villager pickup of thrown items"
|
||||||
|
By: Aikar <aikar@aikar.co>
|
||||||
|
As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||||
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
* EmpireCraft description *
|
||||||
|
|
||||||
|
Helps 1.8 Farms let hoppers pick it up before Villager
|
||||||
|
due to our hopper changes
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||||
|
index 2664d72c3b6906d0505df2e63c0e5075eba9461b..800bc29502ed46bd77cb04c0a79143898f109a48 100644
|
||||||
|
--- a/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||||
|
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||||
|
@@ -87,7 +87,16 @@ public class BehaviorUtils {
|
||||||
|
Vec3 vec3 = offset.subtract(entity.position());
|
||||||
|
vec3 = vec3.normalize().multiply(speedMultiplier.x, speedMultiplier.y, speedMultiplier.z);
|
||||||
|
itemEntity.setDeltaMovement(vec3);
|
||||||
|
- itemEntity.setDefaultPickUpDelay();
|
||||||
|
+ // Gale start - EMC - reduce villager item re-pickup
|
||||||
|
+ if (entity instanceof net.minecraft.world.entity.npc.Villager) {
|
||||||
|
+ int repickupDelay = entity.level().galeConfig().smallOptimizations.reducedIntervals.villagerItemRepickup;
|
||||||
|
+ if (repickupDelay <= -1) {
|
||||||
|
+ itemEntity.setDefaultPickUpDelay();
|
||||||
|
+ } else {
|
||||||
|
+ itemEntity.pickupDelay = repickupDelay;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // Gale end - EMC - reduce villager item re-pickup
|
||||||
|
// CraftBukkit start
|
||||||
|
org.bukkit.event.entity.EntityDropItemEvent event = new org.bukkit.event.entity.EntityDropItemEvent(entity.getBukkitEntity(), (org.bukkit.entity.Item) itemEntity.getBukkitEntity());
|
||||||
|
itemEntity.level().getCraftServer().getPluginManager().callEvent(event);
|
||||||
@@ -6,23 +6,11 @@ Subject: [PATCH] Variable entity wake-up duration
|
|||||||
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
Gale - https://galemc.org
|
Gale - https://galemc.org
|
||||||
|
|
||||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
index 9ac3c235a7adc42af1ba22aaa4efbce5b006f98d..42306d45d3b8f7807b344422fca7382eec52cde2 100644
|
index 5d1e83658bb9646cf56885627256f0be7a84831e..b9c8bcf3136939a1c8f215af53c4fa343b344e38 100644
|
||||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
--- a/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
@@ -96,6 +96,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
@@ -53,27 +53,39 @@ public final class ActivationRange {
|
||||||
public GameplayMechanics gameplayMechanics;
|
|
||||||
public class GameplayMechanics extends ConfigurationPart {
|
|
||||||
|
|
||||||
+ public double entityWakeUpDurationRatioStandardDeviation = 0.2; // Gale - variable entity wake-up duration
|
|
||||||
public boolean tryRespawnEnderDragonAfterEndCrystalPlace = true; // Gale - Pufferfish - make ender dragon respawn attempt after placing end crystals configurable
|
|
||||||
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
index 24536f70309f802d45714e06bace339f1d9f1013..21363541030d0381a8e139b409453b57a4eb6eaf 100644
|
|
||||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
@@ -69,28 +69,40 @@ public class ActivationRange
|
|
||||||
if (entity.activationType == ActivationType.VILLAGER) {
|
if (entity.activationType == ActivationType.VILLAGER) {
|
||||||
if (inactiveFor > config.wakeUpInactiveVillagersEvery && world.wakeupInactiveRemainingVillagers > 0) {
|
if (inactiveFor > config.wakeUpInactiveVillagersEvery && world.wakeupInactiveRemainingVillagers > 0) {
|
||||||
world.wakeupInactiveRemainingVillagers--;
|
world.wakeupInactiveRemainingVillagers--;
|
||||||
@@ -50,7 +38,6 @@ index 24536f70309f802d45714e06bace339f1d9f1013..21363541030d0381a8e139b409453b57
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// Paper end
|
|
||||||
|
|
||||||
+ // Gale start - variable entity wake-up duration
|
+ // Gale start - variable entity wake-up duration
|
||||||
+ private static final java.util.Random wakeUpDurationRandom = new java.util.Random();
|
+ private static final java.util.Random wakeUpDurationRandom = new java.util.Random();
|
||||||
@@ -64,6 +51,6 @@ index 24536f70309f802d45714e06bace339f1d9f1013..21363541030d0381a8e139b409453b57
|
|||||||
+ }
|
+ }
|
||||||
+ // Gale end - variable entity wake-up duration
|
+ // Gale end - variable entity wake-up duration
|
||||||
+
|
+
|
||||||
static AABB maxBB = new AABB( 0, 0, 0, 0, 0, 0 );
|
static AABB maxBB = new AABB(0, 0, 0, 0, 0, 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,11 +12,11 @@ By: chickeneer <emcchickeneer@gmail.com>
|
|||||||
As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index a0d940312e37d7b74df7103878ff547a45fc5c05..ada9814d24b32140f365eb01a231bc123d99c72e 100644
|
index b349da64650f914db8212e19b3c05ba92e74a1a3..9c2f9bc5e5bef96fb7ad0f04aa1cb72db9d10638 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -322,6 +322,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
@@ -386,6 +386,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
public boolean joining = true;
|
public boolean joining = true;
|
||||||
public boolean sentListPacket = false;
|
public boolean sentListPacket = false;
|
||||||
public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready
|
public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready
|
||||||
@@ -24,12 +24,12 @@ index a0d940312e37d7b74df7103878ff547a45fc5c05..ada9814d24b32140f365eb01a231bc12
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
public boolean isRealPlayer; // Paper
|
public boolean isRealPlayer; // Paper
|
||||||
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index c13aadf03462faf04bf0fc50525a130112debdff..ad53a045efaa6ed44a5b345586366b7c50e5688a 100644
|
index 089a903607c0d16dc2744981a6dcb23115df010d..1a2b9a2e2cabf542523982f6f8742840933b0f4a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -2385,7 +2385,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -2325,7 +2325,7 @@ public class ServerGamePacketListenerImpl
|
||||||
this.disconnectAsync((Component) Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper // Paper - add proper async disconnect
|
this.disconnectAsync(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add proper async disconnect
|
||||||
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
|
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
|
||||||
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
|
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
|
||||||
- } else {
|
- } else {
|
||||||
@@ -37,11 +37,11 @@ index c13aadf03462faf04bf0fc50525a130112debdff..ad53a045efaa6ed44a5b345586366b7c
|
|||||||
this.player.resetLastActionTime();
|
this.player.resetLastActionTime();
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (sync) {
|
if (sync) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||||
index 30de3d1a7792c38ae946f19cb0e14637919b5001..0e2b903dbd783bea891b88902136e1ac9f7fd66c 100644
|
index 03feaf0adb8ee87e33744a4615dc2507a02f92d7..23645f84f705bfbea29d7eaeaca84d0b115aae5a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -353,6 +353,8 @@ public abstract class PlayerList {
|
@@ -330,6 +330,8 @@ public abstract class PlayerList {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Thu, 24 Nov 2022 23:39:32 +0100
|
||||||
|
Subject: [PATCH] Do not log invalid statistics
|
||||||
|
|
||||||
|
License: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Ignore statistics warnings"
|
||||||
|
By: Aikar <aikar@aikar.co>
|
||||||
|
As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||||
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/stats/ServerStatsCounter.java b/net/minecraft/stats/ServerStatsCounter.java
|
||||||
|
index 6c5205fe1dc6387a77b1edbdcab748d39e775d7f..b26dbe807e5cb0a42f6c06b933397902310e5616 100644
|
||||||
|
--- a/net/minecraft/stats/ServerStatsCounter.java
|
||||||
|
+++ b/net/minecraft/stats/ServerStatsCounter.java
|
||||||
|
@@ -113,16 +113,20 @@ public class ServerStatsCounter extends StatsCounter {
|
||||||
|
Util.ifElse(
|
||||||
|
this.getStat(type, string1),
|
||||||
|
stat -> this.stats.put(stat, compound1.getInt(string1)),
|
||||||
|
- () -> LOGGER.warn("Invalid statistic in {}: Don't know what {} is", this.file, string1)
|
||||||
|
+ () -> {
|
||||||
|
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.warn("Invalid statistic in {}: Don't know what {} is", this.file, string1); // Gale - EMC - do not log invalid statistics
|
||||||
|
+ }
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
- LOGGER.warn(
|
||||||
|
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.warn( // Gale - EMC - do not log invalid statistics
|
||||||
|
"Invalid statistic value in {}: Don't know what {} is for key {}", this.file, compound1.get(string1), string1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
- () -> LOGGER.warn("Invalid statistic type in {}: Don't know what {} is", this.file, string)
|
||||||
|
+ () -> {
|
||||||
|
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.warn("Invalid statistic type in {}: Don't know what {} is", this.file, string); // Gale - EMC - do not log invalid statistics
|
||||||
|
+ }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Thu, 24 Nov 2022 23:45:57 +0100
|
||||||
|
Subject: [PATCH] Do not log empty message warnings
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
index 1a2b9a2e2cabf542523982f6f8742840933b0f4a..1fa2bb9e9866ad6f0394327df934388b7fcd7f93 100644
|
||||||
|
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
@@ -2479,7 +2479,7 @@ public class ServerGamePacketListenerImpl
|
||||||
|
// CraftBukkit start
|
||||||
|
String rawMessage = message.signedContent();
|
||||||
|
if (rawMessage.isEmpty()) {
|
||||||
|
- LOGGER.warn("{} tried to send an empty message", this.player.getScoreboardName());
|
||||||
|
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.chat.emptyMessageWarning) LOGGER.warn("{} tried to send an empty message", this.player.getScoreboardName()); // Gale - do not log empty message warnings
|
||||||
|
} else if (this.getCraftPlayer().isConversing()) {
|
||||||
|
final String conversationInput = rawMessage;
|
||||||
|
this.server.processQueue.add(() -> ServerGamePacketListenerImpl.this.getCraftPlayer().acceptConversationInput(conversationInput));
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Fri, 25 Nov 2022 13:18:54 +0100
|
||||||
|
Subject: [PATCH] Do not log ignored advancements
|
||||||
|
|
||||||
|
License: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Logger settings (suppressing pointless logs)"
|
||||||
|
By: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
As part of: Purpur (https://github.com/PurpurMC/Purpur)
|
||||||
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
* Purpur copyright *
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2019-2022 PurpurMC
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
|
||||||
|
index 64dbee1f67eaa17c93c13bfa38fbe27de57651e4..ecb7edc1b10d23bb1979152341cd4a2b89613a65 100644
|
||||||
|
--- a/net/minecraft/server/PlayerAdvancements.java
|
||||||
|
+++ b/net/minecraft/server/PlayerAdvancements.java
|
||||||
|
@@ -148,7 +148,7 @@ public class PlayerAdvancements {
|
||||||
|
AdvancementHolder advancementHolder = advancementManager.get(path);
|
||||||
|
if (advancementHolder == null) {
|
||||||
|
if (!path.getNamespace().equals(ResourceLocation.DEFAULT_NAMESPACE)) return; // CraftBukkit
|
||||||
|
- LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", path, this.playerSavePath);
|
||||||
|
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.ignoredAdvancements) LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", path, this.playerSavePath); // Gale - Purpur - do not log ignored advancements
|
||||||
|
} else {
|
||||||
|
this.startProgress(advancementHolder, progress);
|
||||||
|
this.progressChanged.add(advancementHolder);
|
||||||
@@ -36,27 +36,16 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
diff --git a/net/minecraft/server/level/WorldGenRegion.java b/net/minecraft/server/level/WorldGenRegion.java
|
||||||
index e4b0dc3121101d54394a0c3a413dabf8103b2ea6..4212d2522a0619267902c8230d424495378ee743 100644
|
index 7fa41dea184b01891f45d8e404bc1cba19cf1bcf..c41f68a84fce082140cf1b18db328cfacae35208 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
--- a/net/minecraft/server/level/WorldGenRegion.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
+++ b/net/minecraft/server/level/WorldGenRegion.java
|
||||||
@@ -336,6 +336,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
@@ -312,7 +312,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// Paper start - Buffer OOB setBlock calls
|
// Paper start - Buffer OOB setBlock calls
|
||||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.setBlockInFarChunk) // Gale - Purpur - do not log setBlock in far chunks
|
- if (!hasSetFarWarned) {
|
||||||
if (!hasSetFarWarned) {
|
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.setBlockInFarChunk && !hasSetFarWarned) { // Gale - Purpur - do not log setBlock in far chunks
|
||||||
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStep.targetStatus()) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
Util.logAndPauseIfInIde(
|
||||||
hasSetFarWarned = true;
|
"Detected setBlock in a far chunk ["
|
||||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
+ sectionPosX
|
||||||
index 0ffbe284abfc8ef8f9ed21c8539c497cad685380..0844babd79d3743abe240e68a50e082f58e2f01c 100644
|
|
||||||
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
||||||
@@ -53,6 +53,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
|
|
||||||
|
|
||||||
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics
|
|
||||||
public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements
|
|
||||||
+ public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks
|
|
||||||
|
|
||||||
public Chat chat;
|
|
||||||
public class Chat extends ConfigurationPart {
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Fri, 25 Nov 2022 15:01:30 +0100
|
||||||
|
Subject: [PATCH] Do not log unrecognized recipes
|
||||||
|
|
||||||
|
License: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Logger settings (suppressing pointless logs)"
|
||||||
|
By: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
As part of: Purpur (https://github.com/PurpurMC/Purpur)
|
||||||
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
* Purpur copyright *
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2019-2022 PurpurMC
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/stats/ServerRecipeBook.java b/net/minecraft/stats/ServerRecipeBook.java
|
||||||
|
index e3985b70cee7f7d56f179aeef8c2a6a6b312d83a..3418d7d3cf1116479f793e76e101d1c68bfe175c 100644
|
||||||
|
--- a/net/minecraft/stats/ServerRecipeBook.java
|
||||||
|
+++ b/net/minecraft/stats/ServerRecipeBook.java
|
||||||
|
@@ -138,7 +138,7 @@ public class ServerRecipeBook extends RecipeBook {
|
||||||
|
try {
|
||||||
|
ResourceKey<Recipe<?>> resourceKey = ResourceKey.create(Registries.RECIPE, ResourceLocation.parse(string));
|
||||||
|
if (!isRecognized.test(resourceKey)) {
|
||||||
|
- LOGGER.error("Tried to load unrecognized recipe: {} removed now.", resourceKey);
|
||||||
|
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.unrecognizedRecipes) LOGGER.error("Tried to load unrecognized recipe: {} removed now.", resourceKey); // Gale - Purpur - do not log unrecognized recipes
|
||||||
|
} else {
|
||||||
|
output.accept(resourceKey);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Fri, 25 Nov 2022 15:07:55 +0100
|
||||||
|
Subject: [PATCH] Do not log expired message warnings
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/network/chat/SignedMessageChain.java b/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
|
index 23872fac07fa36f10ef090df2423c978998dcb99..44b166f5802468d7b1aefc8641496e0fefd6998f 100644
|
||||||
|
--- a/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
|
+++ b/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
|
@@ -56,7 +56,7 @@ public class SignedMessageChain {
|
||||||
|
throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.INVALID_SIGNATURE);
|
||||||
|
} else {
|
||||||
|
if (playerChatMessage.hasExpiredServer(Instant.now())) {
|
||||||
|
- SignedMessageChain.LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", body.content());
|
||||||
|
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.chat.expiredMessageWarning) SignedMessageChain.LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", body.content()); // Gale - do not log expired message warnings
|
||||||
|
}
|
||||||
|
|
||||||
|
SignedMessageChain.this.nextLink = signedMessageLink.advance();
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Fri, 25 Nov 2022 15:13:38 +0100
|
||||||
|
Subject: [PATCH] Do not log Not Secure marker
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||||
|
index 23645f84f705bfbea29d7eaeaca84d0b115aae5a..a0d56fcd58f943353b55821557d79c4dc0cdf46b 100644
|
||||||
|
--- a/net/minecraft/server/players/PlayerList.java
|
||||||
|
+++ b/net/minecraft/server/players/PlayerList.java
|
||||||
|
@@ -1258,7 +1258,7 @@ public abstract class PlayerList {
|
||||||
|
public void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldFilterMessageTo, @Nullable ServerPlayer sender, ChatType.Bound boundChatType, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
|
||||||
|
// Paper end
|
||||||
|
boolean flag = this.verifyChatTrusted(message);
|
||||||
|
- this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), boundChatType, flag ? null : "Not Secure"); // Paper
|
||||||
|
+ this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), boundChatType, flag || !org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker ? null : "Not Secure"); // Paper // Gale - do not log Not Secure marker
|
||||||
|
OutgoingChatMessage outgoingChatMessage = OutgoingChatMessage.create(message);
|
||||||
|
boolean flag1 = false;
|
||||||
|
|
||||||
@@ -16,10 +16,10 @@ Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|||||||
|
|
||||||
This can help to hide annoying scanning bots from showing up in console.
|
This can help to hide annoying scanning bots from showing up in console.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
diff --git a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
index 033755682c61c889723c3669b5cff4de147f637e..f89eb72f34ff3dcbb04ec0c9e98dfedce203911a 100644
|
index 6689aeacf50d1498e8d23cce696fb4fecbd1cf39..d9c0831dd58a5cdf1b23444489ac04629f8916f9 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
@@ -146,6 +146,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
@@ -146,6 +146,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||||
|
|
||||||
public void disconnect(Component reason) {
|
public void disconnect(Component reason) {
|
||||||
@@ -32,18 +32,6 @@ index 033755682c61c889723c3669b5cff4de147f637e..f89eb72f34ff3dcbb04ec0c9e98dfedc
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Gale end - Pufferfish - do not log disconnections with null id
|
+ // Gale end - Pufferfish - do not log disconnections with null id
|
||||||
ServerLoginPacketListenerImpl.LOGGER.info("Disconnecting {}: {}", this.getUserName(), reason.getString());
|
LOGGER.info("Disconnecting {}: {}", this.getUserName(), reason.getString());
|
||||||
this.connection.send(new ClientboundLoginDisconnectPacket(reason));
|
this.connection.send(new ClientboundLoginDisconnectPacket(reason));
|
||||||
this.connection.disconnect(reason);
|
this.connection.disconnect(reason);
|
||||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
||||||
index 413c41e8c2fead4de859535007641094a64e97dd..a1b98b0f92618764304de484c373ce5e106f34f0 100644
|
|
||||||
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
||||||
@@ -58,6 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
|
|
||||||
public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks
|
|
||||||
public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes
|
|
||||||
public boolean legacyMaterialInitialization = false; // Gale - Purpur - do not log legacy Material initialization
|
|
||||||
+ public boolean nullIdDisconnections = true; // Gale - Pufferfish - do not log disconnections with null id
|
|
||||||
|
|
||||||
public Chat chat;
|
|
||||||
public class Chat extends ConfigurationPart {
|
|
||||||
@@ -40,16 +40,16 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 3c63a956b5b04de5181a1827a4df8a1efb726b0c..46d97e4997babbf6e5b71f1f0fb37c46a887087e 100644
|
index 3cd6e63ea6c18a26ef1aa394cf53d9e3463f8e50..3c1e6320305fa41b27a78c844dcf6172b244cc9b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -194,7 +194,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -183,7 +183,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paper start - detect running as root
|
// Paper start - detect running as root
|
||||||
- if (io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
- if (io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
||||||
+ if (!"false".equalsIgnoreCase(System.getProperty("gale.log.warning.root")) && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) { // Gale - KeYi - do not log run as root warning
|
+ if (!"false".equalsIgnoreCase(System.getProperty("gale.log.warning.root")) && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) { // Gale - KeYi - do not log run as root warning
|
||||||
DedicatedServer.LOGGER.warn("****************************");
|
LOGGER.warn("****************************");
|
||||||
DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
|
LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
|
||||||
DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
|
LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
|
||||||
@@ -40,16 +40,16 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 46d97e4997babbf6e5b71f1f0fb37c46a887087e..feb1758ae47d0d2fe9b049a2167ab52f3e03406b 100644
|
index 3c1e6320305fa41b27a78c844dcf6172b244cc9b..f2e24d52240a84ff7ca69ad2c8ec0d1c197467c0 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -307,7 +307,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -295,7 +295,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
||||||
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
||||||
// Paper end - Add Velocity IP Forwarding Support
|
// Paper end - Add Velocity IP Forwarding Support
|
||||||
- if (!this.usesAuthentication()) {
|
- if (!this.usesAuthentication()) {
|
||||||
+ if (!"false".equalsIgnoreCase(System.getProperty("gale.log.warning.offline.mode")) && !this.usesAuthentication()) { // Gale - KeYi - do not log offline mode warning
|
+ if (!"false".equalsIgnoreCase(System.getProperty("gale.log.warning.offline.mode")) && !this.usesAuthentication()) { // Gale - KeYi - do not log offline mode warning
|
||||||
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
||||||
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||||
// Spigot start
|
// Spigot start
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Fri, 25 Nov 2022 16:26:04 +0100
|
||||||
|
Subject: [PATCH] Softly log invalid pool element errors
|
||||||
|
|
||||||
|
License: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"Change vanilla structure error to info log level"
|
||||||
|
By: chickeneer <emcchickeneer@gmail.com>
|
||||||
|
As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||||
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/level/levelgen/structure/PoolElementStructurePiece.java b/net/minecraft/world/level/levelgen/structure/PoolElementStructurePiece.java
|
||||||
|
index 5c91b11fdb12cd51d9d6c662f4ba7a7f78891e26..c63c357a28e7911c7a227e911a4dc36d914da9b5 100644
|
||||||
|
--- a/net/minecraft/world/level/levelgen/structure/PoolElementStructurePiece.java
|
||||||
|
+++ b/net/minecraft/world/level/levelgen/structure/PoolElementStructurePiece.java
|
||||||
|
@@ -27,7 +27,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
public class PoolElementStructurePiece extends StructurePiece {
|
||||||
|
- private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
|
+ public static final Logger LOGGER = LogUtils.getLogger(); // Gale - EMC - softly log invalid pool element errors - private -> public
|
||||||
|
protected final StructurePoolElement element;
|
||||||
|
protected BlockPos position;
|
||||||
|
private final int groundLevelDelta;
|
||||||
|
@@ -80,7 +80,7 @@ public class PoolElementStructurePiece extends StructurePiece {
|
||||||
|
DynamicOps<Tag> dynamicOps = context.registryAccess().createSerializationContext(NbtOps.INSTANCE);
|
||||||
|
StructurePoolElement.CODEC
|
||||||
|
.encodeStart(dynamicOps, this.element)
|
||||||
|
- .resultOrPartial(LOGGER::error)
|
||||||
|
+ .resultOrPartial(org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidPoolElementErrorStringConsumer) // Gale - EMC - softly log invalid pool element errors)
|
||||||
|
.ifPresent(elementTag -> tag.put("pool_element", elementTag));
|
||||||
|
tag.putString("rotation", this.rotation.name());
|
||||||
|
ListTag listTag = new ListTag();
|
||||||
@@ -37,18 +37,18 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
diff --git a/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||||
index 532f09089b8d6798999cf3f83e852df7479e450e..ae31c667ece5a84772d9c9009d3e66fd37d38908 100644
|
index 465559113071a47e706f77a5b0996597ee986b3d..628fa5afe8eae4ae422ecdd6096a821731d97ac1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||||
@@ -154,6 +154,10 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
@@ -37,6 +37,10 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||||
this.connection.send(new ClientboundStatusResponsePacket(ping));
|
} else {
|
||||||
// CraftBukkit end
|
this.hasRequestedStatus = true;
|
||||||
*/
|
// this.connection.send(new ClientboundStatusResponsePacket(this.status)); // Paper
|
||||||
+ // Gale start - Purpur - fix 'outdated server' showing in ping before server fully boots - do not respond to pings before we know the protocol version
|
+ // Gale start - Purpur - fix 'outdated server' showing in ping before server fully boots - do not respond to pings before we know the protocol version
|
||||||
+ var version = MinecraftServer.getServer().getStatus().version();
|
+ var version = net.minecraft.server.MinecraftServer.getServer().getStatus().version();
|
||||||
+ if (version == null || version.isEmpty()) return;
|
+ if (version == null || version.isEmpty()) return;
|
||||||
+ // Gale end - Purpur - fix 'outdated server' showing in ping before server fully boots - do not respond to pings before we know the protocol version
|
+ // Gale end - Purpur - fix 'outdated server' showing in ping before server fully boots - do not respond to pings before we know the protocol version
|
||||||
com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(MinecraftServer.getServer(), this.connection);
|
com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(net.minecraft.server.MinecraftServer.getServer(), this.connection); // Paper - handle status request
|
||||||
// Paper end
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Tue, 29 Nov 2022 16:16:35 +0100
|
||||||
|
Subject: [PATCH] Fix MC-238526
|
||||||
|
|
||||||
|
License: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"MC-238526 - Fix spawner not spawning water animals correctly"
|
||||||
|
By: BillyGalbreath <Blake.Galbreath@Gmail.com>
|
||||||
|
As part of: Purpur (https://github.com/PurpurMC/Purpur)
|
||||||
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
* Purpur copyright *
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2019-2022 PurpurMC
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/animal/WaterAnimal.java b/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||||
|
index ed4f4c76a53c39c1a912fc0ff0d84f7fdb494b20..8910e2578bf8b7541a98f20ddc34255343ec4e4d 100644
|
||||||
|
--- a/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||||
|
+++ b/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||||
|
@@ -74,8 +74,11 @@ public abstract class WaterAnimal extends PathfinderMob {
|
||||||
|
seaLevel = level.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.maximum.or(seaLevel);
|
||||||
|
i = level.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.minimum.or(i);
|
||||||
|
// Paper end - Make water animal spawn height configurable
|
||||||
|
- return pos.getY() >= i
|
||||||
|
- && pos.getY() <= seaLevel
|
||||||
|
+ // Gale start - Purpur - fix MC-238526
|
||||||
|
+ boolean shouldFixMC238526 = spawnReason == EntitySpawnReason.SPAWNER && level.getMinecraftWorld().galeConfig().gameplayMechanics.fixes.mc238526;
|
||||||
|
+ boolean isAllowedHeight = pos.getY() >= i && pos.getY() <= seaLevel;
|
||||||
|
+ return (shouldFixMC238526 || isAllowedHeight)
|
||||||
|
+ // Gale end - Purpur - fix MC-238526
|
||||||
|
&& level.getFluidState(pos.below()).is(FluidTags.WATER)
|
||||||
|
&& level.getBlockState(pos.above()).is(Blocks.WATER);
|
||||||
|
}
|
||||||
@@ -36,10 +36,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
diff --git a/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java b/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
||||||
index 515c1f671cb2c3a7cc23053aedf404bbbe77af3e..df002c7277a718dc156d2d5271fa4768b97f8d86 100644
|
index 722f378bb3726200b6fe88948bf1e1d3514a7b5c..dc3c709912367fc2789b789f178d16feb3c0a2ed 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
--- a/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
+++ b/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
||||||
@@ -103,7 +103,10 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
@@ -103,7 +103,10 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
||||||
this.strafingTime = 0;
|
this.strafingTime = 0;
|
||||||
}
|
}
|
||||||
@@ -49,34 +49,18 @@ index 515c1f671cb2c3a7cc23053aedf404bbbe77af3e..df002c7277a718dc156d2d5271fa4768
|
|||||||
+ boolean hasStrafingTime = this.strafingTime > -1;
|
+ boolean hasStrafingTime = this.strafingTime > -1;
|
||||||
+ if (hasStrafingTime) {
|
+ if (hasStrafingTime) {
|
||||||
+ // Gale end - Purpur - fix MC-121706
|
+ // Gale end - Purpur - fix MC-121706
|
||||||
if (d > (double)(this.attackRadiusSqr * 0.75F)) {
|
if (d > this.attackRadiusSqr * 0.75F) {
|
||||||
this.strafingBackwards = false;
|
this.strafingBackwards = false;
|
||||||
} else if (d < (double)(this.attackRadiusSqr * 0.25F)) {
|
} else if (d < this.attackRadiusSqr * 0.25F) {
|
||||||
@@ -116,7 +119,10 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
@@ -116,7 +119,10 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mob.lookAt(livingEntity, 30.0F, 30.0F);
|
this.mob.lookAt(target, 30.0F, 30.0F);
|
||||||
- } else {
|
- } else {
|
||||||
+ // Gale start - Purpur - fix MC-121706
|
+ // Gale start - Purpur - fix MC-121706
|
||||||
+ }
|
+ }
|
||||||
+ if (!hasStrafingTime || this.mob.level().galeConfig().gameplayMechanics.fixes.mc121706) {
|
+ if (!hasStrafingTime || this.mob.level().galeConfig().gameplayMechanics.fixes.mc121706) {
|
||||||
+ // Gale end - Purpur - fix MC-121706
|
+ // Gale end - Purpur - fix MC-121706
|
||||||
this.mob.getLookControl().setLookAt(livingEntity, 30.0F, 30.0F);
|
this.mob.getLookControl().setLookAt(target, 30.0F, 30.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
index 3fa354ceef3ec5ab9bca3f13f23aca586dfe09c4..c53cb97b271ca5390b544a1af66182e3c4aefc74 100644
|
|
||||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
@@ -106,6 +106,11 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
|
||||||
public boolean mc238526 = false;
|
|
||||||
// Gale end - Purpur - fix MC-238526
|
|
||||||
|
|
||||||
+ // Gale start - Purpur - fix MC-121706
|
|
||||||
+ @Setting("mc-121706")
|
|
||||||
+ public boolean mc121706 = false;
|
|
||||||
+ // Gale end - Purpur - fix MC-121706
|
|
||||||
+
|
|
||||||
}
|
|
||||||
|
|
||||||
public double entityWakeUpDurationRatioStandardDeviation = 0.2; // Gale - variable entity wake-up duration
|
|
||||||
@@ -41,28 +41,16 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
diff --git a/net/minecraft/world/entity/projectile/AbstractArrow.java b/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||||
index 8ce573042ea87631eb6539f2a0d5036655c2b809..6e313a45356ed2b043ef626c7ca191b294acaf70 100644
|
index 541ee32182b595de7dd6717f8faea00d53c105a3..d206ac2b9cade292b0d69e9aeb0f81227ec0b49e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
--- a/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
+++ b/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||||
@@ -371,7 +371,7 @@ public abstract class AbstractArrow extends Projectile {
|
@@ -347,7 +347,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||||
Vec3 vec3d = this.getDeltaMovement();
|
this.setInGround(false);
|
||||||
|
Vec3 deltaMovement = this.getDeltaMovement();
|
||||||
this.setDeltaMovement(vec3d.multiply((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F)));
|
this.setDeltaMovement(deltaMovement.multiply(this.random.nextFloat() * 0.2F, this.random.nextFloat() * 0.2F, this.random.nextFloat() * 0.2F));
|
||||||
- this.life = 0;
|
- this.life = 0;
|
||||||
+ if (this.level().galeConfig().gameplayMechanics.arrowMovementResetsDespawnCounter) this.life = 0; // Gale - Purpur - make arrow movement resetting despawn counter configurable
|
+ if (this.level().galeConfig().gameplayMechanics.arrowMovementResetsDespawnCounter) this.life = 0; // Gale - Purpur - make arrow movement resetting despawn counter configurable
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInGround() {
|
public boolean isInGround() { // Paper - protected -> public
|
||||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
index 266079aed0610e0fa9e35da81680b7f388a8844a..cc843de2d62bdaadb4efb7032162f8f04b10c286 100644
|
|
||||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
||||||
@@ -118,6 +118,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public boolean arrowMovementResetsDespawnCounter = true; // Gale - Purpur - make arrow movement resetting despawn counter configurable
|
|
||||||
public double entityWakeUpDurationRatioStandardDeviation = 0.2; // Gale - variable entity wake-up duration
|
|
||||||
public boolean tryRespawnEnderDragonAfterEndCrystalPlace = true; // Gale - Pufferfish - make ender dragon respawn attempt after placing end crystals configurable
|
|
||||||
|
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Mon, 26 Dec 2022 00:17:40 +0100
|
||||||
|
Subject: [PATCH] Make logging login locations configurable
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"configurable logging of player login location"
|
||||||
|
By: Simon Gardling <titaniumtown@gmail.com>
|
||||||
|
As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||||
|
index a0d56fcd58f943353b55821557d79c4dc0cdf46b..b4258db165b509d54b9c15a661c5b66ca984ffb3 100644
|
||||||
|
--- a/net/minecraft/server/players/PlayerList.java
|
||||||
|
+++ b/net/minecraft/server/players/PlayerList.java
|
||||||
|
@@ -398,7 +398,13 @@ public abstract class PlayerList {
|
||||||
|
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
|
||||||
|
}
|
||||||
|
// Paper end - Configurable player collision
|
||||||
|
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
|
||||||
|
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
|
||||||
|
+ // Gale start - JettPack - make logging login location configurable
|
||||||
|
+ } else {
|
||||||
|
+ PlayerList.LOGGER.info("{}[{}] logged in with entity id {}", player.getName().getString(), loggableAddress, player.getId());
|
||||||
|
+ }
|
||||||
|
+ // Gale end - JettPack - make logging login location configurable
|
||||||
|
// Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead
|
||||||
|
if (player.isDeadOrDying()) {
|
||||||
|
net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> plains = serverLevel.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME)
|
||||||
@@ -0,0 +1,365 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||||
|
Date: Sat, 26 Nov 2022 11:25:45 +0100
|
||||||
|
Subject: [PATCH] Reduce array allocations
|
||||||
|
|
||||||
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
Gale - https://galemc.org
|
||||||
|
|
||||||
|
This patch is based on the following patch:
|
||||||
|
"reduce allocs"
|
||||||
|
By: Simon Gardling <titaniumtown@gmail.com>
|
||||||
|
As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||||
|
index d21ce54ebb5724c04eadf56a2cde701d5eeb5db2..848374fa7383d6a82c33dad03deb0e97eca97d23 100644
|
||||||
|
--- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||||
|
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||||
|
@@ -378,7 +378,6 @@ public final class ChunkEntitySlices {
|
||||||
|
|
||||||
|
private static final class BasicEntityList<E extends Entity> {
|
||||||
|
|
||||||
|
- private static final Entity[] EMPTY = new Entity[0];
|
||||||
|
private static final int DEFAULT_CAPACITY = 4;
|
||||||
|
|
||||||
|
private E[] storage;
|
||||||
|
@@ -389,8 +388,8 @@ public final class ChunkEntitySlices {
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasicEntityList(final int cap) {
|
||||||
|
- this.storage = (E[])(cap <= 0 ? EMPTY : new Entity[cap]);
|
||||||
|
- }
|
||||||
|
+ this.storage = (E[])(cap <= 0 ? me.titaniumtown.ArrayConstants.emptyEntityArray : new Entity[cap]); // Gale - JettPack - reduce array allocations
|
||||||
|
+ } // Gale - JettPack - reduce array allocations
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return this.size == 0;
|
||||||
|
@@ -401,7 +400,7 @@ public final class ChunkEntitySlices {
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resize() {
|
||||||
|
- if (this.storage == EMPTY) {
|
||||||
|
+ if (this.storage == me.titaniumtown.ArrayConstants.emptyEntityArray) { // Gale - JettPack - reduce array allocations
|
||||||
|
this.storage = (E[])new Entity[DEFAULT_CAPACITY];
|
||||||
|
} else {
|
||||||
|
this.storage = Arrays.copyOf(this.storage, this.storage.length * 2);
|
||||||
|
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
|
||||||
|
index 26207443b1223119c03db478d7e816d9cdf8e618..bbd1c262674b42eb9ea2830acb8bf94182f971f9 100644
|
||||||
|
--- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
|
||||||
|
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
|
||||||
|
@@ -14,10 +14,8 @@ import net.minecraft.world.level.entity.LevelCallback;
|
||||||
|
|
||||||
|
public final class ServerEntityLookup extends EntityLookup {
|
||||||
|
|
||||||
|
- private static final Entity[] EMPTY_ENTITY_ARRAY = new Entity[0];
|
||||||
|
-
|
||||||
|
private final ServerLevel serverWorld;
|
||||||
|
- public final ReferenceList<Entity> trackerEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
|
||||||
|
+ public final ReferenceList<Entity> trackerEntities = new ReferenceList<>(me.titaniumtown.ArrayConstants.emptyEntityArray); // Moonrise - entity tracker // Gale - JettPack - reduce array allocations
|
||||||
|
|
||||||
|
public ServerEntityLookup(final ServerLevel world, final LevelCallback<Entity> worldCallback) {
|
||||||
|
super(world, worldCallback);
|
||||||
|
diff --git a/net/minecraft/nbt/ByteArrayTag.java b/net/minecraft/nbt/ByteArrayTag.java
|
||||||
|
index 6927124a4ea1f460158bf25679104b6f9e9ccee4..dba08f2668d65ae5483f325af3a79b5a63919c50 100644
|
||||||
|
--- a/net/minecraft/nbt/ByteArrayTag.java
|
||||||
|
+++ b/net/minecraft/nbt/ByteArrayTag.java
|
||||||
|
@@ -174,7 +174,7 @@ public class ByteArrayTag extends CollectionTag<ByteTag> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear() {
|
||||||
|
- this.data = new byte[0];
|
||||||
|
+ this.data = me.titaniumtown.ArrayConstants.emptyByteArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
diff --git a/net/minecraft/nbt/CompoundTag.java b/net/minecraft/nbt/CompoundTag.java
|
||||||
|
index 361bc458e0bb590c43da60a1cd993a2785ee45e9..3bce1e8ef90e95abd8b1111f1160f952d2493e69 100644
|
||||||
|
--- a/net/minecraft/nbt/CompoundTag.java
|
||||||
|
+++ b/net/minecraft/nbt/CompoundTag.java
|
||||||
|
@@ -409,7 +409,7 @@ public class CompoundTag implements Tag {
|
||||||
|
throw new ReportedException(this.createReport(key, ByteArrayTag.TYPE, var3));
|
||||||
|
}
|
||||||
|
|
||||||
|
- return new byte[0];
|
||||||
|
+ return me.titaniumtown.ArrayConstants.emptyByteArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getIntArray(String key) {
|
||||||
|
@@ -421,7 +421,7 @@ public class CompoundTag implements Tag {
|
||||||
|
throw new ReportedException(this.createReport(key, IntArrayTag.TYPE, var3));
|
||||||
|
}
|
||||||
|
|
||||||
|
- return new int[0];
|
||||||
|
+ return me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
public long[] getLongArray(String key) {
|
||||||
|
@@ -433,7 +433,7 @@ public class CompoundTag implements Tag {
|
||||||
|
throw new ReportedException(this.createReport(key, LongArrayTag.TYPE, var3));
|
||||||
|
}
|
||||||
|
|
||||||
|
- return new long[0];
|
||||||
|
+ return me.titaniumtown.ArrayConstants.emptyLongArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
public CompoundTag getCompound(String key) {
|
||||||
|
diff --git a/net/minecraft/nbt/IntArrayTag.java b/net/minecraft/nbt/IntArrayTag.java
|
||||||
|
index 7e27546bcb587d03b6de2ab43244e6c61fdb55f4..c7f35f332117305bf0e34eb8b73ddfa73958e434 100644
|
||||||
|
--- a/net/minecraft/nbt/IntArrayTag.java
|
||||||
|
+++ b/net/minecraft/nbt/IntArrayTag.java
|
||||||
|
@@ -181,7 +181,7 @@ public class IntArrayTag extends CollectionTag<IntTag> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear() {
|
||||||
|
- this.data = new int[0];
|
||||||
|
+ this.data = me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
diff --git a/net/minecraft/nbt/ListTag.java b/net/minecraft/nbt/ListTag.java
|
||||||
|
index 8bbe48a4d7d1771d17bec60b70bdf8e086bfd1c7..5ab487178544f6bc6b0c90d7a54b5c3ea1cdfbe9 100644
|
||||||
|
--- a/net/minecraft/nbt/ListTag.java
|
||||||
|
+++ b/net/minecraft/nbt/ListTag.java
|
||||||
|
@@ -258,7 +258,7 @@ public class ListTag extends CollectionTag<Tag> {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- return new int[0];
|
||||||
|
+ return me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
public long[] getLongArray(int index) {
|
||||||
|
@@ -269,7 +269,7 @@ public class ListTag extends CollectionTag<Tag> {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- return new long[0];
|
||||||
|
+ return me.titaniumtown.ArrayConstants.emptyLongArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getDouble(int index) {
|
||||||
|
diff --git a/net/minecraft/nbt/LongArrayTag.java b/net/minecraft/nbt/LongArrayTag.java
|
||||||
|
index 7274aa8ccae9294dcdb718cbd4997f841eeb9eba..d33466f2ad3aa967fd2e6c0efa73805ba725b3c2 100644
|
||||||
|
--- a/net/minecraft/nbt/LongArrayTag.java
|
||||||
|
+++ b/net/minecraft/nbt/LongArrayTag.java
|
||||||
|
@@ -185,7 +185,7 @@ public class LongArrayTag extends CollectionTag<LongTag> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear() {
|
||||||
|
- this.data = new long[0];
|
||||||
|
+ this.data = me.titaniumtown.ArrayConstants.emptyLongArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
diff --git a/net/minecraft/network/CipherBase.java b/net/minecraft/network/CipherBase.java
|
||||||
|
index 121685cacef111fbec0057d386f748497bc3a36d..b4a4fafec1a8e279ec1e31e58fee2d5d34fb8289 100644
|
||||||
|
--- a/net/minecraft/network/CipherBase.java
|
||||||
|
+++ b/net/minecraft/network/CipherBase.java
|
||||||
|
@@ -7,8 +7,8 @@ import javax.crypto.ShortBufferException;
|
||||||
|
|
||||||
|
public class CipherBase {
|
||||||
|
private final Cipher cipher;
|
||||||
|
- private byte[] heapIn = new byte[0];
|
||||||
|
- private byte[] heapOut = new byte[0];
|
||||||
|
+ private byte[] heapIn = me.titaniumtown.ArrayConstants.emptyByteArray; // Gale - JettPack - reduce array allocations
|
||||||
|
+ private byte[] heapOut = me.titaniumtown.ArrayConstants.emptyByteArray; // Gale - JettPack - reduce array allocations
|
||||||
|
|
||||||
|
protected CipherBase(Cipher cipher) {
|
||||||
|
this.cipher = cipher;
|
||||||
|
diff --git a/net/minecraft/network/chat/contents/TranslatableContents.java b/net/minecraft/network/chat/contents/TranslatableContents.java
|
||||||
|
index 68727deaedd55aa86e76fbc6cc2cfb67913f7add..bad5787de2034dbb0eabb9458a47a89e30dec886 100644
|
||||||
|
--- a/net/minecraft/network/chat/contents/TranslatableContents.java
|
||||||
|
+++ b/net/minecraft/network/chat/contents/TranslatableContents.java
|
||||||
|
@@ -29,7 +29,7 @@ import net.minecraft.util.ExtraCodecs;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
|
||||||
|
public class TranslatableContents implements ComponentContents {
|
||||||
|
- public static final Object[] NO_ARGS = new Object[0];
|
||||||
|
+ public static final Object[] NO_ARGS = me.titaniumtown.ArrayConstants.emptyObjectArray; // Gale - JettPack - reduce array allocations
|
||||||
|
private static final Codec<Object> PRIMITIVE_ARG_CODEC = ExtraCodecs.JAVA.validate(TranslatableContents::filterAllowedArguments);
|
||||||
|
private static final Codec<Object> ARG_CODEC = Codec.either(PRIMITIVE_ARG_CODEC, ComponentSerialization.CODEC)
|
||||||
|
.xmap(
|
||||||
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
|
index 2caeb69306a42d02b7a5c27e00fb969e392ac6ba..2b9b683023943435a86c42e3a61e0b3329df19d8 100644
|
||||||
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
|
@@ -1224,7 +1224,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
|
|
||||||
|
public static List<Entity> getCurrentlyTickingEntities() {
|
||||||
|
Entity ticking = currentlyTickingEntity.get();
|
||||||
|
- List<Entity> ret = java.util.Arrays.asList(ticking == null ? new Entity[0] : new Entity[] { ticking });
|
||||||
|
+ List<Entity> ret = java.util.Arrays.asList(ticking == null ? me.titaniumtown.ArrayConstants.emptyEntityArray : new Entity[] { ticking }); // Gale - JettPack - reduce array allocations
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
index 1fa2bb9e9866ad6f0394327df934388b7fcd7f93..247ff694e3d97365a9149b3c2fc99574a21aa9f9 100644
|
||||||
|
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
@@ -2767,7 +2767,7 @@ public class ServerGamePacketListenerImpl
|
||||||
|
target.refreshEntityData(ServerGamePacketListenerImpl.this.player);
|
||||||
|
// SPIGOT-7136 - Allays
|
||||||
|
if (target instanceof Allay || target instanceof net.minecraft.world.entity.animal.horse.AbstractHorse) { // Paper - Fix horse armor desync
|
||||||
|
- ServerGamePacketListenerImpl.this.send(new net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket(target.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, ((LivingEntity) target).getItemBySlot(slot).copy())).collect(Collectors.toList()), true)); // Paper - sanitize
|
||||||
|
+ ServerGamePacketListenerImpl.this.send(new net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket(target.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.VALUES_ARRAY).map((slot) -> Pair.of(slot, ((LivingEntity) target).getItemBySlot(slot).copy())).collect(Collectors.toList()), true)); // Paper - sanitize // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerGamePacketListenerImpl.this.player.containerMenu.sendAllDataToRemote(); // Paper - fix slot desync - always refresh player inventory
|
||||||
|
diff --git a/net/minecraft/server/players/StoredUserList.java b/net/minecraft/server/players/StoredUserList.java
|
||||||
|
index d445e8f126f077d8419c52fa5436ea963a1a42a4..39483f7b453d6faedeccc1ab1eda76669395ea5a 100644
|
||||||
|
--- a/net/minecraft/server/players/StoredUserList.java
|
||||||
|
+++ b/net/minecraft/server/players/StoredUserList.java
|
||||||
|
@@ -70,7 +70,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getUserList() {
|
||||||
|
- return this.map.keySet().toArray(new String[0]);
|
||||||
|
+ return this.map.keySet().toArray(me.titaniumtown.ArrayConstants.emptyStringArray); // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
diff --git a/net/minecraft/util/ZeroBitStorage.java b/net/minecraft/util/ZeroBitStorage.java
|
||||||
|
index 09fd99c9cbd23b5f3c899bfb00c9b89651948ed8..5c1103ef028e5ffe6ce0eadc861dd3b2c8f3ed9f 100644
|
||||||
|
--- a/net/minecraft/util/ZeroBitStorage.java
|
||||||
|
+++ b/net/minecraft/util/ZeroBitStorage.java
|
||||||
|
@@ -5,7 +5,7 @@ import java.util.function.IntConsumer;
|
||||||
|
import org.apache.commons.lang3.Validate;
|
||||||
|
|
||||||
|
public class ZeroBitStorage implements BitStorage {
|
||||||
|
- public static final long[] RAW = new long[0];
|
||||||
|
+ public static final long[] RAW = me.titaniumtown.ArrayConstants.emptyLongArray; // Gale - JettPack - reduce array allocations
|
||||||
|
private final int size;
|
||||||
|
|
||||||
|
public ZeroBitStorage(int size) {
|
||||||
|
diff --git a/net/minecraft/world/entity/EquipmentSlot.java b/net/minecraft/world/entity/EquipmentSlot.java
|
||||||
|
index c65595c0a55b0aeebb2cf858da99329d2192976e..0a5611b1ece4dbe2887e7fbdef45f58e7f4d53ad 100644
|
||||||
|
--- a/net/minecraft/world/entity/EquipmentSlot.java
|
||||||
|
+++ b/net/minecraft/world/entity/EquipmentSlot.java
|
||||||
|
@@ -19,7 +19,8 @@ public enum EquipmentSlot implements StringRepresentable {
|
||||||
|
BODY(EquipmentSlot.Type.ANIMAL_ARMOR, 0, 1, 6, "body");
|
||||||
|
|
||||||
|
public static final int NO_COUNT_LIMIT = 0;
|
||||||
|
- public static final List<EquipmentSlot> VALUES = List.of(values());
|
||||||
|
+ public static final EquipmentSlot[] VALUES_ARRAY = values(); // Gale - JettPack - reduce array allocations
|
||||||
|
+ public static final List<EquipmentSlot> VALUES = List.of(VALUES_ARRAY); // Gale - JettPack - reduce array allocations
|
||||||
|
public static final IntFunction<EquipmentSlot> BY_ID = ByIdMap.continuous(equipmentSlot -> equipmentSlot.id, values(), ByIdMap.OutOfBoundsStrategy.ZERO);
|
||||||
|
public static final StringRepresentable.EnumCodec<EquipmentSlot> CODEC = StringRepresentable.fromEnum(EquipmentSlot::values);
|
||||||
|
public static final StreamCodec<ByteBuf, EquipmentSlot> STREAM_CODEC = ByteBufCodecs.idMapper(BY_ID, equipmentSlot -> equipmentSlot.id);
|
||||||
|
diff --git a/net/minecraft/world/entity/EquipmentSlotGroup.java b/net/minecraft/world/entity/EquipmentSlotGroup.java
|
||||||
|
index 028dff862850c63d0b66902e99dd0bf685a7aa0d..b2d8b6883e2527c13794d23d27a4647ab1e255dd 100644
|
||||||
|
--- a/net/minecraft/world/entity/EquipmentSlotGroup.java
|
||||||
|
+++ b/net/minecraft/world/entity/EquipmentSlotGroup.java
|
||||||
|
@@ -29,6 +29,7 @@ public enum EquipmentSlotGroup implements StringRepresentable {
|
||||||
|
private final int id;
|
||||||
|
private final String key;
|
||||||
|
private final Predicate<EquipmentSlot> predicate;
|
||||||
|
+ public static final EquipmentSlotGroup[] VALUES_ARRAY = EquipmentSlotGroup.values(); // Gale - JettPack - reduce array allocations
|
||||||
|
|
||||||
|
private EquipmentSlotGroup(final int id, final String key, final Predicate<EquipmentSlot> predicate) {
|
||||||
|
this.id = id;
|
||||||
|
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||||
|
index ba31bbdac96e58d299dc260b47aaedf767735a42..badcb066ad66d9d4b17510fb1d633022c19d35d1 100644
|
||||||
|
--- a/net/minecraft/world/item/ItemStack.java
|
||||||
|
+++ b/net/minecraft/world/item/ItemStack.java
|
||||||
|
@@ -1126,7 +1126,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
|
private void addAttributeTooltips(Consumer<Component> tooltipAdder, @Nullable Player player) {
|
||||||
|
ItemAttributeModifiers itemAttributeModifiers = this.getOrDefault(DataComponents.ATTRIBUTE_MODIFIERS, ItemAttributeModifiers.EMPTY);
|
||||||
|
if (itemAttributeModifiers.showInTooltip()) {
|
||||||
|
- for (EquipmentSlotGroup equipmentSlotGroup : EquipmentSlotGroup.values()) {
|
||||||
|
+ for (EquipmentSlotGroup equipmentSlotGroup : EquipmentSlotGroup.VALUES_ARRAY) { // Gale - JettPack - reduce array allocations
|
||||||
|
MutableBoolean mutableBoolean = new MutableBoolean(true);
|
||||||
|
this.forEachModifier(equipmentSlotGroup, (attribute, modifier) -> {
|
||||||
|
if (mutableBoolean.isTrue()) {
|
||||||
|
diff --git a/net/minecraft/world/item/crafting/ShapedRecipePattern.java b/net/minecraft/world/item/crafting/ShapedRecipePattern.java
|
||||||
|
index bfda76974ea8d4397e2c2ebf5bdcb5d7e5f0bab5..cabbc93409ca99180d115e2f23419ee1824d5801 100644
|
||||||
|
--- a/net/minecraft/world/item/crafting/ShapedRecipePattern.java
|
||||||
|
+++ b/net/minecraft/world/item/crafting/ShapedRecipePattern.java
|
||||||
|
@@ -121,7 +121,7 @@ public final class ShapedRecipePattern {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pattern.size() == i3) {
|
||||||
|
- return new String[0];
|
||||||
|
+ return me.titaniumtown.ArrayConstants.emptyStringArray; // Gale - JettPack - reduce array allocations
|
||||||
|
} else {
|
||||||
|
String[] strings = new String[pattern.size() - i3 - i2];
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||||
|
index 51fa382b930ccbeb605064488ab4df985df94ed6..d732a021351d80210e6411565c7a5e9d1b277f0f 100644
|
||||||
|
--- a/net/minecraft/world/level/Level.java
|
||||||
|
+++ b/net/minecraft/world/level/Level.java
|
||||||
|
@@ -1849,7 +1849,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
|
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
|
||||||
|
ca.spottedleaf.moonrise.patches.chunk_system.level.entity.ChunkEntitySlices slices = ((ServerLevel)this).moonrise$getEntityLookup().getChunk(chunkX, chunkZ);
|
||||||
|
if (slices == null) {
|
||||||
|
- return new org.bukkit.entity.Entity[0];
|
||||||
|
+ return me.titaniumtown.ArrayConstants.emptyBukkitEntityArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
List<org.bukkit.entity.Entity> ret = new java.util.ArrayList<>();
|
||||||
|
@@ -1860,7 +1860,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- return ret.toArray(new org.bukkit.entity.Entity[0]);
|
||||||
|
+ return ret.toArray(me.titaniumtown.ArrayConstants.emptyBukkitEntityArray); // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
// Paper end - rewrite chunk system
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/level/block/ComposterBlock.java b/net/minecraft/world/level/block/ComposterBlock.java
|
||||||
|
index 5bc259ad1f9f56f4f596a4ae7b1b324b5e1219e6..0d34839618648bb8c606dd2d9b1f9db93641c742 100644
|
||||||
|
--- a/net/minecraft/world/level/block/ComposterBlock.java
|
||||||
|
+++ b/net/minecraft/world/level/block/ComposterBlock.java
|
||||||
|
@@ -410,7 +410,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getSlotsForFace(Direction side) {
|
||||||
|
- return new int[0];
|
||||||
|
+ return me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@@ -446,7 +446,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getSlotsForFace(Direction side) {
|
||||||
|
- return side == Direction.UP ? new int[]{0} : new int[0];
|
||||||
|
+ return side == Direction.UP ? me.titaniumtown.ArrayConstants.zeroSingletonIntArray : me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@@ -496,7 +496,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getSlotsForFace(Direction side) {
|
||||||
|
- return side == Direction.DOWN ? new int[]{0} : new int[0];
|
||||||
|
+ return side == Direction.DOWN ? me.titaniumtown.ArrayConstants.zeroSingletonIntArray : me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
diff --git a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
|
index 38f145525a8ef4440ab06abb35d5aba1e5746f5d..f772d2542922eddf666ff375fc2546150c39ad32 100644
|
||||||
|
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
|
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
|
@@ -44,7 +44,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||||
|
protected static final int SLOT_FUEL = 1;
|
||||||
|
protected static final int SLOT_RESULT = 2;
|
||||||
|
public static final int DATA_LIT_TIME = 0;
|
||||||
|
- private static final int[] SLOTS_FOR_UP = new int[]{0};
|
||||||
|
+ private static final int[] SLOTS_FOR_UP = me.titaniumtown.ArrayConstants.zeroSingletonIntArray; // Gale - JettPack - reduce array allocations
|
||||||
|
private static final int[] SLOTS_FOR_DOWN = new int[]{2, 1};
|
||||||
|
private static final int[] SLOTS_FOR_SIDES = new int[]{1};
|
||||||
|
public static final int DATA_LIT_DURATION = 1;
|
||||||
|
diff --git a/net/minecraft/world/scores/Team.java b/net/minecraft/world/scores/Team.java
|
||||||
|
index 7b08f2fba99e3eef98f5b36db4081da9ab93f415..9192cb0761c6ec2ddec2c75dbc654d16951d6352 100644
|
||||||
|
--- a/net/minecraft/world/scores/Team.java
|
||||||
|
+++ b/net/minecraft/world/scores/Team.java
|
||||||
|
@@ -70,7 +70,7 @@ public abstract class Team {
|
||||||
|
public final int id;
|
||||||
|
|
||||||
|
public static String[] getAllNames() {
|
||||||
|
- return BY_NAME.keySet().toArray(new String[0]);
|
||||||
|
+ return BY_NAME.keySet().toArray(me.titaniumtown.ArrayConstants.emptyStringArray); // Gale - JettPack - reduce array allocations
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
@@ -12,11 +12,11 @@ By: Simon Gardling <titaniumtown@gmail.com>
|
|||||||
As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
|
As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
|
||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index d7c0a78c17de70037cca43bea758edcbe457cd73..1a03a415d17fec083beaaafb0fc9da1f00f514de 100644
|
index 0bbac68dbd891da8892ba40fc18578c4f9e67c11..b68013f83db13f4aeb94be4777c5341ce8ebfde4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -271,7 +271,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -224,7 +224,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
public double xo;
|
public double xo;
|
||||||
public double yo;
|
public double yo;
|
||||||
public double zo;
|
public double zo;
|
||||||
@@ -24,35 +24,36 @@ index d7c0a78c17de70037cca43bea758edcbe457cd73..1a03a415d17fec083beaaafb0fc9da1f
|
|||||||
+ public Vec3 position; // Gale - JettPack - optimize sun burn tick - private -> public
|
+ public Vec3 position; // Gale - JettPack - optimize sun burn tick - private -> public
|
||||||
public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public
|
public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public
|
||||||
private ChunkPos chunkPosition;
|
private ChunkPos chunkPosition;
|
||||||
private Vec3 deltaMovement;
|
private Vec3 deltaMovement = Vec3.ZERO;
|
||||||
@@ -2145,9 +2145,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -2024,10 +2024,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
/** @deprecated */
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public float getLightLevelDependentMagicValue() {
|
public float getLightLevelDependentMagicValue() {
|
||||||
- return this.level().hasChunkAt(this.getBlockX(), this.getBlockZ()) ? this.level().getLightLevelDependentMagicValue(BlockPos.containing(this.getX(), this.getEyeY(), this.getZ())) : 0.0F;
|
|
||||||
+ return this.getLightLevelDependentMagicValue(BlockPos.containing(this.getX(), this.getEyeY(), this.getZ())); // Gale - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
+ return this.getLightLevelDependentMagicValue(BlockPos.containing(this.getX(), this.getEyeY(), this.getZ())); // Gale - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
||||||
}
|
+ }
|
||||||
|
+
|
||||||
+ // Gale start - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
+ // Gale start - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
||||||
+ /**
|
+ /**
|
||||||
+ * @deprecated
|
+ * @deprecated
|
||||||
+ */
|
+ */
|
||||||
+ @Deprecated
|
+ @Deprecated
|
||||||
+ public float getLightLevelDependentMagicValue(BlockPos pos) {
|
+ public float getLightLevelDependentMagicValue(BlockPos pos) {
|
||||||
+ return this.level().hasChunkAt(this.getBlockX(), this.getBlockZ()) ? this.level.getLightLevelDependentMagicValue(pos) : 0.0F;
|
return this.level().hasChunkAt(this.getBlockX(), this.getBlockZ())
|
||||||
+ }
|
- ? this.level().getLightLevelDependentMagicValue(BlockPos.containing(this.getX(), this.getEyeY(), this.getZ()))
|
||||||
|
+ ? this.level.getLightLevelDependentMagicValue(pos)
|
||||||
|
: 0.0F;
|
||||||
|
}
|
||||||
+ // Gale end - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
+ // Gale end - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
||||||
+
|
|
||||||
public void absMoveTo(double x, double y, double z, float yaw, float pitch) {
|
|
||||||
this.absMoveTo(x, y, z);
|
|
||||||
this.absRotateTo(yaw, pitch);
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
||||||
index 3ccc39e142f946e3fc34753fdc91a2cb62f9bd2d..3b10055c589575078bed8c79b3a0967d3f237957 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
||||||
@@ -1710,13 +1710,28 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
||||||
|
|
||||||
protected void playAttackSound() {}
|
public void absMoveTo(double x, double y, double z, float yRot, float xRot) {
|
||||||
|
this.absMoveTo(x, y, z);
|
||||||
|
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||||
|
index 2568a7f2459ed783d4612546b86d46721d48a396..f3eec8b75fcda47e6632a2a7db9a238b515bc8a0 100644
|
||||||
|
--- a/net/minecraft/world/entity/Mob.java
|
||||||
|
+++ b/net/minecraft/world/entity/Mob.java
|
||||||
|
@@ -1594,20 +1594,30 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
|
protected void playAttackSound() {
|
||||||
|
}
|
||||||
|
|
||||||
+ // Gale start - JettPack - optimize sun burn tick - cache eye blockpos
|
+ // Gale start - JettPack - optimize sun burn tick - cache eye blockpos
|
||||||
+ private BlockPos cached_eye_blockpos;
|
+ private BlockPos cached_eye_blockpos;
|
||||||
@@ -61,24 +62,32 @@ index 3ccc39e142f946e3fc34753fdc91a2cb62f9bd2d..3b10055c589575078bed8c79b3a0967d
|
|||||||
+
|
+
|
||||||
public boolean isSunBurnTick() {
|
public boolean isSunBurnTick() {
|
||||||
if (this.level().isDay() && !this.level().isClientSide) {
|
if (this.level().isDay() && !this.level().isClientSide) {
|
||||||
- float f = this.getLightLevelDependentMagicValue();
|
- float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue();
|
||||||
- BlockPos blockposition = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
- BlockPos blockPos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
||||||
|
- boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||||
|
- if (lightLevelDependentMagicValue > 0.5F
|
||||||
|
- && this.random.nextFloat() * 30.0F < (lightLevelDependentMagicValue - 0.4F) * 2.0F
|
||||||
|
- && !flag
|
||||||
|
- && this.level().canSeeSky(blockPos)) {
|
||||||
|
- return true;
|
||||||
+ // Gale start - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
+ // Gale start - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||||
+ if (this.cached_position != this.position) {
|
+ if (this.cached_position != this.position) {
|
||||||
+ this.cached_eye_blockpos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
+ this.cached_eye_blockpos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
||||||
+ this.cached_position = this.position;
|
+ this.cached_position = this.position;
|
||||||
+ }
|
}
|
||||||
+
|
+
|
||||||
+ float f = this.getLightLevelDependentMagicValue(cached_eye_blockpos); // Pass BlockPos to getBrightness
|
+ float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue(cached_eye_blockpos); // Pass BlockPos to getBrightness
|
||||||
+
|
+
|
||||||
+ // Check brightness first
|
+ // Check brightness first
|
||||||
+ if (f <= 0.5F) return false;
|
+ if (lightLevelDependentMagicValue <= 0.5F) return false;
|
||||||
+ if (this.random.nextFloat() * 30.0F >= (f - 0.4F) * 2.0F) return false;
|
+ if (this.random.nextFloat() * 30.0F >= (lightLevelDependentMagicValue - 0.4F) * 2.0F) return false;
|
||||||
+ // Gale end - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
+ // Gale end - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||||
boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow;
|
+ boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||||
|
+ return !flag && this.level().canSeeSky(this.cached_eye_blockpos); // Gale - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||||
- if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && !flag && this.level().canSeeSky(blockposition)) {
|
|
||||||
+ if (!flag && this.level().canSeeSky(this.cached_eye_blockpos)) { // Gale - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- return false;
|
||||||
|
+ return false; // Gale - JettPack - optimize sun burn tick - optimizations and cache eye blockpos - diff on change
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@@ -13,22 +13,22 @@ By: 2No2Name <2No2Name@web.de>
|
|||||||
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java b/src/main/java/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java
|
diff --git a/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java b/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java
|
||||||
index 3527f1621ef9b4f3f8d8bbb93379f13ff141c3be..4e4dfb72d5a0b46917999b709c655ccfdae27183 100644
|
index 52cb2dcd714cf8c16f167466333eeb923e4ff183..9661def1311102bbb7e8afdd69f5484320e58d01 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java
|
--- a/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java
|
+++ b/net/minecraft/world/level/EntityBasedExplosionDamageCalculator.java
|
||||||
@@ -15,8 +15,17 @@ public class EntityBasedExplosionDamageCalculator extends ExplosionDamageCalcula
|
@@ -15,8 +15,17 @@ public class EntityBasedExplosionDamageCalculator extends ExplosionDamageCalcula
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<Float> getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState) {
|
public Optional<Float> getBlockExplosionResistance(Explosion explosion, BlockGetter reader, BlockPos pos, BlockState state, FluidState fluid) {
|
||||||
- return super.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState)
|
- return super.getBlockExplosionResistance(explosion, reader, pos, state, fluid)
|
||||||
- .map(max -> this.source.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState, max));
|
- .map(resistance -> this.source.getBlockExplosionResistance(explosion, reader, pos, state, fluid, resistance));
|
||||||
+ // Gale start - Lithium - reduce lambda and Optional allocation in EntityBasedExplosionDamageCalculator
|
+ // Gale start - Lithium - reduce lambda and Optional allocation in EntityBasedExplosionDamageCalculator
|
||||||
+ Optional<Float> optionalBlastResistance = super.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState);
|
+ Optional<Float> optionalBlastResistance = super.getBlockExplosionResistance(explosion, reader, pos, state, fluid);
|
||||||
+ if (optionalBlastResistance.isPresent()) {
|
+ if (optionalBlastResistance.isPresent()) {
|
||||||
+ float blastResistance = optionalBlastResistance.get();
|
+ float resistance = optionalBlastResistance.get();
|
||||||
+ float effectiveExplosionResistance = this.source.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState, blastResistance);
|
+ float effectiveExplosionResistance = this.source.getBlockExplosionResistance(explosion, reader, pos, state, fluid, resistance);
|
||||||
+ if (effectiveExplosionResistance != blastResistance) {
|
+ if (effectiveExplosionResistance != resistance) {
|
||||||
+ return Optional.of(effectiveExplosionResistance);
|
+ return Optional.of(effectiveExplosionResistance);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user