Updated Upstream (Paper & Purpur)
This commit is contained in:
@@ -8,6 +8,8 @@ ij_any_block_comment_add_space = false
|
|||||||
ij_any_block_comment_at_first_column = false
|
ij_any_block_comment_at_first_column = false
|
||||||
ij_any_line_comment_at_first_column = false
|
ij_any_line_comment_at_first_column = false
|
||||||
ij_any_line_comment_add_space = true
|
ij_any_line_comment_add_space = true
|
||||||
|
max_line_length = 120
|
||||||
|
ij_visual_guides = 80
|
||||||
|
|
||||||
[*.tiny]
|
[*.tiny]
|
||||||
indent_style=tab
|
indent_style=tab
|
||||||
|
|||||||
7
.gitattributes
vendored
Normal file
7
.gitattributes
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
|
|
||||||
|
*.sh text eol=lf
|
||||||
|
gradlew text eol=lf
|
||||||
|
*.bat text eol=crlf
|
||||||
|
|
||||||
|
*.jar binary
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
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 kotlin.io.path.createSymbolicLinkPointingTo
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
@@ -19,9 +20,7 @@ kotlin.jvmToolchain(jdkVersion)
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://papermc.io/repo/repository/maven-public/") {
|
maven("https://papermc.io/repo/repository/maven-public/") {
|
||||||
content {
|
content { onlyForConfigurations(configurations.paperclip.name) }
|
||||||
onlyForConfigurations(configurations.paperclip.name)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,9 +58,12 @@ allprojects {
|
|||||||
subprojects {
|
subprojects {
|
||||||
tasks {
|
tasks {
|
||||||
withType<JavaCompile>().configureEach {
|
withType<JavaCompile>().configureEach {
|
||||||
options.compilerArgs.addAll(listOf("--add-modules=jdk.incubator.vector", "-Xmaxwarns", "1"))
|
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
options.release = jdkVersion
|
options.release = jdkVersion
|
||||||
|
options.compilerArgs.addAll(listOf(
|
||||||
|
"--add-modules=jdk.incubator.vector",
|
||||||
|
"-Xmaxwarns", "1"
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
withType<Javadoc> {
|
withType<Javadoc> {
|
||||||
@@ -85,7 +87,6 @@ subprojects {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://jitpack.io")
|
maven("https://jitpack.io")
|
||||||
maven("https://papermc.io/repo/repository/maven-public/")
|
maven("https://papermc.io/repo/repository/maven-public/")
|
||||||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,23 +111,16 @@ paperweight {
|
|||||||
patchDir = layout.projectDirectory.dir("patches/generated-api")
|
patchDir = layout.projectDirectory.dir("patches/generated-api")
|
||||||
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
|
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
|
||||||
}
|
}
|
||||||
|
|
||||||
patchTasks.register("mojangApi") {
|
|
||||||
isBareDirectory = true
|
|
||||||
upstreamDirPath = "Paper-MojangAPI"
|
|
||||||
patchDir = layout.projectDirectory.dir("patches/mojang-api")
|
|
||||||
outputDir = layout.projectDirectory.dir("$projectName-MojangAPI")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
alwaysUpToDate {
|
alwaysUpToDate {
|
||||||
|
|
||||||
paperRepoName.set("org.plazmamc.alwaysuptodate.paper.repository")
|
paperRepoName.set("paperRepo")
|
||||||
paperBranchName.set("paperBranch")
|
paperBranchName.set("paperBranch")
|
||||||
paperCommitName.set("paperCommit")
|
paperCommitName.set("paperCommit")
|
||||||
|
|
||||||
purpurRepoName.set("org.plazmamc.alwaysuptodate.purpur.repository")
|
purpurRepoName.set("purpurRepo")
|
||||||
purpurBranchName.set("purpurBranch")
|
purpurBranchName.set("purpurBranch")
|
||||||
purpurCommitName.set("purpurCommit")
|
purpurCommitName.set("purpurCommit")
|
||||||
|
|
||||||
@@ -147,7 +141,6 @@ tasks {
|
|||||||
|
|
||||||
generateDevelopmentBundle {
|
generateDevelopmentBundle {
|
||||||
apiCoordinates.set("${project.group}:${projectName.lowercase()}-api")
|
apiCoordinates.set("${project.group}:${projectName.lowercase()}-api")
|
||||||
mojangApiCoordinates.set("${project.group}:${projectName.lowercase()}-mojangapi")
|
|
||||||
libraryRepositories.addAll(
|
libraryRepositories.addAll(
|
||||||
"https://repo.maven.apache.org/maven2/",
|
"https://repo.maven.apache.org/maven2/",
|
||||||
"https://maven.pkg.github.com/$projectRepo",
|
"https://maven.pkg.github.com/$projectRepo",
|
||||||
@@ -155,16 +148,28 @@ tasks {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
register("reApplyServerPatches") {
|
||||||
|
doFirst {
|
||||||
|
projectDir.resolve("$projectName-Server").deleteRecursively()
|
||||||
|
}
|
||||||
|
|
||||||
|
finalizedBy("applyServerPatches")
|
||||||
|
}
|
||||||
|
|
||||||
clean {
|
clean {
|
||||||
doLast {
|
doLast {
|
||||||
projectDir.resolve(".gradle/caches").deleteRecursively()
|
listOf(
|
||||||
listOf("$projectName-API", "$projectName-MojangAPI", "$projectName-Server", "paper-api-generator", "run").forEach {
|
".gradle/caches",
|
||||||
projectDir.resolve(it).deleteRecursively()
|
"$projectName-API",
|
||||||
}
|
"$projectName-Server",
|
||||||
|
"paper-api-generator",
|
||||||
|
"run",
|
||||||
|
|
||||||
// remove dev environment files
|
// remove dev environment files
|
||||||
listOf("0001-fixup.patch", "compare.txt").forEach {
|
"0001-fixup.patch",
|
||||||
projectDir.resolve(it).delete()
|
"compare.txt"
|
||||||
|
).forEach {
|
||||||
|
projectDir.resolve(it).deleteRecursively()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,8 +177,6 @@ tasks {
|
|||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications.create<MavenPublication>("devBundle") {
|
publications.create<MavenPublication>("devBundle") {
|
||||||
artifact(tasks.generateDevelopmentBundle) {
|
artifact(tasks.generateDevelopmentBundle) { artifactId = "dev-bundle" }
|
||||||
artifactId = "dev-bundle"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
fxapi
14
fxapi
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# FixupAPI
|
|
||||||
|
|
||||||
PS1="$"
|
|
||||||
|
|
||||||
cd Plazma-API
|
|
||||||
|
|
||||||
git add .
|
|
||||||
git commit -m "fixup"
|
|
||||||
git format-patch -1
|
|
||||||
mv 0001-fixup.patch ../
|
|
||||||
|
|
||||||
cd ../
|
|
||||||
14
fxsrv
14
fxsrv
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# FixupServer
|
|
||||||
|
|
||||||
PS1="$"
|
|
||||||
|
|
||||||
cd Plazma-Server
|
|
||||||
|
|
||||||
git add .
|
|
||||||
git commit -m "fixup"
|
|
||||||
git format-patch -1
|
|
||||||
mv 0001-fixup.patch ../
|
|
||||||
|
|
||||||
cd ../
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
group = org.plazmamc.plazma
|
|
||||||
org.gradle.daemon = true
|
org.gradle.daemon = true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
@@ -8,9 +7,7 @@ org.gradle.jvmargs = -Xmx4G -Dfile.encoding=UTF-8 -Dgraal.CompilerConfiguration=
|
|||||||
paper.runMemoryGb = 8
|
paper.runMemoryGb = 8
|
||||||
paper.runDisableWatchdog = true
|
paper.runDisableWatchdog = true
|
||||||
|
|
||||||
org.plazmamc.alwaysuptodate.paper.repository = https://github.com/PaperMC/Paper
|
group = org.plazmamc.plazma
|
||||||
org.plazmamc.alwaysuptodate.purpur.repository = https://github.com/PurpurMC/Purpur
|
|
||||||
|
|
||||||
projectName = Plazma
|
projectName = Plazma
|
||||||
projectRepo = PlazmaMC/PlazmaBukkit
|
projectRepo = PlazmaMC/PlazmaBukkit
|
||||||
|
|
||||||
@@ -18,10 +15,12 @@ version = 1.20.6-R0.1-SNAPSHOT
|
|||||||
mcVersion = 1.20.6
|
mcVersion = 1.20.6
|
||||||
jdkVersion = 21
|
jdkVersion = 21
|
||||||
|
|
||||||
|
paperRepo = https://github.com/PaperMC/Paper
|
||||||
paperBranch = master
|
paperBranch = master
|
||||||
|
purpurRepo = https://github.com/PurpurMC/Purpur
|
||||||
purpurBranch = ver/1.20.6
|
purpurBranch = ver/1.20.6
|
||||||
pufferfishBranch = ver/1.20
|
pufferfishBranch = ver/1.20
|
||||||
usePufferfish = false
|
usePufferfish = false
|
||||||
|
|
||||||
paperCommit = eee55d019fe80372c2e08ccd1d0a94c066cda926
|
paperCommit = 3fc93581bb876e8149b2ca423375a98f5ca12d27
|
||||||
purpurCommit = f9258cd522c14caea3ade7480b01e7e146aa8661
|
purpurCommit = c637b74bade41e7be96ed3478bab7c3b923e7d84
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[versions]
|
[versions]
|
||||||
shadow = "8.1.1"
|
shadow = "8.1.1"
|
||||||
paperweight = "1.6.3"
|
paperweight = "1.7.1"
|
||||||
paperclip = "3.0.3"
|
paperclip = "3.0.3"
|
||||||
decompiler = "1.10.1"
|
decompiler = "1.10.1"
|
||||||
remapper = "0.10.1"
|
remapper = "0.10.1"
|
||||||
|
|||||||
52
initDev
Normal file
52
initDev
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# To initialize your development environment,
|
||||||
|
# run below command in your terminal:
|
||||||
|
# source ./initDev
|
||||||
|
|
||||||
|
export PROJECT_DIR=$(pwd)
|
||||||
|
|
||||||
|
alias api="cd $PROJECT_DIR/*-API"
|
||||||
|
alias srv="cd $PROJECT_DIR/*-Server"
|
||||||
|
|
||||||
|
alias ap="./gradlew --no-rebuild applyPatches"
|
||||||
|
alias aap="./gradlew --no-rebuild applyAPIPatches"
|
||||||
|
alias agp="./gradlew --no-rebuild applyGeneratedAPIPatches"
|
||||||
|
alias asp="./gradlew --no-rebuild applyServerPatches"
|
||||||
|
|
||||||
|
alias rp="./gradlew --no-rebuild rebuildPatches"
|
||||||
|
alias rap="./gradlew --no-rebuild rebuildAPIPatches"
|
||||||
|
alias rgp="./gradlew --no-rebuild rebuildGeneratedAPIPatches"
|
||||||
|
alias rsp="./gradlew --no-rebuild rebuildServerPatches"
|
||||||
|
|
||||||
|
alias lg="git log --oneline base..HEAD"
|
||||||
|
alias rc="git rebase --autosquash -i base"
|
||||||
|
alias rcc="git rebase --continue"
|
||||||
|
|
||||||
|
# generate Fixup patches for Server
|
||||||
|
function fs() {
|
||||||
|
cd *-Server
|
||||||
|
|
||||||
|
git add .
|
||||||
|
git commit -m "fixup"
|
||||||
|
git format-patch -1
|
||||||
|
mv 0001-fixup.patch ../
|
||||||
|
|
||||||
|
cd ../
|
||||||
|
}
|
||||||
|
|
||||||
|
# generate Fixup patches for API
|
||||||
|
function fa() {
|
||||||
|
cd *-API
|
||||||
|
|
||||||
|
git add .
|
||||||
|
git commit -m "fixup"
|
||||||
|
git format-patch -1
|
||||||
|
mv 0001-fixup.patch ../
|
||||||
|
|
||||||
|
cd ../
|
||||||
|
}
|
||||||
|
|
||||||
|
# ReApply Server Patches
|
||||||
|
function rasp() {
|
||||||
|
rm -rf *-Server
|
||||||
|
./gradlew applyServerPatches
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ sentry = "5.4.0"
|
|||||||
fastutil = "8.5.6"
|
fastutil = "8.5.6"
|
||||||
findbugs = "1.3.9"
|
findbugs = "1.3.9"
|
||||||
slf4j-api = "2.0.9"
|
slf4j-api = "2.0.9"
|
||||||
|
brigadier = "1.2.9"
|
||||||
bungeechat = "1.20-R0.2"
|
bungeechat = "1.20-R0.2"
|
||||||
json-simple = "1.1.1"
|
json-simple = "1.1.1"
|
||||||
annotations = "24.0.1"
|
annotations = "24.0.1"
|
||||||
@@ -18,6 +19,7 @@ guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
|
|||||||
sentry = { group = "io.sentry", name = "sentry", version.ref = "sentry" }
|
sentry = { group = "io.sentry", name = "sentry", version.ref = "sentry" }
|
||||||
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
|
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
|
||||||
findbugs = { group = "com.google.code.findbugs", name = "jsr305", version.ref = "findbugs" }
|
findbugs = { group = "com.google.code.findbugs", name = "jsr305", version.ref = "findbugs" }
|
||||||
|
brigadier = { group = "com.mojang", name = "brigadier", version.ref = "brigadier" }
|
||||||
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j-api" }
|
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j-api" }
|
||||||
bungeechat = { group = "net.md-5", name = "bungeecord-chat", version.ref = "bungeechat" }
|
bungeechat = { group = "net.md-5", name = "bungeecord-chat", version.ref = "bungeechat" }
|
||||||
jsonsimple = { group = "com.googlecode.json-simple", name = "json-simple", version.ref = "json-simple" }
|
jsonsimple = { group = "com.googlecode.json-simple", name = "json-simple", version.ref = "json-simple" }
|
||||||
@@ -25,5 +27,5 @@ annotations = { group = "org.jetbrains", name = "annotations", version.ref = "an
|
|||||||
checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" }
|
checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" }
|
||||||
|
|
||||||
[bundles]
|
[bundles]
|
||||||
api = [ "guava", "gson", "joml", "fastutil", "slf4j-api", "sentry" ]
|
api = [ "guava", "gson", "joml", "fastutil", "slf4j-api", "sentry", "brigadier" ]
|
||||||
annotations = [ "annotations", "checkerqual" ]
|
annotations = [ "annotations", "checkerqual" ]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ mockito = "5.5.0"
|
|||||||
jupiter = "5.10.0"
|
jupiter = "5.10.0"
|
||||||
hamcrest = "2.2"
|
hamcrest = "2.2"
|
||||||
snakeyaml = "2.2"
|
snakeyaml = "2.2"
|
||||||
adventure = "4.17.0-SNAPSHOT"
|
adventure = "4.17.0"
|
||||||
commons-lang2 = "2.6"
|
commons-lang2 = "2.6"
|
||||||
commons-lang3 = "3.12.0"
|
commons-lang3 = "3.12.0"
|
||||||
maven-provider = "3.9.6"
|
maven-provider = "3.9.6"
|
||||||
|
|||||||
14
mkapi
14
mkapi
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# PatchAPI <Patch Name>
|
|
||||||
|
|
||||||
PS1="$"
|
|
||||||
|
|
||||||
cd Plazma-API
|
|
||||||
|
|
||||||
git add .
|
|
||||||
git commit -m $1
|
|
||||||
|
|
||||||
cd ../
|
|
||||||
|
|
||||||
./gradlew rebuildAPIPatches
|
|
||||||
14
mksrv
14
mksrv
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# PatchServer <Patch Name>
|
|
||||||
|
|
||||||
PS1="$"
|
|
||||||
|
|
||||||
cd Plazma-Server
|
|
||||||
|
|
||||||
git add .
|
|
||||||
git commit -m $1
|
|
||||||
|
|
||||||
cd ../
|
|
||||||
|
|
||||||
./gradlew rebuildServerPatches
|
|
||||||
@@ -1,897 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Wed, 10 Jan 2024 12:43:26 +0900
|
|
||||||
Subject: [PATCH] Reduce allocations
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java b/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java
|
|
||||||
index ad1eeebe6de219143492b94da309cb54ae9e0a5b..f83bdcf5d2d6f676b2dc83bc1fc0a7453fc2b36a 100644
|
|
||||||
--- a/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java
|
|
||||||
+++ b/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java
|
|
||||||
@@ -38,6 +38,7 @@ public abstract class StarLightEngine {
|
|
||||||
AxisDirection.POSITIVE_X, AxisDirection.NEGATIVE_X,
|
|
||||||
AxisDirection.POSITIVE_Z, AxisDirection.NEGATIVE_Z
|
|
||||||
};
|
|
||||||
+ private static final AxisDirection[] EMPTY_DIRECTIONS = new AxisDirection[0]; // Plazma - Reduce allocations
|
|
||||||
|
|
||||||
protected static enum AxisDirection {
|
|
||||||
|
|
||||||
@@ -1094,7 +1095,7 @@ public abstract class StarLightEngine {
|
|
||||||
for (int bitset = i, len = Integer.bitCount(i), index = 0; index < len; ++index, bitset ^= IntegerUtil.getTrailingBit(bitset)) {
|
|
||||||
directions.add(AXIS_DIRECTIONS[IntegerUtil.trailingZeros(bitset)]);
|
|
||||||
}
|
|
||||||
- OLD_CHECK_DIRECTIONS[i] = directions.toArray(new AxisDirection[0]);
|
|
||||||
+ OLD_CHECK_DIRECTIONS[i] = directions.toArray(EMPTY_DIRECTIONS); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
|
||||||
index e7fe98ea30ae6d0baea3ec1f9f98a89502a49a12..7663ccd247b9942ccfb7a320b047ee621fc1bebe 100644
|
|
||||||
--- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
|
|
||||||
@@ -97,8 +97,8 @@ public final class ChunkPacketBlockControllerAntiXray extends ChunkPacketBlockCo
|
|
||||||
Set<BlockState> presetBlockStateSet = new LinkedHashSet<>();
|
|
||||||
// Therefore addAll(Collection<? extends E>) is used, which guarantees this order in the doc
|
|
||||||
presetBlockStateSet.addAll(presetBlockStateList);
|
|
||||||
- presetBlockStates = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateSet.toArray(new BlockState[0]);
|
|
||||||
- presetBlockStatesFull = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateList.toArray(new BlockState[0]);
|
|
||||||
+ presetBlockStates = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateSet.toArray(org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
|
|
||||||
+ presetBlockStatesFull = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateList.toArray(org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
|
|
||||||
presetBlockStatesStone = null;
|
|
||||||
presetBlockStatesDeepslate = null;
|
|
||||||
presetBlockStatesNetherrack = null;
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
|
|
||||||
index 0133ea6feb1ab88f021f66855669f58367e7420b..a04049bc7738225633ac0b01c470cfbfde86c032 100644
|
|
||||||
--- a/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
|
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
|
|
||||||
@@ -17,9 +17,9 @@ public final class EntityList implements Iterable<Entity> {
|
|
||||||
this.entityToIndex.defaultReturnValue(Integer.MIN_VALUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
- protected static final Entity[] EMPTY_LIST = new Entity[0];
|
|
||||||
+ //protected static final Entity[] EMPTY_LIST = new Entity[0]; // Plazma - Reduce allocations
|
|
||||||
|
|
||||||
- protected Entity[] entities = EMPTY_LIST;
|
|
||||||
+ protected Entity[] entities = org.plazmamc.plazma.constants.Empty.ENTITY; // Plazma - Reduce allocations
|
|
||||||
protected int count;
|
|
||||||
|
|
||||||
public int size() {
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
|
|
||||||
index 277cfd9d1e8fff5d9b5e534b75c3c5162d58b0b7..30d8d9c2dce5e4eb26cc52a03bc395c16c04c256 100644
|
|
||||||
--- a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
|
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
|
|
||||||
@@ -20,9 +20,9 @@ public final class IBlockDataList {
|
|
||||||
this.map.defaultReturnValue(Long.MAX_VALUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
- private static final long[] EMPTY_LIST = new long[0];
|
|
||||||
+ //private static final long[] EMPTY_LIST = new long[0]; // Plazma - Reduce allocations
|
|
||||||
|
|
||||||
- private long[] byIndex = EMPTY_LIST;
|
|
||||||
+ private long[] byIndex = org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
|
|
||||||
private int size;
|
|
||||||
|
|
||||||
public static int getLocationKey(final int x, final int y, final int z) {
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java b/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
|
|
||||||
index 190c5f0b02a3d99054704ae1afbffb3498ddffe1..042ea49ec61ee327c0f67ddcf080774042e44c02 100644
|
|
||||||
--- a/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
|
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
|
|
||||||
@@ -15,9 +15,9 @@ public final class ReferenceList<E> implements Iterable<E> {
|
|
||||||
this.referenceToIndex.defaultReturnValue(Integer.MIN_VALUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
- protected static final Object[] EMPTY_LIST = new Object[0];
|
|
||||||
+ //protected static final Object[] EMPTY_LIST = new Object[0]; // Plazma - Reduce allocations
|
|
||||||
|
|
||||||
- protected Object[] references = EMPTY_LIST;
|
|
||||||
+ protected Object[] references = org.plazmamc.plazma.constants.Empty.OBJECT; // Plazma - Reduce allocations
|
|
||||||
protected int count;
|
|
||||||
|
|
||||||
public int size() {
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
|
|
||||||
index 049e20407..bbd0b944c 100644
|
|
||||||
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
|
|
||||||
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
|
|
||||||
@@ -42,6 +42,7 @@ import java.util.function.Consumer;
|
|
||||||
public final class ChunkTaskScheduler {
|
|
||||||
|
|
||||||
private static final Logger LOGGER = LogUtils.getClassLogger();
|
|
||||||
+ private static final ChunkInfo[] EMPTY_INFO = new ChunkInfo[0]; // Plazma - Reduce allocations
|
|
||||||
|
|
||||||
static int newChunkSystemIOThreads;
|
|
||||||
static int newChunkSystemWorkerThreads;
|
|
||||||
@@ -854,7 +855,7 @@ public final class ChunkTaskScheduler {
|
|
||||||
|
|
||||||
public static ChunkInfo[] getChunkInfos() {
|
|
||||||
synchronized (WAITING_CHUNKS) {
|
|
||||||
- return WAITING_CHUNKS.toArray(new ChunkInfo[0]);
|
|
||||||
+ return WAITING_CHUNKS.toArray(EMPTY_INFO); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java b/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java
|
|
||||||
index ae60bd96b5284d54676d8e7e4dd5d170b526ec1e..359c4b080bd47234e569dce7055da03ddb7b1e90 100644
|
|
||||||
--- a/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java
|
|
||||||
+++ b/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java
|
|
||||||
@@ -14,7 +14,7 @@ public final class VersionCommand implements PaperSubcommand {
|
|
||||||
public boolean execute(final CommandSender sender, final String subCommand, final String[] args) {
|
|
||||||
final @Nullable Command ver = MinecraftServer.getServer().server.getCommandMap().getCommand("version");
|
|
||||||
if (ver != null) {
|
|
||||||
- ver.execute(sender, "paper", new String[0]);
|
|
||||||
+ ver.execute(sender, "paper", org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
|
|
||||||
index 3e82ea07c..692bef556 100644
|
|
||||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
|
|
||||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
|
|
||||||
@@ -47,6 +47,8 @@ import java.util.logging.Level;
|
|
||||||
class PaperPluginInstanceManager {
|
|
||||||
|
|
||||||
private static final FileProviderSource FILE_PROVIDER_SOURCE = new FileProviderSource("File '%s'"::formatted);
|
|
||||||
+ private static final JavaPlugin[] EMPTY_JPLUGIN = new JavaPlugin[0]; // Plazma - Reduce allocations
|
|
||||||
+ private static final Plugin[] EMPTY_PLUGIN = new Plugin[0]; // Plazma - Reduce allocations
|
|
||||||
|
|
||||||
private final List<Plugin> plugins = new ArrayList<>();
|
|
||||||
private final Map<String, Plugin> lookupNames = new HashMap<>();
|
|
||||||
@@ -68,7 +70,7 @@ class PaperPluginInstanceManager {
|
|
||||||
}
|
|
||||||
|
|
||||||
public @NotNull Plugin[] getPlugins() {
|
|
||||||
- return this.plugins.toArray(new Plugin[0]);
|
|
||||||
+ return this.plugins.toArray(EMPTY_PLUGIN); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPluginEnabled(@NotNull String name) {
|
|
||||||
@@ -133,7 +135,7 @@ class PaperPluginInstanceManager {
|
|
||||||
this.server.getLogger().log(Level.SEVERE, "Unknown error occurred while loading plugins through PluginManager.", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
- return runtimePluginEntrypointHandler.getPluginProviderStorage().getLoaded().toArray(new JavaPlugin[0]);
|
|
||||||
+ return runtimePluginEntrypointHandler.getPluginProviderStorage().getLoaded().toArray(EMPTY_JPLUGIN); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
// The behavior of this is that all errors are logged instead of being thrown
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
|
||||||
index ee8e9c0e3..f2598e139 100644
|
|
||||||
--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
|
||||||
+++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java
|
|
||||||
@@ -1149,7 +1149,7 @@ public final class CollisionUtil {
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final MergedVoxelCoordinateList EMPTY = new MergedVoxelCoordinateList(
|
|
||||||
- new double[] { 0.0 }, 0.0, new int[0], new int[0], 0
|
|
||||||
+ new double[] { 0.0 }, 0.0, org.plazmamc.plazma.constants.Empty.INT, org.plazmamc.plazma.constants.Empty.INT, 0 // Plazma - Reduce allocations
|
|
||||||
);
|
|
||||||
|
|
||||||
private static int[] getIndices(final int length) {
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
|
|
||||||
index c78cbec447032de9fe69748591bef6be300160ed..8ca248e844e73685a8d44a966144657315a799aa 100644
|
|
||||||
--- a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
|
|
||||||
+++ b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
|
|
||||||
@@ -304,7 +304,7 @@ public final class ChunkEntitySlices {
|
|
||||||
|
|
||||||
protected static final class BasicEntityList<E extends Entity> {
|
|
||||||
|
|
||||||
- protected static final Entity[] EMPTY = new Entity[0];
|
|
||||||
+ //protected static final Entity[] EMPTY = new Entity[0]; // Plazma - Reduce allocations
|
|
||||||
protected static final int DEFAULT_CAPACITY = 4;
|
|
||||||
|
|
||||||
protected E[] storage;
|
|
||||||
@@ -315,7 +315,7 @@ public final class ChunkEntitySlices {
|
|
||||||
}
|
|
||||||
|
|
||||||
public BasicEntityList(final int cap) {
|
|
||||||
- this.storage = (E[])(cap <= 0 ? EMPTY : new Entity[cap]);
|
|
||||||
+ this.storage = (E[])(cap <= 0 ? org.plazmamc.plazma.constants.Empty.ENTITY : new Entity[cap]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEmpty() {
|
|
||||||
@@ -327,7 +327,7 @@ public final class ChunkEntitySlices {
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resize() {
|
|
||||||
- if (this.storage == EMPTY) {
|
|
||||||
+ if (this.storage == org.plazmamc.plazma.constants.Empty.ENTITY) {
|
|
||||||
this.storage = (E[])new Entity[DEFAULT_CAPACITY];
|
|
||||||
} else {
|
|
||||||
this.storage = Arrays.copyOf(this.storage, this.storage.length * 2);
|
|
||||||
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
|
|
||||||
index c5a3f9c2daf3da135cccecb757353534e1688821..e5585c6befeef62ecf130e8dabbe6b78f9e90a65 100644
|
|
||||||
--- a/src/main/java/net/minecraft/CrashReport.java
|
|
||||||
+++ b/src/main/java/net/minecraft/CrashReport.java
|
|
||||||
@@ -30,7 +30,7 @@ public class CrashReport {
|
|
||||||
@Nullable
|
|
||||||
private File saveFile;
|
|
||||||
private boolean trackingStackTrace = true;
|
|
||||||
- private StackTraceElement[] uncategorizedStackTrace = new StackTraceElement[0];
|
|
||||||
+ private StackTraceElement[] uncategorizedStackTrace = org.plazmamc.plazma.constants.Empty.TRACE; // Plazma - Reduce allocations
|
|
||||||
private final SystemReport systemReport = new SystemReport();
|
|
||||||
|
|
||||||
public CrashReport(String message, Throwable cause) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/CrashReportCategory.java b/src/main/java/net/minecraft/CrashReportCategory.java
|
|
||||||
index 2176171954609fd88f97f93408e14e018c1d6eaa..2a5576dc66a9b1f56e06ba47bef4fe882935c382 100644
|
|
||||||
--- a/src/main/java/net/minecraft/CrashReportCategory.java
|
|
||||||
+++ b/src/main/java/net/minecraft/CrashReportCategory.java
|
|
||||||
@@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
public class CrashReportCategory {
|
|
||||||
private final String title;
|
|
||||||
private final List<CrashReportCategory.Entry> entries = Lists.newArrayList();
|
|
||||||
- private StackTraceElement[] stackTrace = new StackTraceElement[0];
|
|
||||||
+ private StackTraceElement[] stackTrace = org.plazmamc.plazma.constants.Empty.TRACE; // Plazma - Reduce allocations
|
|
||||||
|
|
||||||
public CrashReportCategory(String title) {
|
|
||||||
this.title = title;
|
|
||||||
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
|
|
||||||
index 01a12f4d6f3c2f09bffc78692443b9fd391db45a..9a6e4538dd09263544f39c93f5f1480dc589fb4d 100644
|
|
||||||
--- a/src/main/java/net/minecraft/Util.java
|
|
||||||
+++ b/src/main/java/net/minecraft/Util.java
|
|
||||||
@@ -409,7 +409,7 @@ public class Util {
|
|
||||||
} else if (futures.size() == 1) {
|
|
||||||
return futures.get(0).thenApply(List::of);
|
|
||||||
} else {
|
|
||||||
- CompletableFuture<Void> completableFuture = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
|
|
||||||
+ CompletableFuture<Void> completableFuture = CompletableFuture.allOf(futures.toArray(org.plazmamc.plazma.constants.Empty.FUTURE)); // Plazma - Reduce allocations
|
|
||||||
return completableFuture.thenApply(void_ -> futures.stream().map(CompletableFuture::join).toList());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/ByteArrayTag.java b/src/main/java/net/minecraft/nbt/ByteArrayTag.java
|
|
||||||
index 06648f9751fd8a322d0809ffebf6a544596ee1a4..b0ea87e2ed8f9bf04b33c2ff8a827d4f6f57a435 100644
|
|
||||||
--- a/src/main/java/net/minecraft/nbt/ByteArrayTag.java
|
|
||||||
+++ b/src/main/java/net/minecraft/nbt/ByteArrayTag.java
|
|
||||||
@@ -175,7 +175,7 @@ public class ByteArrayTag extends CollectionTag<ByteTag> {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clear() {
|
|
||||||
- this.data = new byte[0];
|
|
||||||
+ this.data = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
|
||||||
index 4e005b7b0..059a1e49f 100644
|
|
||||||
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
|
|
||||||
+++ b/src/main/java/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 org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce 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 org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce 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 org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
public CompoundTag getCompound(String key) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/IntArrayTag.java b/src/main/java/net/minecraft/nbt/IntArrayTag.java
|
|
||||||
index ff13d67151c50ea11a45117e524c7524e2b1a202..5048ec707c147b9a5b2dd8736d518d938ba95df0 100644
|
|
||||||
--- a/src/main/java/net/minecraft/nbt/IntArrayTag.java
|
|
||||||
+++ b/src/main/java/net/minecraft/nbt/IntArrayTag.java
|
|
||||||
@@ -186,7 +186,7 @@ public class IntArrayTag extends CollectionTag<IntTag> {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clear() {
|
|
||||||
- this.data = new int[0];
|
|
||||||
+ this.data = org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
|
|
||||||
index 154bffd34..83c36d452 100644
|
|
||||||
--- a/src/main/java/net/minecraft/nbt/ListTag.java
|
|
||||||
+++ b/src/main/java/net/minecraft/nbt/ListTag.java
|
|
||||||
@@ -258,7 +258,7 @@ public class ListTag extends CollectionTag<Tag> {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- return new int[0];
|
|
||||||
+ return org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
public long[] getLongArray(int index) {
|
|
||||||
@@ -269,7 +269,7 @@ public class ListTag extends CollectionTag<Tag> {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- return new long[0];
|
|
||||||
+ return org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getDouble(int index) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/LongArrayTag.java b/src/main/java/net/minecraft/nbt/LongArrayTag.java
|
|
||||||
index 2e5c34ebb94a1536cf09d71bdf052a49ecb9159d..144d3bbe80fc0f459a06017a19929e3e849aabd0 100644
|
|
||||||
--- a/src/main/java/net/minecraft/nbt/LongArrayTag.java
|
|
||||||
+++ b/src/main/java/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 = org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/NbtIo.java b/src/main/java/net/minecraft/nbt/NbtIo.java
|
|
||||||
index 9f659af04..d2969c1ce 100644
|
|
||||||
--- a/src/main/java/net/minecraft/nbt/NbtIo.java
|
|
||||||
+++ b/src/main/java/net/minecraft/nbt/NbtIo.java
|
|
||||||
@@ -277,7 +277,7 @@ public class NbtIo {
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
public static CompoundTag read(Path path) throws IOException {
|
|
||||||
- if (!Files.exists(path, new LinkOption[0])) {
|
|
||||||
+ if (!Files.exists(path/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
InputStream inputstream = Files.newInputStream(path);
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/CipherBase.java b/src/main/java/net/minecraft/network/CipherBase.java
|
|
||||||
index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..70d776d5cfdb0612f65d92333d6f872afedc2207 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/CipherBase.java
|
|
||||||
+++ b/src/main/java/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 = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
|
|
||||||
+ private byte[] heapOut = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
|
|
||||||
|
|
||||||
protected CipherBase(Cipher cipher) {
|
|
||||||
this.cipher = cipher;
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
|
||||||
index 9f274048b..ba54c16f1 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
|
||||||
@@ -316,7 +316,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
|
||||||
}
|
|
||||||
|
|
||||||
private void validateListener(ProtocolInfo<?> state, PacketListener listener) {
|
|
||||||
- Validate.notNull(listener, "packetListener", new Object[0]);
|
|
||||||
+ Validate.notNull(listener, "packetListener"/*, new Object[0]*/); // Plazma - Reduce allocations
|
|
||||||
PacketFlow enumprotocoldirection = listener.flow();
|
|
||||||
String s;
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
|
||||||
index 6dcade427..4a0b4b0fa 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
|
||||||
@@ -189,7 +189,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
}
|
|
||||||
|
|
||||||
static MutableComponent translatable(String key) {
|
|
||||||
- return MutableComponent.create(new TranslatableContents(key, (String) null, TranslatableContents.NO_ARGS));
|
|
||||||
+ return MutableComponent.create(new TranslatableContents(key, (String) null, org.plazmamc.plazma.constants.Empty.OBJECT)); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
static MutableComponent translatable(String key, Object... args) {
|
|
||||||
@@ -209,7 +209,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
}
|
|
||||||
|
|
||||||
static MutableComponent translatableWithFallback(String key, @Nullable String fallback) {
|
|
||||||
- return MutableComponent.create(new TranslatableContents(key, fallback, TranslatableContents.NO_ARGS));
|
|
||||||
+ return MutableComponent.create(new TranslatableContents(key, fallback, org.plazmamc.plazma.constants.Empty.OBJECT)); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
static MutableComponent translatableWithFallback(String key, @Nullable String fallback, Object... args) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
|
|
||||||
index 4aa6232bf..84e8a29f0 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
|
|
||||||
+++ b/src/main/java/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 = new Object[0]; // Plazma - Reduce 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(
|
|
||||||
@@ -69,7 +69,7 @@ public class TranslatableContents implements ComponentContents {
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Object[] adjustArgs(Optional<List<Object>> args) {
|
|
||||||
- return args.<Object[]>map(list -> list.isEmpty() ? NO_ARGS : list.toArray()).orElse(NO_ARGS);
|
|
||||||
+ return args.<Object[]>map(list -> list.isEmpty() ? org.plazmamc.plazma.constants.Empty.OBJECT : list.toArray()).orElse(org.plazmamc.plazma.constants.Empty.OBJECT); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
private static TranslatableContents create(String key, Optional<String> fallback, Optional<List<Object>> args) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
|
||||||
index 1a37654af..0e61f8cb3 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
|
||||||
@@ -66,7 +66,7 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
|
|
||||||
public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<BlockState> blockChanges) {
|
|
||||||
this.sectionPos = sectionPos;
|
|
||||||
this.positions = blockChanges.keySet().toShortArray();
|
|
||||||
- this.states = blockChanges.values().toArray(new BlockState[0]);
|
|
||||||
+ this.states = blockChanges.values().toArray(org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
// Paper end - Multi Block Change API
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
index e121cc57e..7b27af22a 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
@@ -1541,13 +1541,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
||||||
}
|
|
||||||
|
|
||||||
private Optional<ServerStatus.Favicon> loadStatusIcon() {
|
|
||||||
- Optional<Path> optional = Optional.of(this.getFile("server-icon.png").toPath()).filter((path) -> {
|
|
||||||
- return Files.isRegularFile(path, new LinkOption[0]);
|
|
||||||
- }).or(() -> {
|
|
||||||
- return this.storageSource.getIconFile().filter((path) -> {
|
|
||||||
- return Files.isRegularFile(path, new LinkOption[0]);
|
|
||||||
- });
|
|
||||||
- });
|
|
||||||
+ // Plazma start - Reduce allocations
|
|
||||||
+ Optional<Path> optional = Optional.of(this.getFile("server-icon.png").toPath()).filter(Files::isRegularFile)
|
|
||||||
+ .or(() -> this.storageSource.getIconFile().filter(Files::isRegularFile));
|
|
||||||
+ // Plazma end
|
|
||||||
|
|
||||||
return optional.flatMap((path) -> {
|
|
||||||
try {
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
|
||||||
index ef520d1dd..b3b0c18b4 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
|
||||||
@@ -130,7 +130,7 @@ public class PlayerAdvancements {
|
|
||||||
}
|
|
||||||
|
|
||||||
private void load(ServerAdvancementManager advancementLoader) {
|
|
||||||
- if (Files.isRegularFile(this.playerSavePath, new LinkOption[0])) {
|
|
||||||
+ if (Files.isRegularFile(this.playerSavePath/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
|
|
||||||
try {
|
|
||||||
JsonReader jsonreader = new JsonReader(Files.newBufferedReader(this.playerSavePath, StandardCharsets.UTF_8));
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java b/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java
|
|
||||||
index 0f52e8a61ca7e57e9f52473dceb9cc3464c0c86d..f54bde32760541a653460682e5a3ddd0b2ceec51 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java
|
|
||||||
@@ -4,12 +4,12 @@ public final class RunningOnDifferentThreadException extends RuntimeException {
|
|
||||||
public static final RunningOnDifferentThreadException RUNNING_ON_DIFFERENT_THREAD = new RunningOnDifferentThreadException();
|
|
||||||
|
|
||||||
private RunningOnDifferentThreadException() {
|
|
||||||
- this.setStackTrace(new StackTraceElement[0]);
|
|
||||||
+ this.setStackTrace(org.plazmamc.plazma.constants.Empty.TRACE); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public synchronized Throwable fillInStackTrace() {
|
|
||||||
- this.setStackTrace(new StackTraceElement[0]);
|
|
||||||
+ this.setStackTrace(org.plazmamc.plazma.constants.Empty.TRACE); // Plazma - Reduce allocations
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
|
||||||
index bae0d208b31aa0a6977c30f2f8484ab3c316bc71..981c3023044f3cc6dc22ada20cd4bedcf7a28db3 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
|
||||||
@@ -92,7 +92,7 @@ public class ServerFunctionLibrary implements PreparableReloadListener {
|
|
||||||
}, prepareExecutor));
|
|
||||||
}
|
|
||||||
|
|
||||||
- CompletableFuture<?>[] completableFutures = map.values().toArray(new CompletableFuture[0]);
|
|
||||||
+ CompletableFuture<?>[] completableFutures = map.values().toArray(org.plazmamc.plazma.constants.Empty.FUTURE); // Plazma - Reduce allocations
|
|
||||||
return CompletableFuture.allOf(completableFutures).handle((unused, ex) -> map);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
||||||
index 4e6fccec4..618dc900d 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
||||||
@@ -112,6 +112,7 @@ import org.bukkit.craftbukkit.generator.CustomChunkGenerator;
|
|
||||||
|
|
||||||
public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
|
|
||||||
|
|
||||||
+ private static final ServerPlayerConnection[] EMPTY_CONNECTION = new ServerPlayerConnection[0]; // Plazma - Reduce allocations
|
|
||||||
private static final byte CHUNK_TYPE_REPLACEABLE = -1;
|
|
||||||
private static final byte CHUNK_TYPE_UNKNOWN = 0;
|
|
||||||
private static final byte CHUNK_TYPE_FULL = 1;
|
|
||||||
@@ -1361,7 +1362,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
||||||
// stuff could have been removed, so we need to check the trackedPlayers set
|
|
||||||
// for players that were removed
|
|
||||||
|
|
||||||
- for (ServerPlayerConnection conn : this.seenBy.toArray(new ServerPlayerConnection[0])) { // avoid CME
|
|
||||||
+ for (ServerPlayerConnection conn : this.seenBy.toArray(EMPTY_CONNECTION)) { // avoid CME // Plazma - Reduce allocations
|
|
||||||
if (newTrackerCandidates == null || !newTrackerCandidates.contains(conn.getPlayer())) {
|
|
||||||
this.updatePlayer(conn.getPlayer());
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
||||||
index f72af2feb..0aaa0e63f 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
||||||
@@ -1439,7 +1439,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
||||||
|
|
||||||
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 ? org.plazmamc.plazma.constants.Empty.ENTITY : new Entity[] { ticking }); // Plazma - Reduce allocations
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
||||||
index 3b4fadb37..f276fe09f 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
||||||
@@ -165,12 +165,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleHello(ServerboundHelloPacket packet) {
|
|
||||||
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
|
|
||||||
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet"/*, new Object[0]*/); // Plazma - Reduce allocations
|
|
||||||
// Paper start - Validate usernames
|
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
|
||||||
&& io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation
|
|
||||||
&& !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) {
|
|
||||||
- Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username", new Object[0]);
|
|
||||||
+ Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username"/*, new Object[0]*/); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
// Paper end - Validate usernames
|
|
||||||
this.requestedUsername = packet.name();
|
|
||||||
@@ -268,7 +268,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleKey(ServerboundKeyPacket packet) {
|
|
||||||
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.KEY, "Unexpected key packet", new Object[0]);
|
|
||||||
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.KEY, "Unexpected key packet"/*, new Object[0]*/); // Plazma - Reduce allocations
|
|
||||||
|
|
||||||
final String s;
|
|
||||||
|
|
||||||
@@ -448,7 +448,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleLoginAcknowledgement(ServerboundLoginAcknowledgedPacket packet) {
|
|
||||||
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.PROTOCOL_SWITCHING, "Unexpected login acknowledgement packet", new Object[0]);
|
|
||||||
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.PROTOCOL_SWITCHING, "Unexpected login acknowledgement packet"/*, new Object[0]*/); // Plazma - Reduce allocations
|
|
||||||
this.connection.setupOutboundProtocol(ConfigurationProtocols.CLIENTBOUND);
|
|
||||||
CommonListenerCookie commonlistenercookie = CommonListenerCookie.createInitial((GameProfile) Objects.requireNonNull(this.authenticatedProfile), this.transferred);
|
|
||||||
ServerConfigurationPacketListenerImpl serverconfigurationpacketlistenerimpl = new ServerConfigurationPacketListenerImpl(this.server, this.connection, commonlistenercookie, this.player); // CraftBukkit
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
index b863f6fe6..068c7619b 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
@@ -135,6 +135,7 @@ public abstract class PlayerList {
|
|
||||||
private static final Logger LOGGER = LogUtils.getLogger();
|
|
||||||
private static final int SEND_PLAYER_INFO_INTERVAL = 600;
|
|
||||||
private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
|
|
||||||
+ private static final org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[] EMPTY_FLAG = new org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[0]; // Plazma - Reduce allocations
|
|
||||||
private final MinecraftServer server;
|
|
||||||
public final List<ServerPlayer> players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety
|
|
||||||
private final Map<UUID, ServerPlayer> playersByUUID = Maps.newHashMap();
|
|
||||||
@@ -815,7 +816,7 @@ public abstract class PlayerList {
|
|
||||||
|
|
||||||
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason) {
|
|
||||||
// Paper start - Expand PlayerRespawnEvent
|
|
||||||
- return respawn(entityplayer, worldserver, flag, location, avoidSuffocation, reason, new org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[0]);
|
|
||||||
+ return respawn(entityplayer, worldserver, flag, location, avoidSuffocation, reason, EMPTY_FLAG); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason, org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag...respawnFlags) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
|
|
||||||
index c038da20b..b6cab933d 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
|
|
||||||
@@ -76,7 +76,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getUserList() {
|
|
||||||
- return (String[]) this.map.keySet().toArray(new String[0]);
|
|
||||||
+ return this.map.keySet().toArray(org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEmpty() {
|
|
||||||
diff --git a/src/main/java/net/minecraft/util/MemoryReserve.java b/src/main/java/net/minecraft/util/MemoryReserve.java
|
|
||||||
index 0ee04fe6ff6a4d09754f326526ae04fe7226bab2..5663ce568a1daa638b7387bee8b9917ce1f64d14 100644
|
|
||||||
--- a/src/main/java/net/minecraft/util/MemoryReserve.java
|
|
||||||
+++ b/src/main/java/net/minecraft/util/MemoryReserve.java
|
|
||||||
@@ -11,6 +11,6 @@ public class MemoryReserve {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void release() {
|
|
||||||
- reserve = new byte[0];
|
|
||||||
+ reserve = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/util/ZeroBitStorage.java b/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
|
||||||
index 01f5b946fabbe34f31110e75973dab9f39897346..2564c21900df7ca3c58872741ec8f68bce80a903 100644
|
|
||||||
--- a/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
|
||||||
+++ b/src/main/java/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 = new long[0]; // Plazma - Reduce allocations
|
|
||||||
private final int size;
|
|
||||||
|
|
||||||
public ZeroBitStorage(int size) {
|
|
||||||
@@ -33,7 +33,7 @@ public class ZeroBitStorage implements BitStorage {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long[] getRaw() {
|
|
||||||
- return RAW;
|
|
||||||
+ return org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
|
||||||
index f34159f8d..4088ec804 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
|
||||||
@@ -57,6 +57,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
|
||||||
public static final Object2FloatMap<ItemLike> COMPOSTABLES = new Object2FloatOpenHashMap();
|
|
||||||
private static final int AABB_SIDE_THICKNESS = 2;
|
|
||||||
private static final VoxelShape OUTER_SHAPE = Shapes.block();
|
|
||||||
+ private static final int[] ZERO_INT = new int[]{0}; // Plazma - Reduce allocations // Plazma - Reduce allocations
|
|
||||||
private static final VoxelShape[] SHAPES = (VoxelShape[]) Util.make(new VoxelShape[9], (avoxelshape) -> {
|
|
||||||
for (int i = 0; i < 8; ++i) {
|
|
||||||
avoxelshape[i] = Shapes.join(ComposterBlock.OUTER_SHAPE, Block.box(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), BooleanOp.ONLY_FIRST);
|
|
||||||
@@ -458,7 +459,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 ? ZERO_INT : org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@@ -507,7 +508,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 ? ZERO_INT : org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@@ -549,7 +550,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSlotsForFace(Direction side) {
|
|
||||||
- return new int[0];
|
|
||||||
+ return org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
|
||||||
index 1362a4794..2490b63cb 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
|
||||||
@@ -445,7 +445,7 @@ public class RegionFile implements AutoCloseable {
|
|
||||||
this.path = path;
|
|
||||||
initOversizedState(); // Paper
|
|
||||||
this.version = compressionFormat;
|
|
||||||
- if (!Files.isDirectory(directory, new LinkOption[0])) {
|
|
||||||
+ if (!Files.isDirectory(directory/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
|
|
||||||
throw new IllegalArgumentException("Expected directory, got " + String.valueOf(directory.toAbsolutePath()));
|
|
||||||
} else {
|
|
||||||
this.externalFileDir = directory;
|
|
||||||
@@ -717,7 +717,7 @@ public class RegionFile implements AutoCloseable {
|
|
||||||
private DataInputStream createExternalChunkInputStream(ChunkPos pos, byte flags) throws IOException {
|
|
||||||
Path path = this.getExternalChunkPath(pos);
|
|
||||||
|
|
||||||
- if (!Files.isRegularFile(path, new LinkOption[0])) {
|
|
||||||
+ if (!Files.isRegularFile(path/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
|
|
||||||
RegionFile.LOGGER.error("External chunk path {} is not file", path);
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
@@ -769,7 +769,7 @@ public class RegionFile implements AutoCloseable {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (!Files.isRegularFile(this.getExternalChunkPath(pos), new LinkOption[0])) {
|
|
||||||
+ if (!Files.isRegularFile(this.getExternalChunkPath(pos)/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java b/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
|
|
||||||
index b8e333e79..b6012d360 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
|
|
||||||
@@ -89,7 +89,7 @@ public class DebugLevelSource extends ChunkGenerator {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NoiseColumn getBaseColumn(int x, int z, LevelHeightAccessor world, RandomState noiseConfig) {
|
|
||||||
- return new NoiseColumn(0, new BlockState[0]);
|
|
||||||
+ return new NoiseColumn(0, org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java b/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
|
|
||||||
index 399da9d43aefbb95897df4697860d5bce5317152..df7816c1c5f069d89a22dbd876a2d663ba68949f 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
|
|
||||||
@@ -110,7 +110,7 @@ public class LevelStorageSource {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DirectoryValidator parseValidator(Path allowedSymlinksFile) {
|
|
||||||
- if (Files.exists(allowedSymlinksFile, new LinkOption[0])) {
|
|
||||||
+ if (Files.exists(allowedSymlinksFile/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
|
|
||||||
try {
|
|
||||||
BufferedReader bufferedreader = Files.newBufferedReader(allowedSymlinksFile);
|
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ public class LevelStorageSource {
|
|
||||||
}
|
|
||||||
|
|
||||||
public LevelStorageSource.LevelCandidates findLevelCandidates() throws LevelStorageException {
|
|
||||||
- if (!Files.isDirectory(this.baseDir, new LinkOption[0])) {
|
|
||||||
+ if (!Files.isDirectory(this.baseDir/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
|
|
||||||
throw new LevelStorageException(Component.translatable("selectWorld.load_folder_access"));
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
@@ -198,11 +198,12 @@ public class LevelStorageSource {
|
|
||||||
LevelStorageSource.LevelCandidates convertable_a;
|
|
||||||
|
|
||||||
try {
|
|
||||||
- List<LevelStorageSource.LevelDirectory> list = stream.filter((path) -> {
|
|
||||||
- return Files.isDirectory(path, new LinkOption[0]);
|
|
||||||
- }).map(LevelStorageSource.LevelDirectory::new).filter((convertable_b) -> {
|
|
||||||
- return Files.isRegularFile(convertable_b.dataFile(), new LinkOption[0]) || Files.isRegularFile(convertable_b.oldDataFile(), new LinkOption[0]);
|
|
||||||
- }).toList();
|
|
||||||
+ // Plazma start - Reduce allocations
|
|
||||||
+ List<LevelStorageSource.LevelDirectory> list = stream.filter(Files::isDirectory)
|
|
||||||
+ .map(LevelStorageSource.LevelDirectory::new)
|
|
||||||
+ .filter(convertable_b -> Files.isRegularFile(convertable_b.dataFile()) || Files.isRegularFile(convertable_b.oldDataFile()))
|
|
||||||
+ .toList();
|
|
||||||
+ // Plazma end
|
|
||||||
|
|
||||||
convertable_a = new LevelStorageSource.LevelCandidates(list);
|
|
||||||
} catch (Throwable throwable) {
|
|
||||||
@@ -312,7 +313,7 @@ public class LevelStorageSource {
|
|
||||||
private LevelSummary readLevelSummary(LevelStorageSource.LevelDirectory save, boolean locked) {
|
|
||||||
Path path = save.dataFile();
|
|
||||||
|
|
||||||
- if (Files.exists(path, new LinkOption[0])) {
|
|
||||||
+ if (Files.exists(path/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
|
|
||||||
try {
|
|
||||||
if (Files.isSymbolicLink(path)) {
|
|
||||||
List<ForbiddenSymlinkInfo> list = this.worldDirValidator.validateSymlink(path);
|
|
||||||
@@ -411,7 +412,7 @@ public class LevelStorageSource {
|
|
||||||
|
|
||||||
public boolean levelExists(String name) {
|
|
||||||
try {
|
|
||||||
- return Files.isDirectory(this.getLevelPath(name), new LinkOption[0]);
|
|
||||||
+ return Files.isDirectory(this.getLevelPath(name)/*, new LinkOption[0]*/); // Plazma - Reduce allocations
|
|
||||||
} catch (InvalidPathException invalidpathexception) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@@ -752,7 +753,7 @@ public class LevelStorageSource {
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasWorldData() {
|
|
||||||
- return Files.exists(this.levelDirectory.dataFile(), new LinkOption[0]) || Files.exists(this.levelDirectory.oldDataFile(), new LinkOption[0]);
|
|
||||||
+ return Files.exists(this.levelDirectory.dataFile()/*, new LinkOption[0]*/) || Files.exists(this.levelDirectory.oldDataFile()/*, new LinkOption[0]*/); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
public void close() throws IOException {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
|
||||||
index 63e187c65cb855031f286aad0d25ac4694f7a331..e0f085169fafa5e574caf368efa343514540b348 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
|
||||||
@@ -124,7 +124,7 @@ public class PlayerDataStorage {
|
|
||||||
String[] astring = this.playerDir.list();
|
|
||||||
|
|
||||||
if (astring == null) {
|
|
||||||
- astring = new String[0];
|
|
||||||
+ astring = org.plazmamc.plazma.constants.Empty.STRING; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < astring.length; ++i) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/scores/Team.java b/src/main/java/net/minecraft/world/scores/Team.java
|
|
||||||
index f00791b89fdb1bb0fb358eff2af2e687bda15e85..aa16c93a4333b603729e2704b92f6d38aec0fd7b 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/scores/Team.java
|
|
||||||
+++ b/src/main/java/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(org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
||||||
index fb2d05e43df3bfb72b1f6e325736dd3cbc6c3096..de4e1d713e5ec182ea8d4832b8359556095ac214 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
||||||
@@ -426,7 +426,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
||||||
public void sendTitle(Title title) {
|
|
||||||
Preconditions.checkNotNull(title, "Title is null");
|
|
||||||
setTitleTimes(title.getFadeIn(), title.getStay(), title.getFadeOut());
|
|
||||||
- setSubtitle(title.getSubtitle() == null ? new BaseComponent[0] : title.getSubtitle());
|
|
||||||
+ setSubtitle(title.getSubtitle() == null ? org.plazmamc.plazma.constants.Empty.BASE_COMPONENT : title.getSubtitle()); // Plazma - Reduce allocations
|
|
||||||
showTitle(title.getTitle());
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
|
|
||||||
index c5d1ba7a1be3f102edcdfdc05fc50b30ef1f775b..66006d9ff581ac96f13389261de0cd647279b98a 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
|
|
||||||
@@ -610,7 +610,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta {
|
|
||||||
throw new IllegalArgumentException("Invalid page number " + page + "/" + CraftMetaBook.this.getPageCount());
|
|
||||||
}
|
|
||||||
|
|
||||||
- BaseComponent[] newText = text == null ? new BaseComponent[0] : text;
|
|
||||||
+ BaseComponent[] newText = text == null ? org.plazmamc.plazma.constants.Empty.BASE_COMPONENT : text; // Plazma - Reduce allocations
|
|
||||||
CraftMetaBook.this.pages.set(page - 1, this.componentsToPage(newText));
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -623,7 +623,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta {
|
|
||||||
public void addPage(final BaseComponent[]... pages) {
|
|
||||||
for (BaseComponent[] page : pages) {
|
|
||||||
if (page == null) {
|
|
||||||
- page = new BaseComponent[0];
|
|
||||||
+ page = org.plazmamc.plazma.constants.Empty.BASE_COMPONENT; // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
CraftMetaBook.this.internalAddPage(this.componentsToPage(page));
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java b/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java
|
|
||||||
index b25dc23b81687dd4d4e70b3615ffb91f8c03c68b..acb98770b9d01e930642a5794f9179660b411c02 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java
|
|
||||||
@@ -164,7 +164,7 @@ public final class WeakCollection<T> implements Collection<T> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object[] toArray() {
|
|
||||||
- return this.toArray(new Object[0]);
|
|
||||||
+ return this.toArray(org.plazmamc.plazma.constants.Empty.OBJECT); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/constants/Empty.java b/src/main/java/org/plazmamc/plazma/constants/Empty.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..2b6eb7997986ab73ccb3b1baca945a3234ae916e
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/constants/Empty.java
|
|
||||||
@@ -0,0 +1,20 @@
|
|
||||||
+package org.plazmamc.plazma.constants;
|
|
||||||
+
|
|
||||||
+public interface Empty {
|
|
||||||
+
|
|
||||||
+ int[] INT = new int[0];
|
|
||||||
+ long[] LONG = new long[0];
|
|
||||||
+ byte[] BYTE = new byte[0];
|
|
||||||
+
|
|
||||||
+ Object[] OBJECT = new Object[0];
|
|
||||||
+ String[] STRING = new String[0];
|
|
||||||
+ StackTraceElement[] TRACE = new StackTraceElement[0];
|
|
||||||
+ java.util.concurrent.CompletableFuture<?>[] FUTURE = new java.util.concurrent.CompletableFuture[0];
|
|
||||||
+
|
|
||||||
+ net.minecraft.world.level.block.state.BlockState[] BLOCK_STATE = new net.minecraft.world.level.block.state.BlockState[0];
|
|
||||||
+ net.minecraft.world.entity.Entity[] ENTITY = new net.minecraft.world.entity.Entity[0];
|
|
||||||
+
|
|
||||||
+ @SuppressWarnings("deprecation")
|
|
||||||
+ net.md_5.bungee.api.chat.BaseComponent[] BASE_COMPONENT = new net.md_5.bungee.api.chat.BaseComponent[0];
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java b/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
|
|
||||||
index 2621e54879e9ab0029a875f1d09eee67878b90d5..e7e959368c01de69261618d1eb749bebba3527af 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
|
|
||||||
@@ -57,7 +57,7 @@ public class PurpurCommand extends Command {
|
|
||||||
} else if (args[0].equalsIgnoreCase("version")) {
|
|
||||||
Command verCmd = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
|
|
||||||
if (verCmd != null) {
|
|
||||||
- return verCmd.execute(sender, commandLabel, new String[0]);
|
|
||||||
+ return verCmd.execute(sender, commandLabel, org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: granny <contact@granny.dev>
|
From: granny <contact@granny.dev>
|
||||||
Date: Wed, 8 May 2024 08:14:51 +0000
|
Date: Tue, 14 May 2024 17:29:02 +0900
|
||||||
Subject: [PATCH] Purpur API Changes
|
Subject: [PATCH] Purpur API Changes
|
||||||
|
|
||||||
PurpurMC
|
PurpurMC
|
||||||
@@ -25,10 +25,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 65e67b8726f1e19a6bcb1fe2f448e4ab68df11d1..892e78b1d2d29dc54def03fcb6d85a93ad56d84c 100644
|
index fd39ed209b20c927054b8482c400beeeeab460a3..6aef83558a5ef7e84873b127c3bb43a6468c9a24 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -121,6 +121,8 @@ tasks.jar {
|
@@ -142,6 +142,8 @@ tasks.jar {
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<Javadoc> {
|
tasks.withType<Javadoc> {
|
||||||
@@ -408,12 +408,12 @@ index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||||
index 7a337fe908915f8ea487a0b9236c511cb07d5e66..1dd02e2782364bf25521088cf8858d3443643447 100644
|
index 81f9ad99699a78b97e4accaaf1a98eacf29493ce..e3e996d932db689ba62a43f7f01d6f003f8337d3 100644
|
||||||
--- a/src/main/java/org/bukkit/Material.java
|
--- a/src/main/java/org/bukkit/Material.java
|
||||||
+++ b/src/main/java/org/bukkit/Material.java
|
+++ b/src/main/java/org/bukkit/Material.java
|
||||||
@@ -11657,4 +11657,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
@@ -5701,4 +5701,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||||
public boolean isEnabledByFeature(@NotNull World world) {
|
}
|
||||||
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
|
return Registry.BLOCK.get(material.key);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // Purpur start
|
+ // Purpur start
|
||||||
@@ -564,7 +564,7 @@ index 30298a629b39bd43ce14b414fc697b2dfcbea89c..ce00af9121de7a910aaea4e0685a06d4
|
|||||||
+ // Purpur end - OfflinePlayer API
|
+ // Purpur end - OfflinePlayer API
|
||||||
}
|
}
|
||||||
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 30cbe3bdc7142769019765b03cc4fe1f9ba1ddb4..320422ff95773efa01e8205edcc5c6c9a84d5ecd 100644
|
index c8595ffcfcbdd79794d464415287d46acef72b72..ec8b9b2cbe65838a194281f7d76d0e17defc5211 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
|
||||||
@@ -2257,6 +2257,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2257,6 +2257,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
@@ -586,7 +586,7 @@ index 30cbe3bdc7142769019765b03cc4fe1f9ba1ddb4..320422ff95773efa01e8205edcc5c6c9
|
|||||||
/**
|
/**
|
||||||
* Sends the component to the player
|
* Sends the component to the player
|
||||||
*
|
*
|
||||||
@@ -2540,4 +2552,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2542,4 +2554,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
*/
|
*/
|
||||||
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
|
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
|
||||||
// Paper end - Folia region threading API
|
// Paper end - Folia region threading API
|
||||||
@@ -813,10 +813,10 @@ index 739911cda33b373f99df627a3a378b37d7d461aa..51e78c22cd021722b963fe31d1d9175d
|
|||||||
* Add an entity to the block.
|
* Add an entity to the block.
|
||||||
*
|
*
|
||||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||||
index ac9a28922f8a556944a4c3649d74c32c622f0cb0..5349f16136d9348c374a7dfe5b89a71dfcb0e66d 100644
|
index c3a9cf65db73ed534bf20996c7f05b5eb0aaebe1..fdedac32544be6534288c8ba28abe7f5c4c56f3b 100644
|
||||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||||
@@ -143,6 +143,19 @@ public class SimpleCommandMap implements CommandMap {
|
@@ -152,6 +152,19 @@ public class SimpleCommandMap implements CommandMap {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -836,7 +836,7 @@ index ac9a28922f8a556944a4c3649d74c32c622f0cb0..5349f16136d9348c374a7dfe5b89a71d
|
|||||||
// Paper start - Plugins do weird things to workaround normal registration
|
// Paper start - Plugins do weird things to workaround normal registration
|
||||||
if (target.timings == null) {
|
if (target.timings == null) {
|
||||||
target.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, target);
|
target.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, target);
|
||||||
@@ -150,10 +163,10 @@ public class SimpleCommandMap implements CommandMap {
|
@@ -159,10 +172,10 @@ public class SimpleCommandMap implements CommandMap {
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -1440,10 +1440,10 @@ index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||||
index 84a7bf0936d35bf42b5ed038d295d5c31740f472..6e9b4cbc81878616b1c48add5db534286d267b05 100644
|
index c64413a6740b604282984dea2a8430a6e7478d68..5c609d916e2d2f08ba90ebd23f13c5c9a14bc73c 100644
|
||||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||||
@@ -17,6 +17,17 @@ import org.bukkit.inventory.meta.ItemMeta;
|
@@ -19,6 +19,17 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.material.MaterialData;
|
import org.bukkit.material.MaterialData;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -1461,7 +1461,7 @@ index 84a7bf0936d35bf42b5ed038d295d5c31740f472..6e9b4cbc81878616b1c48add5db53428
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a stack of items.
|
* Represents a stack of items.
|
||||||
@@ -1073,4 +1084,565 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
@@ -1079,4 +1090,565 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||||
return Bukkit.getUnsafe().computeTooltipLines(this, tooltipContext, player);
|
return Bukkit.getUnsafe().computeTooltipLines(this, tooltipContext, player);
|
||||||
}
|
}
|
||||||
// Paper end - expose itemstack tooltip lines
|
// Paper end - expose itemstack tooltip lines
|
||||||
@@ -2028,7 +2028,7 @@ index 84a7bf0936d35bf42b5ed038d295d5c31740f472..6e9b4cbc81878616b1c48add5db53428
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||||
index db8bcc66bdc4bedfffb4705db6338eda4c0ad29a..feda3ddfaaf37b6ee218a0e0b1fbc199899bd364 100644
|
index c143b0d8b97d514566bac8413d0346cf50822aeb..032a21766ce91471cb7d91b663d70e0d9fa66a26 100644
|
||||||
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||||
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||||
@@ -10,6 +10,7 @@ import java.util.function.Predicate;
|
@@ -10,6 +10,7 @@ import java.util.function.Predicate;
|
||||||
@@ -2039,7 +2039,7 @@ index db8bcc66bdc4bedfffb4705db6338eda4c0ad29a..feda3ddfaaf37b6ee218a0e0b1fbc199
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a potential item match within a recipe. All choices within a
|
* Represents a potential item match within a recipe. All choices within a
|
||||||
@@ -150,6 +151,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
@@ -157,6 +158,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||||
public static class ExactChoice implements RecipeChoice {
|
public static class ExactChoice implements RecipeChoice {
|
||||||
|
|
||||||
private List<ItemStack> choices;
|
private List<ItemStack> choices;
|
||||||
@@ -2047,7 +2047,7 @@ index db8bcc66bdc4bedfffb4705db6338eda4c0ad29a..feda3ddfaaf37b6ee218a0e0b1fbc199
|
|||||||
|
|
||||||
public ExactChoice(@NotNull ItemStack stack) {
|
public ExactChoice(@NotNull ItemStack stack) {
|
||||||
this(Arrays.asList(stack));
|
this(Arrays.asList(stack));
|
||||||
@@ -194,6 +196,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
@@ -206,6 +208,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean test(@NotNull ItemStack t) {
|
public boolean test(@NotNull ItemStack t) {
|
||||||
@@ -2055,7 +2055,7 @@ index db8bcc66bdc4bedfffb4705db6338eda4c0ad29a..feda3ddfaaf37b6ee218a0e0b1fbc199
|
|||||||
for (ItemStack match : choices) {
|
for (ItemStack match : choices) {
|
||||||
if (t.isSimilar(match)) {
|
if (t.isSimilar(match)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -203,6 +206,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
@@ -215,6 +218,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,27 +5,28 @@ Subject: [PATCH] Use Gradle Version Catalogs
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 892e78b1d2d29dc54def03fcb6d85a93ad56d84c..cd64328dd664821a23ba2765e82dd633b696e3ab 100644
|
index 6aef83558a5ef7e84873b127c3bb43a6468c9a24..dedd9703559dbff43adb4b0aee6765789f130d50 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -9,11 +9,13 @@ java {
|
@@ -9,11 +9,13 @@ java {
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
}
|
}
|
||||||
|
|
||||||
+/*
|
+/* // Plazma - Use Gradle Version Catalogs
|
||||||
val annotationsVersion = "24.1.0"
|
val annotationsVersion = "24.1.0"
|
||||||
val bungeeCordChatVersion = "1.20-R0.2"
|
val bungeeCordChatVersion = "1.20-R0.2"
|
||||||
val adventureVersion = "4.17.0-SNAPSHOT"
|
val adventureVersion = "4.17.0"
|
||||||
val slf4jVersion = "2.0.9"
|
val slf4jVersion = "2.0.9"
|
||||||
val log4jVersion = "2.17.1"
|
val log4jVersion = "2.17.1"
|
||||||
+ */
|
+ */ // Plazma - Use Gradle Version Catalogs
|
||||||
val apiAndDocs: Configuration by configurations.creating {
|
val apiAndDocs: Configuration by configurations.creating {
|
||||||
attributes {
|
attributes {
|
||||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
||||||
@@ -27,54 +29,31 @@ configurations.api {
|
@@ -27,55 +29,31 @@ configurations.api {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
- api("com.mojang:brigadier:1.2.9") // Paper - Brigadier command api
|
||||||
- // api dependencies are listed transitively to API consumers
|
- // api dependencies are listed transitively to API consumers
|
||||||
- api("com.google.guava:guava:32.1.2-jre")
|
- api("com.google.guava:guava:32.1.2-jre")
|
||||||
- api("com.google.code.gson:gson:2.10.1")
|
- api("com.google.code.gson:gson:2.10.1")
|
||||||
@@ -82,8 +83,8 @@ index 892e78b1d2d29dc54def03fcb6d85a93ad56d84c..cd64328dd664821a23ba2765e82dd633
|
|||||||
+ api(common.snakeyaml)
|
+ api(common.snakeyaml)
|
||||||
+ api(common.log4j.api)
|
+ api(common.log4j.api)
|
||||||
+ api(common.maven.provider)
|
+ api(common.maven.provider)
|
||||||
+ api(api.bungeechat) { exclude("com.google.guava", "guava") }
|
|
||||||
+ api(api.jsonsimple) { isTransitive = false }
|
+ api(api.jsonsimple) { isTransitive = false }
|
||||||
|
+ api(api.bungeechat) { exclude("com.google.guava", "guava") }
|
||||||
+ apiAndDocs(platform(common.adventure.bom))
|
+ apiAndDocs(platform(common.adventure.bom))
|
||||||
+ apiAndDocs(common.bundles.adventure)
|
+ apiAndDocs(common.bundles.adventure)
|
||||||
+
|
+
|
||||||
@@ -102,7 +103,7 @@ index 892e78b1d2d29dc54def03fcb6d85a93ad56d84c..cd64328dd664821a23ba2765e82dd633
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Paper start
|
// Paper start
|
||||||
@@ -128,25 +107,16 @@ tasks.withType<Javadoc> {
|
@@ -149,25 +127,16 @@ tasks.withType<Javadoc> {
|
||||||
options.use()
|
options.use()
|
||||||
options.isDocFilesSubDirs = true
|
options.isDocFilesSubDirs = true
|
||||||
options.links(
|
options.links(
|
||||||
@@ -115,12 +116,12 @@ index 892e78b1d2d29dc54def03fcb6d85a93ad56d84c..cd64328dd664821a23ba2765e82dd633
|
|||||||
- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
|
- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
|
||||||
- // Paper end
|
- // Paper end
|
||||||
- // Paper start
|
- // Paper start
|
||||||
- //"https://jd.advntr.dev/api/$adventureVersion/",
|
- "https://jd.advntr.dev/api/$adventureVersion/",
|
||||||
- //"https://jd.advntr.dev/text-minimessage/$adventureVersion/",
|
- "https://jd.advntr.dev/text-minimessage/$adventureVersion/",
|
||||||
- //"https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
|
- "https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
|
||||||
- //"https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
|
- "https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
|
||||||
- //"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
|
- "https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
|
||||||
- //"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
|
- "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
|
||||||
- "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
|
- "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
|
||||||
- "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
|
- "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
|
||||||
- // Paper end
|
- // Paper end
|
||||||
|
|||||||
33
patches/api/0003-Rebrand.patch
Normal file
33
patches/api/0003-Rebrand.patch
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AlphaKR93 <dev@alpha93.kr>
|
||||||
|
Date: Tue, 14 May 2024 18:36:30 +0900
|
||||||
|
Subject: [PATCH] Rebrand
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/MIT.txt b/MIT.txt
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..67d405764ed68083d0164b1af0eabc0af7f6efea
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/MIT.txt
|
||||||
|
@@ -0,0 +1,21 @@
|
||||||
|
+The MIT License (MIT)
|
||||||
|
+
|
||||||
|
+Copyright (c) 2024 Paper Contributors
|
||||||
|
+
|
||||||
|
+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.
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Plazma Configurations
|
|||||||
|
|
||||||
|
|
||||||
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 320422ff95773efa01e8205edcc5c6c9a84d5ecd..f1b39968788f90ffc785b9dd434b2a3671553a14 100644
|
index ec8b9b2cbe65838a194281f7d76d0e17defc5211..0062b2d4dc7a64d1e4da240bf8dc5b428eb242ee 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
|
||||||
@@ -2269,6 +2269,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2269,6 +2269,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Alpha <dev@alpha93.kr>
|
|
||||||
Date: Tue, 27 Feb 2024 18:36:43 +0900
|
|
||||||
Subject: [PATCH] Rebrand
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
||||||
index e60be45e2513ea49a8605682c3d80835df4c58ee..6e0d314343bca0c3742359c1734c775a4c2a2b18 100644
|
|
||||||
--- a/build.gradle.kts
|
|
||||||
+++ b/build.gradle.kts
|
|
||||||
@@ -9,7 +9,7 @@ java {
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
- implementation(project(":paper-api"))
|
|
||||||
+ implementation(project(":${parent!!.property("projectName").toString().lowercase()}-api")) // Plazma - Rebrand
|
|
||||||
api("com.mojang:brigadier:1.0.18")
|
|
||||||
|
|
||||||
compileOnly("it.unimi.dsi:fastutil:8.5.6")
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Tue, 7 May 2024 23:07:33 +0900
|
|
||||||
Subject: [PATCH] Add .gitignore file
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/.gitignore b/.gitignore
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..97e78e27ee0eea2c8b24886eeb19164d552323fe
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/.gitignore
|
|
||||||
@@ -0,0 +1,40 @@
|
|
||||||
+.gradle/
|
|
||||||
+
|
|
||||||
+# Eclipse stuff
|
|
||||||
+/.classpath
|
|
||||||
+/.project
|
|
||||||
+/.settings
|
|
||||||
+/.checkstyle
|
|
||||||
+/.factorypath
|
|
||||||
+
|
|
||||||
+# netbeans
|
|
||||||
+/nbproject
|
|
||||||
+/nb-configuration.xml
|
|
||||||
+
|
|
||||||
+# we use maven!
|
|
||||||
+/build.xml
|
|
||||||
+
|
|
||||||
+# maven
|
|
||||||
+/target
|
|
||||||
+
|
|
||||||
+# vim
|
|
||||||
+.*.sw[a-p]
|
|
||||||
+
|
|
||||||
+# various other potential build files
|
|
||||||
+/build
|
|
||||||
+/bin
|
|
||||||
+/dist
|
|
||||||
+/manifest.mf
|
|
||||||
+
|
|
||||||
+# Mac filesystem dust
|
|
||||||
+.DS_Store
|
|
||||||
+
|
|
||||||
+# intellij
|
|
||||||
+*.iml
|
|
||||||
+*.ipr
|
|
||||||
+*.iws
|
|
||||||
+.idea/
|
|
||||||
+
|
|
||||||
+# vs code
|
|
||||||
+/.vscode
|
|
||||||
+/.factorypath
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: granny <contact@granny.dev>
|
From: granny <contact@granny.dev>
|
||||||
Date: Wed, 8 May 2024 08:14:50 +0000
|
Date: Tue, 14 May 2024 17:29:02 +0900
|
||||||
Subject: [PATCH] Purpur Server Changes
|
Subject: [PATCH] Purpur Server Changes
|
||||||
|
|
||||||
PurpurMC
|
PurpurMC
|
||||||
@@ -25,25 +25,19 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 5d448d8a7cf6626a11791f30ad52baf41a099272..81996f00384674b29368e8bea944bdd14d631da3 100644
|
index 87bb3fd9b97506f61734ae7f2e6860610ba794e7..89f21e21efc5f5ab99d1586f4f3b8f2f3c48ac06 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -12,8 +12,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
@@ -12,7 +12,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||||
val alsoShade: Configuration by configurations.creating
|
val alsoShade: Configuration by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
- implementation(project(":paper-api"))
|
- implementation(project(":paper-api"))
|
||||||
- implementation(project(":paper-mojangapi"))
|
+ implementation(project(":purpur-api")) // Purpur
|
||||||
+ // Purpur start
|
|
||||||
+ implementation(project(":purpur-api"))
|
|
||||||
+ implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
|
|
||||||
+ exclude("io.papermc.paper", "paper-api")
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
// Paper start
|
// Paper start
|
||||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||||
@@ -47,6 +51,10 @@ dependencies {
|
@@ -46,6 +46,10 @@ dependencies {
|
||||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||||
|
|
||||||
@@ -54,7 +48,7 @@ index 5d448d8a7cf6626a11791f30ad52baf41a099272..81996f00384674b29368e8bea944bdd1
|
|||||||
testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
|
testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
||||||
testImplementation("org.hamcrest:hamcrest:2.2")
|
testImplementation("org.hamcrest:hamcrest:2.2")
|
||||||
@@ -79,7 +87,7 @@ tasks.jar {
|
@@ -78,7 +82,7 @@ tasks.jar {
|
||||||
attributes(
|
attributes(
|
||||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
"Implementation-Title" to "CraftBukkit",
|
"Implementation-Title" to "CraftBukkit",
|
||||||
@@ -63,7 +57,7 @@ index 5d448d8a7cf6626a11791f30ad52baf41a099272..81996f00384674b29368e8bea944bdd1
|
|||||||
"Implementation-Vendor" to date, // Paper
|
"Implementation-Vendor" to date, // Paper
|
||||||
"Specification-Title" to "Bukkit",
|
"Specification-Title" to "Bukkit",
|
||||||
"Specification-Version" to project.version,
|
"Specification-Version" to project.version,
|
||||||
@@ -138,7 +146,7 @@ fun TaskContainer.registerRunTask(
|
@@ -137,7 +141,7 @@ fun TaskContainer.registerRunTask(
|
||||||
name: String,
|
name: String,
|
||||||
block: JavaExec.() -> Unit
|
block: JavaExec.() -> Unit
|
||||||
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||||
@@ -491,6 +485,30 @@ index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b
|
|||||||
sender.sendMessage(component);
|
sender.sendMessage(component);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
||||||
|
index 10a113b057b0a4d27cce3bae975e1108aaa7b517..02597f890ac7f2dc12c94c283356b8309638dd17 100644
|
||||||
|
--- a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
||||||
|
+++ b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
||||||
|
@@ -75,16 +75,16 @@ public class BukkitCommandNode extends LiteralCommandNode<CommandSourceStack> {
|
||||||
|
|
||||||
|
// Plugins do weird things to workaround normal registration
|
||||||
|
if (this.command.timings == null) {
|
||||||
|
- this.command.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, this.command);
|
||||||
|
+ //this.command.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, this.command); // Purpur
|
||||||
|
}
|
||||||
|
|
||||||
|
String content = context.getRange().get(context.getInput());
|
||||||
|
String[] args = org.apache.commons.lang3.StringUtils.split(content, ' '); // fix adjacent spaces (from console/plugins) causing empty array elements
|
||||||
|
|
||||||
|
- try (Timing ignored = this.command.timings.startTiming()) {
|
||||||
|
+ //try (Timing ignored = this.command.timings.startTiming()) { // Purpur
|
||||||
|
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
||||||
|
this.command.execute(sender, this.literal, Arrays.copyOfRange(args, 1, args.length));
|
||||||
|
- }
|
||||||
|
+ //} // Purpur
|
||||||
|
|
||||||
|
// return true as command was handled
|
||||||
|
return 1;
|
||||||
diff --git a/src/main/java/io/papermc/paper/logging/SysoutCatcher.java b/src/main/java/io/papermc/paper/logging/SysoutCatcher.java
|
diff --git a/src/main/java/io/papermc/paper/logging/SysoutCatcher.java b/src/main/java/io/papermc/paper/logging/SysoutCatcher.java
|
||||||
index a8e813ca89b033f061e695288b3383bdcf128531..1ab65af9359d19530bba7f985a604d2a430ee234 100644
|
index a8e813ca89b033f061e695288b3383bdcf128531..1ab65af9359d19530bba7f985a604d2a430ee234 100644
|
||||||
--- a/src/main/java/io/papermc/paper/logging/SysoutCatcher.java
|
--- a/src/main/java/io/papermc/paper/logging/SysoutCatcher.java
|
||||||
@@ -656,10 +674,10 @@ index 4f3cc14d48690bb183d09bb7a5ba1e23e8a0c08a..c366d84518979e842a6f10f969a59515
|
|||||||
stringbuilder.append(CrashReport.getErrorComment());
|
stringbuilder.append(CrashReport.getErrorComment());
|
||||||
stringbuilder.append("\n\n");
|
stringbuilder.append("\n\n");
|
||||||
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||||
index e6c7f62ed379a78645933670299e4fcda8540ed1..7475aaac2673729091eabc741c8ebb561aeec8f1 100644
|
index 59d7e8a3d83d3ab7aa28606401bb129ccaeff240..684536f600cca94ea346129a139ec4aac4d9f979 100644
|
||||||
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||||
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||||
@@ -230,6 +230,19 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
@@ -209,6 +209,19 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@@ -679,7 +697,7 @@ index e6c7f62ed379a78645933670299e4fcda8540ed1..7475aaac2673729091eabc741c8ebb56
|
|||||||
public Vec3 getPosition() {
|
public Vec3 getPosition() {
|
||||||
return this.worldPosition;
|
return this.worldPosition;
|
||||||
}
|
}
|
||||||
@@ -331,6 +344,30 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
@@ -310,6 +323,30 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -711,7 +729,7 @@ index e6c7f62ed379a78645933670299e4fcda8540ed1..7475aaac2673729091eabc741c8ebb56
|
|||||||
boolean flag1 = this.source.acceptsSuccess() && !this.silent;
|
boolean flag1 = this.source.acceptsSuccess() && !this.silent;
|
||||||
boolean flag2 = broadcastToOps && this.source.shouldInformAdmins() && !this.silent;
|
boolean flag2 = broadcastToOps && this.source.shouldInformAdmins() && !this.silent;
|
||||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||||
index aa2fca6917fb67fe0e9ba067d11487c3a274f675..f9d0e8ee9414b3897f268ba78a1469ddf868f51a 100644
|
index 24086a82e1687cb1925398218b18c2384fa8f6e3..55b29e9a540cfc00dc32c7ae14d603c150e8863d 100644
|
||||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||||
@@ -166,7 +166,7 @@ public class Commands {
|
@@ -166,7 +166,7 @@ public class Commands {
|
||||||
@@ -749,8 +767,8 @@ index aa2fca6917fb67fe0e9ba067d11487c3a274f675..f9d0e8ee9414b3897f268ba78a1469dd
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (environment.includeIntegrated) {
|
if (environment.includeIntegrated) {
|
||||||
@@ -327,9 +335,9 @@ public class Commands {
|
@@ -339,9 +347,9 @@ public class Commands {
|
||||||
public void performCommand(ParseResults<CommandSourceStack> parseresults, String s, String label) { // CraftBukkit
|
// Paper end
|
||||||
CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource();
|
CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource();
|
||||||
|
|
||||||
- commandlistenerwrapper.getServer().getProfiler().push(() -> {
|
- commandlistenerwrapper.getServer().getProfiler().push(() -> {
|
||||||
@@ -761,7 +779,7 @@ index aa2fca6917fb67fe0e9ba067d11487c3a274f675..f9d0e8ee9414b3897f268ba78a1469dd
|
|||||||
ContextChain contextchain = this.finishParsing(parseresults, s, commandlistenerwrapper, label); // CraftBukkit // Paper - Add UnknownCommandEvent
|
ContextChain contextchain = this.finishParsing(parseresults, s, commandlistenerwrapper, label); // CraftBukkit // Paper - Add UnknownCommandEvent
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -358,7 +366,7 @@ public class Commands {
|
@@ -371,7 +379,7 @@ public class Commands {
|
||||||
Commands.LOGGER.error("'/{}' threw an exception", s, exception);
|
Commands.LOGGER.error("'/{}' threw an exception", s, exception);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -770,7 +788,7 @@ index aa2fca6917fb67fe0e9ba067d11487c3a274f675..f9d0e8ee9414b3897f268ba78a1469dd
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -501,6 +509,7 @@ public class Commands {
|
@@ -514,6 +522,7 @@ public class Commands {
|
||||||
private void runSync(ServerPlayer player, Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootcommandnode) {
|
private void runSync(ServerPlayer player, Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootcommandnode) {
|
||||||
// Paper end - Perf: Async command map building
|
// Paper end - Perf: Async command map building
|
||||||
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper - Brigadier API
|
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper - Brigadier API
|
||||||
@@ -778,7 +796,7 @@ index aa2fca6917fb67fe0e9ba067d11487c3a274f675..f9d0e8ee9414b3897f268ba78a1469dd
|
|||||||
PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit));
|
PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit));
|
||||||
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
@@ -511,6 +520,7 @@ public class Commands {
|
@@ -524,6 +533,7 @@ public class Commands {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -1050,7 +1068,7 @@ index 5443013060b62e3bfcc51cddca96d1c0bc59fe72..411f1f8c6be072cfc5ba88cbec38dbc4
|
|||||||
Bootstrap.bootStrap();
|
Bootstrap.bootStrap();
|
||||||
Bootstrap.validate();
|
Bootstrap.validate();
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37a7db31fa 100644
|
index 39303bb4e336732db0ab19dee0c1f8b609bbb134..dfe3d28bd97d1335457d1005ecf69afe75d5ff80 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -300,6 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -300,6 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@@ -1060,7 +1078,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
+ public static final long startTimeMillis = System.currentTimeMillis();
|
+ public static final long startTimeMillis = System.currentTimeMillis();
|
||||||
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
|
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
|
||||||
public int autosavePeriod;
|
public int autosavePeriod;
|
||||||
public Commands vanillaCommandDispatcher;
|
// Paper - don't store the vanilla dispatcher
|
||||||
@@ -310,11 +311,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -310,11 +311,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS;
|
public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS;
|
||||||
private static final int SAMPLE_INTERVAL = 20; // Paper - improve server tick loop
|
private static final int SAMPLE_INTERVAL = 20; // Paper - improve server tick loop
|
||||||
@@ -1096,7 +1114,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
this.random = RandomSource.create();
|
this.random = RandomSource.create();
|
||||||
this.port = -1;
|
this.port = -1;
|
||||||
this.levels = Maps.newLinkedHashMap();
|
this.levels = Maps.newLinkedHashMap();
|
||||||
@@ -960,7 +963,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -962,7 +965,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
shutdownThread = Thread.currentThread();
|
shutdownThread = Thread.currentThread();
|
||||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||||
if (!isSameThread()) {
|
if (!isSameThread()) {
|
||||||
@@ -1105,7 +1123,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
while (this.getRunningThread().isAlive()) {
|
while (this.getRunningThread().isAlive()) {
|
||||||
this.getRunningThread().stop();
|
this.getRunningThread().stop();
|
||||||
try {
|
try {
|
||||||
@@ -970,13 +973,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -972,13 +975,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -1129,7 +1147,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (this.server != null) {
|
if (this.server != null) {
|
||||||
this.server.disablePlugins();
|
this.server.disablePlugins();
|
||||||
@@ -1059,6 +1070,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1061,6 +1072,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.safeShutdown(waitForShutdown, false);
|
this.safeShutdown(waitForShutdown, false);
|
||||||
}
|
}
|
||||||
public void safeShutdown(boolean waitForShutdown, boolean isRestarting) {
|
public void safeShutdown(boolean waitForShutdown, boolean isRestarting) {
|
||||||
@@ -1138,7 +1156,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
this.isRestarting = isRestarting;
|
this.isRestarting = isRestarting;
|
||||||
this.hasLoggedStop = true; // Paper - Debugging
|
this.hasLoggedStop = true; // Paper - Debugging
|
||||||
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
||||||
@@ -1085,6 +1098,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1087,6 +1100,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L;
|
private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L;
|
||||||
private long lastTick = 0;
|
private long lastTick = 0;
|
||||||
private long catchupTime = 0;
|
private long catchupTime = 0;
|
||||||
@@ -1146,7 +1164,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
public final RollingAverage tps1 = new RollingAverage(60);
|
public final RollingAverage tps1 = new RollingAverage(60);
|
||||||
public final RollingAverage tps5 = new RollingAverage(60 * 5);
|
public final RollingAverage tps5 = new RollingAverage(60 * 5);
|
||||||
public final RollingAverage tps15 = new RollingAverage(60 * 15);
|
public final RollingAverage tps15 = new RollingAverage(60 * 15);
|
||||||
@@ -1174,6 +1188,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1176,6 +1190,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
// Paper end - Add onboarding message for initial server start
|
// Paper end - Add onboarding message for initial server start
|
||||||
|
|
||||||
@@ -1163,7 +1181,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
while (this.running) {
|
while (this.running) {
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
// guarantee that nothing can stop the server from halting if it can at least still tick
|
// guarantee that nothing can stop the server from halting if it can at least still tick
|
||||||
@@ -1207,14 +1231,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1209,14 +1233,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) {
|
if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) {
|
||||||
final long diff = currentTime - tickSection;
|
final long diff = currentTime - tickSection;
|
||||||
final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
|
final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
|
||||||
@@ -1186,7 +1204,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
tickSection = currentTime;
|
tickSection = currentTime;
|
||||||
}
|
}
|
||||||
// Paper end - further improve server tick loop
|
// Paper end - further improve server tick loop
|
||||||
@@ -1222,22 +1251,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1224,22 +1253,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
boolean flag = i == 0L;
|
boolean flag = i == 0L;
|
||||||
|
|
||||||
@@ -1220,7 +1238,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
this.startMeasuringTaskExecutionTime();
|
this.startMeasuringTaskExecutionTime();
|
||||||
this.waitUntilNextTick();
|
this.waitUntilNextTick();
|
||||||
this.finishMeasuringTaskExecutionTime();
|
this.finishMeasuringTaskExecutionTime();
|
||||||
@@ -1245,9 +1280,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1247,9 +1282,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.tickRateManager.endTickWork();
|
this.tickRateManager.endTickWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1233,7 +1251,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
this.isReady = true;
|
this.isReady = true;
|
||||||
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
|
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
|
||||||
}
|
}
|
||||||
@@ -1456,7 +1491,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1458,7 +1493,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1242,7 +1260,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
try {
|
try {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
boolean moreTasks = this.tickMidTickTasks();
|
boolean moreTasks = this.tickMidTickTasks();
|
||||||
@@ -1483,7 +1518,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1485,7 +1520,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -1251,7 +1269,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end - execute chunk tasks mid tick
|
// Paper end - execute chunk tasks mid tick
|
||||||
@@ -1511,7 +1546,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1513,7 +1548,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
|
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
|
||||||
@@ -1260,7 +1278,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
super.doRunTask(ticktask);
|
super.doRunTask(ticktask);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1558,15 +1593,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1560,15 +1595,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||||
@@ -1279,7 +1297,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
// Paper end
|
// Paper end
|
||||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
||||||
|
|
||||||
@@ -1584,7 +1619,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1586,7 +1621,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
if (playerSaveInterval < 0) {
|
if (playerSaveInterval < 0) {
|
||||||
playerSaveInterval = autosavePeriod;
|
playerSaveInterval = autosavePeriod;
|
||||||
}
|
}
|
||||||
@@ -1288,7 +1306,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
|
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
|
||||||
try {
|
try {
|
||||||
this.isSaving = true;
|
this.isSaving = true;
|
||||||
@@ -1599,20 +1634,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1601,20 +1636,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
} finally {
|
} finally {
|
||||||
this.isSaving = false;
|
this.isSaving = false;
|
||||||
}
|
}
|
||||||
@@ -1313,7 +1331,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
long j = Util.getNanos() - i;
|
long j = Util.getNanos() - i;
|
||||||
int k = this.tickCount % 100;
|
int k = this.tickCount % 100;
|
||||||
|
|
||||||
@@ -1626,9 +1661,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1628,9 +1663,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.tickTimes60s.add(this.tickCount, j);
|
this.tickTimes60s.add(this.tickCount, j);
|
||||||
// Paper end - Add tick times API and /mspt command
|
// Paper end - Add tick times API and /mspt command
|
||||||
this.logTickMethodTime(i);
|
this.logTickMethodTime(i);
|
||||||
@@ -1325,7 +1343,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logTickMethodTime(long tickStartTime) {
|
private void logTickMethodTime(long tickStartTime) {
|
||||||
@@ -1699,9 +1734,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1701,9 +1736,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
||||||
entityplayer.connection.suspendFlushing();
|
entityplayer.connection.suspendFlushing();
|
||||||
});
|
});
|
||||||
@@ -1337,7 +1355,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
// Paper start - Folia scheduler API
|
// Paper start - Folia scheduler API
|
||||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||||
getAllLevels().forEach(level -> {
|
getAllLevels().forEach(level -> {
|
||||||
@@ -1717,22 +1752,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1719,22 +1754,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
});
|
});
|
||||||
// Paper end - Folia scheduler API
|
// Paper end - Folia scheduler API
|
||||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||||
@@ -1367,7 +1385,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
// Send time updates to everyone, it will get the right time from the world the player is in.
|
// Send time updates to everyone, it will get the right time from the world the player is in.
|
||||||
// Paper start - Perf: Optimize time updates
|
// Paper start - Perf: Optimize time updates
|
||||||
for (final ServerLevel level : this.getAllLevels()) {
|
for (final ServerLevel level : this.getAllLevels()) {
|
||||||
@@ -1741,7 +1776,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1743,7 +1778,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
long worldTime = level.getGameTime();
|
long worldTime = level.getGameTime();
|
||||||
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
|
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
|
||||||
for (Player entityhuman : level.players()) {
|
for (Player entityhuman : level.players()) {
|
||||||
@@ -1376,7 +1394,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
||||||
@@ -1752,7 +1787,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1754,7 +1789,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end - Perf: Optimize time updates
|
// Paper end - Perf: Optimize time updates
|
||||||
@@ -1385,7 +1403,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
|
|
||||||
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
||||||
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
|
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
|
||||||
@@ -1762,31 +1797,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1764,31 +1799,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
||||||
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
|
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
|
||||||
worldserver.updateLagCompensationTick(); // Paper - lag compensation
|
worldserver.updateLagCompensationTick(); // Paper - lag compensation
|
||||||
@@ -1425,7 +1443,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
||||||
|
|
||||||
@@ -1794,33 +1830,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1796,33 +1832,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
throw new ReportedException(crashreport);
|
throw new ReportedException(crashreport);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1471,7 +1489,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
iterator = this.playerList.getPlayers().iterator();
|
iterator = this.playerList.getPlayers().iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -1830,7 +1866,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1832,7 +1868,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
entityplayer.connection.resumeFlushing();
|
entityplayer.connection.resumeFlushing();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1480,7 +1498,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void synchronizeTime(ServerLevel world) {
|
private void synchronizeTime(ServerLevel world) {
|
||||||
@@ -1838,7 +1874,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1840,7 +1876,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
public void forceTimeSynchronization() {
|
public void forceTimeSynchronization() {
|
||||||
@@ -1489,7 +1507,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
Iterator iterator = this.getAllLevels().iterator();
|
Iterator iterator = this.getAllLevels().iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -1847,7 +1883,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1849,7 +1885,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.synchronizeTime(worldserver);
|
this.synchronizeTime(worldserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1498,7 +1516,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNetherEnabled() {
|
public boolean isNetherEnabled() {
|
||||||
@@ -1924,7 +1960,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1926,7 +1962,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
@@ -1507,7 +1525,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SystemReport fillSystemReport(SystemReport details) {
|
public SystemReport fillSystemReport(SystemReport details) {
|
||||||
@@ -2550,6 +2586,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2561,6 +2597,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProfilerFiller getProfiler() {
|
public ProfilerFiller getProfiler() {
|
||||||
@@ -1515,7 +1533,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
return this.profiler;
|
return this.profiler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2796,7 +2833,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2807,7 +2844,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
private void startMetricsRecordingTick() {
|
private void startMetricsRecordingTick() {
|
||||||
@@ -1524,7 +1542,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
||||||
this.executeBlocking(() -> {
|
this.executeBlocking(() -> {
|
||||||
this.saveDebugReport(path.resolve("server"));
|
this.saveDebugReport(path.resolve("server"));
|
||||||
@@ -2806,40 +2843,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2817,40 +2854,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.willStartRecordingMetrics = false;
|
this.willStartRecordingMetrics = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1577,7 +1595,7 @@ index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..21327a92b75a460c7beb3aa408502f37
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Path getWorldPath(LevelResource worldSavePath) {
|
public Path getWorldPath(LevelResource worldSavePath) {
|
||||||
@@ -2892,15 +2929,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2903,15 +2940,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTimeProfilerRunning() {
|
public boolean isTimeProfilerRunning() {
|
||||||
@@ -1617,7 +1635,7 @@ index c7e1f2bac3eca9bb72bf1f8c26cccb2905e1ddfc..ef520d1dd00ae9473c1f34e2df4d8b06
|
|||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||||
index a0ec6c3d122ad28d65d37f1b9f82541997b37d37..775b24a9e55528944b629fd85e1f6ebef9a9892f 100644
|
index c6d7ee0d498bd92d4321acd30ade10abea611e42..7aa1b3705ff548023f8b040678e4008cca3b8514 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||||
@@ -53,10 +53,10 @@ public class ServerFunctionManager {
|
@@ -53,10 +53,10 @@ public class ServerFunctionManager {
|
||||||
@@ -1720,7 +1738,7 @@ index 47355158e5e762540a10dc67b23092a0fc53bce3..9f1c8a62bda242781a0966fa2fc01534
|
|||||||
entityitem = entityplayer.drop(itemstack, false, false, false); // CraftBukkit - SPIGOT-2942: Add boolean to call event
|
entityitem = entityplayer.drop(itemstack, false, false, false); // CraftBukkit - SPIGOT-2942: Add boolean to call event
|
||||||
if (entityitem != null) {
|
if (entityitem != null) {
|
||||||
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/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index eb4fc900164d1fb3a78653ae8bc42ea30323f5b7..775c5de4f5094260096cef6723dd50dfe2cb0c81 100644
|
index 2eb9c584cc77237f1c82d880a51a3f8b51008d73..957da64ddd0a56f457122a3f590b45e348f22382 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -110,6 +110,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -110,6 +110,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
@@ -1745,9 +1763,9 @@ index eb4fc900164d1fb3a78653ae8bc42ea30323f5b7..775c5de4f5094260096cef6723dd50df
|
|||||||
+ org.purpurmc.purpur.PurpurConfig.registerCommands();
|
+ org.purpurmc.purpur.PurpurConfig.registerCommands();
|
||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // Paper - init PaperBrigadierProvider
|
|
||||||
|
|
||||||
@@ -281,6 +291,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||||
|
@@ -280,6 +290,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
if (true) throw new IllegalStateException("Failed to bind to port", ioexception); // Paper - Propagate failed to bind to port error
|
if (true) throw new IllegalStateException("Failed to bind to port", ioexception); // Paper - Propagate failed to bind to port error
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1778,7 +1796,7 @@ index eb4fc900164d1fb3a78653ae8bc42ea30323f5b7..775c5de4f5094260096cef6723dd50df
|
|||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
// this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // Spigot - moved up
|
// this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // Spigot - moved up
|
||||||
@@ -354,6 +388,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -353,6 +387,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
DedicatedServer.LOGGER.info("JMX monitoring enabled");
|
DedicatedServer.LOGGER.info("JMX monitoring enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1787,7 +1805,7 @@ index eb4fc900164d1fb3a78653ae8bc42ea30323f5b7..775c5de4f5094260096cef6723dd50df
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -506,7 +542,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -505,7 +541,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleConsoleInputs() {
|
public void handleConsoleInputs() {
|
||||||
@@ -1796,7 +1814,7 @@ index eb4fc900164d1fb3a78653ae8bc42ea30323f5b7..775c5de4f5094260096cef6723dd50df
|
|||||||
// Paper start - Perf: use proper queue
|
// Paper start - Perf: use proper queue
|
||||||
ConsoleInput servercommand;
|
ConsoleInput servercommand;
|
||||||
while ((servercommand = this.serverCommandQueue.poll()) != null) {
|
while ((servercommand = this.serverCommandQueue.poll()) != null) {
|
||||||
@@ -523,7 +559,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -522,7 +558,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1968,7 +1986,7 @@ index 096c89bd01cec2abd151bf6fffc4847d1bcd548f..cd0a8a6a1be75cab8bbb8ee3ac17bb73
|
|||||||
this.values[this.vp++ & 0xFF] = (int)(l * 100L / Runtime.getRuntime().maxMemory());
|
this.values[this.vp++ & 0xFF] = (int)(l * 100L / Runtime.getRuntime().maxMemory());
|
||||||
this.repaint();
|
this.repaint();
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index dbe9df1e1973db133f7c8516256697ef7c968137..4e6fccec4f5ca14562bf5bae495ac36c14982d85 100644
|
index 7fb9ba3dadb1eca4a1000ea8cf4d13fed2b7db1e..345f143b0eeb77acb96e4bc716f3b23782ac782f 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -541,20 +541,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -541,20 +541,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
@@ -2258,7 +2276,7 @@ index b99f50604bafecbc68835974c9ed0caa91911a40..476a04d87a61b021816d2970e86042bd
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
index 4f103f731623a8570238a6867fda1c5f83fca4e4..39e7dcf3c92c9203c190782be401c00c010b8aeb 100644
|
index f16a69775332a08ed0e87d27acd0fc959359694c..dd6278fe99e2ee4daa95249c71ea935dd08b0025 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
@@ -77,7 +77,7 @@ public class ServerEntity {
|
@@ -77,7 +77,7 @@ public class ServerEntity {
|
||||||
@@ -2271,7 +2289,7 @@ index 4f103f731623a8570238a6867fda1c5f83fca4e4..39e7dcf3c92c9203c190782be401c00c
|
|||||||
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
|
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
|
||||||
this.trackedPlayers = trackedPlayers;
|
this.trackedPlayers = trackedPlayers;
|
||||||
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/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 0981d440d0dbfe4df668d1f3f1b5706a93bc4434..f72af2feb74626abbdfbfd090c15357457810240 100644
|
index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..7924e3c597164f71056cd58dd167ee8b1d41b9c3 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -220,6 +220,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -220,6 +220,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
@@ -2759,7 +2777,7 @@ index 0981d440d0dbfe4df668d1f3f1b5706a93bc4434..f72af2feb74626abbdfbfd090c153574
|
|||||||
}
|
}
|
||||||
// Paper end - Fix merchant inventory not closing on entity removal
|
// Paper end - Fix merchant inventory not closing on entity removal
|
||||||
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/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 8437316888c6056060a2780652147590b6fe7443..d7e4a9fe9676563845d9981523bff1a7ff12282c 100644
|
index c10401e587a710d49c4af481c1e531b4bf51f755..37636343c1b62b7dfa426bd6ca2bd425fd1bfff3 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -298,6 +298,10 @@ public class ServerPlayer extends Player {
|
@@ -298,6 +298,10 @@ public class ServerPlayer extends Player {
|
||||||
@@ -3116,7 +3134,7 @@ index 1351423a12c19a01f602a202832372a399e6a867..1e2025674eafcf56460c741083c91e2e
|
|||||||
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
||||||
hasSetFarWarned = true;
|
hasSetFarWarned = true;
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
index 8ac5d8ccf731100a1be690cb2ed1be82cadba8ed..8368c5ff929df9d32cdb95cc2da0e9f7f3b85d2a 100644
|
index 308aef9c4933b2bcdd622a34b68efab4a220fe4d..b82a72775f9de5ad65ae46a8b97f93a7ef852265 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
@@ -73,11 +73,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
@@ -73,11 +73,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
@@ -3190,8 +3208,8 @@ index 8ac5d8ccf731100a1be690cb2ed1be82cadba8ed..8368c5ff929df9d32cdb95cc2da0e9f7
|
|||||||
+ } else
|
+ } else
|
||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
+
|
+
|
||||||
if (!this.isSingleplayerOwner() && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected
|
if (!this.isSingleplayerOwner() && elapsedTime >= 15000L) { // Paper - use vanilla's 15000L between keep alive packets
|
||||||
if (this.keepAlivePending && !this.processedDisconnect) { // Paper
|
if (this.keepAlivePending && !this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected
|
||||||
this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
|
this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
|
||||||
@@ -264,7 +298,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
@@ -264,7 +298,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
}
|
}
|
||||||
@@ -3203,7 +3221,7 @@ index 8ac5d8ccf731100a1be690cb2ed1be82cadba8ed..8368c5ff929df9d32cdb95cc2da0e9f7
|
|||||||
|
|
||||||
private boolean checkIfClosed(long time) {
|
private boolean checkIfClosed(long time) {
|
||||||
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/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 5e9202bc7fc649764568b55d66ba0d684118c00c..478f3bba5e0768c8ab800d7cb591f07db1bc20da 100644
|
index b9b3277c8ed94e0cd30b20b9c00a33eaad48e5ac..0c3768bb183451e9dfe94bbc9b203bd79e474b99 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -332,6 +332,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -332,6 +332,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@@ -3443,34 +3461,7 @@ index 5e9202bc7fc649764568b55d66ba0d684118c00c..478f3bba5e0768c8ab800d7cb591f07d
|
|||||||
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack, enumhand);
|
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack, enumhand);
|
||||||
cancelled = event.useItemInHand() == Event.Result.DENY;
|
cancelled = event.useItemInHand() == Event.Result.DENY;
|
||||||
} else {
|
} else {
|
||||||
@@ -2466,7 +2546,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -2759,6 +2839,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
|
||||||
public void handleCommand(String s) { // Paper - private -> public
|
|
||||||
org.spigotmc.AsyncCatcher.catchOp("Command Dispatched Async: " + s); // Paper - Add async catcher
|
|
||||||
- co.aikar.timings.MinecraftTimings.playerCommandTimer.startTiming(); // Paper
|
|
||||||
+ //co.aikar.timings.MinecraftTimings.playerCommandTimer.startTiming(); // Paper // Purpur
|
|
||||||
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
|
|
||||||
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
|
|
||||||
|
|
||||||
@@ -2476,7 +2556,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
||||||
this.cserver.getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
if (event.isCancelled()) {
|
|
||||||
- co.aikar.timings.MinecraftTimings.playerCommandTimer.stopTiming(); // Paper
|
|
||||||
+ //co.aikar.timings.MinecraftTimings.playerCommandTimer.stopTiming(); // Paper // Purpur
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2489,7 +2569,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
||||||
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
||||||
return;
|
|
||||||
} finally {
|
|
||||||
- co.aikar.timings.MinecraftTimings.playerCommandTimer.stopTiming(); // Paper
|
|
||||||
+ //co.aikar.timings.MinecraftTimings.playerCommandTimer.stopTiming(); // Paper // Purpur
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
@@ -2776,6 +2856,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
||||||
AABB axisalignedbb = entity.getBoundingBox();
|
AABB axisalignedbb = entity.getBoundingBox();
|
||||||
|
|
||||||
if (this.player.canInteractWithEntity(axisalignedbb, 1.0D)) {
|
if (this.player.canInteractWithEntity(axisalignedbb, 1.0D)) {
|
||||||
@@ -3478,7 +3469,7 @@ index 5e9202bc7fc649764568b55d66ba0d684118c00c..478f3bba5e0768c8ab800d7cb591f07d
|
|||||||
packet.dispatch(new ServerboundInteractPacket.Handler() {
|
packet.dispatch(new ServerboundInteractPacket.Handler() {
|
||||||
private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit
|
private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit
|
||||||
ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand);
|
ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand);
|
||||||
@@ -2789,6 +2870,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -2772,6 +2853,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
|
||||||
ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event);
|
ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event);
|
||||||
|
|
||||||
@@ -3916,11 +3907,11 @@ index 99a7e9eb75231c15bd8bb24fbb4e296bc9fdedff..4fb025a63628eb60509d90b680922a02
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||||
index 359a2f0492a9b938a4f015c546e100e0092ae1d4..25e614be19b2b29b36af136b823f27f85e1650fa 100644
|
index dd9638bdb228a53e72820e0e7cf6fe6fcc08fe4b..1ce1235cbbf23fe975c85a0f713280b433459951 100644
|
||||||
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||||
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||||
@@ -29,6 +29,8 @@ public class DamageSource {
|
@@ -29,6 +29,8 @@ public class DamageSource {
|
||||||
private boolean withSweep = false;
|
private boolean sweep = false;
|
||||||
private boolean melting = false;
|
private boolean melting = false;
|
||||||
private boolean poison = false;
|
private boolean poison = false;
|
||||||
+ private boolean scissors = false; // Purpur
|
+ private boolean scissors = false; // Purpur
|
||||||
@@ -3953,10 +3944,10 @@ index 359a2f0492a9b938a4f015c546e100e0092ae1d4..25e614be19b2b29b36af136b823f27f8
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
+
|
+
|
||||||
// Paper start - fix DamageSource API
|
// Paper start - fix DamageSource API
|
||||||
public @Nullable Entity getCustomEventDamager() {
|
@Nullable
|
||||||
return (this.customEventDamager != null) ? this.customEventDamager : this.directEntity;
|
public Entity getCustomEventDamager() {
|
||||||
@@ -101,6 +123,8 @@ public class DamageSource {
|
@@ -117,6 +139,8 @@ public class DamageSource {
|
||||||
damageSource.withSweep = this.isSweep();
|
damageSource.sweep = this.isSweep();
|
||||||
damageSource.poison = this.isPoison();
|
damageSource.poison = this.isPoison();
|
||||||
damageSource.melting = this.isMelting();
|
damageSource.melting = this.isMelting();
|
||||||
+ damageSource.scissors = this.isScissors(); // Purpur
|
+ damageSource.scissors = this.isScissors(); // Purpur
|
||||||
@@ -3964,7 +3955,7 @@ index 359a2f0492a9b938a4f015c546e100e0092ae1d4..25e614be19b2b29b36af136b823f27f8
|
|||||||
return damageSource;
|
return damageSource;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -173,10 +197,19 @@ public class DamageSource {
|
@@ -189,10 +213,19 @@ public class DamageSource {
|
||||||
|
|
||||||
ItemStack itemstack1 = itemstack;
|
ItemStack itemstack1 = itemstack;
|
||||||
|
|
||||||
@@ -3986,7 +3977,7 @@ index 359a2f0492a9b938a4f015c546e100e0092ae1d4..25e614be19b2b29b36af136b823f27f8
|
|||||||
return this.type().msgId();
|
return this.type().msgId();
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
||||||
index a1c53f04c2dd505e6af72e512e111d7994786035..5ffe772e29dfd422b664e8123e7f5cf396158674 100644
|
index 5ec8cbd07a1830876f58e1fd33de6df4466d7e95..b1fb94380b7d6bd2a3be31a4e8fe95367e948fe2 100644
|
||||||
--- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
--- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
||||||
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
||||||
@@ -44,11 +44,15 @@ public class DamageSources {
|
@@ -44,11 +44,15 @@ public class DamageSources {
|
||||||
@@ -4648,7 +4639,7 @@ index 09fdea983772612ef3fff6b2da3cf469a34e4ec0..3e2ea26c23e88c395856b65001f2895d
|
|||||||
protected ParticleOptions getInkParticle() {
|
protected ParticleOptions getInkParticle() {
|
||||||
return ParticleTypes.GLOW_SQUID_INK;
|
return ParticleTypes.GLOW_SQUID_INK;
|
||||||
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/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 6e043457a29a890bcefd27fc5bb07c1a7e4e30f7..53ff232129443ba3242cfc57fc57026bf76d96e8 100644
|
index 517e10c3d8b1549cd30fd0e7cf2bcb35e88eb8ed..3776b9bf7abce6b3024c50f04741031ef0e8e9c4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -229,9 +229,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -229,9 +229,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
@@ -4864,7 +4855,7 @@ index 6e043457a29a890bcefd27fc5bb07c1a7e4e30f7..53ff232129443ba3242cfc57fc57026b
|
|||||||
+ } // Purpur
|
+ } // Purpur
|
||||||
}
|
}
|
||||||
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
||||||
org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops, () -> {
|
org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, source, this.drops, () -> {
|
||||||
@@ -2363,6 +2412,21 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -2363,6 +2412,21 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10230,7 +10221,7 @@ index d8e440e14b72dc48ae97244f1bed2c06abd997ab..15ca426701f1fc821da94a4dee577fdb
|
|||||||
this.remove(Entity.RemovalReason.KILLED, EntityRemoveEvent.Cause.DEATH); // CraftBukkit - add Bukkit remove cause
|
this.remove(Entity.RemovalReason.KILLED, EntityRemoveEvent.Cause.DEATH); // CraftBukkit - add Bukkit remove cause
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||||
index 6f14607a88761171a72e274b3c9b476b20a272f1..3da1f7a6e443954e4976dd59391ea19b9c903cf7 100644
|
index 0e797e2714a2fd103cbd51548764577fd9b6412d..52e1dd6e064dc03312e18ca515a24e7d3e9be957 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||||
@@ -106,6 +106,7 @@ public class EnderDragon extends Mob implements Enemy {
|
@@ -106,6 +106,7 @@ public class EnderDragon extends Mob implements Enemy {
|
||||||
@@ -10694,7 +10685,7 @@ index 7ddca52f7fe3f289b4b867e134326b1ead1a2aee..4a98027a12c2535d1df3a9f6390eb851
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||||
index c2bd2e303f956d390319f6bbbe9a6492ebec5154..6697cd8a632becd72ee132007a61d1221e817abf 100644
|
index a02ca704e98ef42f32c3c50b111ee3537f60bf7b..92521cbedcf89a855f10a3401933acaf84bc3f98 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||||
@@ -103,10 +103,12 @@ public class ArmorStand extends LivingEntity {
|
@@ -103,10 +103,12 @@ public class ArmorStand extends LivingEntity {
|
||||||
@@ -10734,7 +10725,7 @@ index c2bd2e303f956d390319f6bbbe9a6492ebec5154..6697cd8a632becd72ee132007a61d122
|
|||||||
// Paper start - Allow ArmorStands not to tick
|
// Paper start - Allow ArmorStands not to tick
|
||||||
if (!this.canTick) {
|
if (!this.canTick) {
|
||||||
if (this.noTickPoseDirty) {
|
if (this.noTickPoseDirty) {
|
||||||
@@ -1003,4 +1008,18 @@ public class ArmorStand extends LivingEntity {
|
@@ -1008,4 +1013,18 @@ public class ArmorStand extends LivingEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -11132,7 +11123,7 @@ index 87e4b300ac248f6c13d9b4a8f24fd78b24b565b4..43b5a0e7993ae9daef1c1ea67722347f
|
|||||||
public boolean doHurtTarget(Entity target) {
|
public boolean doHurtTarget(Entity target) {
|
||||||
if (super.doHurtTarget(target)) {
|
if (super.doHurtTarget(target)) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||||
index cbcb2bfa8f91099e5c374f590f48885390bdf7a7..1829bedfa8084c4932a0e67c36f48f19993e22b6 100644
|
index 0ae4ba060b2ce2c79e1235c939f3c1926eb6e33e..76a0bc9bd6033f1c66e940392f5bed360e7db43c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||||
@@ -61,21 +61,99 @@ public class Creeper extends Monster implements PowerableMob {
|
@@ -61,21 +61,99 @@ public class Creeper extends Monster implements PowerableMob {
|
||||||
@@ -11288,8 +11279,8 @@ index cbcb2bfa8f91099e5c374f590f48885390bdf7a7..1829bedfa8084c4932a0e67c36f48f19
|
|||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
this.dead = true;
|
this.dead = true;
|
||||||
- this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB); // CraftBukkit // Paper - fix DamageSource API
|
- this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB); // CraftBukkit // Paper - fix DamageSource API (revert to vanilla, no, just no, don't change this)
|
||||||
+ this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), this.level().getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING) && level().purpurConfig.creeperAllowGriefing ? Level.ExplosionInteraction.MOB : Level.ExplosionInteraction.NONE); // CraftBukkit // Paper - fix DamageSource API // Purpur
|
+ this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), this.level().getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING) && level().purpurConfig.creeperAllowGriefing ? Level.ExplosionInteraction.MOB : Level.ExplosionInteraction.NONE); // CraftBukkit // Paper - fix DamageSource API (revert to vanilla, no, just no, don't change this) // Purpur
|
||||||
this.discard(EntityRemoveEvent.Cause.EXPLODE); // CraftBukkit - add Bukkit remove cause
|
this.discard(EntityRemoveEvent.Cause.EXPLODE); // CraftBukkit - add Bukkit remove cause
|
||||||
this.spawnLingeringCloud();
|
this.spawnLingeringCloud();
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -15018,7 +15009,7 @@ index c72b6ea5530e54fc373c701028e1c147cea34b59..96e9fce5f9084737d2fcf4deb8330573
|
|||||||
if (spawnplacementtype.isSpawnPositionOk(world, blockposition2, EntityType.WANDERING_TRADER)) {
|
if (spawnplacementtype.isSpawnPositionOk(world, blockposition2, EntityType.WANDERING_TRADER)) {
|
||||||
blockposition1 = blockposition2;
|
blockposition1 = blockposition2;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
index 093d1388ff90ad59110a37536b6639f939549068..845c4af5d5d38d54de4a1b20fe32bf5dd4776a29 100644
|
index 093d1388ff90ad59110a37536b6639f939549068..9bef8e88fb6c04388b329011a7ca2fc592a283bb 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
@@ -195,17 +195,40 @@ public abstract class Player extends LivingEntity {
|
@@ -195,17 +195,40 @@ public abstract class Player extends LivingEntity {
|
||||||
@@ -15156,6 +15147,15 @@ index 093d1388ff90ad59110a37536b6639f939549068..845c4af5d5d38d54de4a1b20fe32bf5d
|
|||||||
public boolean setEntityOnShoulder(CompoundTag entityNbt) {
|
public boolean setEntityOnShoulder(CompoundTag entityNbt) {
|
||||||
if (!this.isPassenger() && this.onGround() && !this.isInWater() && !this.isInPowderSnow) {
|
if (!this.isPassenger() && this.onGround() && !this.isInWater() && !this.isInPowderSnow) {
|
||||||
if (this.getShoulderEntityLeft().isEmpty()) {
|
if (this.getShoulderEntityLeft().isEmpty()) {
|
||||||
|
@@ -2312,7 +2368,7 @@ public abstract class Player extends LivingEntity {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- return this.abilities.instabuild ? new ItemStack(Items.ARROW) : ItemStack.EMPTY;
|
||||||
|
+ return this.abilities.instabuild || (level().purpurConfig.infinityWorksWithoutArrows && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, stack) > 0) ? new ItemStack(Items.ARROW) : ItemStack.EMPTY; // Purpur
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2321,7 +2377,7 @@ public abstract class Player extends LivingEntity {
|
@@ -2321,7 +2377,7 @@ public abstract class Player extends LivingEntity {
|
||||||
public ItemStack eat(Level world, ItemStack stack) {
|
public ItemStack eat(Level world, ItemStack stack) {
|
||||||
this.getFoodData().eat(stack);
|
this.getFoodData().eat(stack);
|
||||||
@@ -15318,10 +15318,10 @@ index 2b4d206c0d31ba38d7b2af654bd420e85145d441..1b9d0e28e518c501b4b93ae385ddd64a
|
|||||||
protected void onHit(HitResult hitResult) {
|
protected void onHit(HitResult hitResult) {
|
||||||
super.onHit(hitResult);
|
super.onHit(hitResult);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||||
index 1fb1e729d6879568d8b4943071fa940325b2e5b0..d9761d8fe746e925a7a32dfc15eb8045c6150fe5 100644
|
index 519755b7f8bc7e8bb9fab135fc5bf7de3a9419f9..61bd2459f2b9164dce90134103abaddce42b0621 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||||
@@ -71,10 +71,11 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
@@ -70,10 +70,11 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
||||||
Bukkit.getPluginManager().callEvent(teleEvent);
|
Bukkit.getPluginManager().callEvent(teleEvent);
|
||||||
|
|
||||||
if (!teleEvent.isCancelled() && entityplayer.connection.isAcceptingMessages()) {
|
if (!teleEvent.isCancelled() && entityplayer.connection.isAcceptingMessages()) {
|
||||||
@@ -15334,7 +15334,7 @@ index 1fb1e729d6879568d8b4943071fa940325b2e5b0..d9761d8fe746e925a7a32dfc15eb8045
|
|||||||
entityendermite.moveTo(entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot());
|
entityendermite.moveTo(entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot());
|
||||||
this.level().addFreshEntity(entityendermite, CreatureSpawnEvent.SpawnReason.ENDER_PEARL);
|
this.level().addFreshEntity(entityendermite, CreatureSpawnEvent.SpawnReason.ENDER_PEARL);
|
||||||
}
|
}
|
||||||
@@ -86,7 +87,7 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
@@ -85,7 +86,7 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
||||||
|
|
||||||
entityplayer.connection.teleport(teleEvent.getTo());
|
entityplayer.connection.teleport(teleEvent.getTo());
|
||||||
entity.resetFallDistance();
|
entity.resetFallDistance();
|
||||||
@@ -15857,10 +15857,10 @@ index 0dbfd23bbfc6ad203f048142f8c90ef741849fe1..9a80427d2bb470b6b1638e59aba57216
|
|||||||
return new ChestMenu(MenuType.GENERIC_9x6, syncId, playerInventory, inventory, 6);
|
return new ChestMenu(MenuType.GENERIC_9x6, syncId, playerInventory, inventory, 6);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||||
index 5b3e33807e0e13480e3359c0cf067719e5749237..c3a644b0f8c7c5622acc9e1a496f95d432718806 100644
|
index 480d093105073edfd3acdd7b079b4ca5aa5fdc6d..6d28f1097caa3e37c2917eb401018ebf48c13a39 100644
|
||||||
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||||
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||||
@@ -38,6 +38,12 @@ import org.bukkit.event.enchantment.PrepareItemEnchantEvent;
|
@@ -39,6 +39,12 @@ import org.bukkit.event.enchantment.PrepareItemEnchantEvent;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@@ -15873,7 +15873,7 @@ index 5b3e33807e0e13480e3359c0cf067719e5749237..c3a644b0f8c7c5622acc9e1a496f95d4
|
|||||||
public class EnchantmentMenu extends AbstractContainerMenu {
|
public class EnchantmentMenu extends AbstractContainerMenu {
|
||||||
|
|
||||||
static final ResourceLocation EMPTY_SLOT_LAPIS_LAZULI = new ResourceLocation("item/empty_slot_lapis_lazuli");
|
static final ResourceLocation EMPTY_SLOT_LAPIS_LAZULI = new ResourceLocation("item/empty_slot_lapis_lazuli");
|
||||||
@@ -72,6 +78,22 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
@@ -73,6 +79,22 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
||||||
return context.getLocation();
|
return context.getLocation();
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -15896,7 +15896,7 @@ index 5b3e33807e0e13480e3359c0cf067719e5749237..c3a644b0f8c7c5622acc9e1a496f95d4
|
|||||||
};
|
};
|
||||||
this.random = RandomSource.create();
|
this.random = RandomSource.create();
|
||||||
this.enchantmentSeed = DataSlot.standalone();
|
this.enchantmentSeed = DataSlot.standalone();
|
||||||
@@ -97,6 +119,17 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
@@ -98,6 +120,17 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -15914,7 +15914,7 @@ index 5b3e33807e0e13480e3359c0cf067719e5749237..c3a644b0f8c7c5622acc9e1a496f95d4
|
|||||||
int j;
|
int j;
|
||||||
|
|
||||||
for (j = 0; j < 3; ++j) {
|
for (j = 0; j < 3; ++j) {
|
||||||
@@ -332,6 +365,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
@@ -333,6 +366,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
||||||
public void removed(net.minecraft.world.entity.player.Player player) {
|
public void removed(net.minecraft.world.entity.player.Player player) {
|
||||||
super.removed(player);
|
super.removed(player);
|
||||||
this.access.execute((world, blockposition) -> {
|
this.access.execute((world, blockposition) -> {
|
||||||
@@ -16128,7 +16128,7 @@ index 786e4a8700cb84b16dd9b8892a0d1d5803924d81..b108ca4c7900ccf6a14ebea01c21c103
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
Level world = pointer.level();
|
Level world = pointer.level();
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/ArmorStandItem.java b/src/main/java/net/minecraft/world/item/ArmorStandItem.java
|
diff --git a/src/main/java/net/minecraft/world/item/ArmorStandItem.java b/src/main/java/net/minecraft/world/item/ArmorStandItem.java
|
||||||
index 1634a7d5ff06583408cf2f02f2b5f90931b1e02a..dfe8473a880cbddfc3ac6a9c97f1a500624eeb38 100644
|
index 1634a7d5ff06583408cf2f02f2b5f90931b1e02a..fd83261f64c6469aebde8ab13a6777b9b269cea2 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/ArmorStandItem.java
|
--- a/src/main/java/net/minecraft/world/item/ArmorStandItem.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/ArmorStandItem.java
|
+++ b/src/main/java/net/minecraft/world/item/ArmorStandItem.java
|
||||||
@@ -58,6 +58,14 @@ public class ArmorStandItem extends Item {
|
@@ -58,6 +58,14 @@ public class ArmorStandItem extends Item {
|
||||||
@@ -16139,7 +16139,7 @@ index 1634a7d5ff06583408cf2f02f2b5f90931b1e02a..dfe8473a880cbddfc3ac6a9c97f1a500
|
|||||||
+ if (!world.purpurConfig.persistentDroppableEntityDisplayNames) {
|
+ if (!world.purpurConfig.persistentDroppableEntityDisplayNames) {
|
||||||
+ entityarmorstand.setCustomName(null);
|
+ entityarmorstand.setCustomName(null);
|
||||||
+ }
|
+ }
|
||||||
+ if (world.purpurConfig.armorstandSetNameVisible) {
|
+ if (world.purpurConfig.armorstandSetNameVisible && entityarmorstand.getCustomName() != null) {
|
||||||
+ entityarmorstand.setCustomNameVisible(true);
|
+ entityarmorstand.setCustomNameVisible(true);
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
@@ -16276,7 +16276,7 @@ index eb74d45ad458b80cf8455297c3bc550186adaea3..ef01856c487e4ab982996e0153761823
|
|||||||
return InteractionResultHolder.fail(itemstack);
|
return InteractionResultHolder.fail(itemstack);
|
||||||
} else {
|
} else {
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java
|
diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||||
index 5ca843df5b4caa668953e5e36a9b20fabeb35046..8bca38ec152f9612298bf6b3e10e7e0566ec3b78 100644
|
index 5ca843df5b4caa668953e5e36a9b20fabeb35046..ec21d3d00deac4ad51f0a4beec2894675a461618 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/BowItem.java
|
--- a/src/main/java/net/minecraft/world/item/BowItem.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/BowItem.java
|
+++ b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||||
@@ -31,7 +31,7 @@ public class BowItem extends ProjectileWeaponItem {
|
@@ -31,7 +31,7 @@ public class BowItem extends ProjectileWeaponItem {
|
||||||
@@ -16288,15 +16288,6 @@ index 5ca843df5b4caa668953e5e36a9b20fabeb35046..8bca38ec152f9612298bf6b3e10e7e05
|
|||||||
}
|
}
|
||||||
|
|
||||||
world.playSound(
|
world.playSound(
|
||||||
@@ -81,7 +81,7 @@ public class BowItem extends ProjectileWeaponItem {
|
|
||||||
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
|
|
||||||
ItemStack itemStack = user.getItemInHand(hand);
|
|
||||||
boolean bl = !user.getProjectile(itemStack).isEmpty();
|
|
||||||
- if (!user.hasInfiniteMaterials() && !bl) {
|
|
||||||
+ if (!(world.purpurConfig.infinityWorksWithoutArrows && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, itemStack) > 0) && !user.hasInfiniteMaterials() && !bl) { // Purpur
|
|
||||||
return InteractionResultHolder.fail(itemStack);
|
|
||||||
} else {
|
|
||||||
user.startUsingItem(hand);
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java
|
diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||||
index 49557d6f22c5725c663a231deab019d4f6fe95fa..046652e8f9c5dcdf7c90acb9391214cac46bd7d8 100644
|
index 49557d6f22c5725c663a231deab019d4f6fe95fa..046652e8f9c5dcdf7c90acb9391214cac46bd7d8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/BucketItem.java
|
--- a/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||||
@@ -16951,7 +16942,7 @@ index ea0aee88c7d901034427db201c1b2430f8a1d522..1f28bfb435c1e4d97da713f96c452aba
|
|||||||
if (range < 0.0 || d < range * range) {
|
if (range < 0.0 || d < range * range) {
|
||||||
return true;
|
return true;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index dc88014c4d9f172cc54e5d77b488128f9ffbc73d..f5e84bf8817e2d53557e0909d8c9e0e0e8206a16 100644
|
index 082b804f4793f72e76361f5427f0358273454b3d..133d994d9ac9d4f9527135ac0c77e5749917f8c3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -98,7 +98,7 @@ public class Explosion {
|
@@ -98,7 +98,7 @@ public class Explosion {
|
||||||
@@ -16983,7 +16974,7 @@ index dc88014c4d9f172cc54e5d77b488128f9ffbc73d..f5e84bf8817e2d53557e0909d8c9e0e0
|
|||||||
+ }else {
|
+ }else {
|
||||||
+ Location location = new Location(this.level.getWorld(), this.x, this.y, this.z);
|
+ Location location = new Location(this.level.getWorld(), this.x, this.y, this.z);
|
||||||
+ org.bukkit.block.Block block = location.getBlock();
|
+ org.bukkit.block.Block block = location.getBlock();
|
||||||
+ org.bukkit.block.BlockState blockState = (this.damageSource.blockState != null) ? this.damageSource.blockState : block.getState();
|
+ org.bukkit.block.BlockState blockState = (this.damageSource.getDirectBlockState() != null) ? this.damageSource.getDirectBlockState() : block.getState();
|
||||||
+ if(!new org.purpurmc.purpur.event.PreBlockExplodeEvent(location.getBlock(), this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, blockState).callEvent()) {
|
+ if(!new org.purpurmc.purpur.event.PreBlockExplodeEvent(location.getBlock(), this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, blockState).callEvent()) {
|
||||||
+ this.wasCanceled = true;
|
+ this.wasCanceled = true;
|
||||||
+ return;
|
+ return;
|
||||||
@@ -17291,7 +17282,7 @@ index ce9f189bdafec26360bfadd0f36a8bc2726e132b..d5465b48531fd4b4094874c135274abf
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||||
index 4459685d1fb655f93a523ae50b62d6b97785ed90..a4a988ab1399702b943019e9c4e2cde3652b4e85 100644
|
index 85d598c3354ee62f0fd1b26e485e0084967c0380..17c994a39a1b99cc7727e328ce7493d534247a21 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||||
@@ -104,7 +104,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
@@ -104,7 +104,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||||
@@ -17307,8 +17298,8 @@ index 4459685d1fb655f93a523ae50b62d6b97785ed90..a4a988ab1399702b943019e9c4e2cde3
|
|||||||
|
|
||||||
Vec3 vec3d = blockposition.getCenter();
|
Vec3 vec3d = blockposition.getCenter();
|
||||||
|
|
||||||
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, world, iblockdata, blockposition, blockEntity), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // CraftBukkit - add state // Paper - add BlockEntity
|
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, blockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // CraftBukkit - add state
|
||||||
+ if (world.purpurConfig.bedExplode) world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, world, iblockdata, blockposition, blockEntity), (ExplosionDamageCalculator) null, vec3d, (float) world.purpurConfig.bedExplosionPower, world.purpurConfig.bedExplosionFire, world.purpurConfig.bedExplosionEffect); // CraftBukkit - add state // Paper - add BlockEntity // Purpur
|
+ if (world.purpurConfig.bedExplode) world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, blockState), (ExplosionDamageCalculator) null, vec3d, (float) world.purpurConfig.bedExplosionPower, world.purpurConfig.bedExplosionFire, world.purpurConfig.bedExplosionEffect); // CraftBukkit - add state // Purpur
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18246,15 +18237,15 @@ index 9603d8c84ff483030dc08e82d3579b89e5c1f6e9..8fc65c32a3c6e6842a76b36f45e1b1c2
|
|||||||
} else {
|
} else {
|
||||||
int j = pos.getX();
|
int j = pos.getX();
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||||
index 0699211428f182d8d56a2ba019d89ce05c920430..351fb74d2cccd7f63c2efee197a2968f822eda42 100644
|
index 94d067e9eeee73183de25165d8c97043fe256103..00b6941951e1af9993f8f6da5425d31b8eaa85e4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||||
@@ -149,7 +149,7 @@ public class RespawnAnchorBlock extends Block {
|
@@ -150,7 +150,7 @@ public class RespawnAnchorBlock extends Block {
|
||||||
};
|
};
|
||||||
Vec3 vec3d = explodedPos.getCenter();
|
Vec3 vec3d = explodedPos.getCenter();
|
||||||
|
|
||||||
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, world, state, explodedPos, null), explosiondamagecalculator, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // CraftBukkit - add state // Paper
|
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, blockState), explosiondamagecalculator, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // CraftBukkit - add state
|
||||||
+ if (world.purpurConfig.respawnAnchorExplode) world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, world, state, explodedPos, null), explosiondamagecalculator, vec3d, (float) world.purpurConfig.respawnAnchorExplosionPower, world.purpurConfig.respawnAnchorExplosionFire, world.purpurConfig.respawnAnchorExplosionEffect); // CraftBukkit - add state // Paper // Purpur
|
+ if (world.purpurConfig.respawnAnchorExplode) world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, blockState), explosiondamagecalculator, vec3d, (float) world.purpurConfig.respawnAnchorExplosionPower, world.purpurConfig.respawnAnchorExplosionFire, world.purpurConfig.respawnAnchorExplosionEffect); // CraftBukkit - add state // Purpur
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean canSetSpawn(Level world) {
|
public static boolean canSetSpawn(Level world) {
|
||||||
@@ -19692,10 +19683,10 @@ index 9d93130f23addb18b97d7f5ec013faef17a74529..29d2fb87a65778926aea2cfc7a5b486c
|
|||||||
+ // Purpur end - OfflinePlayer API
|
+ // Purpur end - OfflinePlayer API
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 57db399bc1d3b6b015740b059987bc8d9bcc3101..19937ffa2c93cb75ea8dba58dd5a8214adc035fa 100644
|
index da1aed63af837b193900bb85393611edbd56c363..b82c66c402823874e3a5fc9bb7b1df73c708aec5 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -268,7 +268,7 @@ import javax.annotation.Nullable; // Paper
|
@@ -269,7 +269,7 @@ import javax.annotation.Nullable; // Paper
|
||||||
import javax.annotation.Nonnull; // Paper
|
import javax.annotation.Nonnull; // Paper
|
||||||
|
|
||||||
public final class CraftServer implements Server {
|
public final class CraftServer implements Server {
|
||||||
@@ -19704,10 +19695,10 @@ index 57db399bc1d3b6b015740b059987bc8d9bcc3101..19937ffa2c93cb75ea8dba58dd5a8214
|
|||||||
private final String serverVersion;
|
private final String serverVersion;
|
||||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||||
private final Logger logger = Logger.getLogger("Minecraft");
|
private final Logger logger = Logger.getLogger("Minecraft");
|
||||||
@@ -403,6 +403,20 @@ public final class CraftServer implements Server {
|
@@ -410,6 +410,20 @@ public final class CraftServer implements Server {
|
||||||
this.serverTickManager = new CraftServerTickManager(console.tickRateManager());
|
this.paperPluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(this, this.commandMap, pluginManager);
|
||||||
|
this.pluginManager.paperPluginManager = this.paperPluginManager;
|
||||||
Bukkit.setServer(this);
|
// Paper end
|
||||||
+ // Purpur start
|
+ // Purpur start
|
||||||
+ org.purpurmc.purpur.language.Language.setLanguage(new org.purpurmc.purpur.language.Language() {
|
+ org.purpurmc.purpur.language.Language.setLanguage(new org.purpurmc.purpur.language.Language() {
|
||||||
+ private net.minecraft.locale.Language language = net.minecraft.locale.Language.getInstance();
|
+ private net.minecraft.locale.Language language = net.minecraft.locale.Language.getInstance();
|
||||||
@@ -19725,7 +19716,7 @@ index 57db399bc1d3b6b015740b059987bc8d9bcc3101..19937ffa2c93cb75ea8dba58dd5a8214
|
|||||||
|
|
||||||
CraftRegistry.setMinecraftRegistry(console.registryAccess());
|
CraftRegistry.setMinecraftRegistry(console.registryAccess());
|
||||||
|
|
||||||
@@ -1054,6 +1068,7 @@ public final class CraftServer implements Server {
|
@@ -1038,6 +1052,7 @@ public final class CraftServer implements Server {
|
||||||
|
|
||||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||||
@@ -19733,7 +19724,7 @@ index 57db399bc1d3b6b015740b059987bc8d9bcc3101..19937ffa2c93cb75ea8dba58dd5a8214
|
|||||||
for (ServerLevel world : this.console.getAllLevels()) {
|
for (ServerLevel world : this.console.getAllLevels()) {
|
||||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||||
@@ -1069,6 +1084,7 @@ public final class CraftServer implements Server {
|
@@ -1053,6 +1068,7 @@ public final class CraftServer implements Server {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
world.spigotConfig.init(); // Spigot
|
world.spigotConfig.init(); // Spigot
|
||||||
@@ -19741,7 +19732,7 @@ index 57db399bc1d3b6b015740b059987bc8d9bcc3101..19937ffa2c93cb75ea8dba58dd5a8214
|
|||||||
}
|
}
|
||||||
|
|
||||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||||
@@ -1084,6 +1100,7 @@ public final class CraftServer implements Server {
|
@@ -1069,6 +1085,7 @@ public final class CraftServer implements Server {
|
||||||
this.reloadData();
|
this.reloadData();
|
||||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||||
@@ -19749,7 +19740,7 @@ index 57db399bc1d3b6b015740b059987bc8d9bcc3101..19937ffa2c93cb75ea8dba58dd5a8214
|
|||||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||||
|
|
||||||
@@ -1586,6 +1603,55 @@ public final class CraftServer implements Server {
|
@@ -1577,6 +1594,55 @@ public final class CraftServer implements Server {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19805,7 +19796,7 @@ index 57db399bc1d3b6b015740b059987bc8d9bcc3101..19937ffa2c93cb75ea8dba58dd5a8214
|
|||||||
@Override
|
@Override
|
||||||
public List<Recipe> getRecipesFor(ItemStack result) {
|
public List<Recipe> getRecipesFor(ItemStack result) {
|
||||||
Preconditions.checkArgument(result != null, "ItemStack cannot be null");
|
Preconditions.checkArgument(result != null, "ItemStack cannot be null");
|
||||||
@@ -3048,6 +3114,18 @@ public final class CraftServer implements Server {
|
@@ -3039,6 +3105,18 @@ public final class CraftServer implements Server {
|
||||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19824,7 +19815,7 @@ index 57db399bc1d3b6b015740b059987bc8d9bcc3101..19937ffa2c93cb75ea8dba58dd5a8214
|
|||||||
@Override
|
@Override
|
||||||
public void restart() {
|
public void restart() {
|
||||||
org.spigotmc.RestartCommand.restart();
|
org.spigotmc.RestartCommand.restart();
|
||||||
@@ -3077,6 +3155,7 @@ public final class CraftServer implements Server {
|
@@ -3068,6 +3146,7 @@ public final class CraftServer implements Server {
|
||||||
@Override
|
@Override
|
||||||
public double[] getTPS() {
|
public double[] getTPS() {
|
||||||
return new double[] {
|
return new double[] {
|
||||||
@@ -19832,7 +19823,7 @@ index 57db399bc1d3b6b015740b059987bc8d9bcc3101..19937ffa2c93cb75ea8dba58dd5a8214
|
|||||||
net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(),
|
net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(),
|
||||||
net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(),
|
net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(),
|
||||||
net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
|
net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
|
||||||
@@ -3278,4 +3357,16 @@ public final class CraftServer implements Server {
|
@@ -3269,4 +3348,16 @@ public final class CraftServer implements Server {
|
||||||
return this.potionBrewer;
|
return this.potionBrewer;
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -20266,7 +20257,7 @@ index aa351df679f300018367244c7ccb3e5a59e9276f..b452ebbe11145987fb5e66b399938984
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
||||||
index 0ad16ee7b33582d214dab41eeee378d52c8e38ed..16bd1294c219f15ada653ef810bc2d748222d0da 100644
|
index 351f42842b780d053cd2e5bad9ae299449141b10..4860574e7fad7a9527dda599703c573c5b4b234b 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
||||||
@@ -90,4 +90,16 @@ public class CraftLlama extends CraftChestedHorse implements Llama, com.destroys
|
@@ -90,4 +90,16 @@ public class CraftLlama extends CraftChestedHorse implements Llama, com.destroys
|
||||||
@@ -20287,7 +20278,7 @@ index 0ad16ee7b33582d214dab41eeee378d52c8e38ed..16bd1294c219f15ada653ef810bc2d74
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 5f896948d158651cd9837364759dbfbcce6b7d21..88948526f9acf4bb2157484b80891902fd843b02 100644
|
index 561a7a8e96e2d91bbb87fe6230e94b5f38073d27..2c9726d0f2dec1136a2f45768e8f8169ce165a1d 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -574,10 +574,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -574,10 +574,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
@@ -20318,7 +20309,7 @@ index 5f896948d158651cd9837364759dbfbcce6b7d21..88948526f9acf4bb2157484b80891902
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2736,6 +2745,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -2733,6 +2742,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
return this.getHandle().getAbilities().walkingSpeed * 2f;
|
return this.getHandle().getAbilities().walkingSpeed * 2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20347,7 +20338,7 @@ index 5f896948d158651cd9837364759dbfbcce6b7d21..88948526f9acf4bb2157484b80891902
|
|||||||
private void validateSpeed(float value) {
|
private void validateSpeed(float value) {
|
||||||
Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value);
|
Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value);
|
||||||
}
|
}
|
||||||
@@ -3522,4 +3553,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -3519,4 +3550,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
public void setSendViewDistance(final int viewDistance) {
|
public void setSendViewDistance(final int viewDistance) {
|
||||||
this.getHandle().setSendViewDistance(viewDistance);
|
this.getHandle().setSendViewDistance(viewDistance);
|
||||||
}
|
}
|
||||||
@@ -20500,7 +20491,7 @@ index 86574da257731de7646a712ed73384955fe35aa3..e223234dd64b0e41441c3b9f649f0b64
|
|||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
index 547ab158cd0cbf51da06ea97740cfce34bca651b..6fed586c9a778f7a57e1b4ca2e6f2dbc15c8769d 100644
|
index 34b91eff3190848bae38b20e1d956ece497b1473..e650b85464ac886b4adb1a8924026d34f805aba6 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
@@ -592,6 +592,15 @@ public class CraftEventFactory {
|
@@ -592,6 +592,15 @@ public class CraftEventFactory {
|
||||||
@@ -20519,8 +20510,8 @@ index 547ab158cd0cbf51da06ea97740cfce34bca651b..6fed586c9a778f7a57e1b4ca2e6f2dbc
|
|||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1121,7 +1130,7 @@ public class CraftEventFactory {
|
@@ -1123,7 +1132,7 @@ public class CraftEventFactory {
|
||||||
return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.LAVA, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
|
return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), source.getDirectBlockState(), entity, DamageCause.LAVA, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
|
||||||
} else if (source.getDirectBlock() != null) {
|
} else if (source.getDirectBlock() != null) {
|
||||||
DamageCause cause;
|
DamageCause cause;
|
||||||
- if (source.is(DamageTypes.CACTUS) || source.is(DamageTypes.SWEET_BERRY_BUSH) || source.is(DamageTypes.STALAGMITE) || source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_ANVIL)) {
|
- if (source.is(DamageTypes.CACTUS) || source.is(DamageTypes.SWEET_BERRY_BUSH) || source.is(DamageTypes.STALAGMITE) || source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_ANVIL)) {
|
||||||
@@ -20528,7 +20519,7 @@ index 547ab158cd0cbf51da06ea97740cfce34bca651b..6fed586c9a778f7a57e1b4ca2e6f2dbc
|
|||||||
cause = DamageCause.CONTACT;
|
cause = DamageCause.CONTACT;
|
||||||
} else if (source.is(DamageTypes.HOT_FLOOR)) {
|
} else if (source.is(DamageTypes.HOT_FLOOR)) {
|
||||||
cause = DamageCause.HOT_FLOOR;
|
cause = DamageCause.HOT_FLOOR;
|
||||||
@@ -1179,6 +1188,7 @@ public class CraftEventFactory {
|
@@ -1181,6 +1190,7 @@ public class CraftEventFactory {
|
||||||
EntityDamageEvent event;
|
EntityDamageEvent event;
|
||||||
if (damager != null) {
|
if (damager != null) {
|
||||||
event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, critical);
|
event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, critical);
|
||||||
@@ -20627,7 +20618,7 @@ index 6ba29875d78ede4aa7978ff689e588f7fed11528..4afec4387971612f62b825e9e56c2ead
|
|||||||
throw new IllegalArgumentException("Unknown recipe stack instance " + bukkit);
|
throw new IllegalArgumentException("Unknown recipe stack instance " + bukkit);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||||
index 71d057dc8c7362f8e7aaca5e31c9f02b2bf3f281..9d9405af0db28c0f3ffff2881b54f1dc84675a9d 100644
|
index ae6d9453cbfb708ed00a61a221bd425110b291a4..9dba941b28e1f9d9b6f8d106cf8f6adcd5a436be 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||||
@@ -256,6 +256,7 @@ public final class CraftLegacy {
|
@@ -256,6 +256,7 @@ public final class CraftLegacy {
|
||||||
@@ -20740,10 +20731,10 @@ index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..d3ec817e95628f1fc8be4a29c9a0f13c
|
|||||||
// Paper end - add timings for scoreboard search
|
// Paper end - add timings for scoreboard search
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
index a1c9989df460d7ae3666fffe7968750832a30b85..ad7f21566271260270db452e2f15c32f8a829d28 100644
|
index 5a382907285a288f2a223189e690d3dbdf45594c..3daf674f1e0de3fdd89db5536cc1e34140a5abb8 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
@@ -507,7 +507,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
@@ -511,7 +511,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
|
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
|
||||||
@@ -21395,7 +21386,7 @@ index 0000000000000000000000000000000000000000..de70bfdbdd7740fdf20dd063a7a623a9
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..d8de8710d9b8cf2ae5c434b2b0b27e76ffbbe4bf
|
index 0000000000000000000000000000000000000000..6717941d18dbd6871b4613106b9787063e11722f
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
@@ -0,0 +1,3306 @@
|
@@ -0,0 +1,3306 @@
|
||||||
@@ -21498,7 +21489,7 @@ index 0000000000000000000000000000000000000000..d8de8710d9b8cf2ae5c434b2b0b27e76
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public float armorstandStepHeight = 0.0F;
|
+ public float armorstandStepHeight = 0.0F;
|
||||||
+ public boolean armorstandSetNameVisible = true;
|
+ public boolean armorstandSetNameVisible = false;
|
||||||
+ public boolean armorstandFixNametags = false;
|
+ public boolean armorstandFixNametags = false;
|
||||||
+ public boolean armorstandMovement = true;
|
+ public boolean armorstandMovement = true;
|
||||||
+ public boolean armorstandWaterMovement = true;
|
+ public boolean armorstandWaterMovement = true;
|
||||||
|
|||||||
@@ -5,17 +5,17 @@ Subject: [PATCH] Use Gradle Version Catalogs
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 81996f00384674b29368e8bea944bdd14d631da3..feaff0406fa47ffb265ce316b057fb52aa367870 100644
|
index 89f21e21efc5f5ab99d1586f4f3b8f2f3c48ac06..ec151f06541d7c3b4ffb1cac75e94bf3914dacaf 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -18,57 +18,27 @@ dependencies {
|
@@ -13,57 +13,26 @@ val alsoShade: Configuration by configurations.creating
|
||||||
exclude("io.papermc.paper", "paper-api")
|
|
||||||
}
|
dependencies {
|
||||||
// Purpur end
|
implementation(project(":purpur-api")) // Purpur
|
||||||
- // Paper start
|
- // Paper start
|
||||||
- implementation("org.jline:jline-terminal-jansi:3.21.0")
|
- implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||||
- implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
- implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||||
- implementation("net.kyori:adventure-text-serializer-ansi:4.16.0") // Keep in sync with adventureVersion from Paper-API build file
|
- implementation("net.kyori:adventure-text-serializer-ansi:4.17.0") // Keep in sync with adventureVersion from Paper-API build file
|
||||||
- /*
|
- /*
|
||||||
- Required to add the missing Log4j2Plugins.dat file from log4j-core
|
- Required to add the missing Log4j2Plugins.dat file from log4j-core
|
||||||
- which has been removed by Mojang. Without it, log4j has to classload
|
- which has been removed by Mojang. Without it, log4j has to classload
|
||||||
@@ -24,22 +24,8 @@ index 81996f00384674b29368e8bea944bdd14d631da3..feaff0406fa47ffb265ce316b057fb52
|
|||||||
- */
|
- */
|
||||||
- implementation("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - implementation
|
- implementation("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - implementation
|
||||||
- log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins
|
- log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins
|
||||||
+
|
- runtimeOnly(log4jPlugins.output)
|
||||||
+ // Plazma start - Use Gradle Version Catalogs
|
- alsoShade(log4jPlugins.output)
|
||||||
+ implementation(server.bundles.implementation)
|
|
||||||
+ implementation(common.asm.commons)
|
|
||||||
+ implementation(common.log4j.iostreams)
|
|
||||||
+ implementation(common.commons.lang2)
|
|
||||||
+ implementation(server.velocity) { isTransitive = false }
|
|
||||||
+
|
|
||||||
+ runtimeOnly(common.maven.provider)
|
|
||||||
+ runtimeOnly(common.bundles.maven)
|
|
||||||
+ runtimeOnly(server.bundles.runtime)
|
|
||||||
+
|
|
||||||
+ implementation(common.log4j.core) // Paper - implementation
|
|
||||||
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j.core) // Paper - Needed to generate meta for our Log4j plugins
|
|
||||||
runtimeOnly(log4jPlugins.output)
|
|
||||||
alsoShade(log4jPlugins.output)
|
|
||||||
- implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
|
- implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
|
||||||
- // Paper end
|
- // Paper end
|
||||||
- implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
|
- implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
|
||||||
@@ -77,6 +63,21 @@ index 81996f00384674b29368e8bea944bdd14d631da3..feaff0406fa47ffb265ce316b057fb52
|
|||||||
- implementation("io.papermc:reflection-rewriter-runtime:$reflectionRewriterVersion")
|
- implementation("io.papermc:reflection-rewriter-runtime:$reflectionRewriterVersion")
|
||||||
- implementation("io.papermc:reflection-rewriter-proxy-generator:$reflectionRewriterVersion")
|
- implementation("io.papermc:reflection-rewriter-proxy-generator:$reflectionRewriterVersion")
|
||||||
- // Paper end - Remap reflection
|
- // Paper end - Remap reflection
|
||||||
|
+ // Plazma start - Use Gradle Version Catalogs
|
||||||
|
+ implementation(server.bundles.implementation)
|
||||||
|
+ implementation(common.asm.commons)
|
||||||
|
+ implementation(common.log4j.iostreams)
|
||||||
|
+ implementation(common.commons.lang2)
|
||||||
|
+ implementation(server.velocity) { isTransitive = false }
|
||||||
|
+
|
||||||
|
+ runtimeOnly(common.maven.provider)
|
||||||
|
+ runtimeOnly(common.bundles.maven)
|
||||||
|
+ runtimeOnly(server.bundles.runtime)
|
||||||
|
+
|
||||||
|
+ implementation(common.log4j.core) // Paper - implementation
|
||||||
|
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j.core) // Paper - Needed to generate meta for our Log4j plugins
|
||||||
|
+ runtimeOnly(log4jPlugins.output) // Plazma - diff on patch
|
||||||
|
+ alsoShade(log4jPlugins.output) // Plazma - diff on patch
|
||||||
+
|
+
|
||||||
+ testImplementation(server.bundles.test)
|
+ testImplementation(server.bundles.test)
|
||||||
+ testImplementation(common.bundles.test)
|
+ testImplementation(common.bundles.test)
|
||||||
|
|||||||
@@ -4,33 +4,52 @@ Date: Wed, 21 Dec 2022 19:31:24 +0900
|
|||||||
Subject: [PATCH] Rebrand
|
Subject: [PATCH] Rebrand
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/MIT.txt b/MIT.txt
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..67d405764ed68083d0164b1af0eabc0af7f6efea
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/MIT.txt
|
||||||
|
@@ -0,0 +1,21 @@
|
||||||
|
+The MIT License (MIT)
|
||||||
|
+
|
||||||
|
+Copyright (c) 2024 Paper Contributors
|
||||||
|
+
|
||||||
|
+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/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index feaff0406fa47ffb265ce316b057fb52aa367870..279e1cfd24f29d3ac55e74759d8b542a7520de3d 100644
|
index ec151f06541d7c3b4ffb1cac75e94bf3914dacaf..3cf30564db4e5cb2eeb09258940d0b2b5f9b0edc 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -12,12 +12,10 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
@@ -12,7 +12,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||||
val alsoShade: Configuration by configurations.creating
|
val alsoShade: Configuration by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
- // Purpur start
|
- implementation(project(":purpur-api")) // Purpur
|
||||||
- implementation(project(":purpur-api"))
|
+ implementation(project(":${parent!!.property("projectName").toString().lowercase()}-api")) // Plazma - Rebrand
|
||||||
- implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
|
|
||||||
- exclude("io.papermc.paper", "paper-api")
|
|
||||||
- }
|
|
||||||
- // Purpur end
|
|
||||||
+ // Plazma start - Rebrand
|
|
||||||
+ implementation(project(":${parent!!.property("projectName").toString().lowercase()}-api"))
|
|
||||||
+ implementation(project(":${parent!!.property("projectName").toString().lowercase()}-mojangapi"))
|
|
||||||
+ // Plazma end
|
|
||||||
|
|
||||||
// Plazma start - Use Gradle Version Catalogs
|
// Plazma start - Use Gradle Version Catalogs
|
||||||
implementation(server.bundles.implementation)
|
implementation(server.bundles.implementation)
|
||||||
@@ -57,7 +55,7 @@ tasks.jar {
|
implementation(common.asm.commons)
|
||||||
|
@@ -51,7 +51,7 @@ tasks.jar {
|
||||||
attributes(
|
attributes(
|
||||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
"Implementation-Title" to "CraftBukkit",
|
"Implementation-Title" to "CraftBukkit",
|
||||||
- "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur
|
- "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur
|
||||||
+ "Implementation-Version" to "git-${parent!!.property("projectName")}-$implementationVersion", // Pufferfish // Purpur // Plazma - Setup Gradle Project
|
+ "Implementation-Version" to "git-${parent!!.property("projectName")}-$implementationVersion", // Pufferfish // Purpur // Plazma - Rebrand
|
||||||
"Implementation-Vendor" to date, // Paper
|
"Implementation-Vendor" to date, // Paper
|
||||||
"Specification-Title" to "Bukkit",
|
"Specification-Title" to "Bukkit",
|
||||||
"Specification-Version" to project.version,
|
"Specification-Version" to project.version,
|
||||||
@@ -225,10 +244,10 @@ index 411f1f8c6be072cfc5ba88cbec38dbc4300a41d1..0fb3eeab083a0b1e9b495bd2c5c556fc
|
|||||||
Main.LOGGER.error(awtException);
|
Main.LOGGER.error(awtException);
|
||||||
return;
|
return;
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 21327a92b75a460c7beb3aa408502f37a7db31fa..6d549448e67a110a42dde6f8eeaab1f0033f3462 100644
|
index dfe3d28bd97d1335457d1005ecf69afe75d5ff80..dc571ad9882a6c35e25b20086da1f2c51d3b4b57 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -496,8 +496,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -495,8 +495,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
if (!newWorld.isDirectory() && oldWorld.isDirectory() && oldLevelDat.isFile()) {
|
if (!newWorld.isDirectory() && oldWorld.isDirectory() && oldLevelDat.isFile()) {
|
||||||
MinecraftServer.LOGGER.info("---- Migration of old " + worldType + " folder required ----");
|
MinecraftServer.LOGGER.info("---- Migration of old " + worldType + " folder required ----");
|
||||||
@@ -239,7 +258,7 @@ index 21327a92b75a460c7beb3aa408502f37a7db31fa..6d549448e67a110a42dde6f8eeaab1f0
|
|||||||
MinecraftServer.LOGGER.info("Attempting to move " + oldWorld + " to " + newWorld + "...");
|
MinecraftServer.LOGGER.info("Attempting to move " + oldWorld + " to " + newWorld + "...");
|
||||||
|
|
||||||
if (newWorld.exists()) {
|
if (newWorld.exists()) {
|
||||||
@@ -963,7 +963,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -965,7 +965,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
shutdownThread = Thread.currentThread();
|
shutdownThread = Thread.currentThread();
|
||||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||||
if (!isSameThread()) {
|
if (!isSameThread()) {
|
||||||
@@ -248,7 +267,7 @@ index 21327a92b75a460c7beb3aa408502f37a7db31fa..6d549448e67a110a42dde6f8eeaab1f0
|
|||||||
while (this.getRunningThread().isAlive()) {
|
while (this.getRunningThread().isAlive()) {
|
||||||
this.getRunningThread().stop();
|
this.getRunningThread().stop();
|
||||||
try {
|
try {
|
||||||
@@ -1183,7 +1183,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1185,7 +1185,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
LOGGER.info("*************************************************************************************");
|
LOGGER.info("*************************************************************************************");
|
||||||
LOGGER.info("This is the first time you're starting this server.");
|
LOGGER.info("This is the first time you're starting this server.");
|
||||||
LOGGER.info("It's recommended you read our 'Getting Started' documentation for guidance.");
|
LOGGER.info("It's recommended you read our 'Getting Started' documentation for guidance.");
|
||||||
@@ -258,10 +277,10 @@ index 21327a92b75a460c7beb3aa408502f37a7db31fa..6d549448e67a110a42dde6f8eeaab1f0
|
|||||||
}
|
}
|
||||||
// Paper end - Add onboarding message for initial server start
|
// Paper end - Add onboarding message for initial server start
|
||||||
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/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 775c5de4f5094260096cef6723dd50dfe2cb0c81..d606da8627219b5ecf4f1500086905fb4f572ca9 100644
|
index 957da64ddd0a56f457122a3f590b45e348f22382..a8cef5417273a48e1f76e4116e848b6ba15928f2 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -793,7 +793,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -792,7 +792,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
org.bukkit.plugin.Plugin[] plugins = this.server.getPluginManager().getPlugins();
|
org.bukkit.plugin.Plugin[] plugins = this.server.getPluginManager().getPlugins();
|
||||||
|
|
||||||
result.append(this.server.getName());
|
result.append(this.server.getName());
|
||||||
@@ -356,15 +375,15 @@ index f6e3b745fc417354380d4a969f83aee430bad785..d2795cacee1b3dd2d73ec91553bb8aa3
|
|||||||
|
|
||||||
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 19937ffa2c93cb75ea8dba58dd5a8214adc035fa..4f9638d360497ceef72fb193a4bb6423fd9175d6 100644
|
index b82c66c402823874e3a5fc9bb7b1df73c708aec5..ebc75eb4ae38dd2f24eb81e5797ae48e25ae93c7 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -268,7 +268,7 @@ import javax.annotation.Nullable; // Paper
|
@@ -269,7 +269,7 @@ import javax.annotation.Nullable; // Paper
|
||||||
import javax.annotation.Nonnull; // Paper
|
import javax.annotation.Nonnull; // Paper
|
||||||
|
|
||||||
public final class CraftServer implements Server {
|
public final class CraftServer implements Server {
|
||||||
- private final String serverName = "Purpur"; // Paper // Pufferfish // Purpur
|
- private final String serverName = "Purpur"; // Paper // Pufferfish // Purpur
|
||||||
+ private final String serverName = Versioning.BRANDING; // Paper // Pufferfish // Purpur // Plazma - Rebrand
|
+ private final String serverName = Versioning.BRANDING; // Paper // Pufferfish // Purpur
|
||||||
private final String serverVersion;
|
private final String serverVersion;
|
||||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||||
private final Logger logger = Logger.getLogger("Minecraft");
|
private final Logger logger = Logger.getLogger("Minecraft");
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Plazma Configurations
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 279e1cfd24f29d3ac55e74759d8b542a7520de3d..5b81ed7a9f978b59b1b287126c9161aa6446a28d 100644
|
index 3cf30564db4e5cb2eeb09258940d0b2b5f9b0edc..92826a38773b6d76acfbf18774ada8a395e9007f 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -22,6 +22,7 @@ dependencies {
|
@@ -18,6 +18,7 @@ dependencies {
|
||||||
implementation(common.asm.commons)
|
implementation(common.asm.commons)
|
||||||
implementation(common.log4j.iostreams)
|
implementation(common.log4j.iostreams)
|
||||||
implementation(common.commons.lang2)
|
implementation(common.commons.lang2)
|
||||||
@@ -517,7 +517,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
|
|||||||
+
|
+
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 6d549448e67a110a42dde6f8eeaab1f0033f3462..065308f8cca471dee8360857bd627402849976dc 100644
|
index dc571ad9882a6c35e25b20086da1f2c51d3b4b57..7d20729d18187d2f576a1fe2f9b633429ee96923 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -314,6 +314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -314,6 +314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@@ -528,7 +528,7 @@ index 6d549448e67a110a42dde6f8eeaab1f0033f3462..065308f8cca471dee8360857bd627402
|
|||||||
public static long currentTickLong = 0L; // Paper - track current tick as a long
|
public static long currentTickLong = 0L; // Paper - track current tick as a long
|
||||||
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||||
public boolean lagging = false; // Purpur
|
public boolean lagging = false; // Purpur
|
||||||
@@ -425,6 +426,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -424,6 +425,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
|
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
|
||||||
@@ -596,7 +596,7 @@ index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..4f1071c48fec78036d6759cdff179df3
|
|||||||
}
|
}
|
||||||
|
|
||||||
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/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index d606da8627219b5ecf4f1500086905fb4f572ca9..28e8967a87715fb2db25feb84e8736c446f355b5 100644
|
index a8cef5417273a48e1f76e4116e848b6ba15928f2..6b2aabb9ab3b8e30a8c3b333b7cb6fa9ebb01879 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -222,6 +222,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -222,6 +222,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
@@ -617,7 +617,7 @@ index d606da8627219b5ecf4f1500086905fb4f572ca9..28e8967a87715fb2db25feb84e8736c4
|
|||||||
// Purpur start
|
// Purpur start
|
||||||
try {
|
try {
|
||||||
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/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index f72af2feb74626abbdfbfd090c15357457810240..aef5d7562e1636e85382ed60b694a9a0d5dccd9d 100644
|
index 7924e3c597164f71056cd58dd167ee8b1d41b9c3..5df20b97f3c88248ab70e7686b5fa0ca8e5a58c2 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -700,15 +700,33 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -700,15 +700,33 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
@@ -705,10 +705,10 @@ index eda2f8cc034cf46293be1be117a60cf8b663c303..1e5964f315b3e944d249032744991721
|
|||||||
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
|
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
|
||||||
this.generator = gen;
|
this.generator = gen;
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 4f9638d360497ceef72fb193a4bb6423fd9175d6..26e93a0c346204ccccf8255d0f87da03e943bcfb 100644
|
index ebc75eb4ae38dd2f24eb81e5797ae48e25ae93c7..841ce275ff3f49783a61af71d83020b8cda35473 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -1068,6 +1068,7 @@ public final class CraftServer implements Server {
|
@@ -1052,6 +1052,7 @@ public final class CraftServer implements Server {
|
||||||
|
|
||||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||||
@@ -716,7 +716,7 @@ index 4f9638d360497ceef72fb193a4bb6423fd9175d6..26e93a0c346204ccccf8255d0f87da03
|
|||||||
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||||
for (ServerLevel world : this.console.getAllLevels()) {
|
for (ServerLevel world : this.console.getAllLevels()) {
|
||||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||||
@@ -3126,6 +3127,13 @@ public final class CraftServer implements Server {
|
@@ -3117,6 +3118,13 @@ public final class CraftServer implements Server {
|
||||||
}
|
}
|
||||||
// Purpur end
|
// Purpur end
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ index f164256d59b761264876ca0c85f812d101bfd5de..deaeb134c47da8710afa747bf980bd00
|
|||||||
final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
|
final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 065308f8cca471dee8360857bd627402849976dc..eb4c8b516be77423c7decb247f261a264b1cfc89 100644
|
index 7d20729d18187d2f576a1fe2f9b633429ee96923..9d5257f810f9f88504b913fa0c7c214acc1da2cb 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -323,6 +323,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -323,6 +323,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@@ -148,7 +148,7 @@ index 065308f8cca471dee8360857bd627402849976dc..eb4c8b516be77423c7decb247f261a26
|
|||||||
|
|
||||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||||
AtomicReference<S> atomicreference = new AtomicReference();
|
AtomicReference<S> atomicreference = new AtomicReference();
|
||||||
@@ -1741,17 +1742,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1743,17 +1744,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
//MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper // Purpur
|
//MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper // Purpur
|
||||||
// Paper start - Folia scheduler API
|
// Paper start - Folia scheduler API
|
||||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||||
@@ -175,7 +175,7 @@ index 065308f8cca471dee8360857bd627402849976dc..eb4c8b516be77423c7decb247f261a26
|
|||||||
// Paper end - Folia scheduler API
|
// Paper end - Folia scheduler API
|
||||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||||
//this.profiler.push("commandFunctions"); // Purpur
|
//this.profiler.push("commandFunctions"); // Purpur
|
||||||
@@ -1818,7 +1817,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1820,7 +1819,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur
|
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur
|
||||||
@@ -192,7 +192,7 @@ index 065308f8cca471dee8360857bd627402849976dc..eb4c8b516be77423c7decb247f261a26
|
|||||||
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) {
|
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) {
|
||||||
regionManager.recalculateRegions();
|
regionManager.recalculateRegions();
|
||||||
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/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 28e8967a87715fb2db25feb84e8736c446f355b5..32332070cc62c0842333b05c53005feb30051914 100644
|
index 6b2aabb9ab3b8e30a8c3b333b7cb6fa9ebb01879..ca1e8da7540457ecba5684acd42129509c8204f5 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -224,6 +224,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -224,6 +224,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
@@ -204,7 +204,7 @@ index 28e8967a87715fb2db25feb84e8736c446f355b5..32332070cc62c0842333b05c53005feb
|
|||||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||||
if (this.convertOldUsers()) {
|
if (this.convertOldUsers()) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 4e6fccec4f5ca14562bf5bae495ac36c14982d85..9162c6338dbb516ce60f4853e57da6e49be79282 100644
|
index 345f143b0eeb77acb96e4bc716f3b23782ac782f..4f112e2550fae57ccd41f6525bffe6d6974a8dd1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1439,7 +1439,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1439,7 +1439,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
@@ -212,7 +212,7 @@ index 4e6fccec4f5ca14562bf5bae495ac36c14982d85..9162c6338dbb516ce60f4853e57da6e4
|
|||||||
|
|
||||||
// CraftBukkit start - respect vanish API
|
// CraftBukkit start - respect vanish API
|
||||||
- if (flag && !player.getBukkitEntity().canSee(this.entity.getBukkitEntity())) { // Paper - only consider hits
|
- if (flag && !player.getBukkitEntity().canSee(this.entity.getBukkitEntity())) { // Paper - only consider hits
|
||||||
+ if (flag && !player.getBukkitEntity().canSeeChunkMapUpdatePlauer(this.entity.getBukkitEntity())) { // Paper - only consider hits
|
+ if (flag && !player.getBukkitEntity().chunkMapCanSee(this.entity.getBukkitEntity())) { // Paper - only consider hits // Plazma - Port SparklyPaper patches; Optimize canSee check
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -230,7 +230,7 @@ index 476a04d87a61b021816d2970e86042bde32d95a2..53c0b48966558f43bb9bd7d29d9588f9
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
index 39e7dcf3c92c9203c190782be401c00c010b8aeb..b86ae3929ec5d3c4eb69d92774dc445aa5b3093e 100644
|
index dd6278fe99e2ee4daa95249c71ea935dd08b0025..a528685040bf5596fe20fc055d691fd7e663762c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
@@ -78,6 +78,7 @@ public class ServerEntity {
|
@@ -78,6 +78,7 @@ public class ServerEntity {
|
||||||
@@ -241,18 +241,18 @@ index 39e7dcf3c92c9203c190782be401c00c010b8aeb..b86ae3929ec5d3c4eb69d92774dc445a
|
|||||||
|
|
||||||
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
|
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
|
||||||
this.trackedPlayers = trackedPlayers;
|
this.trackedPlayers = trackedPlayers;
|
||||||
@@ -208,12 +209,16 @@ public class ServerEntity {
|
@@ -215,12 +216,15 @@ public class ServerEntity {
|
||||||
|
|
||||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||||
Vec3 vec3d1 = this.entity.getDeltaMovement();
|
Vec3 vec3d1 = this.entity.getDeltaMovement();
|
||||||
- double d0 = vec3d1.distanceToSqr(this.ap);
|
- double d0 = vec3d1.distanceToSqr(this.ap);
|
||||||
+ // Plazma start - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
|
-
|
||||||
+ if (!skipSqrWhenNoDeltaChanges && vec3d1 != this.ap) {
|
|
||||||
+ double d0 = vec3d1.distanceToSqr(this.ap);
|
|
||||||
|
|
||||||
- if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
|
- if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
|
||||||
- this.ap = vec3d1;
|
- this.ap = vec3d1;
|
||||||
- this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap));
|
- this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap));
|
||||||
|
+ // Plazma start - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
|
||||||
|
+ if (!skipSqrWhenNoDeltaChanges && vec3d1 != this.ap) {
|
||||||
|
+ double d0 = vec3d1.distanceToSqr(this.ap);
|
||||||
+ if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
|
+ if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
|
||||||
+ this.ap = vec3d1;
|
+ this.ap = vec3d1;
|
||||||
+ this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap));
|
+ this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap));
|
||||||
@@ -263,7 +263,7 @@ index 39e7dcf3c92c9203c190782be401c00c010b8aeb..b86ae3929ec5d3c4eb69d92774dc445a
|
|||||||
|
|
||||||
if (packet1 != null) {
|
if (packet1 != null) {
|
||||||
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/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index aef5d7562e1636e85382ed60b694a9a0d5dccd9d..dc8cb0e9c8abdbefb0420599a243b1a4fe66bb05 100644
|
index 5df20b97f3c88248ab70e7686b5fa0ca8e5a58c2..d1b2e68a702ce01c33cfe0e1297a8809e3acf088 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -233,6 +233,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -233,6 +233,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
@@ -826,7 +826,7 @@ index 0000000000000000000000000000000000000000..f8c26e26025d7a7b5489ed5b3274ba73
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 88948526f9acf4bb2157484b80891902fd843b02..20acef32cabdb8f860088341248fe9960f04fbfd 100644
|
index 2c9726d0f2dec1136a2f45768e8f8169ce165a1d..4f199eea0c8a05f94e8443917c5a6f2c42f0b25e 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -976,7 +976,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -976,7 +976,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
@@ -838,19 +838,23 @@ index 88948526f9acf4bb2157484b80891902fd843b02..20acef32cabdb8f860088341248fe996
|
|||||||
|
|
||||||
for (Map.Entry<? extends io.papermc.paper.math.Position, BlockData> entry : blockChanges.entrySet()) {
|
for (Map.Entry<? extends io.papermc.paper.math.Position, BlockData> entry : blockChanges.entrySet()) {
|
||||||
BlockData blockData = entry.getValue();
|
BlockData blockData = entry.getValue();
|
||||||
@@ -2240,6 +2240,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -2237,9 +2237,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
return this.equals(entity) || entity.isVisibleByDefault() ^ this.invertedVisibilityEntities.containsKey(entity.getUniqueId()); // SPIGOT-7312: Can always see self
|
|
||||||
|
@Override
|
||||||
|
public boolean canSee(org.bukkit.entity.Entity entity) {
|
||||||
|
- return this.equals(entity) || entity.isVisibleByDefault() ^ this.invertedVisibilityEntities.containsKey(entity.getUniqueId()); // SPIGOT-7312: Can always see self
|
||||||
|
+ return this.equals(entity) || this.chunkMapCanSee(entity); // SPIGOT-7312: Can always see self // Plazma - Port SparklyPaper patches; Optimize canSee check
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Plazma start - Port SparklyPaper patches; Optimize canSee check
|
+ // Plazma start - Port SparklyPaper patches; Optimize canSee check (The check in ChunkMap#updatePlayer already rejects if it is the same entity, so we don't need to check it twice, especially because CraftPlayer's equals check is a bit expensive)
|
||||||
+ public boolean canSeeChunkMapUpdatePlauer(org.bukkit.entity.Entity entity) {
|
+ public boolean chunkMapCanSee(org.bukkit.entity.Entity entity) {
|
||||||
+ return entity.isVisibleByDefault() ^ (!invertedVisibilityEntities.isEmpty() && this.invertedVisibilityEntities.containsKey(entity.getUniqueId()));
|
+ return entity.isVisibleByDefault() ^ (!invertedVisibilityEntities.isEmpty() && this.invertedVisibilityEntities.containsKey(entity.getUniqueId()));
|
||||||
+ }
|
+ }
|
||||||
+ // Plazma end - Port SparklyPaper patches; Optimize canSee check
|
+ // Plazma end - Port SparklyPaper patches; Optimize canSee check
|
||||||
+
|
+
|
||||||
public boolean canSee(UUID uuid) {
|
public boolean canSeePlayer(UUID uuid) {
|
||||||
org.bukkit.entity.Entity entity = this.getServer().getPlayer(uuid);
|
org.bukkit.entity.Entity entity = this.getServer().getPlayer(uuid);
|
||||||
if (entity == null) {
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
||||||
index 8149b9c51b78eb5c689b7218a2ca3aab60e73bcf..b9a303f6280a2f6ad3616da152922a4f4a504281 100644
|
index 8149b9c51b78eb5c689b7218a2ca3aab60e73bcf..b9a303f6280a2f6ad3616da152922a4f4a504281 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
||||||
|
|||||||
@@ -324,10 +324,10 @@ index 55e16ed1151c5d53f492581f66a3406ac418b653..9af7df196ed74a48a6b6426df36353f9
|
|||||||
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
|
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
|
||||||
this.enableStatus = this.get("enable-status", true);
|
this.enableStatus = this.get("enable-status", true);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 26e93a0c346204ccccf8255d0f87da03e943bcfb..d53be3e57e97cf9806b04f6d6bdd6a3a9fdb299b 100644
|
index 841ce275ff3f49783a61af71d83020b8cda35473..509c7536b84019c854163471cb9d42b969747366 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -426,7 +426,7 @@ public final class CraftServer implements Server {
|
@@ -433,7 +433,7 @@ public final class CraftServer implements Server {
|
||||||
|
|
||||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||||
this.configuration.options().copyDefaults(true);
|
this.configuration.options().copyDefaults(true);
|
||||||
@@ -398,7 +398,7 @@ index 85f4a9300aebfd4ee64d179dfa1f7ffd314cb3b8..fa209964eec7dae8e2a0fa7bb44e0e87
|
|||||||
private static void networkSettings() {
|
private static void networkSettings() {
|
||||||
useUPnP = getBoolean("settings.network.upnp-port-forwarding", useUPnP);
|
useUPnP = getBoolean("settings.network.upnp-port-forwarding", useUPnP);
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
index d8de8710d9b8cf2ae5c434b2b0b27e76ffbbe4bf..72dc81d3015dc7c6365997de9abc269b261649b1 100644
|
index 6717941d18dbd6871b4613106b9787063e11722f..b6a6a74dfd00a4536258c8693048c9d1ac4df435 100644
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||||
@@ -433,7 +433,7 @@ public class PurpurWorldConfig {
|
@@ -433,7 +433,7 @@ public class PurpurWorldConfig {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Tweak console logging
|
|||||||
|
|
||||||
|
|
||||||
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/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index f661418d27f5692a51b880f64180866f7d19d66a..ddfbc49a693d3100e915f5083f1f8e99df2d4b64 100644
|
index ca1e8da7540457ecba5684acd42129509c8204f5..9af4efcf9a2c8dee2208ddf37b1bb963a2894666 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -193,16 +193,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -193,16 +193,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
@@ -43,7 +43,7 @@ index f661418d27f5692a51b880f64180866f7d19d66a..ddfbc49a693d3100e915f5083f1f8e99
|
|||||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||||
if (this.convertOldUsers()) {
|
if (this.convertOldUsers()) {
|
||||||
this.getProfileCache().save(false); // Paper
|
this.getProfileCache().save(false); // Paper
|
||||||
@@ -331,6 +332,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -330,6 +331,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
|
||||||
@@ -51,7 +51,7 @@ index f661418d27f5692a51b880f64180866f7d19d66a..ddfbc49a693d3100e915f5083f1f8e99
|
|||||||
if (!this.usesAuthentication()) {
|
if (!this.usesAuthentication()) {
|
||||||
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
||||||
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||||
@@ -344,7 +346,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -343,7 +345,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
|
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
|
||||||
}
|
}
|
||||||
// Spigot end
|
// Spigot end
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Completely remove Mojang Profiler
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||||
index f9d0e8ee9414b3897f268ba78a1469ddf868f51a..58d89000af36f72d629d8e0873d6efbbbb720fe1 100644
|
index 55b29e9a540cfc00dc32c7ae14d603c150e8863d..4f1976333662662bc6aa844bde9667b8c9a0b159 100644
|
||||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||||
@@ -429,7 +429,7 @@ public class Commands {
|
@@ -442,7 +442,7 @@ public class Commands {
|
||||||
int j = minecraftserver.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_FORK_COUNT);
|
int j = minecraftserver.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_FORK_COUNT);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -65,7 +65,7 @@ index f626a2f28f2aebb3237cebb6afef3c4fa1a6cb37..467e17bfce31d0919d603698c9d88a04
|
|||||||
public int forkLimit() {
|
public int forkLimit() {
|
||||||
return this.forkLimit;
|
return this.forkLimit;
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index eb4c8b516be77423c7decb247f261a264b1cfc89..da5275e9137023b39f7a0a20255e483b61a5237f 100644
|
index 9d5257f810f9f88504b913fa0c7c214acc1da2cb..e0f50dcfe30abf439cea3ecd7837569802bd16c8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -104,18 +104,18 @@ import net.minecraft.util.datafix.DataFixers;
|
@@ -104,18 +104,18 @@ import net.minecraft.util.datafix.DataFixers;
|
||||||
@@ -120,7 +120,7 @@ index eb4c8b516be77423c7decb247f261a264b1cfc89..da5275e9137023b39f7a0a20255e483b
|
|||||||
private ServerConnectionListener connection;
|
private ServerConnectionListener connection;
|
||||||
public final ChunkProgressListenerFactory progressListenerFactory;
|
public final ChunkProgressListenerFactory progressListenerFactory;
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -2594,10 +2594,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2605,10 +2605,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ index eb4c8b516be77423c7decb247f261a264b1cfc89..da5275e9137023b39f7a0a20255e483b
|
|||||||
|
|
||||||
public abstract boolean isSingleplayerOwner(GameProfile profile);
|
public abstract boolean isSingleplayerOwner(GameProfile profile);
|
||||||
|
|
||||||
@@ -2841,6 +2843,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2852,6 +2854,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ index eb4c8b516be77423c7decb247f261a264b1cfc89..da5275e9137023b39f7a0a20255e483b
|
|||||||
private void startMetricsRecordingTick() {
|
private void startMetricsRecordingTick() {
|
||||||
if (false && this.willStartRecordingMetrics) { // Purpur
|
if (false && this.willStartRecordingMetrics) { // Purpur
|
||||||
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
||||||
@@ -2867,12 +2870,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2878,12 +2881,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startRecordingMetrics(Consumer<ProfileResults> resultConsumer, Consumer<Path> dumpConsumer) {
|
public void startRecordingMetrics(Consumer<ProfileResults> resultConsumer, Consumer<Path> dumpConsumer) {
|
||||||
@@ -156,7 +156,7 @@ index eb4c8b516be77423c7decb247f261a264b1cfc89..da5275e9137023b39f7a0a20255e483b
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void stopRecordingMetrics() {
|
public void stopRecordingMetrics() {
|
||||||
@@ -2887,6 +2890,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2898,6 +2901,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
//this.metricsRecorder.cancel(); // Purpur
|
//this.metricsRecorder.cancel(); // Purpur
|
||||||
//this.profiler = this.metricsRecorder.getProfiler(); // Purpur
|
//this.profiler = this.metricsRecorder.getProfiler(); // Purpur
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ index eb4c8b516be77423c7decb247f261a264b1cfc89..da5275e9137023b39f7a0a20255e483b
|
|||||||
|
|
||||||
public Path getWorldPath(LevelResource worldSavePath) {
|
public Path getWorldPath(LevelResource worldSavePath) {
|
||||||
return this.storageSource.getLevelPath(worldSavePath);
|
return this.storageSource.getLevelPath(worldSavePath);
|
||||||
@@ -2937,6 +2941,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2948,6 +2952,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
return this.isSaving;
|
return this.isSaving;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ index eb4c8b516be77423c7decb247f261a264b1cfc89..da5275e9137023b39f7a0a20255e483b
|
|||||||
public boolean isTimeProfilerRunning() {
|
public boolean isTimeProfilerRunning() {
|
||||||
return false; //this.debugCommandProfilerDelayStart || this.debugCommandProfiler != null; // Purpur
|
return false; //this.debugCommandProfilerDelayStart || this.debugCommandProfiler != null; // Purpur
|
||||||
}
|
}
|
||||||
@@ -2955,6 +2960,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2966,6 +2971,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
return methodprofilerresults;
|
return methodprofilerresults;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -180,7 +180,7 @@ index eb4c8b516be77423c7decb247f261a264b1cfc89..da5275e9137023b39f7a0a20255e483b
|
|||||||
|
|
||||||
public int getMaxChainedNeighborUpdates() {
|
public int getMaxChainedNeighborUpdates() {
|
||||||
return 1000000;
|
return 1000000;
|
||||||
@@ -3006,6 +3012,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -3017,6 +3023,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ index eb4c8b516be77423c7decb247f261a264b1cfc89..da5275e9137023b39f7a0a20255e483b
|
|||||||
private static class TimeProfiler {
|
private static class TimeProfiler {
|
||||||
|
|
||||||
final long startNanos;
|
final long startNanos;
|
||||||
@@ -3055,6 +3062,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -3066,6 +3073,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -243,7 +243,7 @@ index bae0d208b31aa0a6977c30f2f8484ab3c316bc71..05d8ca83abf69226aae43ec6f7505572
|
|||||||
Executor applyExecutor
|
Executor applyExecutor
|
||||||
) {
|
) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||||
index 775b24a9e55528944b629fd85e1f6ebef9a9892f..579e0b0040ea3315fc7c0e209574b7fef799d2d1 100644
|
index 7aa1b3705ff548023f8b040678e4008cca3b8514..771a4ad40114961f3340a9100d136d4b3a567c4e 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
||||||
@@ -16,7 +16,7 @@ import net.minecraft.commands.functions.CommandFunction;
|
@@ -16,7 +16,7 @@ import net.minecraft.commands.functions.CommandFunction;
|
||||||
@@ -361,10 +361,10 @@ index 8c587f829c5e8c6b6df3150024c4ae704988c47b..319f484b535143a94ee2da11114acacc
|
|||||||
}
|
}
|
||||||
+// Plazma end - Completely remove Mojang's Profiler
|
+// Plazma end - Completely remove Mojang's Profiler
|
||||||
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/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 0559c251107ebbcf49940a5c7647dce2310eae92..b8fcb2841abf0b00f278d21cb344866ed987b4ce 100644
|
index 9af4efcf9a2c8dee2208ddf37b1bb963a2894666..cbc884db2cacdcba264033dd06988150ba4ee0ba 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -923,11 +923,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -922,11 +922,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
return this.settings.getProperties().serverResourcePackInfo;
|
return this.settings.getProperties().serverResourcePackInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ index 0559c251107ebbcf49940a5c7647dce2310eae92..b8fcb2841abf0b00f278d21cb344866e
|
|||||||
@Override
|
@Override
|
||||||
public SampleLogger getTickTimeLogger() {
|
public SampleLogger getTickTimeLogger() {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 9162c6338dbb516ce60f4853e57da6e49be79282..809d74ce3a0b02538b1543346485731828a9f139 100644
|
index 4f112e2550fae57ccd41f6525bffe6d6974a8dd1..88d52e26fa543cacf0801b4e42c1e1fe0d8dd774 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -68,7 +68,7 @@ import net.minecraft.server.level.progress.ChunkProgressListener;
|
@@ -68,7 +68,7 @@ import net.minecraft.server.level.progress.ChunkProgressListener;
|
||||||
@@ -405,7 +405,7 @@ index 53c0b48966558f43bb9bd7d29d9588f9d83e0de7..7ff845a0ddb308e8b69881f05086105f
|
|||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.ai.village.poi.PoiManager;
|
import net.minecraft.world.entity.ai.village.poi.PoiManager;
|
||||||
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/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index dc8cb0e9c8abdbefb0420599a243b1a4fe66bb05..134b9bc1ad77b295e25bd36fcc47e4eed3273c43 100644
|
index d1b2e68a702ce01c33cfe0e1297a8809e3acf088..f88955fac16576e0eb4d8f6782aa2c8a298f4474 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -79,7 +79,7 @@ import net.minecraft.util.ProgressListener;
|
@@ -79,7 +79,7 @@ import net.minecraft.util.ProgressListener;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Reduce create random instance
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index da5275e9137023b39f7a0a20255e483b61a5237f..33b7b4f544d3ec597075edcbd265815c65c9f8fa 100644
|
index e0f50dcfe30abf439cea3ecd7837569802bd16c8..5a5661c3f4759c1e7501c2b59f541be11af0a83d 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -235,6 +235,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -235,6 +235,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@@ -30,7 +30,7 @@ index b47a8a082170bcb630c4354be7c77a4cac71d105..7fe6b99e146e7374cd29534f1e89046e
|
|||||||
double d1 = (double) (center.y - maxRange);
|
double d1 = (double) (center.y - maxRange);
|
||||||
double d2 = (double) (center.x + maxRange);
|
double d2 = (double) (center.x + maxRange);
|
||||||
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/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index d7e4a9fe9676563845d9981523bff1a7ff12282c..b7b9e02ab31206c48f0db88beabc331b7e73245c 100644
|
index 37636343c1b62b7dfa426bd6ca2bd425fd1bfff3..4ae9db093d7d3bd84c0f14e2067a458579fdd178 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -482,7 +482,7 @@ public class ServerPlayer extends Player {
|
@@ -482,7 +482,7 @@ public class ServerPlayer extends Player {
|
||||||
@@ -165,10 +165,10 @@ index fdff9788eaf663be79214b2ca491f0f0444f6136..de50b06f13df481fa59e1abe16d5181b
|
|||||||
this.level = world;
|
this.level = world;
|
||||||
this.id = nbt.getInt("Id");
|
this.id = nbt.getInt("Id");
|
||||||
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||||
index c3a644b0f8c7c5622acc9e1a496f95d432718806..ce8fb88b31af1d27a7118735154673a9f05499ec 100644
|
index 6d28f1097caa3e37c2917eb401018ebf48c13a39..9397f1fa3b53423deabbedc6f7bb0f98d68c89a2 100644
|
||||||
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||||
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
|
||||||
@@ -95,7 +95,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
@@ -96,7 +96,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
|
||||||
}
|
}
|
||||||
// Purpur end
|
// Purpur end
|
||||||
};
|
};
|
||||||
@@ -178,7 +178,7 @@ index c3a644b0f8c7c5622acc9e1a496f95d432718806..ce8fb88b31af1d27a7118735154673a9
|
|||||||
this.costs = new int[3];
|
this.costs = new int[3];
|
||||||
this.enchantClue = new int[]{-1, -1, -1};
|
this.enchantClue = new int[]{-1, -1, -1};
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
index f5e84bf8817e2d53557e0909d8c9e0e0e8206a16..1792f18397d733d87ef067a7daaf076be4163c63 100644
|
index 133d994d9ac9d4f9527135ac0c77e5749917f8c3..9771279c913a5be86e516db74792fd045c27e4cd 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||||
@@ -93,7 +93,7 @@ public class Explosion {
|
@@ -93,7 +93,7 @@ public class Explosion {
|
||||||
@@ -191,7 +191,7 @@ index f5e84bf8817e2d53557e0909d8c9e0e0e8206a16..1792f18397d733d87ef067a7daaf076b
|
|||||||
this.hitPlayers = Maps.newHashMap();
|
this.hitPlayers = Maps.newHashMap();
|
||||||
this.level = world;
|
this.level = world;
|
||||||
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/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 11a92adbcc97233f10cbe2547352213e92d0a09c..0857723b627c54e1992647c3d605809675397bc5 100644
|
index 2a6bbd570ba885c4666ea4be3dd044ddfe3d9eb9..47fcbff8a0b7feedbc700b6c3cf44d3a02a60246 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -121,16 +121,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -121,16 +121,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ Subject: [PATCH] Ignore useless entity packets
|
|||||||
- PurpurMC/Purpur
|
- PurpurMC/Purpur
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
index b86ae3929ec5d3c4eb69d92774dc445aa5b3093e..44e4a768a0ccde83cae5547c7ba07744cec4c693 100644
|
index a528685040bf5596fe20fc055d691fd7e663762c..9fe8dcea8f5075a5420a4355bb3c27c2311d8f94 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
@@ -205,6 +205,8 @@ public class ServerEntity {
|
@@ -212,6 +212,8 @@ public class ServerEntity {
|
||||||
flag4 = true;
|
flag4 = true;
|
||||||
flag5 = true;
|
flag5 = true;
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ index b86ae3929ec5d3c4eb69d92774dc445aa5b3093e..44e4a768a0ccde83cae5547c7ba07744
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||||
@@ -288,6 +290,19 @@ public class ServerEntity {
|
@@ -295,6 +297,19 @@ public class ServerEntity {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ index b86ae3929ec5d3c4eb69d92774dc445aa5b3093e..44e4a768a0ccde83cae5547c7ba07744
|
|||||||
this.entity.stopSeenByPlayer(player);
|
this.entity.stopSeenByPlayer(player);
|
||||||
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
|
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||||
index 922d1d250f2e2e5a4177bcf5fe7487ff2b43413b..c8a3e91d0d6510b519e927027f5a534cddf7d0a3 100644
|
index b83a1058484e3d4d46f91d659f795f59d7087b72..9debf554deb5b7aa021502ff7d600905f56fa25c 100644
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||||
@@ -29,6 +29,8 @@ public class WorldConfigurations extends ConfigurationPart {
|
@@ -29,6 +29,8 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Suppress errors from dirty attributes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
index 44e4a768a0ccde83cae5547c7ba07744cec4c693..7954be9d04d88444601144bab560701c04274aa7 100644
|
index 9fe8dcea8f5075a5420a4355bb3c27c2311d8f94..acf1cb25f75b35e064e7099d85693632073df858 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||||
@@ -406,7 +406,8 @@ public class ServerEntity {
|
@@ -413,7 +413,8 @@ public class ServerEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.entity instanceof LivingEntity) {
|
if (this.entity instanceof LivingEntity) {
|
||||||
@@ -18,7 +18,7 @@ index 44e4a768a0ccde83cae5547c7ba07744cec4c693..7954be9d04d88444601144bab560701c
|
|||||||
|
|
||||||
if (!set.isEmpty()) {
|
if (!set.isEmpty()) {
|
||||||
// CraftBukkit start - Send scaled max health
|
// CraftBukkit start - Send scaled max health
|
||||||
@@ -417,7 +418,7 @@ public class ServerEntity {
|
@@ -424,7 +425,7 @@ public class ServerEntity {
|
||||||
this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set));
|
this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ index 44e4a768a0ccde83cae5547c7ba07744cec4c693..7954be9d04d88444601144bab560701c
|
|||||||
|
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||||
index 1e7c23c8851ba1d0f37d2b17fd334220e060888e..29514dd01d46ba9f6b123bf3af56981541f670db 100644
|
index bc35244533621436e3c0fb871edf7834ad937f81..a9c8a5918184a2ea364261e279edf7169ae270c7 100644
|
||||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||||
@@ -31,6 +31,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
@@ -31,6 +31,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ index 03be23690a94a14d7343526acad67ccf53b85c70..416c0a736edf47f76a37be0bc5fe8678
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 33b7b4f544d3ec597075edcbd265815c65c9f8fa..3a7c0b25d160ca18a26ebd29cb3b0fcf78fef146 100644
|
index 5a5661c3f4759c1e7501c2b59f541be11af0a83d..7f5ea3282f5069a4a911b69c758981b6f4dcadc0 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -257,8 +257,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -257,8 +257,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@@ -108,7 +108,7 @@ index 33b7b4f544d3ec597075edcbd265815c65c9f8fa..3a7c0b25d160ca18a26ebd29cb3b0fcf
|
|||||||
public final TickTimes tickTimes60s = new TickTimes(1200);
|
public final TickTimes tickTimes60s = new TickTimes(1200);
|
||||||
// Paper end - Add tick times API and /mspt command
|
// Paper end - Add tick times API and /mspt command
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -1823,8 +1825,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1825,8 +1827,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
worldserver.tick(shouldKeepTicking);
|
worldserver.tick(shouldKeepTicking);
|
||||||
long after = Util.getNanos() - before;
|
long after = Util.getNanos() - before;
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ index 33b7b4f544d3ec597075edcbd265815c65c9f8fa..3a7c0b25d160ca18a26ebd29cb3b0fcf
|
|||||||
// Plazma end - Port SparklyPaper patches; Track World specific MSPT
|
// Plazma end - Port SparklyPaper patches; Track World specific MSPT
|
||||||
// Paper start
|
// Paper start
|
||||||
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/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 49307871db084a7f22a0f8570a27c9aa8f7f2f30..997a8eb1e0b72bee871cfff36cd9f66d5c87953b 100644
|
index f88955fac16576e0eb4d8f6782aa2c8a298f4474..fbc698007059d930a102197749c6a5b8e6821b46 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -234,8 +234,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -234,8 +234,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Use Akair's flag when running the test server with gradle
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 41c335bc9d80abb40e58dfbc4842b66db23e0cba..d3f8a3ff1ae30b6e3d253a58cc584cee7d11771c 100644
|
index 92826a38773b6d76acfbf18774ada8a395e9007f..99bf51cb7dd5a8a2d9f87c18bcf9745cead4ba61 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -125,7 +125,7 @@ fun TaskContainer.registerRunTask(
|
@@ -121,7 +121,7 @@ fun TaskContainer.registerRunTask(
|
||||||
languageVersion.set(JavaLanguageVersion.of(21))
|
languageVersion.set(JavaLanguageVersion.of(21))
|
||||||
vendor.set(JvmVendorSpec.JETBRAINS)
|
vendor.set(JvmVendorSpec.JETBRAINS)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Use Plazma logo instead if server favicon doesn't exist
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 3a7c0b25d160ca18a26ebd29cb3b0fcf78fef146..4635d67ed906886f533b6d5911d99a163810ea11 100644
|
index 7f5ea3282f5069a4a911b69c758981b6f4dcadc0..0df87edbd9625b2888b303c1000aefa9bdbd2f26 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1557,29 +1557,36 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1559,29 +1559,36 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<ServerStatus.Favicon> loadStatusIcon() {
|
private Optional<ServerStatus.Favicon> loadStatusIcon() {
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ 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/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 6d39a0d5455fbb0af3916b751d02386af3aa3598..ba059d797251750ac866f8f2e077315597ae737f 100644
|
index cbc884db2cacdcba264033dd06988150ba4ee0ba..99479a594f573aaac2a96bbecd9ef70e845f4677 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -705,6 +705,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -704,6 +704,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
// Paper start - Add setting for proxy online mode status
|
// Paper start - Add setting for proxy online mode status
|
||||||
return dedicatedserverproperties.enforceSecureProfile
|
return dedicatedserverproperties.enforceSecureProfile
|
||||||
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
||||||
@@ -32,7 +32,7 @@ index 6d39a0d5455fbb0af3916b751d02386af3aa3598..ba059d797251750ac866f8f2e0773155
|
|||||||
// Paper end - Add setting for proxy online mode status
|
// Paper end - Add setting for proxy online mode status
|
||||||
}
|
}
|
||||||
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/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index c36ebab552c480d34e7fd48a45f0a320a97b9677..361fcabfe5e6f54903fcbeddc96ad2311cfcfdb6 100644
|
index c36ebab552c480d34e7fd48a45f0a320a97b9677..fdfe8f5bc5ad0e5f5ded41d87756a5866d041df1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -135,6 +135,7 @@ public abstract class PlayerList {
|
@@ -135,6 +135,7 @@ public abstract class PlayerList {
|
||||||
|
|||||||
@@ -1,937 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sat, 27 Apr 2024 14:01:42 +0900
|
|
||||||
Subject: [PATCH] Completely remove Timings
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
|
||||||
index 36b8fe86335df851f9c85d6bb2a91368b4d945d1..acf3df70e17aa8b2b155c83a56226fcc69c2f367 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
|
||||||
@@ -1,12 +1,14 @@
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import static co.aikar.timings.TimingsManager.*;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
-public class FullServerTickHandler extends TimingHandler {
|
|
||||||
+interface FullServerTickHandler { /* extends TimingHandler { // Plazma - Remove timings
|
|
||||||
private static final TimingIdentifier IDENTITY = new TimingIdentifier("Minecraft", "Full Server Tick", null);
|
|
||||||
final TimingData minuteData;
|
|
||||||
double avgFreeMemory = -1D;
|
|
||||||
@@ -83,4 +85,5 @@ public class FullServerTickHandler extends TimingHandler {
|
|
||||||
boolean isViolated() {
|
|
||||||
return record.getCurTickTotal() > 50000000;
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/NullTimingHandler.java b/src/main/java/co/aikar/timings/NullTimingHandler.java
|
|
||||||
index 81671cf40feeed2844ee8d92348d48062aaf2c46..ac3b2d321b43ed73bfe8c30742e3574e3603d1ae 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/NullTimingHandler.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/NullTimingHandler.java
|
|
||||||
@@ -23,11 +23,13 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
-public final class NullTimingHandler implements Timing {
|
|
||||||
+interface NullTimingHandler { /* implements Timing { // Plazma - Remove timings
|
|
||||||
public static final Timing NULL = new NullTimingHandler();
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
@@ -66,4 +68,5 @@ public final class NullTimingHandler implements Timing {
|
|
||||||
public void close() {
|
|
||||||
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
|
||||||
index 6fbc64e0f214d0c8e5afcbe385e414a4e1fe1c72..ed9580da2bfa1e3423bd63962008c00f29f6ff98 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.event.Event;
|
|
||||||
import org.bukkit.event.EventException;
|
|
||||||
@@ -33,21 +34,14 @@ import org.bukkit.plugin.Plugin;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
-public class TimedEventExecutor implements EventExecutor {
|
|
||||||
+interface TimedEventExecutor { /* implements EventExecutor { // Plazma - Remove timings
|
|
||||||
|
|
||||||
private final EventExecutor executor;
|
|
||||||
private final Timing timings;
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Wraps an event executor and associates a timing handler to it.
|
|
||||||
- *
|
|
||||||
- * @param executor Executor to wrap
|
|
||||||
- * @param plugin Owning plugin
|
|
||||||
- * @param method EventHandler method
|
|
||||||
- * @param eventClass Owning class
|
|
||||||
- */
|
|
||||||
public TimedEventExecutor(@NotNull EventExecutor executor, @NotNull Plugin plugin, @Nullable Method method, @NotNull Class<? extends Event> eventClass) {
|
|
||||||
this.executor = executor;
|
|
||||||
String id;
|
|
||||||
@@ -87,4 +81,5 @@ public class TimedEventExecutor implements EventExecutor {
|
|
||||||
public String toString() {
|
|
||||||
return "TimedEventExecutor['" + this.executor.toString() + "']";
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java
|
|
||||||
index 1d866e980abc542bdfee1ce082cd9cdd7761e9f7..409d698de83fb72569813d15d4fb5afbaecda68b 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/Timing.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/Timing.java
|
|
||||||
@@ -23,8 +23,10 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides an ability to time sections of code within the Minecraft Server
|
|
||||||
@@ -32,61 +34,30 @@ import org.jetbrains.annotations.Nullable;
|
|
||||||
* @deprecated Timings will likely be replaced with Spark in the future
|
|
||||||
*/
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
-public interface Timing extends AutoCloseable {
|
|
||||||
- /**
|
|
||||||
- * Starts timing the execution until {@link #stopTiming()} is called.
|
|
||||||
- *
|
|
||||||
- * @return Timing
|
|
||||||
- */
|
|
||||||
+interface Timing { /* extends AutoCloseable { // Plazma - Remove timings
|
|
||||||
@NotNull
|
|
||||||
@io.papermc.paper.annotation.DoNotUse // Purpur
|
|
||||||
Timing startTiming();
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * <p>Stops timing and records the data. Propagates the data up to group handlers.</p>
|
|
||||||
- *
|
|
||||||
- * Will automatically be called when this Timing is used with try-with-resources
|
|
||||||
- */
|
|
||||||
@io.papermc.paper.annotation.DoNotUse // Purpur
|
|
||||||
void stopTiming();
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Starts timing the execution until {@link #stopTiming()} is called.
|
|
||||||
- *
|
|
||||||
- * But only if we are on the primary thread.
|
|
||||||
- *
|
|
||||||
- * @return Timing
|
|
||||||
- */
|
|
||||||
@NotNull
|
|
||||||
@io.papermc.paper.annotation.DoNotUse // Purpur
|
|
||||||
Timing startTimingIfSync();
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * <p>Stops timing and records the data. Propagates the data up to group handlers.</p>
|
|
||||||
- *
|
|
||||||
- * <p>Will automatically be called when this Timing is used with try-with-resources</p>
|
|
||||||
- *
|
|
||||||
- * But only if we are on the primary thread.
|
|
||||||
- */
|
|
||||||
@io.papermc.paper.annotation.DoNotUse // Purpur
|
|
||||||
void stopTimingIfSync();
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * @deprecated Doesn't do anything - Removed
|
|
||||||
- */
|
|
||||||
@Deprecated
|
|
||||||
@io.papermc.paper.annotation.DoNotUse // Purpur
|
|
||||||
void abort();
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Used internally to get the actual backing Handler in the case of delegated Handlers
|
|
||||||
- *
|
|
||||||
- * @return TimingHandler
|
|
||||||
- */
|
|
||||||
@Nullable
|
|
||||||
TimingHandler getTimingHandler();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@io.papermc.paper.annotation.DoNotUse // Purpur
|
|
||||||
void close();
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingData.java b/src/main/java/co/aikar/timings/TimingData.java
|
|
||||||
index a5d13a1e44edb861f45c83a9b4309fbf799d407d..51449d3bbf204f7fee4730af80121bdc1e2c467d 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingData.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingData.java
|
|
||||||
@@ -23,17 +23,19 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import java.util.List;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import static co.aikar.util.JSONUtil.toArray;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>Lightweight object for tracking timing data</p>
|
|
||||||
*
|
|
||||||
* This is broken out to reduce memory usage
|
|
||||||
*/
|
|
||||||
-class TimingData {
|
|
||||||
+interface TimingData { /* // Plazma - Remove timings
|
|
||||||
private final int id;
|
|
||||||
private int count = 0;
|
|
||||||
private int lagCount = 0;
|
|
||||||
@@ -119,4 +121,5 @@ class TimingData {
|
|
||||||
void setCurTickTotal(long curTickTotal) {
|
|
||||||
this.curTickTotal = curTickTotal;
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java
|
|
||||||
index 199789d56d22fcb1b77ebd56805cc28aa5a5ab0a..2a070b9882462226be4547da9a47907df2f64b9d 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingHandler.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingHandler.java
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import co.aikar.util.LoadingIntMap;
|
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
|
||||||
|
|
||||||
@@ -35,8 +36,9 @@ import java.util.logging.Logger;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
-class TimingHandler implements Timing {
|
|
||||||
+interface TimingHandler { /* implements Timing { // Plazma - Remove timings
|
|
||||||
|
|
||||||
private static AtomicInteger idPool = new AtomicInteger(1);
|
|
||||||
private static Deque<TimingHandler> TIMING_STACK = new ArrayDeque<>();
|
|
||||||
@@ -163,9 +165,6 @@ class TimingHandler implements Timing {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Reset this timer, setting all values to zero.
|
|
||||||
- */
|
|
||||||
void reset(boolean full) {
|
|
||||||
record.reset();
|
|
||||||
if (full) {
|
|
||||||
@@ -194,9 +193,6 @@ class TimingHandler implements Timing {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * This is simply for the Closeable interface so it can be used with try-with-resources ()
|
|
||||||
- */
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
stopTimingIfSync();
|
|
||||||
@@ -223,4 +219,5 @@ class TimingHandler implements Timing {
|
|
||||||
}
|
|
||||||
return clonedChildren;
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
|
|
||||||
index 02e88db63be2d5e31da6b65157ba7b971b1f10f3..bda95eeacd244892ea3a114bfdcb8b24dfdfccfa 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingHistory.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import co.aikar.timings.TimingHistory.RegionData.RegionId;
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
@@ -49,10 +50,11 @@ import org.jetbrains.annotations.Nullable;
|
|
||||||
import static co.aikar.timings.TimingsManager.FULL_SERVER_TICK;
|
|
||||||
import static co.aikar.timings.TimingsManager.MINUTE_REPORTS;
|
|
||||||
import static co.aikar.util.JSONUtil.*;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
@SuppressWarnings({"deprecation", "SuppressionAnnotation", "Convert2Lambda", "Anonymous2MethodRef"})
|
|
||||||
-public class TimingHistory {
|
|
||||||
+interface TimingHistory { /*
|
|
||||||
public static long lastMinuteTime;
|
|
||||||
public static long timedTicks;
|
|
||||||
public static long playerTicks;
|
|
||||||
@@ -352,4 +354,5 @@ public class TimingHistory {
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingHistoryEntry.java b/src/main/java/co/aikar/timings/TimingHistoryEntry.java
|
|
||||||
index 86d5ac6bd0d7d0003688761aceb3f3343575319f..c862c14eb99ac9c55cfb367cf3d8c2db59f8a50e 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingHistoryEntry.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingHistoryEntry.java
|
|
||||||
@@ -23,14 +23,16 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import static co.aikar.util.JSONUtil.toArrayMapper;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
-class TimingHistoryEntry {
|
|
||||||
+interface TimingHistoryEntry { /* // Plazma - Remove timings
|
|
||||||
final TimingData data;
|
|
||||||
private final TimingData[] children;
|
|
||||||
|
|
||||||
@@ -55,4 +57,5 @@ class TimingHistoryEntry {
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingIdentifier.java b/src/main/java/co/aikar/timings/TimingIdentifier.java
|
|
||||||
index df142a89b8c43acb81eb383eac0ef048a1f49a6e..b273b4bc96cc756fa246b8b4c8efa1cac23cd957 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingIdentifier.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingIdentifier.java
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import co.aikar.util.LoadingMap;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
@@ -34,16 +35,14 @@ import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>Used as a basis for fast HashMap key comparisons for the Timing Map.</p>
|
|
||||||
*
|
|
||||||
* This class uses interned strings giving us the ability to do an identity check instead of equals() on the strings
|
|
||||||
*/
|
|
||||||
-final class TimingIdentifier {
|
|
||||||
- /**
|
|
||||||
- * Holds all groups. Autoloads on request for a group by name.
|
|
||||||
- */
|
|
||||||
+interface TimingIdentifier { /* // Plazma - Remove timings
|
|
||||||
static final Map<String, TimingGroup> GROUP_MAP = LoadingMap.of(new ConcurrentHashMap<>(64, .5F), TimingGroup::new);
|
|
||||||
private static final TimingGroup DEFAULT_GROUP = getGroup("Minecraft");
|
|
||||||
final String group;
|
|
||||||
@@ -113,4 +112,5 @@ final class TimingIdentifier {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
|
|
||||||
index 752d54830aa8baa1450bf72da03ae55ed30293c2..d2bab3cc02f7dfef2852cd705870351c81376061 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/Timings.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/Timings.java
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.collect.EvictingQueue;
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
@@ -39,13 +40,14 @@ import java.util.Queue;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Timings will likely be replaced with Spark in the future
|
|
||||||
*/
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
@SuppressWarnings({"UnusedDeclaration", "WeakerAccess", "SameParameterValue"})
|
|
||||||
-public final class Timings {
|
|
||||||
+interface Timings { /* // Plazma - Remove timings
|
|
||||||
|
|
||||||
final static List<CommandSender> requestingReport = Lists.newArrayList();
|
|
||||||
private static final int MAX_HISTORY_FRAMES = 12;
|
|
||||||
@@ -58,13 +60,6 @@ public final class Timings {
|
|
||||||
|
|
||||||
private Timings() {}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Returns a Timing for a plugin corresponding to a name.
|
|
||||||
- *
|
|
||||||
- * @param plugin Plugin to own the Timing
|
|
||||||
- * @param name Name of Timing
|
|
||||||
- * @return Handler
|
|
||||||
- */
|
|
||||||
@NotNull
|
|
||||||
public static Timing of(@NotNull Plugin plugin, @NotNull String name) {
|
|
||||||
Timing pluginHandler = null;
|
|
||||||
@@ -74,18 +69,6 @@ public final class Timings {
|
|
||||||
return of(plugin, name, pluginHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * <p>Returns a handler that has a groupHandler timer handler. Parent timers should not have their
|
|
||||||
- * start/stop methods called directly, as the children will call it for you.</p>
|
|
||||||
- *
|
|
||||||
- * Parent Timers are used to group multiple subsections together and get a summary of them combined
|
|
||||||
- * Parent Handler can not be changed after first call
|
|
||||||
- *
|
|
||||||
- * @param plugin Plugin to own the Timing
|
|
||||||
- * @param name Name of Timing
|
|
||||||
- * @param groupHandler Parent handler to mirror .start/stop calls to
|
|
||||||
- * @return Timing Handler
|
|
||||||
- */
|
|
||||||
@NotNull
|
|
||||||
public static Timing of(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) {
|
|
||||||
Preconditions.checkNotNull(plugin, "Plugin can not be null");
|
|
||||||
@@ -93,34 +76,11 @@ public final class Timings {
|
|
||||||
return TimingsManager.getHandler(plugin.getName(), name, groupHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Returns a Timing object after starting it, useful for Java7 try-with-resources.
|
|
||||||
- *
|
|
||||||
- * try (Timing ignored = Timings.ofStart(plugin, someName)) {
|
|
||||||
- * // timed section
|
|
||||||
- * }
|
|
||||||
- *
|
|
||||||
- * @param plugin Plugin to own the Timing
|
|
||||||
- * @param name Name of Timing
|
|
||||||
- * @return Timing Handler
|
|
||||||
- */
|
|
||||||
@NotNull
|
|
||||||
public static Timing ofStart(@NotNull Plugin plugin, @NotNull String name) {
|
|
||||||
return ofStart(plugin, name, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Returns a Timing object after starting it, useful for Java7 try-with-resources.
|
|
||||||
- *
|
|
||||||
- * try (Timing ignored = Timings.ofStart(plugin, someName, groupHandler)) {
|
|
||||||
- * // timed section
|
|
||||||
- * }
|
|
||||||
- *
|
|
||||||
- * @param plugin Plugin to own the Timing
|
|
||||||
- * @param name Name of Timing
|
|
||||||
- * @param groupHandler Parent handler to mirror .start/stop calls to
|
|
||||||
- * @return Timing Handler
|
|
||||||
- */
|
|
||||||
@NotNull
|
|
||||||
public static Timing ofStart(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) {
|
|
||||||
Timing timing = of(plugin, name, groupHandler);
|
|
||||||
@@ -128,22 +88,10 @@ public final class Timings {
|
|
||||||
return timing;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Gets whether or not the Spigot Timings system is enabled
|
|
||||||
- *
|
|
||||||
- * @return Enabled or not
|
|
||||||
- */
|
|
||||||
public static boolean isTimingsEnabled() {
|
|
||||||
return timingsEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * <p>Sets whether or not the Spigot Timings system should be enabled</p>
|
|
||||||
- *
|
|
||||||
- * Calling this will reset timing data.
|
|
||||||
- *
|
|
||||||
- * @param enabled Should timings be reported
|
|
||||||
- */
|
|
||||||
public static void setTimingsEnabled(boolean enabled) {
|
|
||||||
// Purpur start - we don't do that here...
|
|
||||||
timingsEnabled = false;
|
|
||||||
@@ -182,51 +130,19 @@ public final class Timings {
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * <p>Sets whether or not the Timings should monitor at Verbose level.</p>
|
|
||||||
- *
|
|
||||||
- * <p>When Verbose is disabled, high-frequency timings will not be available.</p>
|
|
||||||
- *
|
|
||||||
- * @return Enabled or not
|
|
||||||
- */
|
|
||||||
public static boolean isVerboseTimingsEnabled() {
|
|
||||||
return verboseEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * <p>Sets whether or not the Timings should monitor at Verbose level.</p>
|
|
||||||
- *
|
|
||||||
- * When Verbose is disabled, high-frequency timings will not be available.
|
|
||||||
- * Calling this will reset timing data.
|
|
||||||
- *
|
|
||||||
- * @param enabled Should high-frequency timings be reported
|
|
||||||
- */
|
|
||||||
public static void setVerboseTimingsEnabled(boolean enabled) {
|
|
||||||
verboseEnabled = enabled;
|
|
||||||
TimingsManager.needsRecheckEnabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * <p>Gets the interval between Timing History report generation.</p>
|
|
||||||
- *
|
|
||||||
- * Defaults to 5 minutes (6000 ticks)
|
|
||||||
- *
|
|
||||||
- * @return Interval in ticks
|
|
||||||
- */
|
|
||||||
public static int getHistoryInterval() {
|
|
||||||
return historyInterval;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * <p>Sets the interval between Timing History report generations.</p>
|
|
||||||
- *
|
|
||||||
- * <p>Defaults to 5 minutes (6000 ticks)</p>
|
|
||||||
- *
|
|
||||||
- * This will recheck your history length, so lowering this value will lower your
|
|
||||||
- * history length if you need more than 60 history windows.
|
|
||||||
- *
|
|
||||||
- * @param interval Interval in ticks
|
|
||||||
- */
|
|
||||||
public static void setHistoryInterval(int interval) {
|
|
||||||
historyInterval = Math.max(20*60, interval);
|
|
||||||
// Recheck the history length with the new Interval
|
|
||||||
@@ -235,28 +151,10 @@ public final class Timings {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Gets how long in ticks Timings history is kept for the server.
|
|
||||||
- *
|
|
||||||
- * Defaults to 1 hour (72000 ticks)
|
|
||||||
- *
|
|
||||||
- * @return Duration in Ticks
|
|
||||||
- */
|
|
||||||
public static int getHistoryLength() {
|
|
||||||
return historyLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Sets how long Timing History reports are kept for the server.
|
|
||||||
- *
|
|
||||||
- * Defaults to 1 hours(72000 ticks)
|
|
||||||
- *
|
|
||||||
- * This value is capped at a maximum of getHistoryInterval() * MAX_HISTORY_FRAMES (12)
|
|
||||||
- *
|
|
||||||
- * Will not reset Timing Data but may truncate old history if the new length is less than old length.
|
|
||||||
- *
|
|
||||||
- * @param length Duration in ticks
|
|
||||||
- */
|
|
||||||
public static void setHistoryLength(int length) {
|
|
||||||
// Cap at 12 History Frames, 1 hour at 5 minute frames.
|
|
||||||
int maxLength = historyInterval * MAX_HISTORY_FRAMES;
|
|
||||||
@@ -276,19 +174,10 @@ public final class Timings {
|
|
||||||
TimingsManager.HISTORY.addAll(oldQueue);
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Resets all Timing Data
|
|
||||||
- */
|
|
||||||
public static void reset() {
|
|
||||||
TimingsManager.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Generates a report and sends it to the specified command sender.
|
|
||||||
- *
|
|
||||||
- * If sender is null, ConsoleCommandSender will be used.
|
|
||||||
- * @param sender The sender to send to, or null to use the ConsoleCommandSender
|
|
||||||
- */
|
|
||||||
public static void generateReport(@Nullable CommandSender sender) {
|
|
||||||
if (sender == null) {
|
|
||||||
sender = Bukkit.getConsoleSender();
|
|
||||||
@@ -296,22 +185,11 @@ public final class Timings {
|
|
||||||
requestingReport.add(sender);
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Generates a report and sends it to the specified listener.
|
|
||||||
- * Use with {@link org.bukkit.command.BufferedCommandSender} to get full response when done!
|
|
||||||
- * @param sender The listener to send responses too.
|
|
||||||
- */
|
|
||||||
public static void generateReport(@NotNull TimingsReportListener sender) {
|
|
||||||
Preconditions.checkNotNull(sender);
|
|
||||||
requestingReport.add(sender);
|
|
||||||
}
|
|
||||||
|
|
||||||
- /*
|
|
||||||
- =================
|
|
||||||
- Protected API: These are for internal use only in Bukkit/CraftBukkit
|
|
||||||
- These do not have isPrimaryThread() checks in the startTiming/stopTiming
|
|
||||||
- =================
|
|
||||||
- */
|
|
||||||
@NotNull
|
|
||||||
static TimingHandler ofSafe(@NotNull String name) {
|
|
||||||
return ofSafe(null, name, null);
|
|
||||||
@@ -335,5 +213,6 @@ public final class Timings {
|
|
||||||
static TimingHandler ofSafe(@Nullable String groupName, @NotNull String name, @Nullable Timing groupHandler) {
|
|
||||||
return TimingsManager.getHandler(groupName, name, groupHandler);
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
|
|
||||||
index 1abfcee0f6d632f4cd8d74b4994a90c9ea9d254c..18ddc321c4a23689d93c4340e0010dc67e84f138 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingsCommand.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
|
|
||||||
@@ -61,6 +61,7 @@ public class TimingsCommand extends BukkitCommand {
|
|
||||||
sender.sendMessage(mm.deserialize("<gold><click:open_url:'https://spark.lucko.me/docs/Command-Usage'>https://spark.lucko.me/docs/Command-Usage</click>"));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
+ /* // Plazma - Remove timings
|
|
||||||
if (args.length < 1) {
|
|
||||||
sender.sendMessage(text("Usage: " + this.usageMessage, NamedTextColor.RED));
|
|
||||||
return true;
|
|
||||||
@@ -109,6 +110,7 @@ public class TimingsCommand extends BukkitCommand {
|
|
||||||
} else {
|
|
||||||
sender.sendMessage(text("Usage: " + this.usageMessage, NamedTextColor.RED));
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java
|
|
||||||
index 5e1558ca3ffeeaf2645fa003965474a442d650bf..f6aa204db5ef216e1eb06be5e5e307067cfcf05c 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingsManager.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingsManager.java
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import co.aikar.util.LoadingMap;
|
|
||||||
import com.google.common.collect.EvictingQueue;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
@@ -38,12 +39,13 @@ import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Timings will likely be replaced with Spark in the future
|
|
||||||
*/
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
-public final class TimingsManager {
|
|
||||||
+interface TimingsManager { /* // Plazma - Remove timings
|
|
||||||
static final Map<TimingIdentifier, TimingHandler> TIMING_MAP = LoadingMap.of(
|
|
||||||
new ConcurrentHashMap<>(4096, .5F), TimingHandler::new
|
|
||||||
);
|
|
||||||
@@ -65,17 +67,10 @@ public final class TimingsManager {
|
|
||||||
|
|
||||||
private TimingsManager() {}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Resets all timing data on the next tick
|
|
||||||
- */
|
|
||||||
static void reset() {
|
|
||||||
needsFullReset = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Ticked every tick by CraftBukkit to count the number of times a timer
|
|
||||||
- * caused TPS loss.
|
|
||||||
- */
|
|
||||||
static void tick() {
|
|
||||||
if (Timings.timingsEnabled) {
|
|
||||||
boolean violated = FULL_SERVER_TICK.isViolated();
|
|
||||||
@@ -139,16 +134,6 @@ public final class TimingsManager {
|
|
||||||
return TIMING_MAP.get(new TimingIdentifier(group, name, parent));
|
|
||||||
}
|
|
||||||
|
|
||||||
-
|
|
||||||
- /**
|
|
||||||
- * <p>Due to access restrictions, we need a helper method to get a Command TimingHandler with String group</p>
|
|
||||||
- *
|
|
||||||
- * Plugins should never call this
|
|
||||||
- *
|
|
||||||
- * @param pluginName Plugin this command is associated with
|
|
||||||
- * @param command Command to get timings for
|
|
||||||
- * @return TimingHandler
|
|
||||||
- */
|
|
||||||
@NotNull
|
|
||||||
public static Timing getCommandTiming(@Nullable String pluginName, @NotNull Command command) {
|
|
||||||
Plugin plugin = null;
|
|
||||||
@@ -170,13 +155,6 @@ public final class TimingsManager {
|
|
||||||
return Timings.ofSafe(plugin, "Command: " + pluginName + ":" + command.getTimingName());
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Looks up the class loader for the specified class, and if it is a PluginClassLoader, return the
|
|
||||||
- * Plugin that created this class.
|
|
||||||
- *
|
|
||||||
- * @param clazz Class to check
|
|
||||||
- * @return Plugin if created by a plugin
|
|
||||||
- */
|
|
||||||
@Nullable
|
|
||||||
public static Plugin getPluginByClassloader(@Nullable Class<?> clazz) {
|
|
||||||
if (clazz == null) {
|
|
||||||
@@ -189,4 +167,5 @@ public final class TimingsManager {
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
|
||||||
index 3af5b8ea795311582044c712de50d29412024b77..d5b52c8bf0bd23d9e3c0ba708c758694771a07ac 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
|
||||||
@@ -1,5 +1,6 @@
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
@@ -11,10 +12,11 @@ import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
@SuppressWarnings("WeakerAccess")
|
|
||||||
-public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender {
|
|
||||||
+interface TimingsReportListener { /* implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender { // Plazma - Remove timings
|
|
||||||
private final List<CommandSender> senders;
|
|
||||||
private final Runnable onDone;
|
|
||||||
private String timingsURL;
|
|
||||||
@@ -84,4 +86,5 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
|
||||||
this.senders.add(Bukkit.getConsoleSender());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/UnsafeTimingHandler.java b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java
|
|
||||||
index 632c4961515f5052551f841cfa840e60bba7a257..0656b8e86eaee12161a8bb16d1b46301fd5cea13 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/UnsafeTimingHandler.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java
|
|
||||||
@@ -23,10 +23,12 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
-class UnsafeTimingHandler extends TimingHandler {
|
|
||||||
+interface UnsafeTimingHandler { /* extends TimingHandler { // Plazma - Remove timings
|
|
||||||
|
|
||||||
UnsafeTimingHandler(@NotNull TimingIdentifier id) {
|
|
||||||
super(id);
|
|
||||||
@@ -50,4 +52,5 @@ class UnsafeTimingHandler extends TimingHandler {
|
|
||||||
checkThread();
|
|
||||||
super.stopTiming();
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
|
|
||||||
index b791358f90fe92bc2264d9a26492245763813af3..8c10f2dc17cfede217f3a1b615777ea4dd308f76 100644
|
|
||||||
--- a/src/main/java/org/bukkit/command/Command.java
|
|
||||||
+++ b/src/main/java/org/bukkit/command/Command.java
|
|
||||||
@@ -33,7 +33,7 @@ public abstract class Command {
|
|
||||||
protected String usageMessage;
|
|
||||||
private String permission;
|
|
||||||
private net.kyori.adventure.text.Component permissionMessage; // Paper
|
|
||||||
- public co.aikar.timings.Timing timings; // Paper
|
|
||||||
+ // public co.aikar.timings.Timing timings; // Paper // Plazma - Remove timings
|
|
||||||
@NotNull public String getTimingName() {return getName();} // Paper
|
|
||||||
|
|
||||||
protected Command(@NotNull String name) {
|
|
||||||
diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
|
||||||
index 9d4f553c04784cca63901a56a7aea62a5cae1d72..321082710aa84627405d4f1453246b6a729659cc 100644
|
|
||||||
--- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
|
||||||
+++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
|
||||||
@@ -12,7 +12,7 @@ public class FormattedCommandAlias extends Command {
|
|
||||||
|
|
||||||
public FormattedCommandAlias(@NotNull String alias, @NotNull String[] formatStrings) {
|
|
||||||
super(alias);
|
|
||||||
- timings = co.aikar.timings.TimingsManager.getCommandTiming("minecraft", this); // Spigot
|
|
||||||
+ //timings = co.aikar.timings.TimingsManager.getCommandTiming("minecraft", this); // Spigot // Plazma - Remove timings
|
|
||||||
this.formatStrings = formatStrings;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
|
||||||
index 5349f16136d9348c374a7dfe5b89a71dfcb0e66d..c0c2f7671122f767af3a94a3aadefdfa4b492f3a 100644
|
|
||||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
|
||||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
|
||||||
@@ -34,7 +34,7 @@ public class SimpleCommandMap implements CommandMap {
|
|
||||||
register("bukkit", new VersionCommand("version"));
|
|
||||||
register("bukkit", new ReloadCommand("reload"));
|
|
||||||
//register("bukkit", new PluginsCommand("plugins")); // Paper
|
|
||||||
- register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Paper
|
|
||||||
+ //register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Paper // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFallbackCommands() {
|
|
||||||
@@ -66,7 +66,7 @@ public class SimpleCommandMap implements CommandMap {
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) {
|
|
||||||
- command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Paper
|
|
||||||
+ // command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Paper // Plazma - Remove timings
|
|
||||||
label = label.toLowerCase(java.util.Locale.ENGLISH).trim();
|
|
||||||
fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim();
|
|
||||||
boolean registered = register(label, command, false, fallbackPrefix);
|
|
||||||
@@ -156,11 +156,13 @@ public class SimpleCommandMap implements CommandMap {
|
|
||||||
parsedArgs = event.getArgs();
|
|
||||||
// Purpur end
|
|
||||||
|
|
||||||
+ /* // Plazma - Remove timings
|
|
||||||
// Paper start - Plugins do weird things to workaround normal registration
|
|
||||||
if (target.timings == null) {
|
|
||||||
target.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, target);
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
try {
|
|
||||||
//try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources // Purpur
|
|
||||||
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
|
||||||
index 899d67fa782fac639fe7fb096e05c551d75bd647..1d9906c508ca916297b8e121f8826532b66f83e2 100644
|
|
||||||
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
|
||||||
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
|
||||||
@@ -707,6 +707,7 @@ public final class SimplePluginManager implements PluginManager {
|
|
||||||
Preconditions.checkArgument(plugin != null, "Plugin cannot be null");
|
|
||||||
if (true) {this.paperPluginManager.registerEvent(event, listener, priority, executor, plugin, ignoreCancelled); return;} // Paper
|
|
||||||
|
|
||||||
+ /* // Plazma - Remove timings
|
|
||||||
if (!plugin.isEnabled()) {
|
|
||||||
throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled");
|
|
||||||
}
|
|
||||||
@@ -717,6 +718,7 @@ public final class SimplePluginManager implements PluginManager {
|
|
||||||
} else {
|
|
||||||
getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled));
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@@ -946,8 +948,9 @@ public final class SimplePluginManager implements PluginManager {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useTimings() {
|
|
||||||
- if (true) {return this.paperPluginManager.useTimings();} // Paper
|
|
||||||
- return co.aikar.timings.Timings.isTimingsEnabled(); // Spigot
|
|
||||||
+ return false;
|
|
||||||
+ // if (true) {return this.paperPluginManager.useTimings();} // Paper // Plazma - Remove timings
|
|
||||||
+ // return co.aikar.timings.Timings.isTimingsEnabled(); // Spigot // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -956,7 +959,7 @@ public final class SimplePluginManager implements PluginManager {
|
|
||||||
* @param use True if per event timing code should be used
|
|
||||||
*/
|
|
||||||
public void useTimings(boolean use) {
|
|
||||||
- co.aikar.timings.Timings.setTimingsEnabled(use); // Paper
|
|
||||||
+ // co.aikar.timings.Timings.setTimingsEnabled(use); // Paper // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
|
|
||||||
// Paper start
|
|
||||||
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
||||||
index 0c6ca7588fb3d6b6497ddf032fe75e5c6c9719e5..e5d4ac1b8b4ca3846e2a9ea63f6b6eb05f7b70bd 100644
|
|
||||||
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
||||||
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
||||||
@@ -43,7 +43,7 @@ import org.bukkit.plugin.TimedRegisteredListener;
|
|
||||||
import org.bukkit.plugin.UnknownDependencyException;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
-import org.spigotmc.CustomTimingsHandler; // Spigot
|
|
||||||
+// import org.spigotmc.CustomTimingsHandler; // Spigot // Plazma - Remove timings
|
|
||||||
import org.yaml.snakeyaml.error.YAMLException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -294,7 +294,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Paper
|
|
||||||
+ EventExecutor executor = new EventExecutor() { // Paper // Plazma - Remove timings
|
|
||||||
@Override
|
|
||||||
public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { // Paper
|
|
||||||
try {
|
|
||||||
@@ -308,7 +308,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
|
||||||
throw new EventException(t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- }, plugin, method, eventClass); // Paper
|
|
||||||
+ }; // Paper // Plazma - Remove timings
|
|
||||||
if (false) { // Spigot - RL handles useTimings check now
|
|
||||||
eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
|
|
||||||
} else {
|
|
||||||
diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
|
||||||
index 9c2d605c50cbf9aefa56ec209df9f6cea1392e89..cb2bd5f58544493a5ae0d2b765be806e35639baa 100644
|
|
||||||
--- a/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
|
||||||
+++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
*/
|
|
||||||
package org.spigotmc;
|
|
||||||
|
|
||||||
+/* // Plazma - Remove timings
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.bukkit.plugin.AuthorNagException;
|
|
||||||
@@ -32,6 +33,7 @@ import co.aikar.timings.TimingsManager;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is here for legacy purposes incase any plugin used it.
|
|
||||||
@@ -39,10 +41,9 @@ import java.util.logging.Level;
|
|
||||||
* If you use this, migrate ASAP as this will be removed in the future!
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
- * @see co.aikar.timings.Timings#of
|
|
||||||
*/
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
-public final class CustomTimingsHandler {
|
|
||||||
+interface CustomTimingsHandler { /* // Plazma - Remove timings
|
|
||||||
private final Timing handler;
|
|
||||||
|
|
||||||
public CustomTimingsHandler(@NotNull String name) {
|
|
||||||
@@ -61,7 +62,7 @@ public final class CustomTimingsHandler {
|
|
||||||
handler = timing;
|
|
||||||
}
|
|
||||||
|
|
||||||
- public void startTiming() { /*handler.startTiming();*/ } // Purpur
|
|
||||||
- public void stopTiming() { /*handler.stopTiming();*/ } // Purpur
|
|
||||||
-
|
|
||||||
+ public void startTiming() { handler.startTiming(); } // Purpur // Plazma - IDE Parsing problem
|
|
||||||
+ public void stopTiming() { handler.stopTiming(); } // Purpur // Plazma - IDE Parsing problem
|
|
||||||
+ */ // Plazma - Remove timings
|
|
||||||
}
|
|
||||||
@@ -1,641 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AlphaKR93 <dev@alpha93.kr>
|
|
||||||
Date: Sat, 27 Apr 2024 14:02:18 +0900
|
|
||||||
Subject: [PATCH] Completely remove Timings
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
|
||||||
index 4b467f1af93452d13829f756d55dee18b8889d40..7e20ec279c9fb75b92ca3bf938adeeb126641aa5 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
|
||||||
@@ -1,5 +1,6 @@
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Completely remove Timings
|
|
||||||
import com.google.common.collect.MapMaker;
|
|
||||||
import io.papermc.paper.configuration.GlobalConfiguration;
|
|
||||||
import net.minecraft.commands.functions.CommandFunction;
|
|
||||||
@@ -12,10 +13,11 @@ import org.bukkit.scheduler.BukkitTask;
|
|
||||||
import org.bukkit.craftbukkit.scheduler.CraftTask;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
+ */ // Plazma - Completely remove Timings
|
|
||||||
|
|
||||||
-// TODO: Re-implement missing timers
|
|
||||||
+// TODO: Re-implement missing timers // Plazma - nah you cant
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
-public final class MinecraftTimings {
|
|
||||||
+interface MinecraftTimings { /* // Plazma - Completely remove Timings
|
|
||||||
|
|
||||||
public static final Timing serverOversleep = Timings.ofSafe("Server Oversleep");
|
|
||||||
public static final Timing playerListTimer = Timings.ofSafe("Player List");
|
|
||||||
@@ -59,12 +61,6 @@ public final class MinecraftTimings {
|
|
||||||
return Timings.ofSafe(taskName);
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Gets a timer associated with a plugins tasks.
|
|
||||||
- * @param bukkitTask
|
|
||||||
- * @param period
|
|
||||||
- * @return
|
|
||||||
- */
|
|
||||||
public static Timing getPluginTaskTimings(BukkitTask bukkitTask, long period) {
|
|
||||||
if (!bukkitTask.isSync()) {
|
|
||||||
return NullTimingHandler.NULL;
|
|
||||||
@@ -110,11 +106,6 @@ public final class MinecraftTimings {
|
|
||||||
return Timings.ofSafe(plugin, name.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Get a named timer for the specified entity type to track type specific timings.
|
|
||||||
- * @param entityType
|
|
||||||
- * @return
|
|
||||||
- */
|
|
||||||
public static Timing getEntityTimings(String entityType, String type) {
|
|
||||||
return Timings.ofSafe("Minecraft", "## tickEntity - " + entityType + " - " + type, tickEntityTimer);
|
|
||||||
}
|
|
||||||
@@ -127,11 +118,6 @@ public final class MinecraftTimings {
|
|
||||||
return Timings.ofSafe("## Sensor - " + type + " (Default rate: " + rate + ")");
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Get a named timer for the specified tile entity type to track type specific timings.
|
|
||||||
- * @param entity
|
|
||||||
- * @return
|
|
||||||
- */
|
|
||||||
public static Timing getTileEntityTimings(BlockEntity entity) {
|
|
||||||
String entityType = entity.getClass().getName();
|
|
||||||
return Timings.ofSafe("Minecraft", "## tickTileEntity - " + entityType, tickTileEntityTimer);
|
|
||||||
@@ -150,10 +136,10 @@ public final class MinecraftTimings {
|
|
||||||
public static Timing getBlockTiming(Block block) {
|
|
||||||
return Timings.ofSafe("## Scheduled Block: " + block.toString(), scheduledBlocksTimer);
|
|
||||||
}
|
|
||||||
-/*
|
|
||||||
+
|
|
||||||
public static Timing getStructureTiming(StructureGenerator structureGenerator) {
|
|
||||||
return Timings.ofSafe("Structure Generator - " + structureGenerator.getName(), structureGenerationTimer);
|
|
||||||
- }*/
|
|
||||||
+ }
|
|
||||||
|
|
||||||
public static Timing getPacketTiming(Packet packet) {
|
|
||||||
return Timings.ofSafe("## Packet - " + packet.getClass().getName(), packetProcessTimer);
|
|
||||||
@@ -178,4 +164,6 @@ public final class MinecraftTimings {
|
|
||||||
co.aikar.timings.Timings.setHistoryInterval(config.historyInterval * 20);
|
|
||||||
co.aikar.timings.Timings.setHistoryLength(config.historyLength * 20);
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Completely remove Timings
|
|
||||||
+
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
|
||||||
index b35a9f4c5f8960864c402ede8a51fb5ab9c4fcc0..46085a9c12efc6a1766e704c9bb0fbf454d60c8a 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
*/
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Completely remove Timings
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import io.papermc.paper.adventure.PaperAdventure;
|
|
||||||
import net.kyori.adventure.text.event.ClickEvent;
|
|
||||||
@@ -64,10 +65,11 @@ import static co.aikar.util.JSONUtil.toArray;
|
|
||||||
import static co.aikar.util.JSONUtil.toArrayMapper;
|
|
||||||
import static co.aikar.util.JSONUtil.toObjectMapper;
|
|
||||||
import static net.kyori.adventure.text.Component.text;
|
|
||||||
+ */ // Plazma - Completely remove Timings
|
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "SuppressionAnnotation"})
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
-public class TimingsExport extends Thread {
|
|
||||||
+interface TimingsExport { /* extends Thread { // Plazma - Completely remove Timings
|
|
||||||
|
|
||||||
private final TimingsReportListener listeners;
|
|
||||||
private final Map out;
|
|
||||||
@@ -81,9 +83,6 @@ public class TimingsExport extends Thread {
|
|
||||||
this.history = history;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /**
|
|
||||||
- * Checks if any pending reports are being requested, and builds one if needed.
|
|
||||||
- */
|
|
||||||
public static void reportTimings() {
|
|
||||||
if (Timings.requestingReport.isEmpty()) {
|
|
||||||
return;
|
|
||||||
@@ -386,4 +385,6 @@ public class TimingsExport extends Thread {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Completely remove Timings
|
|
||||||
+
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
|
||||||
index 22687667ec69a954261e55e59261286ac1b8b8cd..9115fab47c5d69aa9c563b8ade7f916b99827e4f 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
|
||||||
@@ -1,15 +1,18 @@
|
|
||||||
package co.aikar.timings;
|
|
||||||
|
|
||||||
+/* // Plazma - Completely remove Timings
|
|
||||||
import net.minecraft.server.level.ServerLevel;
|
|
||||||
import net.minecraft.world.level.Level;
|
|
||||||
import net.minecraft.world.level.storage.PrimaryLevelData;
|
|
||||||
+ */ // Plazma - Completely remove Timings
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set of timers per world, to track world specific timings.
|
|
||||||
*/
|
|
||||||
// TODO: Re-implement missing timers
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
-public class WorldTimingsHandler {
|
|
||||||
+interface WorldTimingsHandler {
|
|
||||||
+ /* // Plazma - Completely remove Timings
|
|
||||||
public final Timing mobSpawn;
|
|
||||||
public final Timing doChunkUnload;
|
|
||||||
public final Timing doPortalForcer;
|
|
||||||
@@ -137,4 +140,5 @@ public class WorldTimingsHandler {
|
|
||||||
public static Timing getTickList(ServerLevel worldserver, String timingsType) {
|
|
||||||
return Timings.ofSafe(((PrimaryLevelData) worldserver.getLevelData()).getLevelName() + " - Scheduled " + timingsType);
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Completely remove Timings
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
|
||||||
index c71daa5d3665cec2836770e5f04da222bc5f90ed..da06919b1911f87e64732716217f85d6ba606e8f 100644
|
|
||||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
|
||||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
package io.papermc.paper.configuration;
|
|
||||||
|
|
||||||
-import co.aikar.timings.MinecraftTimings;
|
|
||||||
+// import co.aikar.timings.MinecraftTimings; // Plazma - Completely remove Timings
|
|
||||||
import com.mojang.logging.LogUtils;
|
|
||||||
import io.papermc.paper.configuration.constraint.Constraints;
|
|
||||||
import io.papermc.paper.configuration.type.number.IntOr;
|
|
||||||
@@ -91,6 +91,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
public boolean useDisplayNameInQuitMessage = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* // Plazma - Completely remove Timings
|
|
||||||
@Deprecated(forRemoval = true)
|
|
||||||
public Timings timings;
|
|
||||||
|
|
||||||
@@ -113,6 +114,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
|
||||||
MinecraftTimings.processConfig(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Completely remove Timings
|
|
||||||
|
|
||||||
public Proxies proxies;
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
|
||||||
index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..2a79e3423724b5005f1918b80e06051dfcfc5bf9 100644
|
|
||||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
|
||||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
package io.papermc.paper.plugin.manager;
|
|
||||||
|
|
||||||
-import co.aikar.timings.TimedEventExecutor;
|
|
||||||
+// import co.aikar.timings.TimedEventExecutor; // Plazma - Completely remove Timings
|
|
||||||
import com.destroystokyo.paper.event.server.ServerExceptionEvent;
|
|
||||||
import com.destroystokyo.paper.exception.ServerEventException;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
@@ -95,7 +95,7 @@ class PaperEventManager {
|
|
||||||
throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled");
|
|
||||||
}
|
|
||||||
|
|
||||||
- executor = new TimedEventExecutor(executor, plugin, null, event);
|
|
||||||
+ // executor = new TimedEventExecutor(executor, plugin, null, event); // Plazma - Completely remove Timings
|
|
||||||
this.getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled));
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ class PaperEventManager {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- EventExecutor executor = new TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass);
|
|
||||||
+ EventExecutor executor = EventExecutor.create(method, eventClass); // Plazma - Completely remove Timings
|
|
||||||
eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java
|
|
||||||
index dab211c458311869c61779305580a1c7da830f71..efa194f99807a61c02923dbaf58fac542bd9229f 100644
|
|
||||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java
|
|
||||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java
|
|
||||||
@@ -227,7 +227,8 @@ public class PaperPluginManagerImpl implements PluginManager, DependencyContext
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useTimings() {
|
|
||||||
- return co.aikar.timings.Timings.isTimingsEnabled();
|
|
||||||
+ return false;
|
|
||||||
+ // return co.aikar.timings.Timings.isTimingsEnabled(); // Plazma - Completely remove Timings
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
|
||||||
index 620edb63cacd15e38f7fc859efd4095bfb5e5f72..85e6a5d5d3266d0d042ee62a89adbb5f0d3880e6 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
|
||||||
@@ -49,7 +49,7 @@ public class PacketUtils {
|
|
||||||
try { // Paper - detailed watchdog information
|
|
||||||
if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players
|
|
||||||
if (listener.shouldHandleMessage(packet)) {
|
|
||||||
- co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
|
|
||||||
+ // co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings // Plazma - Completely remove Timings
|
|
||||||
try { // Paper - timings // Purpur
|
|
||||||
packet.handle(listener);
|
|
||||||
} catch (Exception exception) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
index 93564ba734f6b82ffde07b1321180fc24a0ff50f..25d560594d2fb38a6b94bb4b1677ff79603d5645 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
@@ -3,7 +3,7 @@ package net.minecraft.server;
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.base.Splitter;
|
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
-import co.aikar.timings.Timings;
|
|
||||||
+// import co.aikar.timings.Timings; // Plazma - Completely remove Timings
|
|
||||||
import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
|
|
||||||
import com.google.common.base.Stopwatch;
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
@@ -189,7 +189,7 @@ import org.bukkit.craftbukkit.Main;
|
|
||||||
import org.bukkit.event.server.ServerLoadEvent;
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
-import co.aikar.timings.MinecraftTimings; // Paper
|
|
||||||
+//import co.aikar.timings.MinecraftTimings; // Paper // Plazma - Completely remove Timings
|
|
||||||
|
|
||||||
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable {
|
|
||||||
|
|
||||||
@@ -975,7 +975,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
||||||
|
|
||||||
MinecraftServer.LOGGER.info("Stopping server");
|
|
||||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
|
||||||
- MinecraftTimings.stopServer(); // Paper
|
|
||||||
+ //MinecraftTimings.stopServer(); // Paper // Plazma - Completely remove Timings
|
|
||||||
// Purpur start
|
|
||||||
if (upnp) {
|
|
||||||
if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
index 2a73508dd8a59c6af8b65ab2db97b6e20b104c57..27b14e60bb7ef73a73d49c561056ee42b2d7637f 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
@@ -58,7 +58,7 @@ import org.apache.logging.log4j.Level;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.io.IoBuilder;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
-import co.aikar.timings.MinecraftTimings; // Paper
|
|
||||||
+// import co.aikar.timings.MinecraftTimings; // Paper // Plazma - Completely remove Timings
|
|
||||||
import org.bukkit.event.server.ServerCommandEvent;
|
|
||||||
import org.bukkit.craftbukkit.util.Waitable; // Paper
|
|
||||||
import org.bukkit.event.server.RemoteServerCommandEvent;
|
|
||||||
@@ -830,7 +830,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
||||||
}
|
|
||||||
};
|
|
||||||
waitableArray[0] = waitable;
|
|
||||||
- co.aikar.timings.Timings.generateReport(new co.aikar.timings.TimingsReportListener(sender, waitable));
|
|
||||||
+ // co.aikar.timings.Timings.generateReport(new co.aikar.timings.TimingsReportListener(sender, waitable)); // Plazma - Completely remove Timings
|
|
||||||
} else {
|
|
||||||
// Paper end
|
|
||||||
ConsoleInput serverCommand = new ConsoleInput(event.getCommand(), wrapper);
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
||||||
index d1056b1c91edc3ec06c78e65c8fa2dd1f000c43f..3f78dfb3af583e6b0a960b1d87393744a9da3baf 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
package net.minecraft.server.level;
|
|
||||||
|
|
||||||
-import co.aikar.timings.Timing; // Paper
|
|
||||||
+// import co.aikar.timings.Timing; // Paper // Plazma - Completely remove Timings
|
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
import com.google.common.collect.ImmutableList.Builder;
|
|
||||||
import com.google.common.collect.Iterables;
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
||||||
index 80789e6a31cb0dbbe780154f3bb7353685950e07..84491e05bfbd045c79b48e8524a8a874cad0964b 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
package net.minecraft.server.level;
|
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
-import co.aikar.timings.TimingHistory; // Paper
|
|
||||||
+// import co.aikar.timings.TimingHistory; // Paper // Plazma - Completely remove Timings
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.mojang.datafixers.DataFixer;
|
|
||||||
import com.mojang.datafixers.util.Pair;
|
|
||||||
@@ -1463,9 +1463,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
||||||
currentlyTickingEntity.lazySet(entity);
|
|
||||||
}
|
|
||||||
// Paper end - log detailed entity tick information
|
|
||||||
- ++TimingHistory.entityTicks; // Paper - timings
|
|
||||||
+ // ++TimingHistory.entityTicks; // Paper - timings // Plazma - Completely remove Timings
|
|
||||||
// Spigot start
|
|
||||||
- co.aikar.timings.Timing timer; // Paper
|
|
||||||
+ // co.aikar.timings.Timing timer; // Paper // Plazma - Completely remove Timings
|
|
||||||
/*if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { // Paper - comment out - EAR 2, reimplement below
|
|
||||||
entity.tickCount++;
|
|
||||||
timer = entity.getType().inactiveTickTimer.startTiming(); try { // Paper - timings
|
|
||||||
@@ -1488,7 +1488,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
||||||
});*/ // Purpur
|
|
||||||
//gameprofilerfiller.incrementCounter("tickNonPassenger"); // Purpur
|
|
||||||
if (isActive) { // Paper - EAR 2
|
|
||||||
- TimingHistory.activatedEntityTicks++;
|
|
||||||
+ // TimingHistory.activatedEntityTicks++; // Plazma - Completely remove Timings
|
|
||||||
entity.tick();
|
|
||||||
entity.postTick(); // CraftBukkit
|
|
||||||
} else { entity.inactiveTick(); } // Paper - EAR 2
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
index ef4b1fb1532e1939d9a7e5337edc80b334b78318..5c0786fd473e16f931ab1c24bc622fcac40301c3 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
package net.minecraft.server.players;
|
|
||||||
|
|
||||||
-import co.aikar.timings.MinecraftTimings;
|
|
||||||
+// import co.aikar.timings.MinecraftTimings; // Plazma - Completely remove Timings
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
|
||||||
index a9e2a758669550530eb29475ba99fe42e520f6ae..c74e18522c9569eb405b3d02097f5e9b3a8c9f86 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
|
||||||
@@ -344,10 +344,10 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
|
||||||
this(factory, spawnGroup, saveable, summonable, fireImmune, spawnableFarFromPlayer, canSpawnInside, dimensions, maxTrackDistance, trackTickInterval, requiredFeatures, "custom");
|
|
||||||
}
|
|
||||||
public EntityType(EntityType.EntityFactory<T> factory, MobCategory spawnGroup, boolean saveable, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, ImmutableSet<Block> canSpawnInside, EntityDimensions dimensions, int maxTrackDistance, int trackTickInterval, FeatureFlagSet requiredFeatures, String id) {
|
|
||||||
- this.tickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "tick");
|
|
||||||
- this.inactiveTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "inactiveTick");
|
|
||||||
- this.passengerTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "passengerTick");
|
|
||||||
- this.passengerInactiveTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "passengerInactiveTick");
|
|
||||||
+ // this.tickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "tick"); // Plazma - Completely remove Timings
|
|
||||||
+ // this.inactiveTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "inactiveTick"); // Plazma - Completely remove Timings
|
|
||||||
+ // this.passengerTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "passengerTick"); // Plazma - Completely remove Timings
|
|
||||||
+ // this.passengerInactiveTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "passengerInactiveTick"); // Plazma - Completely remove Timings
|
|
||||||
// Paper end
|
|
||||||
this.builtInRegistryHolder = BuiltInRegistries.ENTITY_TYPE.createIntrusiveHolder(this);
|
|
||||||
this.factory = factory;
|
|
||||||
@@ -721,10 +721,10 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
|
||||||
}
|
|
||||||
|
|
||||||
// Paper start - timings
|
|
||||||
- public final co.aikar.timings.Timing tickTimer;
|
|
||||||
- public final co.aikar.timings.Timing inactiveTickTimer;
|
|
||||||
- public final co.aikar.timings.Timing passengerTickTimer;
|
|
||||||
- public final co.aikar.timings.Timing passengerInactiveTickTimer;
|
|
||||||
+ // public final co.aikar.timings.Timing tickTimer; // Plazma - Completely remove Timings
|
|
||||||
+ // public final co.aikar.timings.Timing inactiveTickTimer; // Plazma - Completely remove Timings
|
|
||||||
+ // public final co.aikar.timings.Timing passengerTickTimer; // Plazma - Completely remove Timings
|
|
||||||
+ // public final co.aikar.timings.Timing passengerInactiveTickTimer; // Plazma - Completely remove Timings
|
|
||||||
// Paper end
|
|
||||||
public boolean trackDeltas() {
|
|
||||||
return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
|
|
||||||
index 8f7d9f8a5138bcd572691d66c814aaa7c308b317..5db4a2b790680ed86a6106473d43fb0b2887f875 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
|
|
||||||
@@ -16,7 +16,7 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
|
|
||||||
private final int maxDuration;
|
|
||||||
// Paper start - configurable behavior tick rate and timings
|
|
||||||
private final String configKey;
|
|
||||||
- private final co.aikar.timings.Timing timing;
|
|
||||||
+ // private final co.aikar.timings.Timing timing; // Plazma - Completely remove Timings
|
|
||||||
// Paper end - configurable behavior tick rate and timings
|
|
||||||
|
|
||||||
public Behavior(Map<MemoryModuleType<?>, MemoryStatus> requiredMemoryState) {
|
|
||||||
@@ -38,7 +38,7 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
|
|
||||||
key = key.substring(lastSeparator + 1);
|
|
||||||
}
|
|
||||||
this.configKey = key.toLowerCase(java.util.Locale.ROOT);
|
|
||||||
- this.timing = co.aikar.timings.MinecraftTimings.getBehaviorTimings(configKey);
|
|
||||||
+ // this.timing = co.aikar.timings.MinecraftTimings.getBehaviorTimings(configKey); // Plazma - Completely remove Timings
|
|
||||||
// Paper end - configurable behavior tick rate and timings
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
|
||||||
index e553f52de2e0b30511ac1b73cb436374017cd7d7..21f4e5c3dd3e528f3184940a2351259a02fcb131 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
|
||||||
@@ -28,7 +28,7 @@ public abstract class Sensor<E extends LivingEntity> {
|
|
||||||
private long timeToTick;
|
|
||||||
// Paper start - configurable sensor tick rate and timings
|
|
||||||
private final String configKey;
|
|
||||||
- private final co.aikar.timings.Timing timing;
|
|
||||||
+ // private final co.aikar.timings.Timing timing; // Plazma - Completely remove Timings
|
|
||||||
// Paper end
|
|
||||||
|
|
||||||
public Sensor(int senseInterval) {
|
|
||||||
@@ -39,7 +39,7 @@ public abstract class Sensor<E extends LivingEntity> {
|
|
||||||
key = key.substring(lastSeparator + 1);
|
|
||||||
}
|
|
||||||
this.configKey = key.toLowerCase(java.util.Locale.ROOT);
|
|
||||||
- this.timing = co.aikar.timings.MinecraftTimings.getSensorTimings(configKey, senseInterval);
|
|
||||||
+ // this.timing = co.aikar.timings.MinecraftTimings.getSensorTimings(configKey, senseInterval); // Plazma - Completely remove Timings
|
|
||||||
// Paper end
|
|
||||||
this.scanRate = senseInterval;
|
|
||||||
this.timeToTick = (long)RANDOM.nextInt(senseInterval);
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
|
||||||
index 16e6716f70d5b9090f29f8b2320302d98dd087c2..c20f3dfdfb4efced687da115be0293887d69f966 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
||||||
@@ -179,7 +179,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
||||||
// Plazma end - Configurable Plazma
|
|
||||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
|
||||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
|
|
||||||
- public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
|
||||||
+ // public final co.aikar.timings.WorldTimingsHandler timings; // Paper // Plazma - Completely remove Timings
|
|
||||||
public static BlockPos lastPhysicsProblem; // Spigot
|
|
||||||
private org.spigotmc.TickLimiter entityLimiter;
|
|
||||||
private org.spigotmc.TickLimiter tileLimiter;
|
|
||||||
@@ -352,7 +352,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
||||||
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
|
|
||||||
});
|
|
||||||
// CraftBukkit end
|
|
||||||
- this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
|
|
||||||
+ // this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings // Plazma - Completely remove Timings
|
|
||||||
this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper - Option to keep spawn chunks loaded
|
|
||||||
this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
|
|
||||||
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
|
|
||||||
@@ -1362,7 +1362,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
||||||
|
|
||||||
//this.timings.tileEntityTick.stopTiming(); // Spigot // Purpur
|
|
||||||
this.tickingBlockEntities = false;
|
|
||||||
- co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
|
|
||||||
+ // co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper // Plazma - Completely remove Timings
|
|
||||||
//gameprofilerfiller.pop(); // Purpur
|
|
||||||
this.spigotConfig.currentPrimedTnt = 0; // Spigot
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
|
||||||
index 284149925440f413d23a9ec3ce704e70a74f4c08..608a00e6be7c8c5ae922aaa738f875559ab708f5 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
|
||||||
@@ -114,6 +114,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
|
||||||
this != Blocks.STRUCTURE_BLOCK &&
|
|
||||||
this != Blocks.JIGSAW;
|
|
||||||
}
|
|
||||||
+ /* // Plazma - Completely remove Timings
|
|
||||||
public co.aikar.timings.Timing timing;
|
|
||||||
public co.aikar.timings.Timing getTiming() {
|
|
||||||
if (timing == null) {
|
|
||||||
@@ -121,6 +122,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
|
||||||
}
|
|
||||||
return timing;
|
|
||||||
}
|
|
||||||
+ */ // Plazma - Completely remove Timings
|
|
||||||
// Paper end
|
|
||||||
@Nullable
|
|
||||||
private String descriptionId;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
|
||||||
index e9701ed4e5b35ace1accd2b46f082191d8ab6497..f2200a6098210ae3137e266a1f079ffd6971504d 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
|
||||||
@@ -23,14 +23,14 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry;
|
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
-import org.spigotmc.CustomTimingsHandler; // Spigot
|
|
||||||
-import co.aikar.timings.MinecraftTimings; // Paper
|
|
||||||
-import co.aikar.timings.Timing; // Paper
|
|
||||||
+// import org.spigotmc.CustomTimingsHandler; // Spigot // Plazma - Completely remove Timings
|
|
||||||
+// import co.aikar.timings.MinecraftTimings; // Paper // Plazma - Completely remove Timings
|
|
||||||
+// import co.aikar.timings.Timing; // Paper // Plazma - Completely remove Timings
|
|
||||||
|
|
||||||
public abstract class BlockEntity {
|
|
||||||
static boolean ignoreTileUpdates; // Paper - Perf: Optimize Hoppers
|
|
||||||
|
|
||||||
- public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper
|
|
||||||
+ // public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper // Plazma - Completely remove Timings
|
|
||||||
// CraftBukkit start - data containers
|
|
||||||
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
|
||||||
public CraftPersistentDataContainer persistentDataContainer;
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
||||||
index e8df8e8520cea5d21197c61a172f7211a3a2c34d..27a106e3844309e5b7ca12d1fd2374cf20f4ba48 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
||||||
@@ -366,8 +366,8 @@ public class Main {
|
|
||||||
tryPreloadClass("org.jline.terminal.impl.MouseSupport");
|
|
||||||
tryPreloadClass("org.jline.terminal.impl.MouseSupport$1");
|
|
||||||
tryPreloadClass("org.jline.terminal.Terminal$MouseTracking");
|
|
||||||
- tryPreloadClass("co.aikar.timings.TimingHistory");
|
|
||||||
- tryPreloadClass("co.aikar.timings.TimingHistory$MinuteReport");
|
|
||||||
+ // tryPreloadClass("co.aikar.timings.TimingHistory"); // Plazma - Completely remove Timings
|
|
||||||
+ // tryPreloadClass("co.aikar.timings.TimingHistory$MinuteReport"); // Plazma - Completely remove Timings
|
|
||||||
tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext");
|
|
||||||
tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext$11");
|
|
||||||
tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext$12");
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
||||||
index 6bab5f9e40987d1a8ca9c17118d2a14135df5dff..14fd658f987f21993f334ae1524f880e3ce12b86 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
package org.bukkit.craftbukkit.scheduler;
|
|
||||||
|
|
||||||
-import co.aikar.timings.MinecraftTimings; // Paper
|
|
||||||
+// import co.aikar.timings.MinecraftTimings; // Paper // Plazma - Completely remove Timings
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
@@ -304,7 +304,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
- }){{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer();}}; // Paper
|
|
||||||
+ });//{{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer();}}; // Paper // Plazma - Completely remove Timings
|
|
||||||
this.handle(task, 0L);
|
|
||||||
for (CraftTask taskPending = this.head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
|
|
||||||
if (taskPending == task) {
|
|
||||||
@@ -344,7 +344,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- }){{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer(plugin);}}; // Paper
|
|
||||||
+ });//{{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer(plugin);}}; // Paper // Plazma - Completely remove Timings
|
|
||||||
this.handle(task, 0L);
|
|
||||||
for (CraftTask taskPending = this.head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
|
|
||||||
if (taskPending == task) {
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
|
||||||
index 5835dc236b3f5291a804f7fb14a12eb466d4e0ba..5b943a792f6b005a094bc06f59899bd28cf576a1 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
|
||||||
@@ -2,14 +2,14 @@ package org.bukkit.craftbukkit.scheduler;
|
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
-import co.aikar.timings.NullTimingHandler;
|
|
||||||
+// import co.aikar.timings.NullTimingHandler; // Plazma - Completely remove Timings
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
|
||||||
|
|
||||||
-import org.spigotmc.CustomTimingsHandler; // Spigot
|
|
||||||
-import co.aikar.timings.MinecraftTimings; // Paper
|
|
||||||
-import co.aikar.timings.Timing; // Paper
|
|
||||||
+// import org.spigotmc.CustomTimingsHandler; // Spigot // Plazma - Completely remove Timings
|
|
||||||
+// import co.aikar.timings.MinecraftTimings; // Paper // Plazma - Completely remove Timings
|
|
||||||
+// import co.aikar.timings.Timing; // Paper // Plazma - Completely remove Timings
|
|
||||||
|
|
||||||
public class CraftTask implements BukkitTask, Runnable { // Spigot
|
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot
|
|
||||||
private long nextRun;
|
|
||||||
public final Runnable rTask; // Paper
|
|
||||||
public final Consumer<BukkitTask> cTask; // Paper
|
|
||||||
- public Timing timings; // Paper
|
|
||||||
+ // public Timing timings; // Paper // Plazma - Completely remove Timings
|
|
||||||
private final Plugin plugin;
|
|
||||||
private final int id;
|
|
||||||
private final long createdAt = System.nanoTime();
|
|
||||||
@@ -55,7 +55,7 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot
|
|
||||||
this.id = id;
|
|
||||||
this.period = CraftTask.NO_REPEATING;
|
|
||||||
this.taskName = taskName;
|
|
||||||
- this.timings = MinecraftTimings.getInternalTaskName(taskName);
|
|
||||||
+ // this.timings = MinecraftTimings.getInternalTaskName(taskName); // Plazma - Completely remove Timings
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot
|
|
||||||
}
|
|
||||||
this.id = id;
|
|
||||||
this.period = period;
|
|
||||||
- timings = task != null ? MinecraftTimings.getPluginTaskTimings(this, period) : NullTimingHandler.NULL; // Paper
|
|
||||||
+ // timings = task != null ? MinecraftTimings.getPluginTaskTimings(this, period) : NullTimingHandler.NULL; // Paper // Plazma - Completely remove Timings
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
||||||
index e29dc1101c7aa4b7b2a2d2e732e27a1a14a2a234..544d6f4831341802ac156080e30b2b500cd9f0da 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
||||||
@@ -217,7 +217,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
|
||||||
// Paper start
|
|
||||||
@Override
|
|
||||||
public void reportTimings() {
|
|
||||||
- co.aikar.timings.TimingsExport.reportTimings();
|
|
||||||
+ //co.aikar.timings.TimingsExport.reportTimings(); // Plazma - Completely remove Timings
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
|
|
||||||
@@ -495,9 +495,9 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
|
||||||
return new CraftDamageSourceBuilder(damageType);
|
|
||||||
}
|
|
||||||
// Paper start
|
|
||||||
- @Override
|
|
||||||
+ @Override @Deprecated // Plazma - Completely remove Timings
|
|
||||||
public String getTimingsServerName() {
|
|
||||||
- return io.papermc.paper.configuration.GlobalConfiguration.get().timings.serverName;
|
|
||||||
+ return null; //io.papermc.paper.configuration.GlobalConfiguration.get().timings.serverName; // Plazma - Completely remove Timings
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
index 56e52b16b419c882440a15947f037ae1a902bc70..e0e1c873703c1d3482d5bc82294490a44dd3a7a9 100644
|
|
||||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
@@ -35,7 +35,7 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity;
|
|
||||||
import net.minecraft.world.entity.projectile.ThrowableProjectile;
|
|
||||||
import net.minecraft.world.entity.projectile.ThrownTrident;
|
|
||||||
import net.minecraft.world.entity.raid.Raider;
|
|
||||||
-import co.aikar.timings.MinecraftTimings;
|
|
||||||
+// import co.aikar.timings.MinecraftTimings; // Plazma - Completely remove Timings
|
|
||||||
import net.minecraft.world.entity.schedule.Activity;
|
|
||||||
import net.minecraft.world.level.Level;
|
|
||||||
import net.minecraft.world.phys.AABB;
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,8 @@ dependencyResolutionManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = projectName.lowercase()
|
rootProject.name = projectName.lowercase()
|
||||||
for (name in listOf("$projectName-API", "$projectName-Server", "$projectName-MojangAPI")) {
|
for (name in listOf("$projectName-API", "$projectName-Server")) {
|
||||||
|
if (!rootDir.resolve("$name/MIT.txt").isFile) continue
|
||||||
val projName = name.lowercase(Locale.ENGLISH)
|
val projName = name.lowercase(Locale.ENGLISH)
|
||||||
include(projName)
|
include(projName)
|
||||||
findProject(":$projName")!!.projectDir = file(name)
|
findProject(":$projName")!!.projectDir = file(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user