Updated Upstream (Paper, Pufferfish, Purpur)
Upstream has released updates that appear to apply and compile correctly. [Purpur Changes] PurpurMC/Purpur@e86a1b6: Updated Upstream (Paper) PurpurMC/Purpur@962ee30: Updated Upstream (Paper) PurpurMC/Purpur@74d1b4c: Updated Upstream (Paper) PurpurMC/Purpur@e2e8c61: Updated Upstream (Paper) PurpurMC/Purpur@7a01fd8: Updated Upstream (Paper) PurpurMC/Purpur@34c18f0: Updated Upstream (Paper) PurpurMC/Purpur@ca668ab: Updated Upstream (Paper) PurpurMC/Purpur@200178d: Updated Upstream (Paper) PurpurMC/Purpur@9968cbb: Updated Upstream (Paper) PurpurMC/Purpur@db09358: Fix clamp-levels option not being true by default (#1609) PurpurMC/Purpur@f289b6a: Updated Upstream (Paper) PurpurMC/Purpur@959c29d: Fix Tridents giving errors without having an Elytra equipped (#1612) PurpurMC/Purpur@68c1612: Fix villagers not spawning when the `follow-emerald-blocks` option is enabled (#1611) PurpurMC/Purpur@5b75c68: fix `bypass-mob-griefing` not being the inverse of mobgriefing gamerule, closes #1603 PurpurMC/Purpur@55d4309: Updated Upstream (Paper) PurpurMC/Purpur@0601f87: Updated Upstream (Paper) PurpurMC/Purpur@06dde9d: Add Ridable and Attribute options for Creaking mob (#1613) PurpurMC/Purpur@420a1ce: Set the bee's `takes-damage-from-water` option to true by default (#1614) PurpurMC/Purpur@2b6f273: Updated Upstream (Paper) PurpurMC/Purpur@504f311: Updated Upstream (Paper) PurpurMC/Purpur@2b694c9: Updated Upstream (Paper) PurpurMC/Purpur@96d7ef7: Updated Upstream (Paper) PurpurMC/Purpur@e141f68: Updated Upstream (Paper) PurpurMC/Purpur@7f6f667: Updated Upstream (Pufferfish) PurpurMC/Purpur@de20ba9: ignore `minecart.max-speed` config value if using minecart experiment, closes #1618 PurpurMC/Purpur@03062a8: fix ridable mobs not being controllable, closes #1620 PurpurMC/Purpur@0493ac3: Updated Upstream (Paper) PurpurMC/Purpur@16ce24a: fix(ridables/creaking): override tick method in look/move control
This commit is contained in:
@@ -9,7 +9,7 @@ ij_any_block_comment_at_first_column = false
|
||||
ij_any_line_comment_at_first_column = false
|
||||
ij_any_line_comment_add_space = true
|
||||
max_line_length = 120
|
||||
ij_visual_guides = 80
|
||||
ij_visual_guides = 16, 80
|
||||
|
||||
[*.tiny]
|
||||
indent_style=tab
|
||||
@@ -19,6 +19,7 @@ end_of_line=crlf
|
||||
|
||||
[*.yml]
|
||||
indent_size=2
|
||||
ij_visual_guides = 8, 80
|
||||
|
||||
[*.patch]
|
||||
trim_trailing_whitespace=false
|
||||
|
||||
6
.github/workflows/gradle.yml
vendored
6
.github/workflows/gradle.yml
vendored
@@ -23,13 +23,13 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout action
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
uses: gradle/actions/wrapper-validation@v4
|
||||
|
||||
- name: Set up JDK ${{ matrix.java }} ${{ matrix.jdk }}
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: ${{ matrix.java }}
|
||||
java-version: ${{ matrix.jdk }}
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -61,3 +61,4 @@ paper-api-generator
|
||||
compare.txt
|
||||
*.patch
|
||||
!patches/**/*
|
||||
upstream
|
||||
|
||||
@@ -12,3 +12,65 @@
|
||||
# mc_data chat_type/chat.json
|
||||
# mc_data dimension_type/overworld.json
|
||||
#
|
||||
|
||||
minecraft net/minecraft/server/commands/AdvancementCommands.java
|
||||
minecraft net/minecraft/server/commands/AttributeCommand.java
|
||||
minecraft net/minecraft/server/commands/BanListCommands.java
|
||||
minecraft net/minecraft/server/commands/BossBarCommands.java
|
||||
minecraft net/minecraft/server/commands/ChaseCommand.java
|
||||
minecraft net/minecraft/server/commands/ClearInventoryCommands.java
|
||||
minecraft net/minecraft/server/commands/CloneCommands.java
|
||||
minecraft net/minecraft/server/commands/DamageCommand.java
|
||||
minecraft net/minecraft/server/commands/DataPackCommand.java
|
||||
minecraft net/minecraft/server/commands/DebugCommand.java
|
||||
minecraft net/minecraft/server/commands/DebugConfigCommand.java
|
||||
minecraft net/minecraft/server/commands/DebugMobSpawningCommand.java
|
||||
minecraft net/minecraft/server/commands/DebugPathCommand.java
|
||||
minecraft net/minecraft/server/commands/EmoteCommands.java
|
||||
minecraft net/minecraft/server/commands/ExecuteCommand.java
|
||||
minecraft net/minecraft/server/commands/ExperienceCommand.java
|
||||
minecraft net/minecraft/server/commands/FillBiomeCommand.java
|
||||
minecraft net/minecraft/server/commands/FillCommand.java
|
||||
minecraft net/minecraft/server/commands/ForceLoadCommand.java
|
||||
minecraft net/minecraft/server/commands/FunctionCommand.java
|
||||
minecraft net/minecraft/server/commands/HelpCommand.java
|
||||
minecraft net/minecraft/server/commands/ItemCommands.java
|
||||
minecraft net/minecraft/server/commands/JfrCommand.java
|
||||
minecraft net/minecraft/server/commands/KillCommand.java
|
||||
minecraft net/minecraft/server/commands/LocateCommand.java
|
||||
minecraft net/minecraft/server/commands/LookAt.java
|
||||
minecraft net/minecraft/server/commands/MsgCommand.java
|
||||
minecraft net/minecraft/server/commands/PardonCommand.java
|
||||
minecraft net/minecraft/server/commands/PardonIpCommand.java
|
||||
minecraft net/minecraft/server/commands/ParticleCommand.java
|
||||
minecraft net/minecraft/server/commands/PerfCommand.java
|
||||
minecraft net/minecraft/server/commands/PlaySoundCommand.java
|
||||
minecraft net/minecraft/server/commands/PublishCommand.java
|
||||
minecraft net/minecraft/server/commands/RaidCommand.java
|
||||
minecraft net/minecraft/server/commands/RandomCommand.java
|
||||
minecraft net/minecraft/server/commands/RecipeCommand.java
|
||||
minecraft net/minecraft/server/commands/ReturnCommand.java
|
||||
minecraft net/minecraft/server/commands/RideCommand.java
|
||||
minecraft net/minecraft/server/commands/RotateCommand.java
|
||||
minecraft net/minecraft/server/commands/SaveAllCommand.java
|
||||
minecraft net/minecraft/server/commands/SaveOffCommand.java
|
||||
minecraft net/minecraft/server/commands/SaveOnCommand.java
|
||||
minecraft net/minecraft/server/commands/SayCommand.java
|
||||
minecraft net/minecraft/server/commands/ScoreboardCommand.java
|
||||
minecraft net/minecraft/server/commands/SeedCommand.java
|
||||
minecraft net/minecraft/server/commands/ServerPackCommand.java
|
||||
minecraft net/minecraft/server/commands/SetBlockCommand.java
|
||||
minecraft net/minecraft/server/commands/SetPlayerIdleTimeoutCommand.java
|
||||
minecraft net/minecraft/server/commands/SpawnArmorTrimsCommand.java
|
||||
minecraft net/minecraft/server/commands/SpectateCommand.java
|
||||
minecraft net/minecraft/server/commands/StopCommand.java
|
||||
minecraft net/minecraft/server/commands/StopSoundCommand.java
|
||||
minecraft net/minecraft/server/commands/TagCommand.java
|
||||
minecraft net/minecraft/server/commands/TeamCommand.java
|
||||
minecraft net/minecraft/server/commands/TeamMsgCommand.java
|
||||
minecraft net/minecraft/server/commands/TellRawCommand.java
|
||||
minecraft net/minecraft/server/commands/TitleCommand.java
|
||||
minecraft net/minecraft/server/commands/TransferCommand.java
|
||||
minecraft net/minecraft/server/commands/TriggerCommand.java
|
||||
minecraft net/minecraft/server/commands/WardenSpawnTrackerCommand.java
|
||||
minecraft net/minecraft/server/commands/WhitelistCommand.java
|
||||
|
||||
@@ -17,13 +17,13 @@ version = 1.21.3-R0.1-SNAPSHOT
|
||||
mcVersion = 1.21.3
|
||||
jdkVersion = 21
|
||||
|
||||
paperRepo = https://github.com/PaperMC/Paper
|
||||
paperBranch = master
|
||||
paperRepo = https://github.com/PaperMC/Paper-archive
|
||||
paperBranch = ver/1.21.3
|
||||
purpurRepo = https://github.com/PurpurMC/Purpur
|
||||
purpurBranch = ver/1.21.3
|
||||
pufferfishRepo = https://github.com/pufferfish-gg/Pufferfish
|
||||
pufferfishBranch = ver/1.21
|
||||
usePufferfish = false
|
||||
|
||||
paperCommit = be886cf4e7ba906a3e79d9d38835d35abf60a0ce
|
||||
purpurCommit = c6802b0a27f1f8faac4ad30f902810fd0ed8051e
|
||||
paperCommit = da7138233f6392e791d790d1c3407414c855f9c2
|
||||
purpurCommit = 16ce24aa7eb08232030e4570e027f7baefa5f3f9
|
||||
|
||||
152
initDev
152
initDev
@@ -3,70 +3,134 @@
|
||||
# run below command in your terminal:
|
||||
# source ./initDev
|
||||
|
||||
export PROJECT_DIR=$(pwd)
|
||||
PROJECT_DIR=$(pwd)
|
||||
|
||||
alias api="cd $PROJECT_DIR/*-API"
|
||||
alias srv="cd $PROJECT_DIR/*-Server"
|
||||
alias cl="clear;"
|
||||
|
||||
alias g="./gradlew"
|
||||
alias c="clear;"
|
||||
alias src="cd $PROJECT_DIR;"
|
||||
alias ca="cd $PROJECT_DIR/*-API || exit 1; vs;"
|
||||
alias cg="cd $PROJECT_DIR/paper-api-generator/generated || exit 1; vs;"
|
||||
alias cs="cd $PROJECT_DIR/*-Server || exit 1; vs;"
|
||||
|
||||
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 fa="ca __generate_fixup_patch"
|
||||
alias fg="cg __generate_fixup_patch"
|
||||
alias fs="cs __generate_fixup_patch"
|
||||
|
||||
alias rp="./gradlew --no-rebuild rebuildPatches"
|
||||
alias rap="./gradlew --no-rebuild rebuildAPIPatches"
|
||||
alias rgp="./gradlew --no-rebuild rebuildGeneratedAPIPatches"
|
||||
alias rsp="./gradlew --no-rebuild rebuildServerPatches"
|
||||
hash gradle 2>&1 && alias gradle="./gradlew"
|
||||
alias gr="cd $PROJECT_DIR; gradle"
|
||||
alias grc="gr --no-rebuild"
|
||||
|
||||
alias run="./gradlew runDevServer"
|
||||
alias build="./gradlew build"
|
||||
alias reobf="./gradlew createReobfPaperclipJar"
|
||||
alias mojmap="./gradlew createMojmapPaperclipJar"
|
||||
alias ap="grc applyPatches"
|
||||
alias aap="grc applyAPIPatches"
|
||||
alias agp="grc applyGeneratedAPIPatches"
|
||||
alias asp="grc applyServerPatches"
|
||||
|
||||
alias lg="git log --oneline base..HEAD"
|
||||
alias rc="git rebase --autosquash -i base"
|
||||
alias rcc="git rebase --continue"
|
||||
alias aap!="rm -rf $PROJECT_DIR/*-API; aap"
|
||||
alias agp!="rm -rf $PROJECT_DIR/paper-api-generator/generated; agp"
|
||||
alias asp!="rm -rf $PROJECT_DIR/*-Server; asp"
|
||||
|
||||
# generate Fixup patches for Server
|
||||
function fs() {
|
||||
cd ./*-Server || exit 1
|
||||
alias aapa="ca vpa"
|
||||
alias aapc="ca vpc"
|
||||
alias aapc="ca vps"
|
||||
alias agpa="cg vpa"
|
||||
alias agpc="cg vpc"
|
||||
alias agpc="cg vps"
|
||||
alias aspa="cs vpa"
|
||||
alias aspc="cs vpc"
|
||||
alias aspc="cs vps"
|
||||
|
||||
alias rp="grc rebuildPatches"
|
||||
alias rap="grc rebuildAPIPatches"
|
||||
alias rgp="grc rebuildGeneratedAPIPatches"
|
||||
alias rsp="grc rebuildServerPatches"
|
||||
|
||||
alias mk="gr build"
|
||||
alias mko="gr createReobfPaperclipJar"
|
||||
alias mkm="gr createMojmapPaperclipJar"
|
||||
|
||||
|
||||
alias va="git add"
|
||||
alias va.="git add ."
|
||||
|
||||
alias vl="git log --oneline base..HEAD"
|
||||
|
||||
alias vr="git rebase --autosquash base"
|
||||
alias vra="git rebase --abort"
|
||||
alias vrc="va.; git rebase --continue"
|
||||
alias vrs="git rebase --skip"
|
||||
|
||||
alias vp="git am --show-current-patch"
|
||||
alias vpa="git am --abort"
|
||||
alias vpc="git am --continue"
|
||||
alias vps="git am --skip"
|
||||
|
||||
alias vm="git commit --fixup"
|
||||
alias vs="git status"
|
||||
|
||||
alias vc="git commit --verbose --no-interactive"
|
||||
alias vcn="vc --no-message"
|
||||
alias vcm="vc --message"
|
||||
|
||||
alias vca="git commit --verbose --no-interactive --all"
|
||||
alias vcan="git commit --verbose --no-interactive --all --no-message"
|
||||
alias vcam="git commit --verbose --no-interactive --all --message"
|
||||
|
||||
alias ve="git commit --verbose --no-interactive --amend"
|
||||
alias ven="ve --no-message"
|
||||
alias vem="ve --message"
|
||||
|
||||
alias vea="git commit --verbose --no-interactive --all --amend"
|
||||
alias vean="vea --no-message"
|
||||
alias veam="vea --message"
|
||||
|
||||
alias as="ca src"
|
||||
alias al="ca vl"
|
||||
alias ac="ca va.; vcm"
|
||||
alias am="ca vm"
|
||||
alias ae="ca ve"
|
||||
alias aea="ca vea"
|
||||
alias aean="ca vean"
|
||||
alias aeam="ca veam"
|
||||
|
||||
alias gs="cg src"
|
||||
alias gl="cg vl"
|
||||
alias gc="cg va.; vcm"
|
||||
alias gm="cg vm"
|
||||
alias ge="cg ve"
|
||||
alias gea="cg vea"
|
||||
alias gean="cg vean"
|
||||
alias geam="cg veam"
|
||||
|
||||
alias ss="cs src"
|
||||
alias sl="cs vl"
|
||||
alias sc="cs va.; vcm"
|
||||
alias sm="cs vm"
|
||||
alias se="cs ve"
|
||||
alias sea="cs vea"
|
||||
alias sean="cs vean"
|
||||
alias seam="cs veam"
|
||||
|
||||
function __generate_fixup_patch() {
|
||||
garg="."
|
||||
[[ "$1" == "-x" ]] && garg="--amend"
|
||||
|
||||
git add .
|
||||
git commit "$garg" -m "fixup"
|
||||
git format-patch -1
|
||||
mv 0001-fixup.patch ../
|
||||
mv 0001-fixup.patch ../ -f
|
||||
|
||||
cd ../
|
||||
}
|
||||
|
||||
# generate Fixup patches for API
|
||||
function fa() {
|
||||
cd ./*-API || exit 1
|
||||
garg="."
|
||||
[[ "$1" == "-x" ]] && garg="--amend"
|
||||
|
||||
git add .
|
||||
git commit "$garg" -m "fixup"
|
||||
git format-patch -1
|
||||
mv 0001-fixup.patch ../
|
||||
|
||||
cd ../
|
||||
}
|
||||
|
||||
# ReApply Server Patches
|
||||
function rasp() {
|
||||
rm -rf ./*-Server
|
||||
./gradlew applyServerPatches
|
||||
}
|
||||
|
||||
# Commit Updated Upstream
|
||||
function cuu() {
|
||||
# shellcheck disable=SC2059
|
||||
printf "Updated Upstream ($1)$(/bin/cat compare.txt)" | git commit -F -
|
||||
}
|
||||
|
||||
git update-index --assume-unchanged ./build-data/dev-imports.txt
|
||||
|
||||
if [ ! -L "$PROJECT_DIR/upstream" ]; then
|
||||
grc applyPatches
|
||||
ln -dsf "$PROJECT_DIR/.gradle/caches/paperweight/upstreams/paper" "$PROJECT_DIR/upstream"
|
||||
fi
|
||||
|
||||
@@ -1,33 +1,47 @@
|
||||
[versions]
|
||||
gson = "2.10.1"
|
||||
joml = "1.10.5"
|
||||
guava = "32.1.2-jre"
|
||||
sentry = "5.4.0"
|
||||
jspecify = "1.0.0"
|
||||
fastutil = "8.5.6"
|
||||
findbugs = "1.3.9"
|
||||
slf4j-api = "2.0.9"
|
||||
brigadier = "1.2.9"
|
||||
bungeechat = "1.20-R0.2"
|
||||
|
||||
guava = "33.3.1-jre"
|
||||
gson = "2.11.0"
|
||||
bungeechat = "1.20-R0.2-deprecated+build.19"
|
||||
|
||||
# snakeyaml
|
||||
joml = "1.10.8"
|
||||
json-simple = "1.1.1"
|
||||
annotations = "24.0.1"
|
||||
|
||||
fastutil = "8.5.6"
|
||||
# adventure
|
||||
# log4j
|
||||
slf4j-api = "2.0.9"
|
||||
sentry = "5.4.0"
|
||||
|
||||
# asm
|
||||
# mvn
|
||||
|
||||
annotations = "24.1.0"
|
||||
checkerqual = "3.21.0"
|
||||
jspecify = "1.0.0"
|
||||
|
||||
|
||||
[libraries]
|
||||
joml = { group = "org.joml", name = "joml", version.ref = "joml" }
|
||||
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
|
||||
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
|
||||
sentry = { group = "io.sentry", name = "sentry", version.ref = "sentry" }
|
||||
jspecify = { group = "org.jspecify", name = "jspecify", version.ref = "jspecify" }
|
||||
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
|
||||
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" }
|
||||
|
||||
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
|
||||
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
|
||||
bungeechat = { group = "net.md-5", name = "bungeecord-chat", version.ref = "bungeechat" }
|
||||
|
||||
joml = { group = "org.joml", name = "joml", version.ref = "joml" }
|
||||
jsonsimple = { group = "com.googlecode.json-simple", name = "json-simple", version.ref = "json-simple" }
|
||||
|
||||
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
|
||||
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j-api" }
|
||||
sentry = { group = "io.sentry", name = "sentry", version.ref = "sentry" }
|
||||
|
||||
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
|
||||
checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" }
|
||||
jspecify = { group = "org.jspecify", name = "jspecify", version.ref = "jspecify" }
|
||||
|
||||
|
||||
[bundles]
|
||||
api = [ "jspecify", "guava", "gson", "joml", "fastutil", "slf4j-api", "sentry", "brigadier" ]
|
||||
api = [ "brigadier", "guava", "gson", "joml", "fastutil", "slf4j", "sentry", "jspecify" ]
|
||||
annotations = [ "annotations", "checkerqual" ]
|
||||
|
||||
@@ -1,47 +1,73 @@
|
||||
[versions]
|
||||
asm = "9.7.1"
|
||||
log4j = "2.19.0"
|
||||
junit = "1.10.0"
|
||||
mockito = "5.14.1"
|
||||
jupiter = "5.10.0"
|
||||
hamcrest = "2.2"
|
||||
snakeyaml = "2.2"
|
||||
adventure = "4.17.0"
|
||||
log4j = "2.19.0"
|
||||
asm = "9.7.1"
|
||||
|
||||
mvn = "3.9.6"
|
||||
mvn-resolver = "1.9.18"
|
||||
|
||||
commons-lang2 = "2.6"
|
||||
commons-lang3 = "3.12.0"
|
||||
maven-provider = "3.9.6"
|
||||
maven-resolver = "1.9.18"
|
||||
|
||||
snakeyaml = "2.2"
|
||||
|
||||
junit = "1.10.0"
|
||||
junit-jupiter = "5.10.0"
|
||||
junit-pioneer = "2.2.0"
|
||||
|
||||
hamcrest = "2.2"
|
||||
mockito = "5.14.1"
|
||||
|
||||
[libraries]
|
||||
junit = { group = "org.junit.platform", name = "junit-platform-suite-engine", version.ref = "junit" }
|
||||
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
|
||||
jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "jupiter" }
|
||||
hamcrest = { group = "org.hamcrest", name = "hamcrest", version.ref = "hamcrest" }
|
||||
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
|
||||
|
||||
asm-head = { group = "org.ow2.asm", name = "asm", version.ref = "asm" }
|
||||
asm-tree = { group = "org.ow2.asm", name = "asm-tree", version.ref = "asm" }
|
||||
asm-commons = { group = "org.ow2.asm", name = "asm-commons", version.ref = "asm" }
|
||||
log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }
|
||||
log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }
|
||||
log4j-iostreams = { group = "org.apache.logging.log4j", name = "log4j-iostreams", version.ref = "log4j" }
|
||||
maven-provider = { group = "org.apache.maven", name = "maven-resolver-provider", version.ref = "maven-provider" }
|
||||
maven-connector = { group = "org.apache.maven.resolver", name = "maven-resolver-connector-basic", version.ref = "maven-resolver" }
|
||||
maven-transport = { group = "org.apache.maven.resolver", name = "maven-resolver-transport-http", version.ref = "maven-resolver" }
|
||||
commons-lang2 = { group = "commons-lang", name = "commons-lang", version.ref = "commons-lang2" }
|
||||
commons-lang3 = { group = "org.apache.commons", name = "commons-lang3", version.ref = "commons-lang3" }
|
||||
|
||||
adventure-bom = { group = "net.kyori", name = "adventure-bom", version.ref = "adventure" }
|
||||
adventure-api = { group = "net.kyori", name = "adventure-api", version.ref = "adventure" }
|
||||
adventure-slf4j = { group = "net.kyori", name = "adventure-text-logger-slf4j", version.ref = "adventure" }
|
||||
adventure-minimessage = { group = "net.kyori", name = "adventure-text-minimessage", version.ref = "adventure" }
|
||||
adventure-logger-slf4j = { group = "net.kyori", name = "adventure-text-logger-slf4j", version.ref = "adventure" }
|
||||
adventure-serializer-gson = { group = "net.kyori", name = "adventure-text-serializer-gson", version.ref = "adventure" }
|
||||
adventure-serializer-ansi = { group = "net.kyori", name = "adventure-text-serializer-ansi", version.ref = "adventure" }
|
||||
adventure-serializer-plain = { group = "net.kyori", name = "adventure-text-serializer-plain", version.ref = "adventure" }
|
||||
adventure-serializer-legacy = { group = "net.kyori", name = "adventure-text-serializer-legacy", version.ref = "adventure" }
|
||||
|
||||
log4j = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }
|
||||
log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }
|
||||
log4j-stream = { group = "org.apache.logging.log4j", name = "log4j-iostreams", version.ref = "log4j" }
|
||||
|
||||
asm = { group = "org.ow2.asm", name = "asm", version.ref = "asm" }
|
||||
asm-tree = { group = "org.ow2.asm", name = "asm-tree", version.ref = "asm" }
|
||||
asm-commons = { group = "org.ow2.asm", name = "asm-commons", version.ref = "asm" }
|
||||
|
||||
mvn = { group = "org.apache.maven", name = "maven-resolver-provider", version.ref = "mvn" }
|
||||
mvn-connector = { group = "org.apache.maven.resolver", name = "maven-resolver-connector-basic", version.ref = "mvn-resolver" }
|
||||
mvn-transport = { group = "org.apache.maven.resolver", name = "maven-resolver-transport-http", version.ref = "mvn-resolver" }
|
||||
|
||||
commons-lang2 = { group = "commons-lang", name = "commons-lang", version.ref = "commons-lang2" }
|
||||
commons-lang3 = { group = "org.apache.commons", name = "commons-lang3", version.ref = "commons-lang3" }
|
||||
|
||||
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
|
||||
|
||||
junit = { group = "org.junit.platform", name = "junit-platform-suite-engine", version.ref = "junit" }
|
||||
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit-jupiter" }
|
||||
junit-pioneer = { group = "org.junit-pioneer", name = "junit-pioneer", version.ref = "junit-pioneer" }
|
||||
|
||||
hamcrest = { group = "org.hamcrest", name = "hamcrest", version.ref = "hamcrest" }
|
||||
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
|
||||
|
||||
|
||||
[bundles]
|
||||
asm = [ "asm-head", "asm-commons" ]
|
||||
test = [ "jupiter", "hamcrest", "mockito", "asm-tree", "junit" ]
|
||||
maven = [ "maven-connector", "maven-transport" ]
|
||||
adventure = [ "adventure-api", "adventure-slf4j", "adventure-minimessage", "adventure-serializer-gson", "adventure-serializer-plain", "adventure-serializer-legacy" ]
|
||||
asm = [ "asm", "asm-commons" ]
|
||||
mvn = [ "mvn-connector", "mvn-transport" ]
|
||||
|
||||
test = [
|
||||
"junit-jupiter",
|
||||
"hamcrest",
|
||||
"mockito",
|
||||
"asm-tree"
|
||||
]
|
||||
adventure = [
|
||||
"adventure-api",
|
||||
"adventure-minimessage",
|
||||
"adventure-logger-slf4j",
|
||||
"adventure-serializer-gson",
|
||||
"adventure-serializer-plain",
|
||||
"adventure-serializer-legacy"
|
||||
]
|
||||
|
||||
@@ -1,56 +1,89 @@
|
||||
[versions]
|
||||
art = "2.0.3"
|
||||
jline = "3.27.1"
|
||||
tca = "1.3.0"
|
||||
upnp = "1.0"
|
||||
ansi = "1.0.3"
|
||||
jansi = "3.21.0"
|
||||
rhino = "1.7.14"
|
||||
mysql = "9.1.0"
|
||||
flare = "34637f3f87"
|
||||
sqlite = "3.46.1.3"
|
||||
pioneer = "2.2.0"
|
||||
haproxy = "4.1.97.Final"
|
||||
rewriter = "0.0.3"
|
||||
srgutils = "1.0.9"
|
||||
sparkapi = "0.1-20240720.200737-2"
|
||||
sparknt = "1.10.105-SNAPSHOT"
|
||||
velocity = "3.3.0-SNAPSHOT"
|
||||
disruptor = "3.4.4"
|
||||
simpleyaml = "1.8.4"
|
||||
classgraph = "4.8.47"
|
||||
mapping-io = "0.5.0"
|
||||
# adventure
|
||||
# log4j
|
||||
netty = "4.1.97.Final"
|
||||
# asm
|
||||
configurate = "4.2.0-SNAPSHOT"
|
||||
# commons2
|
||||
sqlite = "3.46.1.3"
|
||||
mysql = "9.1.0"
|
||||
disruptor = "3.4.4"
|
||||
velocity = "3.3.0-SNAPSHOT"
|
||||
|
||||
# mvn
|
||||
|
||||
# snakeyaml
|
||||
simpleyaml = "1.8.4"
|
||||
|
||||
rhino = "1.7.14"
|
||||
upnp = "1.0"
|
||||
|
||||
classgraph = "4.8.47"
|
||||
# test (junit, hamcrest, mockito, asm-tree)
|
||||
srgutils = "1.0.9"
|
||||
art = "2.0.3"
|
||||
|
||||
rewriter = "0.0.3"
|
||||
spark-api = "0.1-20240720.200737-2"
|
||||
spark = "1.10.119-SNAPSHOT"
|
||||
|
||||
|
||||
[libraries]
|
||||
art = { group = "net.neoforged", name = "AutoRenamingTool", version.ref = "art" }
|
||||
jline-ffm = { group = "org.jline", name = "jline-terminal-ffm", version.ref = "jline" }
|
||||
jline-jni = { group = "org.jline", name = "jline-terminal-jni", version.ref = "jline" }
|
||||
tca = { group = "net.minecrell", name = "terminalconsoleappender", version.ref="tca" }
|
||||
ansi = { group = "net.kyori", name = "ansi", version.ref = "ansi" }
|
||||
upnp = { group = "dev.omega24", name = "upnp4j", version.ref = "upnp" }
|
||||
mysql = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysql" }
|
||||
jansi = { group = "org.jline", name = "jline-terminal-jansi", version.ref = "jansi" }
|
||||
flare = { group = "com.github.technove", name = "flare", version.ref = "flare" }
|
||||
# adventure
|
||||
# log4j
|
||||
netty-haproxy = { group = "io.netty", name = "netty-codec-haproxy", version.ref = "netty" }
|
||||
# asm
|
||||
configurate-yaml = { group = "org.spongepowered", name = "configurate-yaml", version.ref = "configurate" }
|
||||
# commons2
|
||||
sqlite = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite" }
|
||||
pioneer = { group = "org.junit-pioneer", name = "junit-pioneer", version.ref = "pioneer" }
|
||||
haproxy = { group = "io.netty", name = "netty-codec-haproxy", version.ref = "haproxy" }
|
||||
srgutils = { group = "net.neoforged", name = "srgutils", version.ref = "srgutils" }
|
||||
velocity = { group = "com.velocitypowered", name = "velocity-native", version.ref = "velocity" }
|
||||
mysql = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysql" }
|
||||
disruptor = { group = "com.lmax", name = "disruptor", version.ref = "disruptor" }
|
||||
mappingio = { group = "net.fabricmc", name = "mapping-io", version.ref = "mapping-io" }
|
||||
classgraph = { group = "io.github.classgraph", name = "classgraph", version.ref = "classgraph" }
|
||||
velocity-native = { group = "com.velocitypowered", name = "velocity-native", version.ref = "velocity" }
|
||||
|
||||
# snakeyaml
|
||||
simpleyaml = { group = "com.github.carleslc.Simple-YAML", name = "Simple-Yaml", version.ref = "simpleyaml" }
|
||||
configurate = { group = "org.spongepowered", name = "configurate-yaml", version.ref = "configurate" }
|
||||
|
||||
spark-api = { group = "me.lucko", name = "spark-api", version.ref = "sparkapi" }
|
||||
spark-paper = { group = "me.lucko", name = "spark-paper", version.ref = "sparknt" }
|
||||
|
||||
rhino-engine = { group = "org.mozilla", name = "rhino-engine", version.ref = "rhino" }
|
||||
rhino-runtime = { group = "org.mozilla", name = "rhino-runtime", version.ref = "rhino" }
|
||||
rhino-engine = { group = "org.mozilla", name = "rhino-engine", version.ref = "rhino" }
|
||||
upnp = { group = "dev.omega24", name = "upnp4j", version.ref = "upnp" }
|
||||
|
||||
classgraph = { group = "io.github.classgraph", name = "classgraph", version.ref = "classgraph" }
|
||||
# test (junit, hamcrest, mockito, asm-tree)
|
||||
srgutils = { group = "net.neoforged", name = "srgutils", version.ref = "srgutils" }
|
||||
art = { group = "net.neoforged", name = "AutoRenamingTool", version.ref = "art" }
|
||||
|
||||
rewriter = { group = "io.papermc", name = "reflection-rewriter", version.ref = "rewriter" }
|
||||
rewriter-runtime = { group = "io.papermc", name = "reflection-rewriter-runtime", version.ref = "rewriter" }
|
||||
rewriter-generator = { group = "io.papermc", name = "reflection-rewriter-proxy-generator", version.ref = "rewriter" }
|
||||
rewriter-proxy = { group = "io.papermc", name = "reflection-rewriter-proxy-generator", version.ref = "rewriter" }
|
||||
|
||||
spark-api = { group = "me.lucko", name = "spark-api", version.ref = "spark-api" }
|
||||
spark = { group = "me.lucko", name = "spark-paper", version.ref = "spark" }
|
||||
|
||||
|
||||
[bundles]
|
||||
runtime = [ "sqlite", "mysql", "disruptor" ]
|
||||
implementation = [ "spark-api", "spark-paper", "jansi", "tca", "ansi", "upnp", "haproxy", "configurate", "mappingio", "rhino-engine", "rhino-runtime", "srgutils", "art", "rewriter", "rewriter-runtime", "rewriter-generator", "flare" ]
|
||||
test = [ "classgraph", "pioneer" ]
|
||||
test = [ "classgraph" ]
|
||||
|
||||
implementation = [
|
||||
"jline-ffm",
|
||||
"jline-jni",
|
||||
"tca",
|
||||
"netty-haproxy",
|
||||
"configurate-yaml",
|
||||
"velocity-native",
|
||||
"rhino-runtime",
|
||||
"rhino-engine",
|
||||
"upnp",
|
||||
"srgutils",
|
||||
"art",
|
||||
"rewriter",
|
||||
"rewriter-runtime",
|
||||
"rewriter-proxy",
|
||||
"spark-api",
|
||||
"spark"
|
||||
]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: granny <contact@granny.dev>
|
||||
Date: Wed, 30 Oct 2024 13:25:01 +0900
|
||||
Date: Fri, 13 Dec 2024 07:03:22 +0900
|
||||
Subject: [PATCH] Purpur API Changes
|
||||
|
||||
PurpurMC
|
||||
@@ -567,10 +567,10 @@ index 652ff54e7c50412503725d628bfe72ed03059790..7196594e07af19a14c320d77df893978
|
||||
* Gets the {@code ServerBuildInfo}.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 391a1e3e07657a404520c1462507a2c731f32b27..8f5fde63b195d08029305ee0172687df88ad0496 100644
|
||||
index 8ab94f8189ebd9d4158231871abdebec399deb2c..db453d04efb00baaeabb904a7bd1b99dd0a50735 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2945,4 +2945,127 @@ public final class Bukkit {
|
||||
@@ -2968,4 +2968,127 @@ public final class Bukkit {
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
}
|
||||
@@ -781,13 +781,13 @@ index 918a045165cdcde264bc24082b7afebb407271de..e98d6321c5f2cdde91b54f8a74cbcc04
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 615eb24ffdd8f6d55ccd4f21760b809c1098bc68..fbbe9e52ed3437d2407e042f45b0a18abdd48fe1 100644
|
||||
index 028ac35df6c4d044d07b3869751736d418c1eb0e..95c1f331f364c5fafa100860f3c9674f18888714 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -5799,4 +5799,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public BlockType asBlockType() {
|
||||
return blockType.get();
|
||||
@@ -5840,4 +5840,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
return this.asItemType().getDefaultDataTypes();
|
||||
}
|
||||
// Paper end - data component API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ public boolean isArmor() {
|
||||
@@ -826,7 +826,7 @@ index 615eb24ffdd8f6d55ccd4f21760b809c1098bc68..fbbe9e52ed3437d2407e042f45b0a18a
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
index a028f2fe541491729856051780b33dba07832fb6..fc64902368a068481f16d5db99c94386caf6b60b 100644
|
||||
index 5622fe3165baad8138c22cfc016ed6c3834cf702..6d31b561d915180fcd473b317721064feed28f37 100644
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -573,4 +573,106 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
@@ -937,7 +937,7 @@ index a028f2fe541491729856051780b33dba07832fb6..fc64902368a068481f16d5db99c94386
|
||||
+ // Purpur end - OfflinePlayer API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 0b78564256ebc647ebac402e549d86ab6e307c8d..ddb1ff894910761a78b91a343f32e129f03a03c4 100644
|
||||
index ad816538b30079c62d5e1eb98c6f4b61e12e8d47..fcfad39173ecf2573a1ba77236bce8d9f73e02bb 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2283,6 +2283,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -959,10 +959,10 @@ index 0b78564256ebc647ebac402e549d86ab6e307c8d..ddb1ff894910761a78b91a343f32e129
|
||||
/**
|
||||
* Sends the component to the player
|
||||
*
|
||||
@@ -2572,4 +2584,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2607,4 +2619,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
|
||||
// Paper end - Folia region threading API
|
||||
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
|
||||
// Paper end - API to check if the server is sleeping
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
@@ -1066,10 +1066,10 @@ index 0b78564256ebc647ebac402e549d86ab6e307c8d..ddb1ff894910761a78b91a343f32e129
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index ef32a937e6faf1e8a5d6b1207986715bae5a246c..36cf567973900d1e472616748926aecb9afcb42f 100644
|
||||
index bef54a6c8290e09cbaac20b03dde8dfb902c96b0..5f7de23e419175e55459df760c7190639ea39f18 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -4209,6 +4209,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -4246,6 +4246,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
public DragonBattle getEnderDragonBattle();
|
||||
|
||||
@@ -1252,7 +1252,7 @@ index e64bb57f74e6d6f78927be228825b3e0bdf41f48..c880d0010849ab733ad13bbd18fab3c8
|
||||
);
|
||||
this.versionMessage = Component.text()
|
||||
diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
index 455ff52d90565838fe7640c3f045b27082a6c2f1..45f5493eebfecf56b7c0ef4659c078dfc62c0612 100644
|
||||
index 6fcc15d588239481136876d117ab346a8deac1dd..13b903e785a9ef5e513cb9d6483482133cc5f25b 100644
|
||||
--- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
+++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
@@ -227,6 +227,28 @@ public enum EnchantmentTarget {
|
||||
@@ -1285,7 +1285,7 @@ index 455ff52d90565838fe7640c3f045b27082a6c2f1..45f5493eebfecf56b7c0ef4659c078df
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Endermite.java b/src/main/java/org/bukkit/entity/Endermite.java
|
||||
index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c6f2883d1 100644
|
||||
index 7b379fb21e800a766ad022705a12dff6d42279ab..10a8d64ad2da0be2c14f34c3e7d1957c6f2883d1 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Endermite.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Endermite.java
|
||||
@@ -3,25 +3,21 @@ package org.bukkit.entity;
|
||||
@@ -1301,7 +1301,7 @@ index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c
|
||||
* @return player spawned status
|
||||
- * @deprecated this functionality no longer exists
|
||||
*/
|
||||
- @Deprecated
|
||||
- @Deprecated(since = "1.17")
|
||||
boolean isPlayerSpawned();
|
||||
|
||||
/**
|
||||
@@ -1314,12 +1314,12 @@ index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c
|
||||
* @param playerSpawned player spawned status
|
||||
- * @deprecated this functionality no longer exists
|
||||
*/
|
||||
- @Deprecated
|
||||
- @Deprecated(since = "1.17")
|
||||
void setPlayerSpawned(boolean playerSpawned);
|
||||
// Paper start
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index d0ae8a94db20281d3664d74718c65234eb2e5f83..b7d53973ac4e829a03821d59e0b3a28d6f6a4373 100644
|
||||
index 19272cff8d6d040e95b2644d70acdac606e06c16..076fe310d500ebb52e705a3a69e895061702f470 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1172,4 +1172,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -1471,7 +1471,7 @@ index bcc6ba95bd21c7972865838c636a03f50b6c1f1a..c3fcd8dd7dbb1e1a18e17c014c1e6411
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 68c08e7a212bc3e3885f9b5a4d9aef85fcb3b029..a22909446b7193b1de121bdd6d7b6fbf81dc3be4 100644
|
||||
index d21a228bbec0302e75c4db5aa1db54f321143587..a4acc3578e935cd1174474bd1f6ff14db4294fe7 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1468,4 +1468,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -1521,7 +1521,7 @@ index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 95f0b3186e313c7fbd5c8531d52b82a69e525f94..a7f989121c493baff9d2b6910c39145a0e12477d 100644
|
||||
index fac4aec289e07231d80a9890653432f688355afa..6f7f1fc3db0237021fa1bd0f11fe56b2d6d4f84a 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3911,4 +3911,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1743,10 +1743,10 @@ index c73489f4b745bc84501ce94f0227b034d9768eae..a97129e71f16ec691759add664bdfd35
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java
|
||||
index ef5b2a0f18c1c126db0b0c4a4d2a57483680665a..e6c8ffc2583af754eaedc55160ef45c61c22e213 100644
|
||||
index d1a5424ff3b289f1c82449ef6d88eb52665df41b..f23b0c250f88926c147af0314b5c4d23c5f8dbae 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java
|
||||
@@ -307,7 +307,8 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||
@@ -308,7 +308,8 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||
WORLD_BORDER,
|
||||
/**
|
||||
* Damage caused when an entity contacts a block such as a Cactus,
|
||||
@@ -1774,7 +1774,7 @@ index 8fdfcbc7d20fe0af6b220ab94516247093637621..f6a8928408e11a5ae723366e4ea1280d
|
||||
* When a player gets bad omen after killing a patrol captain.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
index 7184f80899206bedeac387e9f8a35482801efd4b..e4197c89c04b91732ce96981f8df0a0bdaee24ce 100644
|
||||
index 81118a91c2e22e02a1f774d1cc4d3e97064087ce..3ac1e4a821a5b48d3936222cbfddadd3b803deef 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
@@ -164,7 +164,7 @@ public enum InventoryType {
|
||||
@@ -1834,7 +1834,7 @@ index f1f97a85ec713c05c882d7588f4a3e4a017f4795..813f6cd253322538bdf96eb323dd23a7
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..4414381ac942c040480d53b03565b160eb85c444 100644
|
||||
index 8c9654cd19af8b28fa276a55c5060eb389e60c1c..875124b06d87cd4163f0ab1d4dd75f939622f8aa 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -19,6 +19,13 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
@@ -1851,10 +1851,10 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..4414381ac942c040480d53b03565b160
|
||||
|
||||
/**
|
||||
* Represents a stack of items.
|
||||
@@ -1137,4 +1144,482 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return Bukkit.getUnsafe().computeTooltipLines(this, tooltipContext, player);
|
||||
@@ -1318,4 +1325,482 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return this.craftDelegate.matchesWithoutData(item, excludeTypes, ignoreCount);
|
||||
}
|
||||
// Paper end - expose itemstack tooltip lines
|
||||
// Paper end - data component API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
@@ -2335,7 +2335,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..4414381ac942c040480d53b03565b160
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||
index f1aa67997f904953742e8895e49341c2f73d44a2..993cf7995514fb0ef3c4388bb3ce49c3187ab251 100644
|
||||
index 922bb69b5f218e489a6dd5e0f207743c1f1d3d35..9b3e292be334d21eb978373f434bf3811ec4af2b 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||
@@ -191,6 +191,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||
@@ -2412,7 +2412,7 @@ index 3c1aa1e036bee08304c1cdca59f6a5bc0ba306c0..709fb2d1c7e3253034a651a9f68c0036
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
|
||||
index 55a46db9d73885ea967ac929013906b687e476bb..b99796629100c7d5fff1b7f84026001e0013b477 100644
|
||||
index 6995f9cc08d162e3adcd3a28f6bfa6d329661999..b9edb96fc5bac8793477657dbb45ccf98ab17f27 100644
|
||||
--- a/src/main/java/org/bukkit/map/MapPalette.java
|
||||
+++ b/src/main/java/org/bukkit/map/MapPalette.java
|
||||
@@ -1,6 +1,7 @@
|
||||
@@ -2488,7 +2488,7 @@ index 75b77cc4fe189b4b6baa1af3663dc492e992a266..30b98d1645c571ba5c18e5cc93b0bec3
|
||||
|
||||
permissions.put(lname, new PermissionAttachmentInfo(parent, lname, attachment, value));
|
||||
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
index b878e7167cfcdea0e224c182b40abeadd339d3b3..6b6edf9007997d9672e4c850464c1b71cb55f6b4 100644
|
||||
index 001465eedafa51ac027a4db51cba6223edfe1171..2e6d62c4f3687e299c34e876c503b400e13be05a 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
@@ -597,7 +597,9 @@ public final class SimplePluginManager implements PluginManager {
|
||||
@@ -2514,7 +2514,7 @@ index b878e7167cfcdea0e224c182b40abeadd339d3b3..6b6edf9007997d9672e4c850464c1b71
|
||||
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerEventException(msg, ex, registration.getPlugin(), registration.getListener(), event)));
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..0c6ca7588fb3d6b6497ddf032fe75e5c6c9719e5 100644
|
||||
index b412aaf08901d169ac9fc89b36f9d6ccb95c53d3..e2b631fc160f13ea6e27b69f835bbdf83d6d3dec 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
@@ -55,6 +55,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||
|
||||
@@ -5,24 +5,24 @@ Subject: [PATCH] Use Gradle Version Catalogs
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index b0fd6c1804844f09428051952e3ac4e58f8c859c..51a3639e5d1c3fec24af53f1e829532adeb6a1fa 100644
|
||||
index b0fd6c1804844f09428051952e3ac4e58f8c859c..2b668f8a5c245d024e03c94b7d8872448f1929cf 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -9,11 +9,13 @@ java {
|
||||
withJavadocJar()
|
||||
}
|
||||
|
||||
+/* // Plazma - Use Gradle Versuib Catalogs
|
||||
+/* // Plazma - Use Gradle Version Catalogs
|
||||
val annotationsVersion = "24.1.0"
|
||||
val bungeeCordChatVersion = "1.20-R0.2"
|
||||
val adventureVersion = "4.17.0"
|
||||
val slf4jVersion = "2.0.9"
|
||||
val log4jVersion = "2.17.1"
|
||||
+ */
|
||||
+ */ // Plazma - Use Gradle Version Catalogs
|
||||
val apiAndDocs: Configuration by configurations.creating {
|
||||
attributes {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
||||
@@ -39,57 +41,29 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||
@@ -39,58 +41,30 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||
// Paper end - configure mockito agent that is needed in newer java versions
|
||||
|
||||
dependencies {
|
||||
@@ -77,33 +77,35 @@ index b0fd6c1804844f09428051952e3ac4e58f8c859c..51a3639e5d1c3fec24af53f1e829532a
|
||||
- testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
- testImplementation("org.mockito:mockito-core:5.14.1")
|
||||
- testImplementation("org.ow2.asm:asm-tree:9.7.1")
|
||||
- mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions
|
||||
+ // Plazma start - Use Gradle Version Catalogs
|
||||
+ implementation(common.bundles.asm)
|
||||
+
|
||||
+ api(api.bundles.api)
|
||||
+ api(common.snakeyaml)
|
||||
+ api(common.log4j.api)
|
||||
+ api(common.maven.provider)
|
||||
+ api(api.jsonsimple) { isTransitive = false }
|
||||
+ api(api.bungeechat) { exclude("com.google.guava", "guava") }
|
||||
+ api(common.snakeyaml)
|
||||
+ api(api.jsonsimple) { isTransitive = false }
|
||||
+ apiAndDocs(platform(common.adventure.bom))
|
||||
+ apiAndDocs(common.bundles.adventure)
|
||||
+ api(common.log4j.api)
|
||||
+
|
||||
+ implementation(common.bundles.asm)
|
||||
+
|
||||
+ api(common.mvn)
|
||||
+ compileOnly(common.bundles.mvn)
|
||||
+
|
||||
+ compileOnly(common.bundles.maven)
|
||||
+ compileOnly(api.annotations)
|
||||
+ compileOnlyApi(api.checkerqual)
|
||||
+ testCompileOnly(api.annotations)
|
||||
+
|
||||
+ compileOnlyApi(api.checkerqual)
|
||||
+ testCompileOnly(api.checkerqual)
|
||||
+
|
||||
+ testImplementation(common.asm.tree)
|
||||
+ testImplementation(common.commons.lang3)
|
||||
+ testImplementation(common.bundles.test)
|
||||
+
|
||||
+ testCompileOnly(api.annotations)
|
||||
+ testCompileOnly(api.checkerqual)
|
||||
+ mockitoAgent(common.mockito) { isTransitive = false }
|
||||
+ // Plazma end
|
||||
mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions
|
||||
}
|
||||
|
||||
@@ -175,27 +149,24 @@ tasks.withType<Javadoc> {
|
||||
// Paper start
|
||||
@@ -175,27 +149,25 @@ tasks.withType<Javadoc> {
|
||||
options.use()
|
||||
options.isDocFilesSubDirs = true
|
||||
options.links(
|
||||
@@ -114,7 +116,7 @@ index b0fd6c1804844f09428051952e3ac4e58f8c859c..51a3639e5d1c3fec24af53f1e829532a
|
||||
- // Paper start - add missing javadoc links
|
||||
- "https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
|
||||
- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
|
||||
"https://jspecify.dev/docs/api/",
|
||||
- "https://jspecify.dev/docs/api/",
|
||||
- // Paper end
|
||||
- // Paper start
|
||||
- "https://jd.advntr.dev/api/$adventureVersion/",
|
||||
@@ -129,6 +131,12 @@ index b0fd6c1804844f09428051952e3ac4e58f8c859c..51a3639e5d1c3fec24af53f1e829532a
|
||||
- // Paper end
|
||||
- "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
|
||||
+ // Plazma start - Use Gradle Version Catalogs
|
||||
+ "https://guava.dev/releases/${api.guava.orNull?.version}/api/docs/",
|
||||
+ "https://javadoc.io/doc/org.yaml/snakeyaml/${common.snakeyaml.orNull?.version}/",
|
||||
+ "https://javadoc.io/doc/org.jetbrains/annotations/${api.annotations.orNull?.version}/",
|
||||
+ "https://javadoc.io/doc/org.joml/joml/${api.joml.orNull?.version}/index.html",
|
||||
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/${api.gson.orNull?.version}",
|
||||
+ "https://jspecify.dev/docs/api/", //diff on change
|
||||
+ "https://jd.advntr.dev/api/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://jd.advntr.dev/key/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://jd.advntr.dev/text-minimessage/${common.adventure.api.orNull?.version}/",
|
||||
@@ -136,14 +144,10 @@ index b0fd6c1804844f09428051952e3ac4e58f8c859c..51a3639e5d1c3fec24af53f1e829532a
|
||||
+ "https://jd.advntr.dev/text-serializer-legacy/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://jd.advntr.dev/text-serializer-plain/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://jd.advntr.dev/text-logger-slf4j/${common.adventure.api.orNull?.version}/",
|
||||
+ "https://guava.dev/releases/${api.guava.orNull?.version}/api/docs/",
|
||||
+ "https://javadoc.io/doc/org.yaml/snakeyaml/${common.snakeyaml.orNull?.version}/",
|
||||
+ "https://javadoc.io/doc/org.jetbrains/annotations/${api.annotations.orNull?.version}/",
|
||||
+ "https://javadoc.io/doc/org.joml/joml/${api.joml.orNull?.version}/index.html",
|
||||
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/${api.gson.orNull?.version}",
|
||||
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/${api.slf4j.api.orNull?.version}/",
|
||||
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/${api.slf4j.orNull?.version}/",
|
||||
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/${common.log4j.api.orNull?.version}/",
|
||||
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.maven.connector.orNull?.version}",
|
||||
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.mvn.connector.orNull?.version}",
|
||||
+ // Plazma end
|
||||
)
|
||||
options.tags("apiNote:a:API Note:")
|
||||
|
||||
@@ -27,7 +27,7 @@ index c89d6c4c38e2390cb11ffba182f8741d3726cfd1..2451f466ae6f953b01ad2cbaeac7d163
|
||||
* Executes the command with the given {@link CommandSourceStack} and arguments.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/Fluid.java b/src/main/java/org/bukkit/Fluid.java
|
||||
index a3ff4fefaf50f3e99a69ba68cbe8e30c95dac5df..284b351e3628bf278afb43cc6f6bdf1e6b295366 100644
|
||||
index a3ff4fefaf50f3e99a69ba68cbe8e30c95dac5df..5bbecd907e222f9adcf726bccab63c9ef59f5c14 100644
|
||||
--- a/src/main/java/org/bukkit/Fluid.java
|
||||
+++ b/src/main/java/org/bukkit/Fluid.java
|
||||
@@ -10,6 +10,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -47,7 +47,7 @@ index a3ff4fefaf50f3e99a69ba68cbe8e30c95dac5df..284b351e3628bf278afb43cc6f6bdf1e
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/attribute/Attribute.java b/src/main/java/org/bukkit/attribute/Attribute.java
|
||||
index 521f035409ee61a9ad73d39bec938f2938892570..4ca383b167326a2ccc21b2435eb96ff41c49cc31 100644
|
||||
index 521f035409ee61a9ad73d39bec938f2938892570..6e53135579426cb677bf34a0813db8268d550428 100644
|
||||
--- a/src/main/java/org/bukkit/attribute/Attribute.java
|
||||
+++ b/src/main/java/org/bukkit/attribute/Attribute.java
|
||||
@@ -15,6 +15,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -67,7 +67,7 @@ index 521f035409ee61a9ad73d39bec938f2938892570..4ca383b167326a2ccc21b2435eb96ff4
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/block/Biome.java b/src/main/java/org/bukkit/block/Biome.java
|
||||
index 464f8f81ba907a61588e4ab869e4f8269830195a..c5f1cc1660c69dfd827344cbafee08005121fb62 100644
|
||||
index 464f8f81ba907a61588e4ab869e4f8269830195a..6d50664e76e6e7ed98ca7b311fdb368886ab65a8 100644
|
||||
--- a/src/main/java/org/bukkit/block/Biome.java
|
||||
+++ b/src/main/java/org/bukkit/block/Biome.java
|
||||
@@ -23,6 +23,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -88,7 +88,7 @@ index 464f8f81ba907a61588e4ab869e4f8269830195a..c5f1cc1660c69dfd827344cbafee0800
|
||||
|
||||
// Paper start
|
||||
diff --git a/src/main/java/org/bukkit/block/banner/PatternType.java b/src/main/java/org/bukkit/block/banner/PatternType.java
|
||||
index 70904d6c43b93cb7b9d74d20666fac93a6b4996c..ce88fc3594a6b5e85009707e1319f7f87524dd5f 100644
|
||||
index 24b58ed80f3dd7c6b35bb18071000af845d18ba4..13ad0ba6320acd054a665d1749871a14cfd1a520 100644
|
||||
--- a/src/main/java/org/bukkit/block/banner/PatternType.java
|
||||
+++ b/src/main/java/org/bukkit/block/banner/PatternType.java
|
||||
@@ -12,6 +12,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -100,7 +100,7 @@ index 70904d6c43b93cb7b9d74d20666fac93a6b4996c..ce88fc3594a6b5e85009707e1319f7f8
|
||||
PatternType BASE = getType("base");
|
||||
PatternType SQUARE_BOTTOM_LEFT = getType("square_bottom_left");
|
||||
PatternType SQUARE_BOTTOM_RIGHT = getType("square_bottom_right");
|
||||
@@ -130,6 +132,6 @@ public interface PatternType extends OldEnum<PatternType>, Keyed {
|
||||
@@ -140,6 +142,6 @@ public interface PatternType extends OldEnum<PatternType>, Keyed {
|
||||
@NotNull
|
||||
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
|
||||
static PatternType[] values() {
|
||||
@@ -109,7 +109,7 @@ index 70904d6c43b93cb7b9d74d20666fac93a6b4996c..ce88fc3594a6b5e85009707e1319f7f8
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
|
||||
index 0a26fffe9b1e5080b5639767a03af11006108b4a..bcd12e352d8846826a678ff72742fc7038daf812 100644
|
||||
index 74384a56eebbce41d431db2507c55eddbcf50a41..ef3afe91312de1d0fb38d985e0421ceae59d7e57 100644
|
||||
--- a/src/main/java/org/bukkit/command/Command.java
|
||||
+++ b/src/main/java/org/bukkit/command/Command.java
|
||||
@@ -58,6 +58,19 @@ public abstract class Command {
|
||||
@@ -133,7 +133,7 @@ index 0a26fffe9b1e5080b5639767a03af11006108b4a..bcd12e352d8846826a678ff72742fc70
|
||||
* Executes the command, returning its success
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
|
||||
index 43e306584988e39a6daca78c621a937acdce48a1..ec6dc4747c8bcdca1cf866ba135fb772e79a73d1 100644
|
||||
index a824ac90e78d3d7f90b01397270e54422d88e8b9..95df10ad8a53942de435cec7db57c1bb496097dc 100644
|
||||
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
|
||||
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
|
||||
@@ -15,6 +15,8 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -147,14 +147,14 @@ index 43e306584988e39a6daca78c621a937acdce48a1..ec6dc4747c8bcdca1cf866ba135fb772
|
||||
*/
|
||||
@@ -536,6 +538,6 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
|
||||
@NotNull
|
||||
@Deprecated
|
||||
@Deprecated(since = "1.20.3")
|
||||
public static Enchantment[] values() {
|
||||
- return Lists.newArrayList(Registry.ENCHANTMENT).toArray(new Enchantment[0]);
|
||||
+ return Lists.newArrayList(Registry.ENCHANTMENT).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java
|
||||
index fca4671c6976aee9e981ef344244f9322651d0c9..ef53ca228492434b1b8bc615a33690bb93dec72b 100644
|
||||
index fca4671c6976aee9e981ef344244f9322651d0c9..7dc1744fba576683155e7970832794c05ceff768 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Cat.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Cat.java
|
||||
@@ -51,6 +51,7 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
|
||||
@@ -175,7 +175,7 @@ index fca4671c6976aee9e981ef344244f9322651d0c9..ef53ca228492434b1b8bc615a33690bb
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Frog.java b/src/main/java/org/bukkit/entity/Frog.java
|
||||
index f661a6b4797dd814a197e9245bcb2ddf2fca773f..6b3c10d378e9e80805d8cd2d8671b313bddd23e9 100644
|
||||
index f661a6b4797dd814a197e9245bcb2ddf2fca773f..58bf414cd753299abc54c45b3036d3fdbf9170dc 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Frog.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Frog.java
|
||||
@@ -49,6 +49,7 @@ public interface Frog extends Animals {
|
||||
@@ -196,7 +196,7 @@ index f661a6b4797dd814a197e9245bcb2ddf2fca773f..6b3c10d378e9e80805d8cd2d8671b313
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
|
||||
index 9c722a762c88a88bb5ef18c3b9eab8b371360dac..87c3e94a2b5e9205a9ad13a920ed7b9dfba03340 100644
|
||||
index 9c722a762c88a88bb5ef18c3b9eab8b371360dac..127bc2aab7fb36df206d53f3e6042bb6c920878e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Villager.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
||||
@@ -170,6 +170,7 @@ public interface Villager extends AbstractVillager {
|
||||
@@ -234,7 +234,7 @@ index 9c722a762c88a88bb5ef18c3b9eab8b371360dac..87c3e94a2b5e9205a9ad13a920ed7b9d
|
||||
|
||||
// Paper start
|
||||
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
|
||||
index eb73f3224e7d2314c4209a3743a37bdae2395670..1b660fd1334847d8f8cd7eeff3d5ebd085fdfcfd 100644
|
||||
index 7f5682c80ff25142e7c8fa14e03b4a62fc5c01d3..5fbcdf637b1e0162276e668d9ebe4a8648a29b8a 100644
|
||||
--- a/src/main/java/org/bukkit/map/MapCursor.java
|
||||
+++ b/src/main/java/org/bukkit/map/MapCursor.java
|
||||
@@ -286,6 +286,7 @@ public final class MapCursor {
|
||||
@@ -255,7 +255,7 @@ index eb73f3224e7d2314c4209a3743a37bdae2395670..1b660fd1334847d8f8cd7eeff3d5ebd0
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
index 11b973b70ce62a6e227d343bdef6dcb9ece3f97d..ccb4245b214444153cbca487ca98cb2ad65ccbae 100644
|
||||
index 2f8d3b7a5b25e323f892d2ec5eb7c3412a816ea4..22e358f7a83d84745c32ff9f04d79d51d8d92131 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
@@ -47,6 +47,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -276,7 +276,7 @@ index 11b973b70ce62a6e227d343bdef6dcb9ece3f97d..ccb4245b214444153cbca487ca98cb2a
|
||||
Preconditions.checkArgument(directory != null, "Directory cannot be null");
|
||||
Preconditions.checkArgument(directory.isDirectory(), "Directory must be a directory");
|
||||
diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java
|
||||
index 294ba70f1e446ec8d502e5c14f82ae52547aeb21..beb22bb6ca719ef11814e7cc80cc1aef7cb6f0ec 100644
|
||||
index e4cfdc80c9e49fc7992183022bdf2f36aae0d95a..0cd7987e935e2b7ede759af3db9af04366930e19 100644
|
||||
--- a/src/main/java/org/bukkit/potion/PotionEffectType.java
|
||||
+++ b/src/main/java/org/bukkit/potion/PotionEffectType.java
|
||||
@@ -19,6 +19,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -289,7 +289,7 @@ index 294ba70f1e446ec8d502e5c14f82ae52547aeb21..beb22bb6ca719ef11814e7cc80cc1aef
|
||||
* Increases movement speed.
|
||||
@@ -358,7 +359,7 @@ public abstract class PotionEffectType implements Keyed, Translatable, net.kyori
|
||||
@NotNull
|
||||
@Deprecated
|
||||
@Deprecated(since = "1.20.3")
|
||||
public static PotionEffectType[] values() {
|
||||
- return Lists.newArrayList(Registry.EFFECT).toArray(new PotionEffectType[0]);
|
||||
+ return Lists.newArrayList(Registry.EFFECT).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,56 @@ Date: Sat, 2 Nov 2024 15:26:27 +0900
|
||||
Subject: [PATCH] mc dev fixes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/DebugCommand.java b/src/main/java/net/minecraft/server/commands/DebugCommand.java
|
||||
index 06568cc308e06b16f43ec7facd5e2c4e36f3fee9..f8cdd6911fe9d6402455b7368d0e98c25e9511ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/DebugCommand.java
|
||||
+++ b/src/main/java/net/minecraft/server/commands/DebugCommand.java
|
||||
@@ -271,5 +271,12 @@ public class DebugCommand {
|
||||
public void close() {
|
||||
IOUtils.closeQuietly((Writer)this.output);
|
||||
}
|
||||
+
|
||||
+ // Plazma start - Decompile fixes
|
||||
+ @Override
|
||||
+ public CommandSender getBukkitSender(final CommandSourceStack wrapper) {
|
||||
+ return wrapper.getBukkitSender();
|
||||
+ }
|
||||
+ // Plazma end - Decompile fixes
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/ReturnCommand.java b/src/main/java/net/minecraft/server/commands/ReturnCommand.java
|
||||
index 9f82ca1fee2a319d52a4106c3581f5e9a9554a9e..f5c7748117342dedd9d600881143c206e429fe5b 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/ReturnCommand.java
|
||||
+++ b/src/main/java/net/minecraft/server/commands/ReturnCommand.java
|
||||
@@ -16,18 +16,18 @@ import net.minecraft.commands.execution.tasks.BuildContexts;
|
||||
import net.minecraft.commands.execution.tasks.FallthroughTask;
|
||||
|
||||
public class ReturnCommand {
|
||||
- public static <T extends ExecutionCommandSource<T>> void register(CommandDispatcher<T> dispatcher) {
|
||||
- dispatcher.register(
|
||||
- (LiteralArgumentBuilder<T>)LiteralArgumentBuilder.<ExecutionCommandSource>literal("return")
|
||||
- .requires(source -> source.hasPermission(2))
|
||||
- .then(
|
||||
- RequiredArgumentBuilder.<T, Integer>argument("value", IntegerArgumentType.integer())
|
||||
- .executes(new ReturnCommand.ReturnValueCustomExecutor<>())
|
||||
- )
|
||||
- .then(LiteralArgumentBuilder.<T>literal("fail").executes(new ReturnCommand.ReturnFailCustomExecutor<>()))
|
||||
- .then(LiteralArgumentBuilder.<T>literal("run").forward(dispatcher.getRoot(), new ReturnCommand.ReturnFromCommandCustomModifier<>(), false))
|
||||
+
|
||||
+ // Plazma start - Decompile fixes
|
||||
+ public static void register(CommandDispatcher<net.minecraft.commands.CommandSourceStack> dispatcher) {
|
||||
+ dispatcher.register(net.minecraft.commands.Commands.literal("return")
|
||||
+ .requires(source -> source.hasPermission(2))
|
||||
+ .then(net.minecraft.commands.Commands.argument("value", IntegerArgumentType.integer())
|
||||
+ .executes(new ReturnCommand.ReturnValueCustomExecutor<>()))
|
||||
+ .then(net.minecraft.commands.Commands.literal("fail").executes(new ReturnCommand.ReturnFailCustomExecutor<>()))
|
||||
+ .then(net.minecraft.commands.Commands.literal("run").forward(dispatcher.getRoot(), new ReturnCommand.ReturnFromCommandCustomModifier<>(), false))
|
||||
);
|
||||
}
|
||||
+ // Plazma end - Decompile fixes
|
||||
|
||||
static class ReturnFailCustomExecutor<T extends ExecutionCommandSource<T>> implements CustomCommandExecutor.CommandAdapter<T> {
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/AllayAi.java b/src/main/java/net/minecraft/world/entity/animal/allay/AllayAi.java
|
||||
index 3fc1ec01e1a77a169ec762a23f15b97f040ce5f8..b5464708c1fa949e7df8aed71126ccad72d66ee3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/allay/AllayAi.java
|
||||
|
||||
19
patches/server/0003-Minor-code-optimizations.patch
Normal file
19
patches/server/0003-Minor-code-optimizations.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 13 Dec 2024 13:54:22 +0900
|
||||
Subject: [PATCH] Minor code optimizations
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 34e8eb828be517d9ee3973597c74c5cac3d75c99..f8575f94a389d87d8043ae838720dbe2247235c4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1697,7 +1697,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@Override
|
||||
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
|
||||
Profiler.get().incrementCounter("getEntities");
|
||||
- List<Entity> list = Lists.newArrayList();
|
||||
+ //List<Entity> list = Lists.newArrayList(); // Plazma - minor optimizations
|
||||
|
||||
// Paper start - rewrite chunk system
|
||||
final List<Entity> ret = new java.util.ArrayList<>();
|
||||
@@ -5,16 +5,16 @@ Subject: [PATCH] Build System Changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index b4579fb919d8cc981edc4863b82abca531349f1e..6734821658e7679f328336038587390a262f2b64 100644
|
||||
index 77602e4445b1b45a17e5552ac6a769e0ed46ebc7..f021047331c7eb3dac7f0d56af73a9056ffe826b 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -25,64 +25,30 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||
// Paper end - configure mockito agent that is needed in newer java versions
|
||||
@@ -26,71 +26,34 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur
|
||||
implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur
|
||||
- // Paper start
|
||||
- implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
- implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
||||
- implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
||||
- implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
- implementation("net.kyori:adventure-text-serializer-ansi:4.17.0") // Keep in sync with adventureVersion from Paper-API build file
|
||||
- /*
|
||||
@@ -46,6 +46,13 @@ index b4579fb919d8cc981edc4863b82abca531349f1e..6734821658e7679f328336038587390a
|
||||
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
-
|
||||
- // Pufferfish start
|
||||
- implementation("org.yaml:snakeyaml:1.32")
|
||||
- implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") { // Purpur
|
||||
- exclude(group="org.yaml", module="snakeyaml")
|
||||
- }
|
||||
- // Pufferfish end
|
||||
-
|
||||
- implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
|
||||
- implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
|
||||
- implementation("dev.omega24:upnp4j:1.0") // Purpur
|
||||
@@ -55,30 +62,7 @@ index b4579fb919d8cc981edc4863b82abca531349f1e..6734821658e7679f328336038587390a
|
||||
- testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0")
|
||||
- testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
- testImplementation("org.mockito:mockito-core:5.14.1")
|
||||
+ // Plazma start - Build System Changes
|
||||
+ implementation(project(":${rootProject.providers.gradleProperty("brandName").get().lowercase()}-api"))
|
||||
+ implementation(common.snakeyaml)
|
||||
+ implementation(common.asm.commons)
|
||||
+ implementation(common.log4j.core)
|
||||
+ implementation(common.log4j.iostreams)
|
||||
+ implementation(common.commons.lang2)
|
||||
+ implementation(common.adventure.serializer.ansi)
|
||||
+ implementation(server.velocity) { isTransitive = false }
|
||||
+ implementation(server.simpleyaml) { exclude(group="org.yaml", module="snakeyaml") }
|
||||
+ implementation(server.bundles.implementation)
|
||||
+
|
||||
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j.core)
|
||||
+ alsoShade(log4jPlugins.output) // diff on changes
|
||||
+ runtimeOnly(log4jPlugins.output) // diff on changes
|
||||
+
|
||||
+ runtimeOnly(common.maven.provider)
|
||||
+ runtimeOnly(common.bundles.maven)
|
||||
+ runtimeOnly(server.bundles.runtime)
|
||||
+
|
||||
+ testImplementation(common.bundles.test)
|
||||
+ testImplementation(server.bundles.test)
|
||||
+ // Plazma end - Build System Changes
|
||||
mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions
|
||||
- mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions
|
||||
- testImplementation("org.ow2.asm:asm-tree:9.7.1")
|
||||
- testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
|
||||
- implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
|
||||
@@ -91,12 +75,40 @@ index b4579fb919d8cc981edc4863b82abca531349f1e..6734821658e7679f328336038587390a
|
||||
- // Paper end - Remap reflection
|
||||
- // Paper start - spark
|
||||
- implementation("me.lucko:spark-api:0.1-20240720.200737-2")
|
||||
- implementation("me.lucko:spark-paper:1.10.105-SNAPSHOT")
|
||||
- implementation("me.lucko:spark-paper:1.10.119-SNAPSHOT")
|
||||
- // Paper end - spark
|
||||
+ // Plazma start - Use Gradle Version Catalogs
|
||||
+ implementation(server.bundles.implementation)
|
||||
+ implementation(common.adventure.serializer.ansi)
|
||||
+ implementation(common.log4j.stream)
|
||||
+
|
||||
+ implementation(common.log4j)
|
||||
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j)
|
||||
+ runtimeOnly(log4jPlugins.output) // diff on change
|
||||
+ alsoShade(log4jPlugins.output) // diff on change
|
||||
+
|
||||
+ runtimeOnly(server.bundles.runtime)
|
||||
+
|
||||
+ implementation(common.bundles.asm)
|
||||
+ implementation(common.commons.lang2)
|
||||
+ implementation(server.velocity.native) { isTransitive = false }
|
||||
+
|
||||
+ runtimeOnly(common.mvn)
|
||||
+ runtimeOnly(common.bundles.mvn)
|
||||
+
|
||||
+ implementation(common.snakeyaml)
|
||||
+ implementation(server.simpleyaml) { exclude(group="org.yaml", module="snakeyaml") }
|
||||
+
|
||||
+ testImplementation(server.classgraph)
|
||||
+ testImplementation(common.bundles.test)
|
||||
+ testImplementation(common.junit)
|
||||
+ mockitoAgent(common.mockito) { isTransitive = false }
|
||||
+ testImplementation(common.junit.pioneer)
|
||||
+ // Plazma end - Use Gradle Version Catalogs
|
||||
}
|
||||
|
||||
paperweight {
|
||||
@@ -102,14 +68,14 @@ tasks.jar {
|
||||
@@ -118,14 +81,14 @@ tasks.jar {
|
||||
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
@@ -4,6 +4,19 @@ Date: Wed, 21 Dec 2022 19:31:24 +0900
|
||||
Subject: [PATCH] Fork-friendly Rebranding
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index f021047331c7eb3dac7f0d56af73a9056ffe826b..41005f58fdd526907972185e728bbe1fa97171e9 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -25,7 +25,7 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||
// Paper end - configure mockito agent that is needed in newer java versions
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur
|
||||
+ implementation(project(":plazma-api")) // Pufferfish // Paper // Purpur // Plazma
|
||||
// Plazma start - Use Gradle Version Catalogs
|
||||
implementation(server.bundles.implementation)
|
||||
implementation(common.adventure.serializer.ansi)
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..8d5a52c5762c3d9b44dcdf00ae312e0bdc01fa1f 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -127,20 +140,21 @@ index 0000000000000000000000000000000000000000..3af005ce2bbd30601917987d8c831db2
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
index a6e5950b5875cafd734300cdfbf58f5d3736f3c8..a337e2c9576fb70a8ee9082e9b69719c804b286e 100644
|
||||
index 3099c21ee589acf6edff5903a23673adf489024f..a337e2c9576fb70a8ee9082e9b69719c804b286e 100644
|
||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
@@ -30,9 +30,6 @@ public record ServerBuildInfoImpl(
|
||||
@@ -30,10 +30,6 @@ public record ServerBuildInfoImpl(
|
||||
private static final String ATTRIBUTE_GIT_BRANCH = "Git-Branch";
|
||||
private static final String ATTRIBUTE_GIT_COMMIT = "Git-Commit";
|
||||
|
||||
- private static final String BRAND_PAPER_NAME = "Paper";
|
||||
- private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Purpur
|
||||
- private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur
|
||||
-
|
||||
private static final String BUILD_DEV = "DEV";
|
||||
|
||||
public ServerBuildInfoImpl() {
|
||||
@@ -43,9 +40,9 @@ public record ServerBuildInfoImpl(
|
||||
@@ -44,9 +40,9 @@ public record ServerBuildInfoImpl(
|
||||
this(
|
||||
getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID)
|
||||
.map(Key::key)
|
||||
@@ -152,30 +166,28 @@ index a6e5950b5875cafd734300cdfbf58f5d3736f3c8..a337e2c9576fb70a8ee9082e9b69719c
|
||||
SharedConstants.getCurrentVersion().getId(),
|
||||
SharedConstants.getCurrentVersion().getName(),
|
||||
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
|
||||
@@ -62,7 +59,7 @@ public record ServerBuildInfoImpl(
|
||||
@@ -63,7 +59,7 @@ public record ServerBuildInfoImpl(
|
||||
|
||||
@Override
|
||||
public boolean isBrandCompatible(final @NotNull Key brandId) {
|
||||
- return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID); // Purpur
|
||||
- return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_PUFFERFISH_ID); // Purpur
|
||||
+ return brandId.equals(this.brandId) || SUPPORTED_BRANDS.contains(brandId); // Purpur // Plazma - Fork-friendly Rebranding
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
index 87e5f614ba988547a827486740db217e28585773..f5aac6cde46ca08a4d4792e38f514bb3d8188ae8 100644
|
||||
index 8cf720f08514e8e4f62f4ad196f1277bd761c6b2..cda2ca940e30506807a5d12b84dbf69529051e26 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
@@ -113,9 +113,7 @@ public abstract class Configurations<G, W> {
|
||||
try {
|
||||
@@ -112,7 +112,7 @@ public abstract class Configurations<G, W> {
|
||||
loader.save(node);
|
||||
} catch (ConfigurateException ex) {
|
||||
- if (ex.getCause() instanceof AccessDeniedException) {
|
||||
if (ex.getCause() instanceof AccessDeniedException) {
|
||||
- LOGGER.warn("Could not save {}: Paper could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at https://docs.papermc.io/paper/configuration for more details.", filename, ex);
|
||||
- } else throw ex;
|
||||
+ if (ex.getCause() instanceof AccessDeniedException) LOGGER.warn("Could not save {}: {} could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at {} for more details.", filename, io.papermc.paper.ServerBrandConstants.BRAND_NAME, io.papermc.paper.ServerBrandConstants.CONFIG_REFERENCE, ex); else throw ex; // Plazma - Fork-friendly Rebranding
|
||||
+ LOGGER.warn("Could not save {}: {} could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at {} for more details.", filename, io.papermc.paper.ServerBrandConstants.BRAND_NAME, io.papermc.paper.ServerBrandConstants.CONFIG_REFERENCE, ex); // Plazma - Fork-friendly Rebranding
|
||||
} else throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
|
||||
index 710477ae27ebc5afdf0012ef0867d05efd293c24..3a5e7546c5cc1fcec880cece3f0d0b04ec23cc18 100644
|
||||
--- a/src/main/java/net/minecraft/CrashReport.java
|
||||
@@ -197,7 +209,7 @@ index 710477ae27ebc5afdf0012ef0867d05efd293c24..3a5e7546c5cc1fcec880cece3f0d0b04
|
||||
|
||||
public String getTitle() {
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index f0d762bd140fad27ae73bcf3e61b640b9e3f2592..3a9f7143505ba1a70bcd224ee8fef5c844a94ed1 100644
|
||||
index ecaec3c7b5768771b00c4c33d48a76ba22653a79..8f77566bef4b992013e3b65068cabe7ee1921951 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -108,6 +108,11 @@ public class Main {
|
||||
@@ -213,10 +225,10 @@ index f0d762bd140fad27ae73bcf3e61b640b9e3f2592..3a9f7143505ba1a70bcd224ee8fef5c8
|
||||
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 1ad565ad881cb7efd4a3919c164f275006b4b789..b281048d9cb54d3acb53da8f722d00c1786f1fb6 100644
|
||||
index 23505b0f80d643d9ef569b49192f44e0373dfb5f..20f79bcd7613e426b6b1020f586773819f1ac9d0 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1277,7 +1277,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1280,7 +1280,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
LOGGER.info("*************************************************************************************");
|
||||
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.");
|
||||
@@ -226,10 +238,10 @@ index 1ad565ad881cb7efd4a3919c164f275006b4b789..b281048d9cb54d3acb53da8f722d00c1
|
||||
}
|
||||
// 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
|
||||
index e9ad8e2ac267c46df80e884308df8bb12d0deeff..4aaeb0521a5e48a7d74a7968c952fcca7b6c0433 100644
|
||||
index 7a442fb4cf78bcb1268359ee41a6de138edb76b6..193c62ed303d25558d78f1e8dfb655919335fdf6 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -775,7 +775,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -779,7 +779,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
org.bukkit.plugin.Plugin[] plugins = this.server.getPluginManager().getPlugins();
|
||||
|
||||
result.append(this.server.getName());
|
||||
@@ -239,7 +251,7 @@ index e9ad8e2ac267c46df80e884308df8bb12d0deeff..4aaeb0521a5e48a7d74a7968c952fcca
|
||||
|
||||
if (plugins.length > 0 && this.server.getQueryPlugins()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
index ee70e7a2f87ca31b1c2918148d585e90601d277b..568141881ffb26b425be452c79ecc146821ba1d9 100644
|
||||
index 05e16103af3fd276f0196ddf1a2e5b729b025c34..8f7e922ceca286b1a590181c301fbe9bff55c024 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
@@ -56,10 +56,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
@@ -309,10 +321,10 @@ index 4a96d914f8aa6f0c5f13fc85369a311f25835ac2..5b4285d6b37346bcea3bf072c6f00bd5
|
||||
DamageSource damageSource = this.cloneInstance();
|
||||
damageSource.customEventDamager = entity;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
index 0dde7cd71a32e6c0cde6cbbaef585896a3d7dae7..9b4afcd708270225da272ba5278397ffe1f91403 100644
|
||||
index cf0f3a14584b9280211f88808cb1ddfb10105ec5..fffe0091008339d438961f0d9f6f62ad6d31859f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -274,7 +274,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
@@ -289,7 +289,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
|
||||
// Paper start
|
||||
private static void printOversizedLog(String msg, Path file, int x, int z) {
|
||||
@@ -322,7 +334,7 @@ index 0dde7cd71a32e6c0cde6cbbaef585896a3d7dae7..9b4afcd708270225da272ba5278397ff
|
||||
|
||||
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index b2d60b214b58d9a5fadf3629e5ebc358c904d1c6..f9ee08eae4a1e1c6490e4682901609c0e4d52579 100644
|
||||
index 430407b0cf06ba337c59cd576c7e40a8e5fe8229..75a062e1105c2f7cc631a6b8b201b0e08621e3c5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -143,7 +143,7 @@ public class Main {
|
||||
@@ -334,7 +346,7 @@ index b2d60b214b58d9a5fadf3629e5ebc358c904d1c6..f9ee08eae4a1e1c6490e4682901609c0
|
||||
|
||||
this.acceptsAll(Main.asList("demo"), "Demo mode");
|
||||
|
||||
@@ -188,7 +188,7 @@ public class Main {
|
||||
@@ -194,7 +194,7 @@ public class Main {
|
||||
acceptsAll(asList("server-name"), "Name of the server")
|
||||
.withRequiredArg()
|
||||
.ofType(String.class)
|
||||
@@ -344,7 +356,7 @@ index b2d60b214b58d9a5fadf3629e5ebc358c904d1c6..f9ee08eae4a1e1c6490e4682901609c0
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index c914e1e13c4f64f24efa5f825e58efb69632bfa6..c558a2621381cf54661fd3926a00982af2037365 100644
|
||||
index 5e7b833fc9f37bc370c76e5c43e6c9919d6d20af..ddbda1491e5873be1b54f0a555cc5c675f4597d4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -491,7 +491,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Plazma Configurations
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
index f5aac6cde46ca08a4d4792e38f514bb3d8188ae8..4ab13053dec8f05f84981b1bbb6ed06beff65045 100644
|
||||
index cda2ca940e30506807a5d12b84dbf69529051e26..150556ba594eae2214e4d1f0243ee97a7beb1e99 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
@@ -39,27 +39,94 @@ public abstract class Configurations<G, W> {
|
||||
@@ -37,27 +37,94 @@ public abstract class Configurations<G, W> {
|
||||
public static final String WORLD_DEFAULTS = "__world_defaults__";
|
||||
public static final ResourceLocation WORLD_DEFAULTS_KEY = ResourceLocation.fromNamespaceAndPath("configurations", WORLD_DEFAULTS);
|
||||
protected final Path globalFolder;
|
||||
@@ -123,7 +123,7 @@ index f5aac6cde46ca08a4d4792e38f514bb3d8188ae8..4ab13053dec8f05f84981b1bbb6ed06b
|
||||
|
||||
protected ObjectMapper.Factory.Builder createObjectMapper() {
|
||||
return ObjectMapper.factoryBuilder()
|
||||
@@ -68,17 +135,21 @@ public abstract class Configurations<G, W> {
|
||||
@@ -66,17 +133,21 @@ public abstract class Configurations<G, W> {
|
||||
}
|
||||
|
||||
protected YamlConfigurationLoader.Builder createLoaderBuilder() {
|
||||
@@ -148,7 +148,7 @@ index f5aac6cde46ca08a4d4792e38f514bb3d8188ae8..4ab13053dec8f05f84981b1bbb6ed06b
|
||||
}
|
||||
|
||||
@MustBeInvokedByOverriders
|
||||
@@ -96,7 +167,7 @@ public abstract class Configurations<G, W> {
|
||||
@@ -94,7 +165,7 @@ public abstract class Configurations<G, W> {
|
||||
};
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ index f5aac6cde46ca08a4d4792e38f514bb3d8188ae8..4ab13053dec8f05f84981b1bbb6ed06b
|
||||
return node -> {
|
||||
ObjectMapper.Factory factory = (ObjectMapper.Factory) Objects.requireNonNull(node.options().serializers().get(type));
|
||||
ObjectMapper.Mutable<T> mutable = (ObjectMapper.Mutable<T>) factory.get(type);
|
||||
@@ -106,7 +177,7 @@ public abstract class Configurations<G, W> {
|
||||
@@ -104,7 +175,7 @@ public abstract class Configurations<G, W> {
|
||||
}
|
||||
|
||||
public G initializeGlobalConfiguration(final RegistryAccess registryAccess) throws ConfigurateException {
|
||||
@@ -295,10 +295,10 @@ index f5aac6cde46ca08a4d4792e38f514bb3d8188ae8..4ab13053dec8f05f84981b1bbb6ed06b
|
||||
|
||||
public static class ContextMap {
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d1f26aa4a 100644
|
||||
index 47a2cba0db36b11548d06ec21f7c7d7c9a962d6e..3f99ca451099d2c7baf12b7b603d8b30f520734c 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
@@ -135,6 +135,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -137,6 +137,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
See https://docs.papermc.io/paper/configuration for more information.
|
||||
""";
|
||||
|
||||
@@ -306,7 +306,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
@VisibleForTesting
|
||||
public static final Supplier<SpigotWorldConfig> SPIGOT_WORLD_DEFAULTS = Suppliers.memoize(() -> new SpigotWorldConfig(RandomStringUtils.randomAlphabetic(255)) {
|
||||
@Override // override to ensure "verbose" is false
|
||||
@@ -143,11 +144,68 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -145,11 +146,68 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
}
|
||||
});
|
||||
public static final ContextKey<Supplier<SpigotWorldConfig>> SPIGOT_WORLD_CONFIG_CONTEXT_KEY = new ContextKey<>(new TypeToken<Supplier<SpigotWorldConfig>>() {}, "spigot world config");
|
||||
@@ -377,7 +377,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
|
||||
@Override
|
||||
protected int globalConfigVersion() {
|
||||
@@ -162,14 +220,11 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -164,14 +222,11 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@Override
|
||||
protected YamlConfigurationLoader.Builder createLoaderBuilder() {
|
||||
return super.createLoaderBuilder()
|
||||
@@ -394,7 +394,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
.register(IntOr.Default.SERIALIZER)
|
||||
.register(IntOr.Disabled.SERIALIZER)
|
||||
.register(DoubleOr.Default.SERIALIZER)
|
||||
@@ -181,6 +236,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -183,6 +238,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
);
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
@Override
|
||||
protected ObjectMapper.Factory.Builder createGlobalObjectMapperFactoryBuilder() {
|
||||
return defaultGlobalFactoryBuilder(super.createGlobalObjectMapperFactoryBuilder());
|
||||
@@ -189,6 +245,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -191,6 +247,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
private static ObjectMapper.Factory.Builder defaultGlobalFactoryBuilder(ObjectMapper.Factory.Builder builder) {
|
||||
return builder.addDiscoverer(InnerClassFieldDiscoverer.globalConfig());
|
||||
}
|
||||
@@ -410,7 +410,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
|
||||
@Override
|
||||
protected YamlConfigurationLoader.Builder createGlobalLoaderBuilder() {
|
||||
@@ -211,6 +268,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -213,6 +270,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
return configuration;
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
@Override
|
||||
protected ContextMap.Builder createDefaultContextMap(final RegistryAccess registryAccess) {
|
||||
return super.createDefaultContextMap(registryAccess)
|
||||
@@ -224,8 +282,9 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -226,8 +284,9 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
.addNodeResolver(new NestedSetting.Factory())
|
||||
.addDiscoverer(InnerClassFieldDiscoverer.worldConfig(createWorldConfigInstance(contextMap)));
|
||||
}
|
||||
@@ -429,7 +429,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
return new WorldConfiguration(
|
||||
contextMap.require(PaperConfigurations.SPIGOT_WORLD_CONFIG_CONTEXT_KEY).get(),
|
||||
contextMap.require(Configurations.WORLD_KEY)
|
||||
@@ -237,7 +296,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -239,7 +298,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
final RegistryAccess access = contextMap.require(REGISTRY_ACCESS);
|
||||
return super.createWorldConfigLoaderBuilder(contextMap)
|
||||
.defaultOptions(options -> options
|
||||
@@ -438,7 +438,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
.serializers(serializers -> serializers
|
||||
.register(new TypeToken<Reference2IntMap<?>>() {}, new FastutilMapSerializer.SomethingToPrimitive<Reference2IntMap<?>>(Reference2IntOpenHashMap::new, Integer.TYPE))
|
||||
.register(new TypeToken<Reference2LongMap<?>>() {}, new FastutilMapSerializer.SomethingToPrimitive<Reference2LongMap<?>>(Reference2LongOpenHashMap::new, Long.TYPE))
|
||||
@@ -256,12 +315,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -259,12 +318,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
|
||||
@Override
|
||||
protected void applyWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode node, final @Nullable ConfigurationNode defaultsNode) throws ConfigurateException {
|
||||
@@ -452,7 +452,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
|
||||
final ConfigurationTransformation.VersionedBuilder versionedBuilder = Transformations.versionedBuilder();
|
||||
V29_ZeroWorldHeight.apply(versionedBuilder);
|
||||
@@ -273,11 +327,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -276,11 +330,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
|
||||
@Override
|
||||
protected void applyGlobalConfigTransformations(ConfigurationNode node) throws ConfigurateException {
|
||||
@@ -465,7 +465,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
|
||||
final ConfigurationTransformation.VersionedBuilder versionedBuilder = Transformations.versionedBuilder();
|
||||
V29_LogIPs.apply(versionedBuilder);
|
||||
@@ -297,6 +347,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -300,6 +350,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
builder.build().apply(worldNode);
|
||||
}
|
||||
|
||||
@@ -473,7 +473,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
@Override
|
||||
public WorldConfiguration createWorldConfig(final ContextMap contextMap) {
|
||||
final String levelName = contextMap.require(WORLD_NAME);
|
||||
@@ -338,6 +389,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -341,6 +392,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
.put(GAME_RULES, gameRules)
|
||||
.build();
|
||||
}
|
||||
@@ -481,7 +481,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
|
||||
public static PaperConfigurations setup(final Path legacyConfig, final Path configDir, final Path worldFolder, final File spigotConfig) throws Exception {
|
||||
final Path legacy = Files.isSymbolicLink(legacyConfig) ? Files.readSymbolicLink(legacyConfig) : legacyConfig;
|
||||
@@ -371,12 +423,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -374,12 +426,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
throw new RuntimeException("Could not convert '" + legacyFileName + "' to the new configuration format", ex);
|
||||
}
|
||||
}
|
||||
@@ -495,7 +495,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
}
|
||||
|
||||
private static void convert(final Path legacyConfig, final Path configDir, final Path worldFolder, final File spigotConfig) throws Exception {
|
||||
@@ -427,6 +474,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -430,6 +477,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
|
||||
}
|
||||
|
||||
@@ -503,7 +503,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
@Deprecated
|
||||
public YamlConfiguration createLegacyObject(final MinecraftServer server) {
|
||||
YamlConfiguration global = YamlConfiguration.loadConfiguration(this.globalFolder.resolve(this.globalConfigFileName).toFile());
|
||||
@@ -437,6 +485,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -440,6 +488,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
}
|
||||
return global;
|
||||
}
|
||||
@@ -511,7 +511,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
|
||||
@Deprecated
|
||||
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
|
||||
@@ -459,10 +508,13 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -462,10 +511,13 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
return BasicConfigurationNode.root(options);
|
||||
}
|
||||
|
||||
@@ -526,7 +526,7 @@ index ee0d1df78838e05450ad1a06ce70eab2d5e5d3b8..acfd2e0b6bb20af237bffb2540a9b45d
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 00bcb6de9f7aa5cb4c9fff2a784709b0fcc9b431..c462d9f0c1997f8c49f6e80c4c87124d2a2533d8 100644
|
||||
index 20f79bcd7613e426b6b1020f586773819f1ac9d0..20266ef8f0974f47581e71175de4b01ea1a27bf0 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -328,6 +328,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -537,7 +537,7 @@ index 00bcb6de9f7aa5cb4c9fff2a784709b0fcc9b431..c462d9f0c1997f8c49f6e80c4c87124d
|
||||
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
public boolean lagging = false; // Purpur
|
||||
protected boolean upnp = false; // Purpur
|
||||
@@ -513,6 +514,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -515,6 +516,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
||||
// CraftBukkit end
|
||||
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
|
||||
@@ -605,7 +605,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
|
||||
index 4aaeb0521a5e48a7d74a7968c952fcca7b6c0433..743ef664a84da93751feaa06e3522515cf9831f8 100644
|
||||
index 193c62ed303d25558d78f1e8dfb655919335fdf6..d4a9b187b01c63342d9b05b5c29bb1d199deed6c 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -232,6 +232,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -626,10 +626,10 @@ index 4aaeb0521a5e48a7d74a7968c952fcca7b6c0433..743ef664a84da93751feaa06e3522515
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 10d00d1d63d078d9462eca209420995de5f80eb8..8bd80a4f2f0cb0c4f206bc7d3e70fbcfe56188ee 100644
|
||||
index 6a359f1ed07aa7b9c78e470fb00661ea03eaec03..a4421517b8136bb974e197eaa6dd0d83c2fdd0de 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -593,7 +593,24 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -600,7 +600,24 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer
|
||||
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
|
||||
@@ -656,7 +656,7 @@ index 10d00d1d63d078d9462eca209420995de5f80eb8..8bd80a4f2f0cb0c4f206bc7d3e70fbcf
|
||||
this.convertable = convertable_conversionsession;
|
||||
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 7493262c2879af196e5585b15faad69ae42764e3..ad15fc9f329f5ea7fa0d0d88c937b2f36e0f2f3d 100644
|
||||
index f8575f94a389d87d8043ae838720dbe2247235c4..0da2014933fe441c4d3dc27c5fe10afa92ca1ec7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -172,7 +172,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -708,10 +708,10 @@ index 7493262c2879af196e5585b15faad69ae42764e3..ad15fc9f329f5ea7fa0d0d88c937b2f3
|
||||
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
|
||||
this.generator = gen;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 51770b116695c9d60d43785ae56e249672227025..9f2fb39eb3bde43fe8de9f962a15bbd121625679 100644
|
||||
index 81922bf93f8a96e6cf05944ca98a82cc5945a6c6..655463a7d588ed88778d137b6fe5ac18951ff172 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1088,6 +1088,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1100,6 +1100,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
@@ -719,7 +719,7 @@ index 51770b116695c9d60d43785ae56e249672227025..9f2fb39eb3bde43fe8de9f962a15bbd1
|
||||
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
@@ -3100,6 +3101,13 @@ public final class CraftServer implements Server {
|
||||
@@ -3112,6 +3113,13 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
@@ -734,10 +734,10 @@ index 51770b116695c9d60d43785ae56e249672227025..9f2fb39eb3bde43fe8de9f962a15bbd1
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index f9ee08eae4a1e1c6490e4682901609c0e4d52579..a1b7bacf43d68aee60b3f5a7fd3b077ee0fcb354 100644
|
||||
index 75a062e1105c2f7cc631a6b8b201b0e08621e3c5..b75e2a9273e9562a3d07f68af927ad085c428589 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -191,6 +191,14 @@ public class Main {
|
||||
@@ -197,6 +197,14 @@ public class Main {
|
||||
.defaultsTo("A " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Server") // Plazma - Fork-friendly Rebranding
|
||||
.describedAs("Name");
|
||||
// Paper end
|
||||
@@ -1319,6 +1319,32 @@ index 0000000000000000000000000000000000000000..f2d3d51cb4b8fc7a5fd6db1a63289fff
|
||||
+ int version = VERSION;
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/plazma/Config.java b/src/main/java/plazma/Config.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..afa60976a6a0bbdd8ed5b9231df2aeeb669b231e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/plazma/Config.java
|
||||
@@ -0,0 +1,20 @@
|
||||
+package plazma;
|
||||
+
|
||||
+import org.jetbrains.annotations.Contract;
|
||||
+import org.jspecify.annotations.NonNull;
|
||||
+import org.plazmamc.plazma.configurations.GlobalConfiguration;
|
||||
+import org.plazmamc.plazma.configurations.PlazmaConfigurations;
|
||||
+
|
||||
+public interface Config {
|
||||
+
|
||||
+ @Contract(pure = true)
|
||||
+ static boolean optimize() {
|
||||
+ return PlazmaConfigurations.optimize();
|
||||
+ }
|
||||
+
|
||||
+ @Contract(pure = true)
|
||||
+ static @NonNull GlobalConfiguration get() {
|
||||
+ return GlobalConfiguration.get();
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/test/java/org/bukkit/support/DummyServerHelper.java b/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
index 309d371247adcddf0a1b370cc5faff3e6e01cb0f..285a90ff5cdc8cb28fafd4ea3dae306ae5b899c9 100644
|
||||
--- a/src/test/java/org/bukkit/support/DummyServerHelper.java
|
||||
@@ -84,10 +84,10 @@ index 25c0f5d28107b45677aa7b19bc0d5238512d9826..ac0f038de0ce5cf6df0b730af69d3229
|
||||
|
||||
NodePath[] GLOBAL_PATHS = {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index f2d3d51cb4b8fc7a5fd6db1a63289fff6d32a1ea..8dce68cf7769fcd5ea03be32621ccb6bab174697 100644
|
||||
index f2d3d51cb4b8fc7a5fd6db1a63289fff6d32a1ea..c222d58520b655b54b8975ec226a4ba948691cd4 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -19,4 +19,38 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
@@ -19,4 +19,44 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
@Setting(Configuration.VERSION_FIELD)
|
||||
int version = VERSION;
|
||||
|
||||
@@ -124,5 +124,11 @@ index f2d3d51cb4b8fc7a5fd6db1a63289fff6d32a1ea..8dce68cf7769fcd5ea03be32621ccb6b
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public Item item;
|
||||
+ public class Item extends ConfigurationPart {
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Warn on startup
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 3a9f7143505ba1a70bcd224ee8fef5c844a94ed1..e0885f53aa3d0ae95a40574806af70c865025a9d 100644
|
||||
index 8f77566bef4b992013e3b65068cabe7ee1921951..65fd553887ed9eb9c26e036c8009179a7baf5380 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -113,6 +113,18 @@ public class Main {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Always agree EULA on development mode
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 6734821658e7679f328336038587390a262f2b64..787d3447f328c59deabb6b07b9f72f9fbce71cba 100644
|
||||
index 41005f58fdd526907972185e728bbe1fa97171e9..746ad8087192931400256c8a1ef71e966eaf6b1a 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -151,7 +151,7 @@ fun TaskContainer.registerRunTask(
|
||||
@@ -164,7 +164,7 @@ fun TaskContainer.registerRunTask(
|
||||
languageVersion.set(JavaLanguageVersion.of(21))
|
||||
vendor.set(JvmVendorSpec.JETBRAINS)
|
||||
})
|
||||
@@ -18,7 +18,7 @@ index 6734821658e7679f328336038587390a262f2b64..787d3447f328c59deabb6b07b9f72f9f
|
||||
if (rootProject.childProjects["test-plugin"] != null) {
|
||||
val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile }
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index e0885f53aa3d0ae95a40574806af70c865025a9d..3978c93a847c859c70446a6d6157fdb49c0bc74c 100644
|
||||
index 65fd553887ed9eb9c26e036c8009179a7baf5380..694b126df2c3d1d6fa40ee9731c28886caf1a4fc 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -179,6 +179,7 @@ public class Main {
|
||||
@@ -8,8 +8,45 @@ Subject: [PATCH] Optimize default configurations
|
||||
- AkiraDevelopment/SimplyMC
|
||||
- YouHaveTrouble/minecraft-exploits-and-how-to-fix-them
|
||||
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
index 411c81a88b8a008b2aaf0ca62fb7ffa1dd9e32a4..53dc2e3c22c5cb038b9a283112f265d362f187e3 100644
|
||||
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
@@ -61,7 +61,7 @@ public class PufferfishConfig {
|
||||
getString("info.version", "1.0");
|
||||
setComment("info",
|
||||
"Pufferfish Configuration",
|
||||
- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host",
|
||||
+ // "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - Sponsorblock
|
||||
"Join our Discord for support: https://discord.gg/reZw4vQV9H",
|
||||
"Download new builds at https://ci.pufferfish.host/job/Pufferfish");
|
||||
|
||||
@@ -216,7 +216,7 @@ public class PufferfishConfig {
|
||||
public static int maxProjectileLoadsPerTick;
|
||||
public static int maxProjectileLoadsPerProjectile;
|
||||
private static void projectileLoading() {
|
||||
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
|
||||
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", plazma.Config.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations
|
||||
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
|
||||
|
||||
setComment("projectile", "Optimizes projectile settings");
|
||||
@@ -230,12 +230,12 @@ public class PufferfishConfig {
|
||||
public static int activationDistanceMod;
|
||||
|
||||
private static void dynamicActivationOfBrains() throws IOException {
|
||||
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
|
||||
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", plazma.Config.optimize()); // Purpur // Plazma - Optimize default configurations
|
||||
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
|
||||
"This value determines how far away an entity has to be",
|
||||
"from the player to start being effected by DEAR.");
|
||||
startDistanceSquared = startDistance * startDistance;
|
||||
- maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
|
||||
+ maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", plazma.Config.optimize() ? 7 : 8, // Plazma - Optimize default configurations
|
||||
"This value defines how often in ticks, the furthest entity",
|
||||
"will get their pathfinders and behaviors ticked. 20 = 1s");
|
||||
activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index cbd0f2c6636b8ae332f20a3cb763b06855dfe795..3b636760f32b9b5b277edb15782d6206567e012f 100644
|
||||
index 17e23ca4dd2bbfba49ea00aa2b719a95feb931be..a8e75eaadfcc6c8b2503776d7de197f756712819 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -147,7 +147,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -21,7 +58,7 @@ index cbd0f2c6636b8ae332f20a3cb763b06855dfe795..3b636760f32b9b5b277edb15782d6206
|
||||
}
|
||||
|
||||
public SpamLimiter spamLimiter;
|
||||
@@ -189,7 +189,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -187,7 +187,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Commands commands;
|
||||
|
||||
public class Commands extends ConfigurationPart {
|
||||
@@ -30,7 +67,7 @@ index cbd0f2c6636b8ae332f20a3cb763b06855dfe795..3b636760f32b9b5b277edb15782d6206
|
||||
public boolean fixTargetSelectorTagCompletion = true;
|
||||
public boolean timeCommandAffectsAllWorlds = false;
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -253,7 +253,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public BookSize bookSize;
|
||||
|
||||
public class BookSize extends ConfigurationPart {
|
||||
@@ -39,7 +76,7 @@ index cbd0f2c6636b8ae332f20a3cb763b06855dfe795..3b636760f32b9b5b277edb15782d6206
|
||||
public double totalMultiplier = 0.98D; // TODO this should probably be merged into the above inner class
|
||||
}
|
||||
public boolean resolveSelectorsInBooks = false;
|
||||
@@ -266,7 +266,15 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -264,7 +264,15 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class PacketLimiter extends ConfigurationPart {
|
||||
public Component kickMessage = Component.translatable("disconnect.exceeded_packet_rate", NamedTextColor.RED);
|
||||
public PacketLimit allPackets = new PacketLimit(7.0, 500.0, PacketLimit.ViolateAction.KICK);
|
||||
@@ -56,7 +93,7 @@ index cbd0f2c6636b8ae332f20a3cb763b06855dfe795..3b636760f32b9b5b277edb15782d6206
|
||||
|
||||
@ConfigSerializable
|
||||
public record PacketLimit(@Required double interval, @Required double maxPacketRate, ViolateAction action) {
|
||||
@@ -334,7 +342,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -332,7 +340,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
executor.setMaximumPoolSize(_chatExecutorMaxSize);
|
||||
}
|
||||
}
|
||||
@@ -66,10 +103,10 @@ index cbd0f2c6636b8ae332f20a3cb763b06855dfe795..3b636760f32b9b5b277edb15782d6206
|
||||
public boolean loadPermissionsYmlBeforePlugins = true;
|
||||
@Constraints.Min(4)
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
index b7428b8c287980941eaa5c5d1f1d321955277a09..b6f818d568bdf32c32685e163ba1588c7a8e153d 100644
|
||||
index 82210667376fd466d5d4cdcb56b62f6165bd5cde..3c6e9ec236bfd851700ce7fae2599b725ec899eb 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
@@ -100,12 +100,32 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -103,12 +103,32 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class AntiXray extends ConfigurationPart {
|
||||
public boolean enabled = false;
|
||||
@@ -105,7 +142,7 @@ index b7428b8c287980941eaa5c5d1f1d321955277a09..b6f818d568bdf32c32685e163ba1588c
|
||||
//<editor-fold desc="Anti-Xray Hidden Blocks" defaultstate="collapsed">
|
||||
Blocks.COPPER_ORE,
|
||||
Blocks.DEEPSLATE_COPPER_ORE,
|
||||
@@ -132,7 +152,28 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -135,7 +155,28 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
Blocks.ENDER_CHEST
|
||||
//</editor-fold>
|
||||
);
|
||||
@@ -135,7 +172,7 @@ index b7428b8c287980941eaa5c5d1f1d321955277a09..b6f818d568bdf32c32685e163ba1588c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,14 +195,14 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -157,14 +198,14 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public ArmorStands armorStands;
|
||||
|
||||
public class ArmorStands extends ConfigurationPart {
|
||||
@@ -153,7 +190,7 @@ index b7428b8c287980941eaa5c5d1f1d321955277a09..b6f818d568bdf32c32685e163ba1588c
|
||||
}
|
||||
|
||||
public Sniffer sniffer;
|
||||
@@ -406,7 +447,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -415,7 +456,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Environment extends ConfigurationPart {
|
||||
public boolean disableThunder = false;
|
||||
public boolean disableIceAndSnow = false;
|
||||
@@ -162,7 +199,7 @@ index b7428b8c287980941eaa5c5d1f1d321955277a09..b6f818d568bdf32c32685e163ba1588c
|
||||
public boolean disableExplosionKnockback = false;
|
||||
public boolean generateFlatBedrock = false;
|
||||
public FrostedIce frostedIce;
|
||||
@@ -462,7 +503,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -471,7 +512,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public Fixes fixes;
|
||||
|
||||
public class Fixes extends ConfigurationPart {
|
||||
@@ -171,7 +208,7 @@ index b7428b8c287980941eaa5c5d1f1d321955277a09..b6f818d568bdf32c32685e163ba1588c
|
||||
public boolean disableUnloadedChunkEnderpearlExploit = false;
|
||||
public boolean preventTntFromMovingInWater = false;
|
||||
public boolean splitOverstackedLoot = true;
|
||||
@@ -490,9 +531,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -499,9 +540,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public class Collisions extends ConfigurationPart {
|
||||
public boolean onlyPlayersCollide = false;
|
||||
public boolean allowVehicleCollisions = true;
|
||||
@@ -183,7 +220,7 @@ index b7428b8c287980941eaa5c5d1f1d321955277a09..b6f818d568bdf32c32685e163ba1588c
|
||||
public boolean allowPlayerCrammingDamage = false;
|
||||
}
|
||||
|
||||
@@ -500,18 +541,41 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -509,18 +550,41 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Chunks extends ConfigurationPart {
|
||||
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
|
||||
@@ -233,7 +270,7 @@ index b7428b8c287980941eaa5c5d1f1d321955277a09..b6f818d568bdf32c32685e163ba1588c
|
||||
});
|
||||
public boolean flushRegionsOnSave = false;
|
||||
}
|
||||
@@ -526,9 +590,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -535,9 +599,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
public TickRates tickRates;
|
||||
|
||||
public class TickRates extends ConfigurationPart {
|
||||
@@ -245,7 +282,7 @@ index b7428b8c287980941eaa5c5d1f1d321955277a09..b6f818d568bdf32c32685e163ba1588c
|
||||
public int wetFarmland = 1;
|
||||
public int dryFarmland = 1;
|
||||
public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40));
|
||||
@@ -562,9 +626,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -571,9 +635,9 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
|
||||
public class Misc extends ConfigurationPart {
|
||||
public int lightQueueSize = 20;
|
||||
@@ -270,7 +307,7 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 3978c93a847c859c70446a6d6157fdb49c0bc74c..a4ef13e8b91dcc4bea7b49c004af085357aba6ad 100644
|
||||
index 694b126df2c3d1d6fa40ee9731c28886caf1a4fc..822ecda5f4dc6cc8cd0cc4da577f27cdcc5c4967 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -164,7 +164,7 @@ public class Main {
|
||||
@@ -283,7 +320,7 @@ index 3978c93a847c859c70446a6d6157fdb49c0bc74c..a4ef13e8b91dcc4bea7b49c004af0853
|
||||
|
||||
File commandFile = (File) optionset.valueOf("commands-settings");
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
index 568141881ffb26b425be452c79ecc146821ba1d9..067f91dd019be40cb09f8fa78cae587429488201 100644
|
||||
index 8f7e922ceca286b1a590181c301fbe9bff55c024..3dd5c7441bb300ca17d717af37edbefb89db4b2f 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
@@ -132,14 +132,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
@@ -315,10 +352,10 @@ index 568141881ffb26b425be452c79ecc146821ba1d9..067f91dd019be40cb09f8fa78cae5874
|
||||
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
|
||||
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
|
||||
index d76e487529dd5661753a91230c9ebab5814f79d1..47fa401e484fc3ebc6b66013c225bc1bb20f00a9 100644
|
||||
index 655463a7d588ed88778d137b6fe5ac18951ff172..cc4762c13e21600b4c5e287a6fae9e6e472080b3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -437,7 +437,7 @@ public final class CraftServer implements Server {
|
||||
@@ -449,7 +449,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||
this.configuration.options().copyDefaults(true);
|
||||
@@ -381,10 +418,10 @@ index 95cd1156766895546ef5574b33a60806bff08fa2..097f3c34d244b89e7dd9f8b6f2a3d8fd
|
||||
private static void networkSettings() {
|
||||
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
|
||||
index 742a46ef95a5e46e9c338cedcecaf008a7108c58..2198477c174f89fdaece5ffef8b40c8096a9c9a9 100644
|
||||
index 57ddb4e6a464567cc67e09ce06218cc25af4ddf9..e55993e318b7f7292e22c4539bc2fd1447f67fa8 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -422,7 +422,7 @@ public class PurpurWorldConfig {
|
||||
@@ -424,7 +424,7 @@ public class PurpurWorldConfig {
|
||||
public boolean idleTimeoutTargetPlayer = true;
|
||||
public String playerDeathExpDropEquation = "expLevel * 7";
|
||||
public int playerDeathExpDropMax = 100;
|
||||
@@ -393,7 +430,7 @@ index 742a46ef95a5e46e9c338cedcecaf008a7108c58..2198477c174f89fdaece5ffef8b40c80
|
||||
public boolean teleportOnNetherCeilingDamage = false;
|
||||
public boolean totemOfUndyingWorksInInventory = false;
|
||||
public boolean playerFixStuckPortal = false;
|
||||
@@ -3243,7 +3243,7 @@ public class PurpurWorldConfig {
|
||||
@@ -3262,7 +3262,7 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieJockeyOnlyBaby = true;
|
||||
public double zombieJockeyChance = 0.05D;
|
||||
public boolean zombieJockeyTryExistingChickens = true;
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Add an option to apply the configuration to the vanilla
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index 3b636760f32b9b5b277edb15782d6206567e012f..6d0f1448a1546cdaf81335b47e3bc9e361095545 100644
|
||||
index a8e75eaadfcc6c8b2503776d7de197f756712819..99cf08bc17eec05463b300c0c9fd108cbfba1b8f 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -87,7 +87,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -19,10 +19,10 @@ index 3b636760f32b9b5b277edb15782d6206567e012f..6d0f1448a1546cdaf81335b47e3bc9e3
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 47fa401e484fc3ebc6b66013c225bc1bb20f00a9..7e87db1f99888c206400add17f5ea514de242e9f 100644
|
||||
index cc4762c13e21600b4c5e287a6fae9e6e472080b3..76f255d12189ffe83426cc7aa85771d5c7cfb111 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -437,7 +437,19 @@ public final class CraftServer implements Server {
|
||||
@@ -449,7 +449,19 @@ public final class CraftServer implements Server {
|
||||
|
||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||
this.configuration.options().copyDefaults(true);
|
||||
@@ -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
|
||||
index 743ef664a84da93751feaa06e3522515cf9831f8..4e583dde426f8345fb931be6135a1427ed635ab2 100644
|
||||
index d4a9b187b01c63342d9b05b5c29bb1d199deed6c..38752c9ba1726e3c38dd758287a920bc476ef88a 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -194,16 +194,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -41,7 +41,7 @@ index 743ef664a84da93751feaa06e3522515cf9831f8..4e583dde426f8345fb931be6135a1427
|
||||
this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
if (this.convertOldUsers()) {
|
||||
@@ -332,6 +331,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -335,6 +334,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
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/";
|
||||
// Paper end - Add Velocity IP Forwarding Support
|
||||
@@ -49,7 +49,7 @@ index 743ef664a84da93751feaa06e3522515cf9831f8..4e583dde426f8345fb931be6135a1427
|
||||
if (!this.usesAuthentication()) {
|
||||
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
||||
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||
@@ -345,7 +345,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -348,7 +348,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.");
|
||||
}
|
||||
// Spigot end
|
||||
@@ -59,7 +59,7 @@ index 743ef664a84da93751feaa06e3522515cf9831f8..4e583dde426f8345fb931be6135a1427
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 7d57f9b7fc4837f0f44f5c1cb76a5751a15b9254..8cc4907984f1a344e1983cd48744e92170ff650f 100644
|
||||
index 16999fa20c3621e016d1b0fadfb76f2fe03a2a69..8d7d050f12df83931bbb32f1832d7fcbc06317da 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1426,6 +1426,7 @@ public abstract class PlayerList {
|
||||
@@ -71,13 +71,14 @@ index 7d57f9b7fc4837f0f44f5c1cb76a5751a15b9254..8cc4907984f1a344e1983cd48744e921
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index aff5c68bc715c6ea9b5b808e5a94cbac9a3725ba..a8586f1bd161ad3470ae7f0590f1bba0cf627bd0 100644
|
||||
index aff5c68bc715c6ea9b5b808e5a94cbac9a3725ba..779cdc523aab3afc529685f7e913bd6bb7336c51 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -69,4 +69,13 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -69,4 +69,14 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+
|
||||
+ public ConsoleLogs consoleLogs;
|
||||
+ public class ConsoleLogs extends ConfigurationPart {
|
||||
+
|
||||
@@ -0,0 +1,62 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 13 Dec 2024 13:08:37 +0900
|
||||
Subject: [PATCH] Add missing Pufferfish configurations
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
index 9ef53608f1608e88de7a7b3e96b43d8d2b4230ae..8500ac473581b90036578d66243c5313e2ce3ddf 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
@@ -161,11 +161,13 @@ public class Armadillo extends Animal {
|
||||
return ArmadilloAi.makeBrain(this.brainProvider().makeBrain(dynamic));
|
||||
}
|
||||
|
||||
+ private int behaviorTick; // Plazma - Add missing pufferfish configurations
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel world) {
|
||||
ProfilerFiller gameprofilerfiller = Profiler.get();
|
||||
|
||||
gameprofilerfiller.push("armadilloBrain");
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
|
||||
((Brain<Armadillo>) this.brain).tick(world, this); // CraftBukkit - decompile error
|
||||
gameprofilerfiller.pop();
|
||||
gameprofilerfiller.push("armadilloActivityUpdate");
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
index dbce71f45c008da883b6d244a06343d83ae25e7e..d2f0b14a0014802605b601e62d0eebddf06d3737 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
@@ -152,6 +152,7 @@ public class Camel extends AbstractHorse {
|
||||
return pose == Pose.SITTING ? Camel.SITTING_DIMENSIONS.scale(this.getAgeScale()) : super.getDefaultDimensions(pose);
|
||||
}
|
||||
|
||||
+ private int behaviorTick = 0; // Plazma - Add missing pufferfish configurations
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel world) {
|
||||
ProfilerFiller gameprofilerfiller = Profiler.get();
|
||||
@@ -159,6 +160,7 @@ public class Camel extends AbstractHorse {
|
||||
gameprofilerfiller.push("camelBrain");
|
||||
Brain<Camel> behaviorcontroller = (Brain<Camel>) this.getBrain(); // CraftBukkit - decompile error
|
||||
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
|
||||
behaviorcontroller.tick(world, this);
|
||||
gameprofilerfiller.pop();
|
||||
gameprofilerfiller.push("camelActivityUpdate");
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
index 464a16df15d8759d66f94ad080d1ea28b3f6474c..6061cd4fc38fef0895571ab767e495d5755f9fc8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
@@ -493,11 +493,13 @@ public class Sniffer extends Animal {
|
||||
return Brain.provider(SnifferAi.MEMORY_TYPES, SnifferAi.SENSOR_TYPES);
|
||||
}
|
||||
|
||||
+ private int behaviorTick; // Plazma - Add missing pufferfish configurations
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel world) {
|
||||
ProfilerFiller gameprofilerfiller = Profiler.get();
|
||||
|
||||
gameprofilerfiller.push("snifferBrain");
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
|
||||
this.getBrain().tick(world, this);
|
||||
gameprofilerfiller.popPush("snifferActivityUpdate");
|
||||
SnifferAi.updateActivity(this);
|
||||
@@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 25 Mar 2023 00:52:11 +0900
|
||||
Subject: [PATCH] Add missing purpur configuration options
|
||||
Subject: [PATCH] Add missing Purpur configuration options
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
index f60961bd5fdf6d1417e458b92e311c1a0a62463d..026cd57df33476841ed3a8f9fdc4d17a77e037b0 100644
|
||||
index 0a173040c56fea6d8f83998b7c66aa8daaf648f2..16b98cad477d7af2d9534cc189aae43a5adc8d58 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
@@ -160,6 +160,18 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
@@ -28,7 +28,7 @@ index f60961bd5fdf6d1417e458b92e311c1a0a62463d..026cd57df33476841ed3a8f9fdc4d17a
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
index 56d97225a909fd55f0d8aec992d5b6d42687c948..39cdecc382a71ef643d382ac506249bbb8df3d34 100644
|
||||
index d2f0b14a0014802605b601e62d0eebddf06d3737..459a45f82c42b346a66bb1954e155a0970dcc30f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
@@ -96,6 +96,18 @@ public class Camel extends AbstractHorse {
|
||||
@@ -51,7 +51,7 @@ index 56d97225a909fd55f0d8aec992d5b6d42687c948..39cdecc382a71ef643d382ac506249bb
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index 501a12398c56fe0df4e76a3bbce0f98c6c5aa6cb..94ca735513901a180d42ac1cfd48d841142a6ef5 100644
|
||||
index 02581f47d1ca58c2b8abffc478adf48343585c8b..bd04af6311ca64d81c8829e731ac39a6486ee789 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -163,6 +163,23 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||
@@ -79,7 +79,7 @@ index 501a12398c56fe0df4e76a3bbce0f98c6c5aa6cb..94ca735513901a180d42ac1cfd48d841
|
||||
|
||||
public int getPurpurBreedTime() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
index 071d14cc6697587ec14f02c69c78df364e7d8a8f..cc5c172b2fccc5fc59337203ed2b6edb2abc0c22 100644
|
||||
index 7e92e8c4fec36c8838604f17cf366cc80e82b19b..1b0e80ae62b5c5d4e1fcac71b90f83f12fe4878a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
@@ -93,6 +93,23 @@ public class Tadpole extends AbstractFish {
|
||||
@@ -107,7 +107,7 @@ index 071d14cc6697587ec14f02c69c78df364e7d8a8f..cc5c172b2fccc5fc59337203ed2b6edb
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
index 3fb4f12095883ea4ec6e0d60e0600b9de6ed7be2..f853730cee4fad2f3a5711e38918c65dcb1dc038 100644
|
||||
index 6061cd4fc38fef0895571ab767e495d5755f9fc8..0bc7856065fdc599890f18f5a4e2f6c2b3d94ba7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
@@ -116,6 +116,18 @@ public class Sniffer extends Animal {
|
||||
@@ -130,7 +130,7 @@ index 3fb4f12095883ea4ec6e0d60e0600b9de6ed7be2..f853730cee4fad2f3a5711e38918c65d
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
index 692261880d05daa75fc53dde31d0f2b95dc52746..9f542e4f0077a6abc89fdec1a4bf3e8f40203b2a 100644
|
||||
index 5a62fe9c4f0cee9e8b4a48564f76afec609335b1..79b090030b716029cc4cfc8bf9d81af0b2202313 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -151,6 +151,23 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
@@ -157,6 +157,15 @@ index 692261880d05daa75fc53dde31d0f2b95dc52746..9f542e4f0077a6abc89fdec1a4bf3e8f
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
@@ -305,7 +322,7 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
ProfilerFiller gameprofilerfiller = Profiler.get();
|
||||
|
||||
gameprofilerfiller.push("wardenBrain");
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Plazma - Add missing Purpur configurations
|
||||
this.getBrain().tick(world, this);
|
||||
gameprofilerfiller.pop();
|
||||
super.customServerAiStep(world);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
|
||||
index 1f4cc08e84a23213bb9786ea09ad77caeec2d336..f888f1dd2e3c228b0a370fe920b63d547bbba571 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
|
||||
@@ -200,10 +209,10 @@ index 097f3c34d244b89e7dd9f8b6f2a3d8fdc67b36dc..3f4c94aada930e55dfe6a2dd6f3bfb51
|
||||
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 2198477c174f89fdaece5ffef8b40c8096a9c9a9..046af5afaf3e234fb7d14c4a9ae183cda8cb0b0c 100644
|
||||
index e55993e318b7f7292e22c4539bc2fd1447f67fa8..b67b6147e9175041539b01357dd8b1e94cfd6841 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1133,7 +1133,13 @@ public class PurpurWorldConfig {
|
||||
@@ -1135,7 +1135,13 @@ public class PurpurWorldConfig {
|
||||
public boolean allayControllable = true;
|
||||
public double allayMaxHealth = 20.0D;
|
||||
public double allayScale = 1.0D;
|
||||
@@ -217,7 +226,7 @@ index 2198477c174f89fdaece5ffef8b40c8096a9c9a9..046af5afaf3e234fb7d14c4a9ae183cd
|
||||
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
|
||||
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
|
||||
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
|
||||
@@ -1288,7 +1294,13 @@ public class PurpurWorldConfig {
|
||||
@@ -1290,7 +1296,13 @@ public class PurpurWorldConfig {
|
||||
public double camelMovementSpeedMin = 0.09D;
|
||||
public double camelMovementSpeedMax = 0.09D;
|
||||
public int camelBreedingTicks = 6000;
|
||||
@@ -231,7 +240,7 @@ index 2198477c174f89fdaece5ffef8b40c8096a9c9a9..046af5afaf3e234fb7d14c4a9ae183cd
|
||||
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
|
||||
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
|
||||
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
|
||||
@@ -1740,7 +1752,15 @@ public class PurpurWorldConfig {
|
||||
@@ -1755,7 +1767,15 @@ public class PurpurWorldConfig {
|
||||
public boolean frogControllable = true;
|
||||
public float frogRidableJumpHeight = 0.65F;
|
||||
public int frogBreedingTicks = 6000;
|
||||
@@ -247,7 +256,7 @@ index 2198477c174f89fdaece5ffef8b40c8096a9c9a9..046af5afaf3e234fb7d14c4a9ae183cd
|
||||
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
|
||||
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
|
||||
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
|
||||
@@ -2752,7 +2772,13 @@ public class PurpurWorldConfig {
|
||||
@@ -2767,7 +2787,13 @@ public class PurpurWorldConfig {
|
||||
public double snifferMaxHealth = 14.0D;
|
||||
public double snifferScale = 1.0D;
|
||||
public int snifferBreedingTicks = 6000;
|
||||
@@ -261,7 +270,7 @@ index 2198477c174f89fdaece5ffef8b40c8096a9c9a9..046af5afaf3e234fb7d14c4a9ae183cd
|
||||
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
|
||||
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
|
||||
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
|
||||
@@ -2860,7 +2886,15 @@ public class PurpurWorldConfig {
|
||||
@@ -2875,7 +2901,15 @@ public class PurpurWorldConfig {
|
||||
public boolean tadpoleRidable = false;
|
||||
public boolean tadpoleRidableInWater = true;
|
||||
public boolean tadpoleControllable = true;
|
||||
@@ -277,7 +286,7 @@ index 2198477c174f89fdaece5ffef8b40c8096a9c9a9..046af5afaf3e234fb7d14c4a9ae183cd
|
||||
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
|
||||
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
|
||||
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
|
||||
@@ -3088,7 +3122,15 @@ public class PurpurWorldConfig {
|
||||
@@ -3107,7 +3141,15 @@ public class PurpurWorldConfig {
|
||||
public boolean wardenRidable = false;
|
||||
public boolean wardenRidableInWater = true;
|
||||
public boolean wardenControllable = true;
|
||||
@@ -36,7 +36,7 @@ index acdff7b4a00d563739fd301c3633a266875296fa..1266aaf4bfcf53aa16d7b9bd697a0c48
|
||||
|
||||
// CraftBukkit start - return boolean, add entity
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index a8586f1bd161ad3470ae7f0590f1bba0cf627bd0..b3fccda131e51b03b1617b028f8d7488db342f24 100644
|
||||
index 779cdc523aab3afc529685f7e913bd6bb7336c51..665b77d5cdf81a73d28f93294ee590af746bdfbc 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -60,6 +60,26 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -67,7 +67,7 @@ index a8586f1bd161ad3470ae7f0590f1bba0cf627bd0..b3fccda131e51b03b1617b028f8d7488
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 8dce68cf7769fcd5ea03be32621ccb6bab174697..e50118ec7a4c00bd367ca6c740214c53b0d60fc9 100644
|
||||
index c222d58520b655b54b8975ec226a4ba948691cd4..c703237d46b114227cf0d5cdff2e033839bc5f57 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -36,17 +36,6 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
@@ -7,10 +7,10 @@ Subject: [PATCH] Apply various optimizations
|
||||
Akarin - Swaps the predicate order of collision
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index d6d9dd17750d7028e13aad539e7b65a7561d9f4b..ae264484f99227f5535c428ebda4860fc8abcc72 100644
|
||||
index aa171a1afb9800e6ec84f6b4f1b28e44177752f7..eaf53f5f4c33ca7a7a988e7bd04b7033e16f9529 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2342,8 +2342,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2309,8 +2309,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public void playerTouch(Player player) {}
|
||||
|
||||
public void push(Entity entity) {
|
||||
@@ -21,7 +21,7 @@ index d6d9dd17750d7028e13aad539e7b65a7561d9f4b..ae264484f99227f5535c428ebda4860f
|
||||
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper - Collision option for requiring a player participant
|
||||
double d0 = entity.getX() - this.getX();
|
||||
double d1 = entity.getZ() - this.getZ();
|
||||
@@ -2371,8 +2372,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2338,8 +2339,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
entity.push(d0, 0.0D, d1);
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ index 27eb9a365006884c85603dc6d9dd8eee009c98b3..958a48d05aba8e500c7b19a466dcca6f
|
||||
FluidState fluid = world.getFluidState(blockposition1);
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index e50118ec7a4c00bd367ca6c740214c53b0d60fc9..4d204a0dc976d96c98764092c8461b0e2b920fc1 100644
|
||||
index c703237d46b114227cf0d5cdff2e033839bc5f57..a976e2b960a5f3b7ecf6e42afcb1dd3bd140b8bd 100644
|
||||
--- a/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 {
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Add option to disable moved to quickly check for specific
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 61b19f52aeb371abdd29f41291099f35a9b4c258..dcb0a4461a2fca964e4d8390401e463648ed3351 100644
|
||||
index 9ae16e24013ea5664d4ea6d52ed7dd188404890f..91f161d27a45174b6f3c31440eea46ff81185203 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1694,7 +1694,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1695,7 +1695,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ index 61b19f52aeb371abdd29f41291099f35a9b4c258..dcb0a4461a2fca964e4d8390401e4636
|
||||
return false;
|
||||
} else if (this.player.isChangingDimension()) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index b3fccda131e51b03b1617b028f8d7488db342f24..6fd1f1c859a6e6cea780d9dfa9a2770d59ddfd04 100644
|
||||
index 665b77d5cdf81a73d28f93294ee590af746bdfbc..e2aa6b8ae63ed7f5a0882fcaf5a3fadc29f553f1 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -27,6 +27,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -33,7 +33,7 @@ index 3f39d6c786d9dfdd9ad591e08ff05fcbb41a1df6..0346fd4ab7095d66c0eef5a440afbc7a
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 6fd1f1c859a6e6cea780d9dfa9a2770d59ddfd04..af0ca8b0470c0e66cbc4cc0331219b71d0fa429f 100644
|
||||
index e2aa6b8ae63ed7f5a0882fcaf5a3fadc29f553f1..6648d50cea38c17714785a335e5bc25f98d2595e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -35,6 +35,24 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -5,24 +5,24 @@ Subject: [PATCH] Configurable entity sensor tick
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index ff9d23aef4658922692b43a859bd83632fe23612..8e5ad4cd6c8f61661b87dc96ba914c0bcd199879 100644
|
||||
index 7ca12a1128661ea36e2e33cda204c7d2df55a21c..331a75fee26e3fe2532e8661db282a0c207ddf9b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -949,10 +949,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
//ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
|
||||
@@ -951,10 +951,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
ProfilerFiller gameprofilerfiller = Profiler.get();
|
||||
|
||||
//gameprofilerfiller.push("sensing"); // Purpur
|
||||
gameprofilerfiller.push("sensing");
|
||||
- this.sensing.tick();
|
||||
+ //this.sensing.tick(); // Plazma - moved down
|
||||
//gameprofilerfiller.pop(); // Purpur
|
||||
gameprofilerfiller.pop();
|
||||
int i = this.tickCount + this.getId();
|
||||
|
||||
+ if (i % this.level().plazmaConfig().entity.sensorTick == 0) this.sensing.tick(); // Plazma - Configurable entity sensor tick
|
||||
if (i % 2 != 0 && this.tickCount > 1) {
|
||||
//gameprofilerfiller.push("targetSelector"); // Purpur
|
||||
this.targetSelector.tickRunningGoals(false);
|
||||
gameprofilerfiller.push("targetSelector");
|
||||
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 4d204a0dc976d96c98764092c8461b0e2b920fc1..33bcfec86f83ce6e0ec17436ad38da8aeced48be 100644
|
||||
index a976e2b960a5f3b7ecf6e42afcb1dd3bd140b8bd..9e408d6c1826d36a935b3e382e8eb0283f3d1580 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -28,6 +28,8 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Variable entity wakeup duration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 33bcfec86f83ce6e0ec17436ad38da8aeced48be..b047af738236be3400d07d46c663017ed39b6f96 100644
|
||||
index 9e408d6c1826d36a935b3e382e8eb0283f3d1580..a371893777a2c2d1de22e7d52f2fd3f55b82d74d 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -37,6 +37,20 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
@@ -30,10 +30,10 @@ index 33bcfec86f83ce6e0ec17436ad38da8aeced48be..b047af738236be3400d07d46c663017e
|
||||
|
||||
public Block block;
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index e047c0a4a8638588b4ac0d47c4c96899fac4abb7..14e62940aec1fe4c70b128f2811df6c09c701718 100644
|
||||
index 9b1a16747aa23b18e4cff986efaac6ce64b6ddb9..6a45bafaa1d7ddc0f80c0945e15c3d6c67f9f2b3 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -62,29 +62,37 @@ public class ActivationRange
|
||||
@@ -66,29 +66,37 @@ public class ActivationRange
|
||||
net.minecraft.world.entity.schedule.Activity.PANIC
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ index bb4411cfdf1bc7adc12c2f918d2eec830299f38b..357d484029fe338bea4f5770d13ccfc0
|
||||
return nbt;
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index b047af738236be3400d07d46c663017ed39b6f96..6c9c28ae5fbe62ba647e7790acccb377d1e62490 100644
|
||||
index a371893777a2c2d1de22e7d52f2fd3f55b82d74d..d366e8755ba91c329164c16659f6b07245577fba 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -51,6 +51,14 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Improve SwingTime ticking
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index d3d4e7e01afeb4ace5e487f9ef0926fd987c8ca4..6f999fcba6f72f2d31835c4ce5f6c17a69b0537c 100644
|
||||
index f4604e543a980d6aeb485252da5a4e755aa12bfa..f2753cf51634479e501c1a3e7931d6d9882bc801 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2772,6 +2772,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2821,6 +2821,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
protected void updateSwingTime() {
|
||||
@@ -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
|
||||
index 787d3447f328c59deabb6b07b9f72f9fbce71cba..487cf26f8cf38b3df58df5591c029b4a7d639c00 100644
|
||||
index 746ad8087192931400256c8a1ef71e966eaf6b1a..14695f421c3751a1e75567aecf3685d901790011 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -151,7 +151,7 @@ fun TaskContainer.registerRunTask(
|
||||
@@ -164,7 +164,7 @@ fun TaskContainer.registerRunTask(
|
||||
languageVersion.set(JavaLanguageVersion.of(21))
|
||||
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
|
||||
index c462d9f0c1997f8c49f6e80c4c87124d2a2533d8..e12225ae784f52e13195a759ccb19f8b4a909927 100644
|
||||
index 20266ef8f0974f47581e71175de4b01ea1a27bf0..54ef910938efb537a689dd5dbda119455bbf2a0e 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1622,29 +1622,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1627,29 +1627,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
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/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 4e583dde426f8345fb931be6135a1427ed635ab2..808cf602ee77d8156b032fb1a2bd1f5a3a2c2579 100644
|
||||
index 38752c9ba1726e3c38dd758287a920bc476ef88a..45fa867a22481bbba86e587767cfdb96d9691c49 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -684,6 +684,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -688,6 +688,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
// Paper start - Add setting for proxy online mode status
|
||||
return dedicatedserverproperties.enforceSecureProfile
|
||||
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
||||
@@ -32,7 +32,7 @@ index 4e583dde426f8345fb931be6135a1427ed635ab2..808cf602ee77d8156b032fb1a2bd1f5a
|
||||
// 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
|
||||
index 62a6fec0f4bf0f2a70740ba5cfd386857abe9531..503716bfa3d54c46534738d4209ef1a8ab50f7c3 100644
|
||||
index 8d7d050f12df83931bbb32f1832d7fcbc06317da..be4a5407fe9b692b72eb2b85e2dea160a0555bca 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 {
|
||||
@@ -52,7 +52,7 @@ index 62a6fec0f4bf0f2a70740ba5cfd386857abe9531..503716bfa3d54c46534738d4209ef1a8
|
||||
player.loadGameTypes((CompoundTag) optional.orElse(null)); // CraftBukkit - decompile error
|
||||
ServerGamePacketListenerImpl playerconnection = new ServerGamePacketListenerImpl(this.server, connection, player, clientData);
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index af0ca8b0470c0e66cbc4cc0331219b71d0fa429f..97a2aebc9ba946e4532c66553d9a2e7e7b3139f2 100644
|
||||
index 6648d50cea38c17714785a335e5bc25f98d2595e..9e61505b8c34a3be20bcbe91ac98941729f5b64f 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -29,6 +29,15 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -19,7 +19,7 @@ index 26da9e7c25ef6a89482838010d8ed6bcf8c87511..71aa3b9c5604f832e764e0d7a93da467
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 97a2aebc9ba946e4532c66553d9a2e7e7b3139f2..2a1dceb5251c67d6a5c60e1b9fb3ef2931055673 100644
|
||||
index 9e61505b8c34a3be20bcbe91ac98941729f5b64f..d1d6ac9e3ad200228dc0ee08fd0152ccec38b397 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -114,6 +114,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -20,7 +20,7 @@ index 5ebbdb94d9b91c442ff60eb6872f740ebd790fa0..aeeb8af68ea43ae6c93952610918d77b
|
||||
} else {
|
||||
// Paper start - Perf: Optimize Hoppers
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 6c9c28ae5fbe62ba647e7790acccb377d1e62490..0618db9893eda1fac0da6b771cc4d456b247d237 100644
|
||||
index d366e8755ba91c329164c16659f6b07245577fba..f21ed3431fd8472c78c15578bbd12214c499ceea 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -64,6 +64,12 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Suppress errors from dirty attributes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index bf5633f387e268191e2a33be2dcec6c514c0766f..4653b25a818ebe18980864e6e450bd0ab8db99e9 100644
|
||||
index f2753cf51634479e501c1a3e7931d6d9882bc801..02288d8f3521756770351c02f623f9db02efd40c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1377,7 +1377,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1390,7 +1390,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
private void refreshDirtyAttributes() {
|
||||
@@ -18,7 +18,7 @@ index bf5633f387e268191e2a33be2dcec6c514c0766f..4653b25a818ebe18980864e6e450bd0a
|
||||
Iterator iterator = set.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1386,7 +1387,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1399,7 +1400,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.onAttributeUpdated(attributemodifiable.getAttribute());
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ index bf5633f387e268191e2a33be2dcec6c514c0766f..4653b25a818ebe18980864e6e450bd0a
|
||||
|
||||
protected void onAttributeUpdated(Holder<Attribute> attribute) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 0618db9893eda1fac0da6b771cc4d456b247d237..bd795efde3b34371e54df881be39891a344d44fd 100644
|
||||
index f21ed3431fd8472c78c15578bbd12214c499ceea..9cfab16b9cdf40ccb709c0af66c406954560c0ef 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -29,6 +29,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
@@ -354,7 +354,7 @@ index bd14c08defe8afc5ceca59d16a5b1dbad178f594..99dc44c569b6003b271ce2ea3f80cb19
|
||||
boolean flag1 = world.hasNeighborSignal(pos) || this.findPoweredRailSignal(world, pos, state, true, 0) || this.findPoweredRailSignal(world, pos, state, false, 0);
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index bd795efde3b34371e54df881be39891a344d44fd..619cd178f6954563f7cd1c94c9eb8cbd78f3289b 100644
|
||||
index 9cfab16b9cdf40ccb709c0af66c406954560c0ef..0e27e4a1f767842d1dcd2ed235a6a45f120bf32e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -72,6 +72,13 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
@@ -370,4 +370,4 @@ index bd795efde3b34371e54df881be39891a344d44fd..619cd178f6954563f7cd1c94c9eb8cbd
|
||||
+
|
||||
}
|
||||
|
||||
}
|
||||
public Item item;
|
||||
@@ -18,7 +18,7 @@ index 16069b9cbf6c7679c28a2e9a54e77d23cd10e541..bb10892f33ba0d7fc3959debef104507
|
||||
private final byte[] challenge;
|
||||
final MinecraftServer server;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 503716bfa3d54c46534738d4209ef1a8ab50f7c3..14dd70f95ed6f6d4f24b509becf764aad60a3df1 100644
|
||||
index be4a5407fe9b692b72eb2b85e2dea160a0555bca..579f81ed04eeb6373b25e6794d3bf0c403891011 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -183,6 +183,16 @@ public abstract class PlayerList {
|
||||
@@ -56,7 +56,7 @@ index 503716bfa3d54c46534738d4209ef1a8ab50f7c3..14dd70f95ed6f6d4f24b509becf764aa
|
||||
// CraftBukkit start - Better rename detection
|
||||
if (optional.isPresent()) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 2a1dceb5251c67d6a5c60e1b9fb3ef2931055673..4a73bffae1531b42a2718cbe620fe2fc53139c45 100644
|
||||
index d1d6ac9e3ad200228dc0ee08fd0152ccec38b397..9e5477d15668488139e431b8289d1fcfac38048c 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -28,6 +28,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -240,10 +240,10 @@ index f1e0d3d7b1f458fcce83cf67762a16309123cdcb..6a8d5948f127ea87a0b4554ece4ad2c4
|
||||
|
||||
public boolean isIgnoreEntities() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 9a104c48bb1a92655b1feaab3e01a3be6ec7d942..06a5dcfd89d43d9b09ac5932a75a33fc5c0216e6 100644
|
||||
index 907fe00ab752ad124020755f211567af771b9d70..e041752bbcba5cefce0dde8db917510129d29987 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -287,7 +287,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -288,7 +288,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -51,10 +51,10 @@ index ebbad97920df3d1645637e646a98e16cb04d361e..a149c949a042e1d1e504d9f5ce0bfa6d
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 4a73bffae1531b42a2718cbe620fe2fc53139c45..cac12ad98eb0fa4dcc1b0f7f21d1eadd14ef7456 100644
|
||||
index 9e5477d15668488139e431b8289d1fcfac38048c..68a0e7144942022f0665e3124d98add70376d4a4 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -128,4 +128,16 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -129,4 +129,16 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ index 1e741f36b79585f33abe413beafe00cf5205d54f..028aea6640356ba80f5d682e3cc03b7f
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 619cd178f6954563f7cd1c94c9eb8cbd78f3289b..ef3dc8477b5547efa08a7fb60704f246e57fedfe 100644
|
||||
index 0e27e4a1f767842d1dcd2ed235a6a45f120bf32e..c1d4a96cf5be77f4460c54ed19622f527d42ca06 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -64,7 +64,9 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
File diff suppressed because it is too large
Load Diff
@@ -48,7 +48,7 @@ index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..844e340c331c6dd12eaaac247f871b04
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 5cd9b92bccf8446df2a9341a006e2e6bbcba7257..2ccf6415ec36a998904df6d5c4cae435b3e948e7 100644
|
||||
index 54ef910938efb537a689dd5dbda119455bbf2a0e..6e9766aff9a9f2b578f5b8a6b42e206fb7ad1bc6 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;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -764,7 +764,7 @@ index f73b559b8e60859020f762dab88b67b8c912bf8f..d218604447afbde96dc4af33ba90a876
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
index c7c6385c71c5bfae5818976008feececf5890654..b54c7b274c5c4eefc8c0170b89a6c7d7d02f5f08 100644
|
||||
index 48c0de870a5bbf647309e69361dfb10ab56c65ab..99e31c8e8488ce7138c5385575cbbabe0bd7394e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
@@ -168,6 +168,7 @@ public abstract class PathNavigation {
|
||||
@@ -778,7 +778,7 @@ index c7c6385c71c5bfae5818976008feececf5890654..b54c7b274c5c4eefc8c0170b89a6c7d7
|
||||
@@ -195,6 +196,23 @@ public abstract class PathNavigation {
|
||||
PathNavigationRegion pathNavigationRegion = new PathNavigationRegion(this.level, blockPos.offset(-i, -i, -i), blockPos.offset(i, i, i));
|
||||
Path path = this.pathFinder.findPath(pathNavigationRegion, this.mob, positions, followRange, distance, this.maxVisitedNodesMultiplier);
|
||||
//profilerFiller.pop(); // Purpur
|
||||
profilerFiller.pop();
|
||||
+ // Plazma start - Process pathfinding asynchronously
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().entity.asyncPathProcess.enabled) {
|
||||
+ if (!positions.isEmpty()) this.targetPos = positions.iterator().next();
|
||||
@@ -894,7 +894,7 @@ index 9104d7010bda6f9f73b478c11490ef9c53f76da2..a53950a6e4cb2e672b6f130461fa6306
|
||||
// Paper end - optimise POI access
|
||||
if (path != null && path.canReach()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
index 6c4cab8cabdd27b6dbd97a408a588f4ef9684654..32a1bb3ea64099c4583607ee246b8cadb77c4d44 100644
|
||||
index 6dec1720aea724baab541e26e14c9fa0646abdbf..bf4a3bc730709f41a5089dfe4c6342b08057ef02 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -1206,7 +1206,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -916,10 +916,10 @@ index 6c4cab8cabdd27b6dbd97a408a588f4ef9684654..32a1bb3ea64099c4583607ee246b8cad
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index 62991c7d1c4d62669adeb30b56c94b0e7d998ab2..2077ccca3f6f942ec7daa06759ce0532b11a00a5 100644
|
||||
index 17ba0c6060ab56ab97b133565ebf86320ab52e1b..305fe2c13ae2d81b99ff36f8ef18e24c23255eae 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -505,10 +505,23 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||
@@ -506,10 +506,23 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||
return nodeType != PathType.WATER_BORDER && super.canCutCorner(nodeType);
|
||||
}
|
||||
|
||||
@@ -944,7 +944,7 @@ index 62991c7d1c4d62669adeb30b56c94b0e7d998ab2..2077ccca3f6f942ec7daa06759ce0532
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
index de3d91891000c599950e31da595c254a3b421e7a..a73d7a1ea1ef7a98a114b7d10de6b2946c092f76 100644
|
||||
index 19bc362ff8e28cd0e26ba357dda425bac24c5a56..e4784d37c4b93c34325eb72cfbaa640c63d0c3c1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
@@ -308,7 +308,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -957,7 +957,7 @@ index de3d91891000c599950e31da595c254a3b421e7a..a73d7a1ea1ef7a98a114b7d10de6b294
|
||||
if (blockPos != null) {
|
||||
double d = this.distanceToSqr((double)blockPos.getX(), (double)blockPos.getY(), (double)blockPos.getZ());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Strider.java b/src/main/java/net/minecraft/world/entity/monster/Strider.java
|
||||
index d414158e1222f9a4f73a33abcf96f994aee4efde..dec0fd7d0b704c20df03b3c17fae1af921217e11 100644
|
||||
index c09e49f928e32a3dc6c557f01d92c455d9bfc8c6..bf507bcb8746298ca96e50686cdf1bd91c91e4c1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Strider.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Strider.java
|
||||
@@ -610,10 +610,23 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
|
||||
@@ -985,10 +985,10 @@ index d414158e1222f9a4f73a33abcf96f994aee4efde..dec0fd7d0b704c20df03b3c17fae1af9
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
index bcc1f2e8ad66eb826617f17d98fb43649fc8deb2..421a255dcb9843b34e8b0e39b65ee9b1bbd3ed0d 100644
|
||||
index 6cce132f43ce7aad6f5ee2b351855c9b57b8f0c1..4102dc4c8b63a1d00a8417aa303521590202f9a6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -636,6 +636,15 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
@@ -638,6 +638,15 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
protected PathFinder createPathFinder(int range) {
|
||||
this.nodeEvaluator = new WalkNodeEvaluator();
|
||||
this.nodeEvaluator.setCanPassDoors(true);
|
||||
@@ -1026,11 +1026,11 @@ index d9d0fff9962131808d54cca20f209df50b8e4af1..420dd323790e72aa12c942d31a94bcb8
|
||||
public void write(FriendlyByteBuf buf) {
|
||||
buf.writeCollection(this.targetNodes, (bufx, node) -> node.writeToStream(bufx));
|
||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
index f1aa182d7cc0ffac23ddb1f77335c61ca9f6f720..bc98944d37d5eb96a58092c31d7cb108249b7701 100644
|
||||
index cc7d94144e39f7dace7b569b4567def98396e8f9..95e71c471904fc54003180632dc85398ae06d241 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.core.BlockPos;
|
||||
//import net.minecraft.util.profiling.metrics.MetricCategory; // Plazma - Completely remove Mojang's Profiler
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.util.profiling.metrics.MetricCategory;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.level.PathNavigationRegion;
|
||||
+import dev.kaiijumc.kaiiju.path.*; // Plazma - Process pathfinding asynchronously
|
||||
@@ -1083,9 +1083,9 @@ index f1aa182d7cc0ffac23ddb1f77335c61ca9f6f720..bc98944d37d5eb96a58092c31d7cb108
|
||||
- @Nullable
|
||||
- // Paper start - Perf: remove streams and optimize collection
|
||||
- private Path findPath(Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) {
|
||||
- //ProfilerFiller profilerFiller = Profiler.get(); // Purpur
|
||||
- //profilerFiller.push("find_path"); // Purpur
|
||||
- //profilerFiller.markForCharting(MetricCategory.PATH_FINDING); // Purpur
|
||||
- ProfilerFiller profilerFiller = Profiler.get();
|
||||
- profilerFiller.push("find_path");
|
||||
- profilerFiller.markForCharting(MetricCategory.PATH_FINDING);
|
||||
- // Set<Target> set = positions.keySet();
|
||||
- startNode.g = 0.0F;
|
||||
- startNode.h = this.getBestH(startNode, positions); // Paper - optimize collection
|
||||
@@ -1187,7 +1187,7 @@ index f1aa182d7cc0ffac23ddb1f77335c61ca9f6f720..bc98944d37d5eb96a58092c31d7cb108
|
||||
+ } finally {
|
||||
+ this.nodeEvaluator.done();
|
||||
}
|
||||
- //profilerFiller.pop(); // Purpur
|
||||
- profilerFiller.pop();
|
||||
- return best;
|
||||
- // Paper end - Perf: remove streams and optimize collection
|
||||
}
|
||||
@@ -1298,7 +1298,7 @@ index 1c83926923f50fb4da1a83dc91614c20a831555f..aec2d0f9a957be65d031957dbff874d8
|
||||
|
||||
Command.broadcastCommandMessage(sender, text("Successfully reloaded Plazma configuration files.", NamedTextColor.GREEN));
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index cac12ad98eb0fa4dcc1b0f7f21d1eadd14ef7456..ab4ff76efbe4077691a0fde4043160ecbc4bc7dc 100644
|
||||
index 68a0e7144942022f0665e3124d98add70376d4a4..e85e7b22e7b2e59897d4c35e2e5150c0a26235c6 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -70,6 +70,26 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -1,21 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 2 Nov 2024 15:10:12 +0900
|
||||
Subject: [PATCH] minor code improvements
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
|
||||
index e5c5e20b0f2b2094faae2955a886f06ef6771eff..f19ab0a7daa671727675c2d03b3c77b287062f75 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
|
||||
@@ -100,8 +100,8 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal {
|
||||
// Paper end - call EntityPortalEnterEvent
|
||||
BlockEntity tileentity = world.getBlockEntity(pos);
|
||||
|
||||
- if (/*!world.isClientSide &&*/ tileentity instanceof TheEndGatewayBlockEntity) { // Plazma - Remove persist flag
|
||||
- TheEndGatewayBlockEntity tileentityendgateway = (TheEndGatewayBlockEntity) tileentity;
|
||||
+ if (/*!world.isClientSide &&*/ tileentity instanceof TheEndGatewayBlockEntity tileentityendgateway) { // Plazma - Remove persist flag // Plazma - minor code improvements
|
||||
+ //TheEndGatewayBlockEntity tileentityendgateway = (TheEndGatewayBlockEntity) tileentity; // Plazma - minor code improvements
|
||||
|
||||
if (!tileentityendgateway.isCoolingDown()) {
|
||||
// Purpur start
|
||||
@@ -218,7 +218,7 @@ index 0e6dfe2635ea5f5e410049b05f94f5083b2f18a4..584311a00c5037a6d5bc05b1261969aa
|
||||
return null;
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index ab4ff76efbe4077691a0fde4043160ecbc4bc7dc..2e1cf5f79556250aa22df3ade66393fe6a947659 100644
|
||||
index e85e7b22e7b2e59897d4c35e2e5150c0a26235c6..dc300e14e1bd03b4e855a360f1deda1cd7d6f7f0 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -45,6 +45,8 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -95,7 +95,7 @@ index db92261a6cb3758391108361096417c61bc82cdc..70ffa0853e04bd1684a36621143c3656
|
||||
|
||||
public SortedList(final E[] elements, final Comparator<? super E> comparator) {
|
||||
diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
|
||||
index bb44de17a37082e57f2292a4f470740be1d09b11..34c4d6cff702683d488a3ba0f59b513e279413af 100644
|
||||
index 7e440b4a46b040365df7317035e577d93e7d855d..fd30799510b8230e11de10376ff9f781262e8282 100644
|
||||
--- a/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
|
||||
+++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
|
||||
@@ -156,7 +156,7 @@ public final class NearbyPlayers {
|
||||
@@ -165,10 +165,10 @@ index 58d9187adc188b693b6becc400f766e069bf1bf5..a3d186c80840fdb628a48181df219c46
|
||||
public ServerEntityLookup(final ServerLevel world, final LevelCallback<Entity> worldCallback) {
|
||||
super(world, worldCallback);
|
||||
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
|
||||
index f3c453773e0413276935ca653b60bbe64fa4b169..1983a3802d96def1dbb53445ebf219290342cc29 100644
|
||||
index b0bfe655922877676948d9b6ff3fa5a6ebb7a640..742594c95a6ea88f8e6e899e448277bc6f57ded7 100644
|
||||
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
|
||||
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
|
||||
@@ -919,9 +919,10 @@ public final class ChunkTaskScheduler {
|
||||
@@ -921,9 +921,10 @@ public final class ChunkTaskScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ index eafa4e6d55cd0f9314ac0f2b96a7f48fbb5e1a4c..19c55571d3478532845d87d0053e4100
|
||||
public static final record ChunkCompletion(ChunkAccess chunk, ChunkStatus genStatus) {};
|
||||
private static final VarHandle CHUNK_COMPLETION_ARRAY_HANDLE = ConcurrentUtil.getArrayHandle(ChunkCompletion[].class);
|
||||
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/starlight/light/StarLightEngine.java b/src/main/java/ca/spottedleaf/moonrise/patches/starlight/light/StarLightEngine.java
|
||||
index 95218c6dc9ade3c0347f26564c9f319f0e88c102..2bcf46ade808cb9db05f07777adf36f19408b192 100644
|
||||
index ef40af5c6ac60fe00c05adcb664c811b28330819..097b9c5f8f81fdc547b379dcf5e68ddf6d7bbca4 100644
|
||||
--- a/src/main/java/ca/spottedleaf/moonrise/patches/starlight/light/StarLightEngine.java
|
||||
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/starlight/light/StarLightEngine.java
|
||||
@@ -1094,6 +1094,7 @@ public abstract class StarLightEngine {
|
||||
@@ -346,10 +346,10 @@ index 1e9873d7b258ce1f0b2437cb1e487157a16f6834..94f1337bb63a505641b66e6cbf0cc288
|
||||
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 ccfe9ef24dce9f34613692adb13738d3ad0e7aac..c2c5606bd02598b011eb998b034b03f515b29331 100644
|
||||
index 1360aa8202542d3d0f32247f1123575fc2c38ff1..c9c1a2bd96804835250ff3b921277e4fe6191bcc 100644
|
||||
--- a/src/main/java/net/minecraft/Util.java
|
||||
+++ b/src/main/java/net/minecraft/Util.java
|
||||
@@ -576,7 +576,7 @@ public class Util {
|
||||
@@ -592,7 +592,7 @@ public class Util {
|
||||
} else if (futures.size() == 1) {
|
||||
return futures.get(0).thenApply(List::of);
|
||||
} else {
|
||||
@@ -479,7 +479,7 @@ index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..80a28985e072334d960fe5a674d9bb08
|
||||
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 56e47c5709c765943407d2065b25bd512d1f9388..902faff84d17d3a251745ceb7b047340fb7b5faa 100644
|
||||
index 44a31f6f44885598ee06e88b940b84b1e89e5430..01158f1f4aa13cefb46c0ed7cce55dbbde89b521 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -326,7 +326,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -609,10 +609,10 @@ index 8dd9375f2ad2c65a773a3195aeff1f977e09e7e0..89cfe5a4e1554dd722ca98ec8c896e85
|
||||
private ChunkMap getChunkMap() {
|
||||
return (ChunkMap)this.playerProvider;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index b7f3ba9fe334362227c1c1624ad7922d624993f3..575fa1395477bad8e264f18648811b02376afe0b 100644
|
||||
index 3a8b566aa44df367c6edacf371c0b7a2bd2548b6..20d9cd87fcbdd666231746ca1b364cde7016b5d6 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1349,7 +1349,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -1364,7 +1364,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
public static List<Entity> getCurrentlyTickingEntities() {
|
||||
Entity ticking = currentlyTickingEntity.get();
|
||||
@@ -622,7 +622,7 @@ index b7f3ba9fe334362227c1c1624ad7922d624993f3..575fa1395477bad8e264f18648811b02
|
||||
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 bb10892f33ba0d7fc3959debef1045073868f8b8..b717afedc81765b8990f04a6c8c3795c00b746f0 100644
|
||||
index ab6a7d20f5473d8bffa7f8d136c1d55f17bbfaff..dce1796f0a7dbc69596b0348f42fe8d5fec1d2fa 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -172,12 +172,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -640,7 +640,7 @@ index bb10892f33ba0d7fc3959debef1045073868f8b8..b717afedc81765b8990f04a6c8c3795c
|
||||
}
|
||||
// Paper end - Validate usernames
|
||||
this.requestedUsername = packet.name();
|
||||
@@ -275,7 +275,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -266,7 +266,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
|
||||
@Override
|
||||
public void handleKey(ServerboundKeyPacket packet) {
|
||||
@@ -649,7 +649,7 @@ index bb10892f33ba0d7fc3959debef1045073868f8b8..b717afedc81765b8990f04a6c8c3795c
|
||||
|
||||
final String s;
|
||||
|
||||
@@ -456,7 +456,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -447,7 +447,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@Override
|
||||
public void handleLoginAcknowledgement(ServerboundLoginAcknowledgedPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.server); // CraftBukkit
|
||||
@@ -715,7 +715,7 @@ index a371f685534bf161f476ccea431fec6a80aca9c1..d2addf2453fa35779f0197f54a102e06
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
index 32a1bb3ea64099c4583607ee246b8cadb77c4d44..e7b79aa92afbee2c4f3b18fc30b36cb47fea357b 100644
|
||||
index bf4a3bc730709f41a5089dfe4c6342b08057ef02..b8ac4ff028dc839a7f1d0c1b9922b0507dc384db 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -257,7 +257,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -728,7 +728,7 @@ index 32a1bb3ea64099c4583607ee246b8cadb77c4d44..e7b79aa92afbee2c4f3b18fc30b36cb4
|
||||
this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
||||
index 0c085bc33a8f1a4ab299d9b6a13ac0f54c76b101..727e0d9fb297923088c6622f137b1e97807c1849 100644
|
||||
index cf071f48fb9b3acb7fabe4295de979dfca1079b4..fb663d60f6245f16fb4a09ce7c6fa65badfa1e36 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
||||
@@ -119,7 +119,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
@@ -741,7 +741,7 @@ index 0c085bc33a8f1a4ab299d9b6a13ac0f54c76b101..727e0d9fb297923088c6622f137b1e97
|
||||
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Mob.class, 5, false, false, (entityliving, worldserver) -> {
|
||||
return entityliving instanceof Enemy && !(entityliving instanceof Creeper);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Panda.java b/src/main/java/net/minecraft/world/entity/animal/Panda.java
|
||||
index 5997c826baecbc291575662917dc2f86aae18343..ba3ff61e1accbe299a49bcc93b2cdbfeeafc55c6 100644
|
||||
index 2df413fce51db6360c2a55fde72061135e0bd3a9..ae5d66afa5573596df9c322d9bb5c270777e8b8b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Panda.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java
|
||||
@@ -338,7 +338,7 @@ public class Panda extends Animal {
|
||||
@@ -754,7 +754,7 @@ index 5997c826baecbc291575662917dc2f86aae18343..ba3ff61e1accbe299a49bcc93b2cdbfe
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||
index 082004a11174ecd492da4a59de226bdd94da914c..c2b81c8c43fdd14dcf5347e6683636da5687830a 100644
|
||||
index 034dec437d6a6df5664185de77245bd17fcdd59b..67788747c84174054bfc2f66a4596837e08dd046 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||
@@ -458,7 +458,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
|
||||
@@ -767,7 +767,7 @@ index 082004a11174ecd492da4a59de226bdd94da914c..c2b81c8c43fdd14dcf5347e6683636da
|
||||
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Wolf.class, true));
|
||||
this.getAttribute(Attributes.ATTACK_DAMAGE).addOrUpdateTransientModifier(new AttributeModifier(Rabbit.EVIL_ATTACK_POWER_MODIFIER, 5.0D, AttributeModifier.Operation.ADD_VALUE));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
index d6953cc2cd43e740106983730b1ef4f0f8d532a0..2f448e3895d3e7c5c60c953c6302cb24656549fd 100644
|
||||
index 14d3e09e8eca665d186f5d356158052b118c6848..02927b6face86a9825a97b767c8de85838a79725 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
@@ -247,7 +247,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
|
||||
@@ -780,7 +780,7 @@ index d6953cc2cd43e740106983730b1ef4f0f8d532a0..2f448e3895d3e7c5c60c953c6302cb24
|
||||
// this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, Wolf.PREY_SELECTOR)); // Purpur - moved to updatePathfinders()
|
||||
this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
index 61a939bdebeed51a839c93d31038e4395a9484c3..947c492f2350aa76bbf85e2679f6e3096444617c 100644
|
||||
index a660d8bfa1294cd44dfa89f4c15bd339ffcccecf..dc833fe4aed149a4edbf668af4bc12937f6a4850 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
@@ -88,7 +88,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
@@ -807,7 +807,7 @@ index 48826eb0a960f7af6dd2ef184a8aed744a1d8f83..495a24d4e6705902c36032227bdfa359
|
||||
public static final EnderDragonPhase<DragonStrafePlayerPhase> STRAFE_PLAYER = create(DragonStrafePlayerPhase.class, "StrafePlayer");
|
||||
public static final EnderDragonPhase<DragonLandingApproachPhase> LANDING_APPROACH = create(DragonLandingApproachPhase.class, "LandingApproach");
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
index 7c862d730d8062303046519a9601c62fe284e1ba..8ef1beb34e4439a62be222a8ad7d2f58df6f328b 100644
|
||||
index 05fb8b26369f7703c6a97f1764a71bd4c3fe1058..82b31ced06d883a817b6d7036f8fce8481b463b9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
@@ -258,7 +258,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
@@ -820,7 +820,7 @@ index 7c862d730d8062303046519a9601c62fe284e1ba..8ef1beb34e4439a62be222a8ad7d2f58
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
index 4a389323d2ba15b282217ec54c52f5c278f79ff6..47d40d10c1b1514e6d56b994cc34b124b7fb5ce1 100644
|
||||
index 41c6b60a9d0210b7f2c660cc03999be9c9bc344e..8acafd4f4d2dec45fb18f89a0be5c4a584c44904 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
@@ -81,7 +81,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
@@ -833,7 +833,7 @@ index 4a389323d2ba15b282217ec54c52f5c278f79ff6..47d40d10c1b1514e6d56b994cc34b124
|
||||
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
|
||||
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR));
|
||||
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 058ca0f7b85754950ddbb014958c1b90f15f8549..275e874a27afdb6b708d7edb8317f8b26f3e2711 100644
|
||||
index 3b2560ee1bb8c415eada619fc057d35ccb0e2ab0..82ccbcef029066a1b48c0844e974380d89059910 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
@@ -154,7 +154,7 @@ public class Creeper extends Monster {
|
||||
@@ -846,7 +846,7 @@ index 058ca0f7b85754950ddbb014958c1b90f15f8549..275e874a27afdb6b708d7edb8317f8b2
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index fbf08c9041e07f49f1fc2f869ea2f5ba795bc7ff..1f9a24cc958675d4ad5d6fe9fd1ff515d0bdb4d2 100644
|
||||
index d57f6b312341f6d83788bbb294cc65ee47361373..aff74f0ca5a8a007b919151194f8ef578ce6fda4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -136,7 +136,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
@@ -859,7 +859,7 @@ index fbf08c9041e07f49f1fc2f869ea2f5ba795bc7ff..1f9a24cc958675d4ad5d6fe9fd1ff515
|
||||
this.targetSelector.addGoal(4, new ResetUniversalAngerTargetGoal<>(this, false));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Endermite.java b/src/main/java/net/minecraft/world/entity/monster/Endermite.java
|
||||
index 57158457f7d0e6a785df9fe19204d73d6b918e79..6326c74849b648622eda886a3adb0db45b8c750c 100644
|
||||
index 063954513b5c69047298a98224d7e099e18588bf..be9a5957b076268d79445d6daf7ae0deac32f6eb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Endermite.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Endermite.java
|
||||
@@ -90,7 +90,7 @@ public class Endermite extends Monster {
|
||||
@@ -872,7 +872,7 @@ index 57158457f7d0e6a785df9fe19204d73d6b918e79..6326c74849b648622eda886a3adb0db4
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
|
||||
index ece70d8303e563df416fc6703e6d7d2e23ee220a..25110321e35656e30017e7affceff1960991da37 100644
|
||||
index 7a6ad611faf39eb8dd87bd498169571633c33769..2a3edfeab8306efe013084de44e1c372fffe98d6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
|
||||
@@ -89,7 +89,7 @@ public class Silverfish extends Monster {
|
||||
@@ -885,7 +885,7 @@ index ece70d8303e563df416fc6703e6d7d2e23ee220a..25110321e35656e30017e7affceff196
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
||||
index 651cc3297a86ff298f72b28a9fb623a0922adad8..3cb5d615833767122ae8b92294e44ffdf4ac21b3 100644
|
||||
index 74f8903541d5288f2a50769ffc5ef88e0c9aad1b..b58cef316e85edde6200fe870144334a19ef193d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
||||
@@ -97,7 +97,7 @@ public class Spider extends Monster {
|
||||
@@ -898,7 +898,7 @@ index 651cc3297a86ff298f72b28a9fb623a0922adad8..3cb5d615833767122ae8b92294e44ffd
|
||||
this.targetSelector.addGoal(3, new Spider.SpiderTargetGoal<>(this, IronGolem.class));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index 94f2f27abdf5e48835bd134ac164a163fb78dc41..a3141438b5fa64318a1d515de296ce59e18b0ce9 100644
|
||||
index 6628efb0ec59e68810152a64309bc5f610181392..badde720a15f3a9a0c0c8b6b66b387b3b1aabd64 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -170,7 +170,7 @@ public class Zombie extends Monster {
|
||||
@@ -960,7 +960,7 @@ index 2490a42c9c35c7e080279ef8566288a28362d167..34d6eaebfe03716c8cbbb5395024b0da
|
||||
String[] strings = new String[pattern.size() - l - k];
|
||||
|
||||
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 cb19d28823a701720cd1998310dfc8cc8f50919f..5be6a615182fe7cf46be6a3b9683333c4e98f7b7 100644
|
||||
index f5b498bf68d351e42f5db5ae28aab4923847e3a5..73f5ccf83285d5514907160e3cc5f5c1cde73d6b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
@@ -462,7 +462,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
@@ -1004,7 +1004,7 @@ index 4e56398a6fb8b97199f4c74ebebc1055fb718dcf..84faa524b57e1877ed6006be6784b07b
|
||||
}
|
||||
|
||||
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 6a465d9b12c92b5385c394fef7456630be97c04d..d0be5fd43b59a8b4dd3ac2fab1c6580936318be0 100644
|
||||
index 16f07007a0f73ec0c6f421c9b082518e87e8cc7b..c08c0096eeac2d184256c703f38b230d7ad8ee9f 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
|
||||
@@ -426,7 +426,7 @@ public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patche
|
||||
@@ -1148,7 +1148,7 @@ index 8a4f95049c63afb28bef6719c77b7a7092e75aae..f295205e3093f8c3c4ed4c1cf6ac3aaf
|
||||
System.out.println("Starting server");
|
||||
Thread runThread = new Thread(() -> {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 48ad261eec1b74fad5a4fc1516b75fd2aaecd528..024465e1c1232f839db00432379ca8f42b7ff78b 100644
|
||||
index 63065a22ff359c142bab23fccacfd5ebd86f81a5..b788c9c1b162ea5b71754a1061565531b8cf1548 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -520,7 +520,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Hashed rcon password
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
index 067f91dd019be40cb09f8fa78cae587429488201..765eb86e66125a517f14a568958281bd57c1bc63 100644
|
||||
index 3dd5c7441bb300ca17d717af37edbefb89db4b2f..df367fbb8c582614aaf2087aa37d5e47247af810 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
@@ -73,7 +73,6 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
@@ -1,92 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Mon, 4 Nov 2024 15:20:40 +0900
|
||||
Subject: [PATCH] Option to use better RNG
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index e94ab488b4d7ef26021be3b97c71831eeef505f4..82ed63aa458b6b628be7163a6b1f1f47d1a69ce4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -125,7 +125,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public final Thread thread;
|
||||
private final boolean isDebug;
|
||||
private int skyDarken;
|
||||
- protected int randValue = RandomSource.create().nextInt();
|
||||
+ protected long randValue;
|
||||
protected final int addend = 1013904223;
|
||||
protected float oRainLevel;
|
||||
public float rainLevel;
|
||||
@@ -134,7 +134,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public final RandomSource random = RandomSource.create();
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
- private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
|
||||
+ private final @Nullable RandomSource threadSafeRandom;
|
||||
private final Holder<DimensionType> dimensionTypeRegistration;
|
||||
public final WritableLevelData levelData;
|
||||
//public final boolean isClientSide; // Plazma - Remove persist flag
|
||||
@@ -909,6 +909,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
this.plazmaConfig = plazmaWorldConfigurationCreator.apply(this.spigotConfig); // Plazma - Configurable Plazma
|
||||
+ this.randValue = plazmaConfig.misc.useBetterRandomAlgorithm ? RandomSource.create().nextLong() : RandomSource.create().nextInt(); // Plazma - Option to use better RNG
|
||||
+ this.threadSafeRandom = plazmaConfig.misc.useBetterRandomAlgorithm ? null : RandomSource.createThreadSafe(); // Plazma - Option to use better RNG
|
||||
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur
|
||||
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
|
||||
this.generator = gen;
|
||||
@@ -1472,15 +1474,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
|
||||
public void playSound(@Nullable Player source, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch) {
|
||||
- this.playSeededSound(source, x, y, z, sound, category, volume, pitch, this.threadSafeRandom.nextLong());
|
||||
+ long seed = this.threadSafeRandom == null ? this.randValue++ : this.threadSafeRandom.nextLong();
|
||||
+ this.playSeededSound(source, x, y, z, sound, category, volume, pitch, seed);
|
||||
}
|
||||
|
||||
public void playSound(@Nullable Player source, double x, double y, double z, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch) {
|
||||
- this.playSeededSound(source, x, y, z, sound, category, volume, pitch, this.threadSafeRandom.nextLong());
|
||||
+ long seed = this.threadSafeRandom == null ? this.randValue++ : this.threadSafeRandom.nextLong();
|
||||
+ this.playSeededSound(source, x, y, z, sound, category, volume, pitch, seed);
|
||||
}
|
||||
|
||||
public void playSound(@Nullable Player source, Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch) {
|
||||
- this.playSeededSound(source, entity, BuiltInRegistries.SOUND_EVENT.wrapAsHolder(sound), category, volume, pitch, this.threadSafeRandom.nextLong());
|
||||
+ long seed = this.threadSafeRandom == null ? this.randValue++ : this.threadSafeRandom.nextLong();
|
||||
+ this.playSeededSound(source, entity, BuiltInRegistries.SOUND_EVENT.wrapAsHolder(sound), category, volume, pitch, seed);
|
||||
}
|
||||
|
||||
public void playLocalSound(BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch, boolean useDistance) {
|
||||
@@ -2047,8 +2052,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public abstract RecipeAccess recipeAccess();
|
||||
|
||||
public BlockPos getBlockRandomPos(int x, int y, int z, int l) {
|
||||
+ // Plazma start - Option to use better RNG
|
||||
+ if (this.threadSafeRandom == null) {
|
||||
+ this.randValue = (((long)(x ^ 16691) << 32 | ((z ^ 19391) & (1L << 32) - 1)) << 8 | ((this.randValue + 2319389831L) * 11 & 0xFF));
|
||||
+ long i1 = Long.reverse(randValue * randValue << 39);
|
||||
+ long i2 = Long.reverse(randValue * randValue << 41);
|
||||
+ long i3 = Long.reverse(randValue * randValue << 23);
|
||||
+
|
||||
+ return new BlockPos(x + ((int) i1 & 15), y + ((int) i2 & l), z + ((int) i3 & 15));
|
||||
+ }
|
||||
+ // Plazma end - Option to use better RNG
|
||||
+
|
||||
this.randValue = this.randValue * 3 + 1013904223;
|
||||
- int i1 = this.randValue >> 2;
|
||||
+ int i1 = (int) (this.randValue >> 2); // Plazma - Option to use better RNG
|
||||
|
||||
return new BlockPos(x + (i1 & 15), y + (i1 >> 16 & l), z + (i1 >> 8 & 15));
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index ef3dc8477b5547efa08a7fb60704f246e57fedfe..6b68ce9b5961cd298eaf2fca478cb8197f2128ee 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -22,6 +22,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
public Miscellaneous misc;
|
||||
public class Miscellaneous extends ConfigurationPart {
|
||||
|
||||
+ public boolean useBetterRandomAlgorithm = false;
|
||||
|
||||
}
|
||||
|
||||
75
patches/server/0047-Add-option-to-allow-shoot-fireball.patch
Normal file
75
patches/server/0047-Add-option-to-allow-shoot-fireball.patch
Normal file
@@ -0,0 +1,75 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 13 Dec 2024 11:14:49 +0900
|
||||
Subject: [PATCH] Add option to allow shoot fireball
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/FireChargeItem.java b/src/main/java/net/minecraft/world/item/FireChargeItem.java
|
||||
index 641eb27097740219199ce61ed3e6aa5f42a51b1c..c5973b9182d25d7eb03ba3d91ec7a325cae5fa00 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/FireChargeItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/FireChargeItem.java
|
||||
@@ -30,6 +30,27 @@ public class FireChargeItem extends Item implements ProjectileItem {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
+ // Plazma start - Option to shoot fireballs
|
||||
+ @Override
|
||||
+ public InteractionResult use(Level world, Player user, net.minecraft.world.InteractionHand hand) {
|
||||
+ if (!world.plazmaConfig().item.allowShootFireballs) {
|
||||
+ super.use(world, user, hand);
|
||||
+ return InteractionResult.PASS;
|
||||
+ }
|
||||
+
|
||||
+ ItemStack itemStack = user.getItemInHand(hand);
|
||||
+ Vec3 vec = user.getDirection().getUnitVec3().multiply(10, 10, 10);
|
||||
+
|
||||
+ SmallFireball fireball = new SmallFireball(world, user, vec);
|
||||
+ fireball.setItem(itemStack);
|
||||
+ fireball.shootFromRotation(user, user.getXRot(), user.getYRot(), 0.0F, 1.5F, 1.0F);
|
||||
+ world.addFreshEntity(fireball);
|
||||
+
|
||||
+ itemStack.shrink(1);
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Plazma end - Option to shoot fireballs
|
||||
+
|
||||
@Override
|
||||
public InteractionResult useOn(UseOnContext context) {
|
||||
Level world = context.getLevel();
|
||||
diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java
|
||||
index 580bd63fdbf9555f867362d3c1f39f41fd750089..bfde7c2d386d94913bde5452b903f2f2ee7ac672 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/Items.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/Items.java
|
||||
@@ -1698,7 +1698,7 @@ public class Items {
|
||||
ExperienceBottleItem::new,
|
||||
new Item.Properties().rarity(Rarity.UNCOMMON).component(DataComponents.ENCHANTMENT_GLINT_OVERRIDE, true)
|
||||
);
|
||||
- public static final Item FIRE_CHARGE = registerItem("fire_charge", FireChargeItem::new);
|
||||
+ public static final Item FIRE_CHARGE = registerItem("fire_charge", FireChargeItem::new, new Item.Properties().useCooldown(org.plazmamc.plazma.configurations.GlobalConfiguration.get().item.fireCharge.cooldown()));
|
||||
public static final Item WIND_CHARGE = registerItem("wind_charge", WindChargeItem::new, new Item.Properties().useCooldown(0.5F));
|
||||
public static final Item WRITABLE_BOOK = registerItem(
|
||||
"writable_book", WritableBookItem::new, new Item.Properties().stacksTo(1).component(DataComponents.WRITABLE_BOOK_CONTENT, WritableBookContent.EMPTY)
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index dc300e14e1bd03b4e855a360f1deda1cd7d6f7f0..2e1cf5f79556250aa22df3ade66393fe6a947659 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -146,7 +146,6 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
-
|
||||
public ConsoleLogs consoleLogs;
|
||||
public class ConsoleLogs extends ConfigurationPart {
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index c1d4a96cf5be77f4460c54ed19622f527d42ca06..7591e21bfd90edff05639bb6a027c3fe8c1c36c3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -86,6 +86,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
public Item item;
|
||||
public class Item extends ConfigurationPart {
|
||||
|
||||
+ public boolean allowShootFireballs = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Remove Mojang Profiler codes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
|
||||
index 600a7036b503f60cc9c95f189f73c2dbf020e2e1..aacfd9b8d71a47a75eefa3a0f87636e58a5b6370 100644
|
||||
index bce2dac613d29083dd5fbb68739304cc5a6d4d27..aacfd9b8d71a47a75eefa3a0f87636e58a5b6370 100644
|
||||
--- a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
|
||||
+++ b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
|
||||
@@ -1,206 +1,3 @@
|
||||
@@ -66,7 +66,7 @@ index 600a7036b503f60cc9c95f189f73c2dbf020e2e1..aacfd9b8d71a47a75eefa3a0f87636e5
|
||||
- this.started = true;
|
||||
- this.path = "";
|
||||
- this.paths.clear();
|
||||
- //this.push("root"); // Purpur
|
||||
- this.push("root");
|
||||
- }
|
||||
- }
|
||||
-
|
||||
@@ -75,7 +75,7 @@ index 600a7036b503f60cc9c95f189f73c2dbf020e2e1..aacfd9b8d71a47a75eefa3a0f87636e5
|
||||
- if (!this.started) {
|
||||
- LOGGER.error("Profiler tick already ended - missing startTick()?");
|
||||
- } else {
|
||||
- //this.pop(); // Purpur
|
||||
- this.pop();
|
||||
- this.started = false;
|
||||
- if (!this.path.isEmpty()) {
|
||||
- LOGGER.error(
|
||||
@@ -104,7 +104,7 @@ index 600a7036b503f60cc9c95f189f73c2dbf020e2e1..aacfd9b8d71a47a75eefa3a0f87636e5
|
||||
-
|
||||
- @Override
|
||||
- public void push(Supplier<String> locationGetter) {
|
||||
- //this.push(locationGetter.get()); // Purpur
|
||||
- this.push(locationGetter.get());
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
@@ -143,14 +143,14 @@ index 600a7036b503f60cc9c95f189f73c2dbf020e2e1..aacfd9b8d71a47a75eefa3a0f87636e5
|
||||
-
|
||||
- @Override
|
||||
- public void popPush(String location) {
|
||||
- //this.pop(); // Purpur
|
||||
- //this.push(location); // Purpur
|
||||
- this.pop();
|
||||
- this.push(location);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void popPush(Supplier<String> locationGetter) {
|
||||
- //this.pop(); // Purpur
|
||||
- //this.push(locationGetter); // Purpur
|
||||
- this.pop();
|
||||
- this.push(locationGetter);
|
||||
- }
|
||||
-
|
||||
- private ActiveProfiler.PathEntry getCurrentEntry() {
|
||||
@@ -841,10 +841,10 @@ index fe8a8ee1f88c58a9fe730c4c0cc5fc4e3651e9f8..09d2768bd51e0bd8917e870387fd1877
|
||||
-}
|
||||
+@Deprecated(forRemoval = true) interface Profiler {} // Plazma - Completely remove Mojang's Profiler
|
||||
diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
|
||||
index ce81d6bd87f688a24003f2fbf6d5010ad6273917..1bce6008d63c371c666db13633902e303142127f 100644
|
||||
index bc5c8879befe849ce81becf5e3fba6757b01cb70..1bce6008d63c371c666db13633902e303142127f 100644
|
||||
--- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
|
||||
+++ b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
|
||||
@@ -1,168 +1,3 @@
|
||||
@@ -1,151 +1,3 @@
|
||||
package net.minecraft.util.profiling;
|
||||
|
||||
-import java.util.function.Supplier;
|
||||
@@ -853,68 +853,51 @@ index ce81d6bd87f688a24003f2fbf6d5010ad6273917..1bce6008d63c371c666db13633902e30
|
||||
-public interface ProfilerFiller {
|
||||
- String ROOT = "root";
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void startTick();
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void endTick();
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void push(String location);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void push(Supplier<String> locationGetter);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void pop();
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void popPush(String location);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void popPush(Supplier<String> locationGetter);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- default void addZoneText(String label) {
|
||||
- }
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- default void addZoneValue(long value) {
|
||||
- }
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- default void setZoneColor(int color) {
|
||||
- }
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- default Zone zone(String name) {
|
||||
- this.push(name);
|
||||
- return new Zone(this);
|
||||
- }
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- default Zone zone(Supplier<String> nameSupplier) {
|
||||
- this.push(nameSupplier);
|
||||
- return new Zone(this);
|
||||
- }
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void markForCharting(MetricCategory type);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- default void incrementCounter(String marker) {
|
||||
- //this.incrementCounter(marker, 1); // Purpur
|
||||
- this.incrementCounter(marker, 1);
|
||||
- }
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void incrementCounter(String marker, int num);
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- default void incrementCounter(Supplier<String> markerGetter) {
|
||||
- //this.incrementCounter(markerGetter, 1); // Purpur
|
||||
- this.incrementCounter(markerGetter, 1);
|
||||
- }
|
||||
-
|
||||
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
- void incrementCounter(Supplier<String> markerGetter, int num);
|
||||
-
|
||||
- static ProfilerFiller combine(ProfilerFiller first, ProfilerFiller second) {
|
||||
@@ -936,80 +919,80 @@ index ce81d6bd87f688a24003f2fbf6d5010ad6273917..1bce6008d63c371c666db13633902e30
|
||||
-
|
||||
- @Override
|
||||
- public void startTick() {
|
||||
- //this.first.startTick(); // Purpur
|
||||
- //this.second.startTick(); // Purpur
|
||||
- this.first.startTick();
|
||||
- this.second.startTick();
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void endTick() {
|
||||
- //this.first.endTick(); // Purpur
|
||||
- //this.second.endTick(); // Purpur
|
||||
- this.first.endTick();
|
||||
- this.second.endTick();
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void push(String location) {
|
||||
- //this.first.push(location); // Purpur
|
||||
- //this.second.push(location); // Purpur
|
||||
- this.first.push(location);
|
||||
- this.second.push(location);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void push(Supplier<String> locationGetter) {
|
||||
- //this.first.push(locationGetter); // Purpur
|
||||
- //this.second.push(locationGetter); // Purpur
|
||||
- this.first.push(locationGetter);
|
||||
- this.second.push(locationGetter);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void markForCharting(MetricCategory type) {
|
||||
- //this.first.markForCharting(type); // Purpur
|
||||
- //this.second.markForCharting(type); // Purpur
|
||||
- this.first.markForCharting(type);
|
||||
- this.second.markForCharting(type);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void pop() {
|
||||
- //this.first.pop(); // Purpur
|
||||
- //this.second.pop(); // Purpur
|
||||
- this.first.pop();
|
||||
- this.second.pop();
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void popPush(String location) {
|
||||
- //this.first.popPush(location); // Purpur
|
||||
- //this.second.popPush(location); // Purpur
|
||||
- this.first.popPush(location);
|
||||
- this.second.popPush(location);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void popPush(Supplier<String> locationGetter) {
|
||||
- //this.first.popPush(locationGetter); // Purpur
|
||||
- //this.second.popPush(locationGetter); // Purpur
|
||||
- this.first.popPush(locationGetter);
|
||||
- this.second.popPush(locationGetter);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void incrementCounter(String marker, int num) {
|
||||
- //this.first.incrementCounter(marker, num); // Purpur
|
||||
- //this.second.incrementCounter(marker, num); // Purpur
|
||||
- this.first.incrementCounter(marker, num);
|
||||
- this.second.incrementCounter(marker, num);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void incrementCounter(Supplier<String> markerGetter, int num) {
|
||||
- //this.first.incrementCounter(markerGetter, num); // Purpur
|
||||
- //this.second.incrementCounter(markerGetter, num); // Purpur
|
||||
- this.first.incrementCounter(markerGetter, num);
|
||||
- this.second.incrementCounter(markerGetter, num);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void addZoneText(String label) {
|
||||
- //this.first.addZoneText(label); // Purpur
|
||||
- //this.second.addZoneText(label); // Purpur
|
||||
- this.first.addZoneText(label);
|
||||
- this.second.addZoneText(label);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void addZoneValue(long value) {
|
||||
- //this.first.addZoneValue(value); // Purpur
|
||||
- //this.second.addZoneValue(value); // Purpur
|
||||
- this.first.addZoneValue(value);
|
||||
- this.second.addZoneValue(value);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void setZoneColor(int color) {
|
||||
- //this.first.setZoneColor(color); // Purpur
|
||||
- //this.second.setZoneColor(color); // Purpur
|
||||
- this.first.setZoneColor(color);
|
||||
- this.second.setZoneColor(color);
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
2922
patches/server/0049-Completely-remove-Mojang-profiler.patch
Normal file
2922
patches/server/0049-Completely-remove-Mojang-profiler.patch
Normal file
File diff suppressed because it is too large
Load Diff
116
patches/server/0050-Port-minor-SparklyPaper-patches.patch
Normal file
116
patches/server/0050-Port-minor-SparklyPaper-patches.patch
Normal file
@@ -0,0 +1,116 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 13 Dec 2024 21:10:27 +0900
|
||||
Subject: [PATCH] Port minor SparklyPaper patches
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index c14ce846afb7364e541bfe01b73a06a94e48f55b..3b11cc112e98cea1067ecdfe20d894f8ba753b93 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -58,6 +58,7 @@ import org.bukkit.event.player.PlayerVelocityEvent;
|
||||
|
||||
public class ServerEntity {
|
||||
|
||||
+ public static boolean PLAZMA_DISTANCE_SQR = false; // Plazma - Port Minor SparklyPaper patches; Skip distanceToSqr if the delta is the same
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private static final int TOLERANCE_LEVEL_ROTATION = 1;
|
||||
private static final double TOLERANCE_LEVEL_POSITION = 7.62939453125E-6D;
|
||||
@@ -232,6 +233,7 @@ public class ServerEntity {
|
||||
|
||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||
Vec3 vec3d1 = this.entity.getDeltaMovement();
|
||||
+ if (PLAZMA_DISTANCE_SQR || vec3d1 != this.lastSentMovement) { // Plazma - Port Minor SparklyPaper patches; Skip distanceToSqr if the delta is the same
|
||||
double d0 = vec3d1.distanceToSqr(this.lastSentMovement);
|
||||
|
||||
if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
|
||||
@@ -246,6 +248,7 @@ public class ServerEntity {
|
||||
this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
|
||||
}
|
||||
}
|
||||
+ } // Plazma - Port Minor SparklyPaper patches; Skip distanceToSqr if the delta is the same
|
||||
}
|
||||
|
||||
if (packet1 != null) {
|
||||
diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
index da7e1a69ecb4e6b3be2d8544ac406aa519bd196e..ce56fdd0bbe1c95146c88594c68a6a399f01218e 100644
|
||||
--- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
+++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
@@ -90,12 +90,14 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
this.dirty.add(stat);
|
||||
}
|
||||
|
||||
+ /* // Plazma - Port Minor SparklyPaper patches; Skip dirty stats copy when requesting player stats
|
||||
private Set<Stat<?>> getDirty() {
|
||||
Set<Stat<?>> set = Sets.newHashSet(this.dirty);
|
||||
|
||||
this.dirty.clear();
|
||||
return set;
|
||||
}
|
||||
+ */ // Plazma - Port Minor SparklyPaper patches; Skip dirty stats copy when requesting player stats
|
||||
|
||||
public void parseLocal(DataFixer dataFixer, String json) {
|
||||
try {
|
||||
@@ -242,14 +244,12 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
}
|
||||
|
||||
public void sendStats(ServerPlayer player) {
|
||||
- Object2IntMap<Stat<?>> object2intmap = new Object2IntOpenHashMap();
|
||||
- Iterator iterator = this.getDirty().iterator();
|
||||
+ // Plazma start - Port Minor SparklyPaper patches; Skip dirty stats copy when requesting player stats
|
||||
+ Object2IntMap<Stat<?>> object2intmap = new Object2IntOpenHashMap<>();
|
||||
+ for (final Stat<?> stat : this.dirty) object2intmap.put(stat, this.getValue(stat));
|
||||
|
||||
- while (iterator.hasNext()) {
|
||||
- Stat<?> statistic = (Stat) iterator.next();
|
||||
-
|
||||
- object2intmap.put(statistic, this.getValue(statistic));
|
||||
- }
|
||||
+ this.dirty.clear();
|
||||
+ // Plazma end - Port Minor SparklyPaper patches; Skip dirty stats copy when requesting player stats
|
||||
|
||||
player.connection.send(new ClientboundAwardStatsPacket(object2intmap));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
index 8c455ac7dcb126e2b2932eba980454513947fac2..ecf9153b0eadb264d79fe9a809918bb13cd6d4b8 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
@@ -276,7 +276,12 @@ public class MapItem extends Item {
|
||||
mapItemSavedData.tickCarriedBy(player, stack);
|
||||
}
|
||||
|
||||
- if (!mapItemSavedData.locked && (selected || entity instanceof Player && ((Player)entity).getOffhandItem() == stack)) {
|
||||
+ // Plazma start - Port Minor SparklyPaper patches; Skip map update if the craft renderer is null
|
||||
+ if (!mapItemSavedData.locked
|
||||
+ && (!world.plazmaConfig().item.skipMapUpdateIfCraftRenderIsNull || mapItemSavedData.mapView.getRenderers().stream().anyMatch(renderer -> renderer instanceof org.bukkit.craftbukkit.map.CraftMapRenderer))
|
||||
+ && (selected || entity instanceof Player player && player.getOffhandItem() == stack)
|
||||
+ ) {
|
||||
+ // Plazma end - Port Minor SparklyPaper patches; Skip map update if the craft renderer is null
|
||||
this.update(world, entity, mapItemSavedData);
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
||||
index 8149b9c51b78eb5c689b7218a2ca3aab60e73bcf..125a4f13dbe98976c4cf94bb523463a51bd4f8dd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
||||
@@ -145,7 +145,7 @@ public class CraftMapColorCache implements MapPalette.MapColorCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
- public boolean isCached() {
|
||||
+ public synchronized boolean isCached() { // Plazma - Port Minor SparklyPaper patches; Fix concurrency issues when using "imageToBytes" in multiple threads
|
||||
return this.cached || (!this.running.get() && this.initCache().isDone());
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index 7591e21bfd90edff05639bb6a027c3fe8c1c36c3..bab5f682b8aeaa6dfcda7f07499ae297cbcbe23e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -87,6 +87,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
public class Item extends ConfigurationPart {
|
||||
|
||||
public boolean allowShootFireballs = false;
|
||||
+ public boolean skipMapUpdateIfCraftRenderIsNull = true;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,317 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 13 Dec 2024 21:00:07 +0900
|
||||
Subject: [PATCH] SparklyPaper - Optimize framed map tracker ticking
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 3b11cc112e98cea1067ecdfe20d894f8ba753b93..f33e7f7fdee160b7397b1156c179a5c95816307a 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -129,33 +129,31 @@ public class ServerEntity {
|
||||
|
||||
Entity entity = this.entity;
|
||||
|
||||
- if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame entityitemframe) { // Paper - Perf: Only tick item frames if players can see it
|
||||
- if (true || this.tickCount % 10 == 0) { // CraftBukkit - Moved below, should always enter this block
|
||||
- ItemStack itemstack = entityitemframe.getItem();
|
||||
-
|
||||
- if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable
|
||||
- MapId mapid = entityitemframe.cachedMapId; // Paper - Perf: Cache map ids on item frames
|
||||
- MapItemSavedData worldmap = MapItem.getSavedData(mapid, this.level);
|
||||
-
|
||||
- if (worldmap != null) {
|
||||
- Iterator<ServerPlayerConnection> iterator = this.trackedPlayers.iterator(); // CraftBukkit
|
||||
-
|
||||
- while (iterator.hasNext()) {
|
||||
- ServerPlayer entityplayer = iterator.next().getPlayer(); // CraftBukkit
|
||||
-
|
||||
- worldmap.tickCarriedBy(entityplayer, itemstack);
|
||||
- Packet<?> packet = worldmap.getUpdatePacket(mapid, entityplayer);
|
||||
+ // Plazma start - Optimize framed map tracker ticking
|
||||
+ if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame frame && frame.cachedMapId != null) { // Paper - Perf: Only tick item frames if players can see it
|
||||
+ if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable
|
||||
+ MapId id = frame.cachedMapId; // Paper - Perf: Cache map ids on item frames
|
||||
+ MapItemSavedData data = MapItem.getSavedData(id, this.level);
|
||||
+
|
||||
+ if (data != null) for (final ServerPlayerConnection trackedPlayer : this.trackedPlayers) {
|
||||
+ if (!data.hasContextualRenderer) {
|
||||
+ // Pass in a "random" player when a non-contextual plugin renderer is added to make sure it is called
|
||||
+ final Packet<?> updatePacket = data.framedUpdatePacket(id, data.hasPluginRenderer ? com.google.common.collect.Iterables.getFirst(this.trackedPlayers, null).getPlayer() : null);
|
||||
+
|
||||
+ if (updatePacket != null)
|
||||
+ for (ServerPlayerConnection connection : this.trackedPlayers) connection.send(updatePacket);
|
||||
+ } else {
|
||||
+ ServerPlayer player = trackedPlayer.getPlayer(); // CraftBukkit
|
||||
+ Packet<?> packet = data.getUpdatePacket(id, player);
|
||||
|
||||
- if (packet != null) {
|
||||
- entityplayer.connection.send(packet);
|
||||
- }
|
||||
- }
|
||||
+ if (packet != null) player.connection.send(packet);
|
||||
}
|
||||
}
|
||||
-
|
||||
- this.sendDirtyEntityData();
|
||||
}
|
||||
+
|
||||
+ this.sendDirtyEntityData();
|
||||
}
|
||||
+ // Plazma end - Optimize framed map tracker ticking
|
||||
|
||||
if (this.forceStateResync || this.tickCount % this.updateInterval == 0 || this.entity.hasImpulse || this.entity.getEntityData().isDirty()) { // Paper - fix desync when a player is added to the tracker
|
||||
byte b0 = Mth.packDegrees(this.entity.getYRot());
|
||||
@@ -426,6 +424,16 @@ public class ServerEntity {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Plazma start - Optimize framed map tracker adding
|
||||
+ if (this.entity instanceof ItemFrame frame && frame.cachedMapId != null) {
|
||||
+ MapItemSavedData mapData = MapItem.getSavedData(frame.cachedMapId, this.level);
|
||||
+ if (mapData == null) return;
|
||||
+
|
||||
+ mapData.addFrameDecoration(frame);
|
||||
+ final Packet<?> mapPacket = mapData.fullUpdatePacket(frame.cachedMapId, mapData.hasPluginRenderer ? player : null);
|
||||
+ if (mapPacket != null) sender.accept((Packet<ClientGamePacketListener>) mapPacket);
|
||||
+ }
|
||||
+ // Plazma end - Optimize framed map tracker adding
|
||||
}
|
||||
|
||||
public Vec3 getPositionBase() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
index 27f7a0abf77e94f15ff5f42e54e979377c94e63c..d1b8edccf3d7418a4aceba8491491b3a339b645a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
@@ -175,6 +175,16 @@ public class ItemFrame extends HangingEntity {
|
||||
this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()), false);
|
||||
}
|
||||
// Paper end - Add PlayerItemFrameChangeEvent
|
||||
+ // Plazma start - Optimize framed map tracker ticking
|
||||
+ final ItemStack item = this.getItem();
|
||||
+ if (item.is(Items.FILLED_MAP)) {
|
||||
+ final MapItemSavedData data = MapItem.getSavedData(item, this.level());
|
||||
+ if (data != null) {
|
||||
+ data.addFrameDecoration(this);
|
||||
+ data.markAllDirty();
|
||||
+ }
|
||||
+ }
|
||||
+ // Plazma end - Optimize framed map tracker ticking
|
||||
this.dropItem(world, source.getEntity(), false);
|
||||
this.gameEvent(GameEvent.BLOCK_CHANGE, source.getEntity());
|
||||
this.playSound(this.getRemoveItemSound(), 1.0F, 1.0F);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
index 71aa3b9c5604f832e764e0d7a93da467ffe7dee1..e1440d1fc32229867e1f1543961fdfcec99a36fd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
@@ -80,12 +80,22 @@ public class MapItemSavedData extends SavedData {
|
||||
public final Map<String, MapDecoration> decorations = Maps.newLinkedHashMap();
|
||||
private final Map<String, MapFrame> frameMarkers = Maps.newHashMap();
|
||||
private int trackedDecorationCount;
|
||||
- private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper
|
||||
+ private final org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper // Plazma - Improve code styling
|
||||
public boolean isExplorerMap; // Purpur
|
||||
+ // Plazma start - Optimize framed map tracker ticking; Shared between all players tracking this map inside an item frame
|
||||
+ public boolean dirtyColorData;
|
||||
+ public int minDirtyX;
|
||||
+ public int minDirtyY;
|
||||
+ public int maxDirtyX;
|
||||
+ public int maxDirtyY;
|
||||
+ public boolean dirtyFrameDecorations;
|
||||
+ public boolean hasPluginRenderer;
|
||||
+ public boolean hasContextualRenderer;
|
||||
+ // Plazma end - Optimize framed map tracker ticking; Shared between all players tracking this map inside an item frame
|
||||
|
||||
// CraftBukkit start
|
||||
public final CraftMapView mapView;
|
||||
- private CraftServer server;
|
||||
+ private final CraftServer server; // Plazma - Improve code styling
|
||||
public UUID uniqueId = null;
|
||||
public MapId id;
|
||||
// CraftBukkit end
|
||||
@@ -372,7 +382,7 @@ public class MapItemSavedData extends SavedData {
|
||||
--this.trackedDecorationCount;
|
||||
}
|
||||
|
||||
- if (mapicon != null) this.setDecorationsDirty(); // Paper - only mark dirty if a change occurs
|
||||
+ if (mapicon != null && mapicon.renderOnFrame()) this.dirtyFrameDecorations = true; // Plazma - Optimize framed map tracker ticking
|
||||
}
|
||||
|
||||
public static void addTargetDecoration(ItemStack stack, BlockPos pos, String id, Holder<MapDecorationType> decorationType) {
|
||||
@@ -409,6 +419,7 @@ public class MapItemSavedData extends SavedData {
|
||||
}
|
||||
|
||||
this.setDecorationsDirty();
|
||||
+ if (mapicon.renderOnFrame()) this.dirtyFrameDecorations = true; // Plazma - Optimize framed map tracker ticking
|
||||
}
|
||||
|
||||
}
|
||||
@@ -480,14 +491,23 @@ public class MapItemSavedData extends SavedData {
|
||||
|
||||
public void setColorsDirty(int x, int z) {
|
||||
this.setDirty();
|
||||
- Iterator iterator = this.carriedBy.iterator();
|
||||
-
|
||||
- while (iterator.hasNext()) {
|
||||
- MapItemSavedData.HoldingPlayer worldmap_worldmaphumantracker = (MapItemSavedData.HoldingPlayer) iterator.next();
|
||||
-
|
||||
- worldmap_worldmaphumantracker.markColorsDirty(x, z);
|
||||
- }
|
||||
-
|
||||
+ // Plazma start - Optimize framed map tracker ticking
|
||||
+ if (this.dirtyColorData) {
|
||||
+ this.minDirtyX = Math.min(this.minDirtyX, x);
|
||||
+ this.minDirtyY = Math.min(this.minDirtyY, z);
|
||||
+ this.maxDirtyX = Math.max(this.maxDirtyX, x);
|
||||
+ this.maxDirtyY = Math.max(this.maxDirtyY, z);
|
||||
+ } else {
|
||||
+ this.dirtyColorData = true;
|
||||
+ this.minDirtyX = x;
|
||||
+ this.minDirtyY = z;
|
||||
+ this.maxDirtyX = x;
|
||||
+ this.maxDirtyY = z;
|
||||
+ } // diff on change
|
||||
+ for (final HoldingPlayer tracker : this.carriedBy) {
|
||||
+ tracker.markColorsDirty(x, z);
|
||||
+ } // diff on change
|
||||
+ // Plazma end - Optimize framed map tracker ticking
|
||||
}
|
||||
|
||||
public void setDecorationsDirty() {
|
||||
@@ -563,6 +583,7 @@ public class MapItemSavedData extends SavedData {
|
||||
this.removeDecoration(MapItemSavedData.getFrameKey(id));
|
||||
this.frameMarkers.remove(MapFrame.frameId(pos));
|
||||
this.setDirty();
|
||||
+ this.dirtyFrameDecorations = true; // Plazma - Optimize framed map tracker ticking
|
||||
}
|
||||
|
||||
public boolean updateColor(int x, int z, byte color) {
|
||||
@@ -776,4 +797,86 @@ public class MapItemSavedData extends SavedData {
|
||||
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Plazma start - Optimize framed map tracker ticking
|
||||
+ public final @Nullable Packet<?> framedUpdatePacket(MapId id, @Nullable Player player) {
|
||||
+ return createUpdatePacket(id, player, false);
|
||||
+ }
|
||||
+
|
||||
+ public final @Nullable Packet<?> fullUpdatePacket(MapId id, @Nullable Player player) {
|
||||
+ return createUpdatePacket(id, player, true);
|
||||
+ }
|
||||
+
|
||||
+ public final @Nullable Packet<?> createUpdatePacket(MapId id, @Nullable Player player, boolean full) {
|
||||
+ if (!dirtyColorData && !dirtyFrameDecorations && (player == null || server.getCurrentTick() % 5 != 0) && !full)
|
||||
+ // Periodically send update packets if a renderer is added
|
||||
+ return null;
|
||||
+
|
||||
+ final org.bukkit.craftbukkit.map.RenderData render = player != null
|
||||
+ ? this.mapView.render((org.bukkit.craftbukkit.entity.CraftPlayer) player.getBukkitEntity())
|
||||
+ : this.vanillaRender;
|
||||
+
|
||||
+ final MapPatch patch;
|
||||
+ if (full) {
|
||||
+ patch = createPatch(render.buffer, 0, 0, 127, 127);
|
||||
+ } else if (dirtyColorData) {
|
||||
+ dirtyColorData = false;
|
||||
+ patch = createPatch(render.buffer, this.minDirtyX, this.minDirtyY, this.maxDirtyX, this.maxDirtyY);
|
||||
+ } else {
|
||||
+ patch = null;
|
||||
+ }
|
||||
+
|
||||
+ Collection<MapDecoration> decorations = null;
|
||||
+ if (dirtyFrameDecorations || full || hasPluginRenderer) { // Always add decorations when a plugin renderer is added
|
||||
+ dirtyFrameDecorations = false;
|
||||
+ decorations = new java.util.ArrayList<>();
|
||||
+
|
||||
+ if (player == null) {
|
||||
+ // Using the vanilla renderer, add in vanilla decorations
|
||||
+ for (MapDecoration decoration : this.decorations.values()) {
|
||||
+ // Skip sending decorations that are not rendered, i.e., player decorations.
|
||||
+ // Skipping player decorations also allows sending the same update packet to all tracking players, the only issue
|
||||
+ // being that it causes a slight flicker of the player decoration for anyone holding and looking at the map.
|
||||
+ if (decoration.renderOnFrame()) decorations.add(decoration);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ for (final org.bukkit.map.MapCursor cursor : render.cursors) {
|
||||
+ if (cursor.isVisible()) continue;
|
||||
+ decorations.add(new MapDecoration(CraftMapCursor.CraftType.bukkitToMinecraftHolder(cursor.getType()), cursor.getX(), cursor.getY(), cursor.getDirection(), Optional.ofNullable(PaperAdventure.asVanilla(cursor.caption()))));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return new ClientboundMapItemDataPacket(id, this.scale, this.locked, decorations, patch);
|
||||
+ }
|
||||
+
|
||||
+ private MapPatch createPatch(byte[] buffer, int minDirtyX, int minDirtyY, int maxDirtyX, int maxDirtyY) {
|
||||
+ int xL = maxDirtyX + 1 - minDirtyX;
|
||||
+ int yL = maxDirtyY + 1 - minDirtyY;
|
||||
+ byte[] bytes = new byte[xL * yL];
|
||||
+
|
||||
+ for (int i = 0; i < xL; ++i) for (int j = 0; j < yL; ++j)
|
||||
+ bytes[i + j * xL] = buffer[minDirtyX + i + (minDirtyY + j) * 128];
|
||||
+
|
||||
+ return new MapItemSavedData.MapPatch(minDirtyX, minDirtyY, xL, yL, bytes);
|
||||
+ }
|
||||
+
|
||||
+ public void addFrameDecoration(net.minecraft.world.entity.decoration.ItemFrame frame) {
|
||||
+ if (this.trackedDecorationCount >= frame.level().paperConfig().maps.itemFrameCursorLimit || this.frameMarkers.containsKey(MapFrame.frameId(frame.getPos())))
|
||||
+ return;
|
||||
+
|
||||
+ MapFrame mapFrame = new MapFrame(frame.getPos(), frame.getDirection().get2DDataValue() * 90, frame.getId());
|
||||
+ this.addDecoration(MapDecorationTypes.FRAME, frame.level(), "frame-" + frame.getId(), frame.getPos().getX(), frame.getPos().getZ(), mapFrame.getRotation(), null);
|
||||
+ this.frameMarkers.put(mapFrame.getId(), mapFrame);
|
||||
+ }
|
||||
+
|
||||
+ public void markAllDirty() {
|
||||
+ this.dirtyColorData = true;
|
||||
+ this.minDirtyX = 0;
|
||||
+ this.minDirtyY = 0;
|
||||
+ this.maxDirtyX = 127;
|
||||
+ this.maxDirtyY = 127;
|
||||
+ this.dirtyFrameDecorations = true;
|
||||
+ }
|
||||
+ // Plazma end - Optimize framed map tracker ticking
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java
|
||||
index a15cdf64575841edfe30f2b2c522f8fdfe2caae3..d8e8faf38a2fc6ae9846a6a0d2868d0a1418afef 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java
|
||||
@@ -97,11 +97,15 @@ public final class CraftMapView implements MapView {
|
||||
|
||||
@Override
|
||||
public void addRenderer(MapRenderer renderer) {
|
||||
- if (!this.renderers.contains(renderer)) {
|
||||
- this.renderers.add(renderer);
|
||||
- this.canvases.put(renderer, new HashMap<CraftPlayer, CraftMapCanvas>());
|
||||
- renderer.initialize(this);
|
||||
- }
|
||||
+ // Plazma start - Optimize framed map tracker ticking
|
||||
+ if (this.renderers.contains(renderer)) return;
|
||||
+
|
||||
+ this.renderers.add(renderer);
|
||||
+ this.canvases.put(renderer, new HashMap<>());
|
||||
+ this.worldMap.hasPluginRenderer |= !(renderer instanceof CraftMapRenderer);
|
||||
+ this.worldMap.hasContextualRenderer |= renderer.isContextual();
|
||||
+ renderer.initialize(this);
|
||||
+ // Plazma end - Optimize framed map tracker ticking
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,6 +120,16 @@ public final class CraftMapView implements MapView {
|
||||
}
|
||||
}
|
||||
this.canvases.remove(renderer);
|
||||
+ // Plazma start - Optimize framed map tracker ticking
|
||||
+ this.worldMap.hasPluginRenderer = !(this.renderers.size() == 1 && this.renderers.getFirst() instanceof CraftMapRenderer);
|
||||
+ if (!renderer.isContextual()) return true;
|
||||
+
|
||||
+ // Re-check all renderers
|
||||
+ boolean contextualFound = false;
|
||||
+ for (final MapRenderer mapRenderer : this.renderers) contextualFound |= mapRenderer.isContextual();
|
||||
+
|
||||
+ this.worldMap.hasContextualRenderer = contextualFound;
|
||||
+ // Plazma end - Optimize framed map tracker ticking
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -0,0 +1,137 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 13 Dec 2024 21:18:55 +0900
|
||||
Subject: [PATCH] SparklyPaper - Skip executeTick check if there's no task to
|
||||
be run
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
|
||||
index c03608fec96b51e1867f43d8f42e5aefb1520e46..9bb01accce426fafbddc1965a61257a73af8f152 100644
|
||||
--- a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
|
||||
+++ b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
|
||||
@@ -36,8 +36,9 @@ public final class EntityScheduler {
|
||||
* The Entity. Note that it is the CraftEntity, since only that class properly tracks world transfers.
|
||||
*/
|
||||
public final CraftEntity entity;
|
||||
+ public final net.minecraft.server.MinecraftServer server; // Plazma - Skip executeTick check if there is no any task to be run
|
||||
|
||||
- private static final record ScheduledTask(Consumer<? extends Entity> run, Consumer<? extends Entity> retired) {}
|
||||
+ private record ScheduledTask(Consumer<? extends Entity> run, Consumer<? extends Entity> retired) {} // Plazma - minor code improvement
|
||||
|
||||
private long tickCount = 0L;
|
||||
private static final long RETIRED_TICK_COUNT = -1L;
|
||||
@@ -46,7 +47,8 @@ public final class EntityScheduler {
|
||||
|
||||
private final ArrayDeque<ScheduledTask> currentlyExecuting = new ArrayDeque<>();
|
||||
|
||||
- public EntityScheduler(final CraftEntity entity) {
|
||||
+ public EntityScheduler(final net.minecraft.server.MinecraftServer server, final CraftEntity entity) { // Plazma - Skip executeTick check if there is no any task to be run
|
||||
+ this.server = Validate.notNull(server); // Plazma - Skip executeTick check if there is no any task to be run
|
||||
this.entity = Validate.notNull(entity);
|
||||
}
|
||||
|
||||
@@ -61,15 +63,15 @@ public final class EntityScheduler {
|
||||
* @throws IllegalStateException If the scheduler is already retired.
|
||||
*/
|
||||
public void retire() {
|
||||
+ final Entity thisEntity = this.entity.getHandleRaw(); // Plazma - Skip executeTick check if there is no any task to be run
|
||||
synchronized (this.stateLock) {
|
||||
if (this.tickCount == RETIRED_TICK_COUNT) {
|
||||
throw new IllegalStateException("Already retired");
|
||||
}
|
||||
this.tickCount = RETIRED_TICK_COUNT;
|
||||
+ this.server.entitiesWithScheduledTasks.remove(thisEntity); // Plazma - Skip executeTick check if there is no any task to be run
|
||||
}
|
||||
|
||||
- final Entity thisEntity = this.entity.getHandleRaw();
|
||||
-
|
||||
// correctly handle and order retiring while running executeTick
|
||||
for (int i = 0, len = this.currentlyExecuting.size(); i < len; ++i) {
|
||||
final ScheduledTask task = this.currentlyExecuting.pollFirst();
|
||||
@@ -124,9 +126,8 @@ public final class EntityScheduler {
|
||||
if (this.tickCount == RETIRED_TICK_COUNT) {
|
||||
return false;
|
||||
}
|
||||
- this.oneTimeDelayed.computeIfAbsent(this.tickCount + Math.max(1L, delay), (final long keyInMap) -> {
|
||||
- return new ArrayList<>();
|
||||
- }).add(task);
|
||||
+ this.server.entitiesWithScheduledTasks.add(this.entity.getHandleRaw()); // Plazma - Skip executeTick check if there is no any task to be run
|
||||
+ this.oneTimeDelayed.computeIfAbsent(this.tickCount + Math.max(1L, delay), ignored -> new ArrayList<>()).add(task); // Plazma - Skip executeTick check if there is no any task to be run
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -143,6 +144,13 @@ public final class EntityScheduler {
|
||||
TickThread.ensureTickThread(thisEntity, "May not tick entity scheduler asynchronously");
|
||||
final List<ScheduledTask> toRun;
|
||||
synchronized (this.stateLock) {
|
||||
+ // Plazma start - Skip executeTick check if there is no any task to be run
|
||||
+ if (this.currentlyExecuting.isEmpty() && this.oneTimeDelayed.isEmpty()) {
|
||||
+ this.server.entitiesWithScheduledTasks.remove(thisEntity);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Plazma end - Skip executeTick check if there is no any task to be run
|
||||
+
|
||||
if (this.tickCount == RETIRED_TICK_COUNT) {
|
||||
throw new IllegalStateException("Ticking retired scheduler");
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index e63e6d885054cd926508f9999c8a4eed712d4891..022c4c01ab015a2a6135baa5dbe442fa7a1b4615 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -337,6 +337,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
|
||||
+ public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // Plazma - Skip executeTick check if there is no any task to be run
|
||||
public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("MobSpawning"); // Pufferfish - optimize mob spawning
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
@@ -1869,17 +1870,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
- getAllLevels().forEach(level -> {
|
||||
- for (final Entity entity : level.getEntities().getAll()) {
|
||||
- if (entity.isRemoved()) {
|
||||
- continue;
|
||||
- }
|
||||
- final org.bukkit.craftbukkit.entity.CraftEntity bukkit = entity.getBukkitEntityRaw();
|
||||
- if (bukkit != null) {
|
||||
- bukkit.taskScheduler.executeTick();
|
||||
- }
|
||||
- }
|
||||
- });
|
||||
+ // Plazma start - Skip executeTick check if there is no any task to be run
|
||||
+ for (final Entity entity : entitiesWithScheduledTasks) {
|
||||
+ if (entity.isRemoved()) continue;
|
||||
+
|
||||
+ final org.bukkit.craftbukkit.entity.CraftEntity craftEntity = entity.getBukkitEntityRaw();
|
||||
+ if (craftEntity == null) return;
|
||||
+
|
||||
+ craftEntity.taskScheduler.executeTick();
|
||||
+ }
|
||||
+ // Plazma end - Skip executeTick check if there is no any task to be run
|
||||
// Paper end - Folia scheduler API
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
//gameprofilerfiller.push("commandFunctions"); // Plazma - Completely remove Mojang profilers
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 51aee9a468f4ebfa9672fd9ce84883cf080859e3..94bdeaf15a73228ff92b50a22bc3aca41658de8d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -72,7 +72,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftEntity.DATA_TYPE_REGISTRY);
|
||||
protected net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers
|
||||
// Paper start - Folia shedulers
|
||||
- public final io.papermc.paper.threadedregions.EntityScheduler taskScheduler = new io.papermc.paper.threadedregions.EntityScheduler(this);
|
||||
+ public final io.papermc.paper.threadedregions.EntityScheduler taskScheduler; // Plazma - Skip executeTick check if there is no any task to be run
|
||||
private final io.papermc.paper.threadedregions.scheduler.FoliaEntityScheduler apiScheduler = new io.papermc.paper.threadedregions.scheduler.FoliaEntityScheduler(this);
|
||||
|
||||
@Override
|
||||
@@ -85,6 +85,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
this.server = server;
|
||||
this.entity = entity;
|
||||
this.entityType = CraftEntityType.minecraftToBukkit(entity.getType());
|
||||
+ this.taskScheduler = new io.papermc.paper.threadedregions.EntityScheduler(this.entity.getServer(), this); // Plazma - Skip executeTick check if there is no any task to be run
|
||||
}
|
||||
|
||||
// Purpur start - API for any mob to burn daylight
|
||||
177
patches/server/0053-SparklyPaper-MSPT-by-World.patch
Normal file
177
patches/server/0053-SparklyPaper-MSPT-by-World.patch
Normal file
@@ -0,0 +1,177 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 13 Dec 2024 23:36:03 +0900
|
||||
Subject: [PATCH] SparklyPaper - MSPT by World
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/command/MSPTCommand.java b/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
||||
index 8b5293b0c696ef21d0101493ffa41b60bf0bc86b..bf3a6e8e35fe9869dfa56a97dd5d820296de9721 100644
|
||||
--- a/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
||||
+++ b/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
||||
@@ -25,6 +25,29 @@ import static net.kyori.adventure.text.format.NamedTextColor.YELLOW;
|
||||
public final class MSPTCommand extends Command {
|
||||
private static final DecimalFormat DF = new DecimalFormat("########0.0");
|
||||
private static final Component SLASH = text("/");
|
||||
+ // Plazma start - MSPT by world
|
||||
+ private static final Component COMMA = text(", ", YELLOW);
|
||||
+ private static final Component HEADER = text().color(YELLOW).append(
|
||||
+ text("("),
|
||||
+ text("avg", GRAY),
|
||||
+ text("/"),
|
||||
+ text("min", GRAY),
|
||||
+ text("/"),
|
||||
+ text("max", GRAY),
|
||||
+ text(")")
|
||||
+ ).append(
|
||||
+ text(" from last 1s"),
|
||||
+ text(",", GRAY),
|
||||
+ text(" 5s"),
|
||||
+ text(",", GRAY),
|
||||
+ text(" 10s"),
|
||||
+ text(",", GRAY),
|
||||
+ text(" 30s"),
|
||||
+ text(",", GRAY),
|
||||
+ text(" 1m"),
|
||||
+ text(":", YELLOW)
|
||||
+ ).build();
|
||||
+ // Plazma end - MSPT by world
|
||||
|
||||
public MSPTCommand(final String name) {
|
||||
super(name);
|
||||
@@ -45,39 +68,44 @@ public final class MSPTCommand extends Command {
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
|
||||
List<Component> times = new ArrayList<>();
|
||||
+ // Plazma start - MSPT by world
|
||||
+ times.addAll(eval(server.tickTimes1s.getTimes()));
|
||||
times.addAll(eval(server.tickTimes5s.getTimes()));
|
||||
times.addAll(eval(server.tickTimes10s.getTimes()));
|
||||
+ times.addAll(eval(server.tickTimes30s.getTimes()));
|
||||
times.addAll(eval(server.tickTimes60s.getTimes()));
|
||||
|
||||
- sender.sendMessage(text().content("Server tick times ").color(GOLD)
|
||||
- .append(text().color(YELLOW)
|
||||
- .append(
|
||||
- text("("),
|
||||
- text("avg", GRAY),
|
||||
- text("/"),
|
||||
- text("min", GRAY),
|
||||
- text("/"),
|
||||
- text("max", GRAY),
|
||||
- text(")")
|
||||
- )
|
||||
- ).append(
|
||||
- text(" from last 5s"),
|
||||
- text(",", GRAY),
|
||||
- text(" 10s"),
|
||||
- text(",", GRAY),
|
||||
- text(" 1m"),
|
||||
- text(":", YELLOW)
|
||||
- )
|
||||
- );
|
||||
- sender.sendMessage(text().content("◴ ").color(GOLD)
|
||||
- .append(text().color(GRAY)
|
||||
- .append(
|
||||
- times.get(0), SLASH, times.get(1), SLASH, times.get(2), text(", ", YELLOW),
|
||||
- times.get(3), SLASH, times.get(4), SLASH, times.get(5), text(", ", YELLOW),
|
||||
- times.get(6), SLASH, times.get(7), SLASH, times.get(8)
|
||||
- )
|
||||
- )
|
||||
- );
|
||||
+ sender.sendMessage(text().content("Server tick times ").color(GOLD).append(HEADER));
|
||||
+ sender.sendMessage(text().content("◴ ").color(GOLD).append(text().color(GRAY).append(
|
||||
+ times.get(0), SLASH, times.get(1), SLASH, times.get(2), COMMA,
|
||||
+ times.get(3), SLASH, times.get(4), SLASH, times.get(5), COMMA,
|
||||
+ times.get(6), SLASH, times.get(7), SLASH, times.get(8), COMMA,
|
||||
+ times.get(9), SLASH, times.get(10), SLASH, times.get(11), COMMA,
|
||||
+ times.get(12), SLASH, times.get(13), SLASH, times.get(14)
|
||||
+ )));
|
||||
+
|
||||
+ sender.sendMessage(text());
|
||||
+ sender.sendMessage(text().content("World tick times ").color(GOLD).append(HEADER));
|
||||
+ for (net.minecraft.server.level.ServerLevel serverLevel : server.getAllLevels()) {
|
||||
+ List<Component> worldTimes = new ArrayList<>();
|
||||
+ worldTimes.addAll(eval(serverLevel.tickTimes1s.getTimes()));
|
||||
+ worldTimes.addAll(eval(serverLevel.tickTimes5s.getTimes()));
|
||||
+ worldTimes.addAll(eval(serverLevel.tickTimes10s.getTimes()));
|
||||
+ worldTimes.addAll(eval(serverLevel.tickTimes30s.getTimes()));
|
||||
+ worldTimes.addAll(eval(serverLevel.tickTimes60s.getTimes()));
|
||||
+
|
||||
+ sender.sendMessage(text().content("◴ " + serverLevel.getWorld().getName() + ": ").color(GOLD).append(
|
||||
+ text().color(GRAY).append(
|
||||
+ worldTimes.get(0), SLASH, worldTimes.get(1), SLASH, worldTimes.get(2), COMMA,
|
||||
+ worldTimes.get(3), SLASH, worldTimes.get(4), SLASH, worldTimes.get(5), COMMA,
|
||||
+ worldTimes.get(6), SLASH, worldTimes.get(7), SLASH, worldTimes.get(8), COMMA,
|
||||
+ worldTimes.get(9), SLASH, worldTimes.get(10), SLASH, worldTimes.get(11), COMMA,
|
||||
+ worldTimes.get(12), SLASH, worldTimes.get(13), SLASH, worldTimes.get(14)
|
||||
+ ))
|
||||
+ );
|
||||
+ }
|
||||
+ // Plazma end - MSPT by world
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 022c4c01ab015a2a6135baa5dbe442fa7a1b4615..26c5cb68b464305fde43e2e0e1a415a2425483ea 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -264,8 +264,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
private final long[] tickTimesNanos;
|
||||
private long aggregatedTickTimesNanos;
|
||||
// Paper start - Add tick times API and /mspt command
|
||||
+ public final TickTimes tickTimes1s = new TickTimes(20); // Plazma - Add more MSPT
|
||||
public final TickTimes tickTimes5s = new TickTimes(100);
|
||||
public final TickTimes tickTimes10s = new TickTimes(200);
|
||||
+ public final TickTimes tickTimes30s = new TickTimes(600); // Plazma - Add more MSPT
|
||||
public final TickTimes tickTimes60s = new TickTimes(1200);
|
||||
// Paper end - Add tick times API and /mspt command
|
||||
@Nullable
|
||||
@@ -1778,8 +1780,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.tickTimesNanos[l] = k;
|
||||
this.smoothedTickTimeMillis = this.smoothedTickTimeMillis * 0.8F + (float) k / (float) TimeUtil.NANOSECONDS_PER_MILLISECOND * 0.19999999F;
|
||||
// Paper start - Add tick times API and /mspt command
|
||||
+ this.tickTimes1s.add(this.tickCount, k); // Plazma - Add more MSPT
|
||||
this.tickTimes5s.add(this.tickCount, k);
|
||||
this.tickTimes10s.add(this.tickCount, k);
|
||||
+ this.tickTimes30s.add(this.tickCount, k); // Plazma - Add more MSPT
|
||||
this.tickTimes60s.add(this.tickCount, k);
|
||||
// Paper end - Add tick times API and /mspt command
|
||||
this.logTickMethodTime(i);
|
||||
@@ -1941,7 +1945,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
//gameprofilerfiller.push("tick"); // Plazma - Completely remove Mojang profilers
|
||||
|
||||
try {
|
||||
+ // Plazma start - MSPT by world
|
||||
+ long i = Util.getNanos();
|
||||
worldserver.tick(shouldKeepTicking);
|
||||
+ long d = Util.getNanos() - i;
|
||||
+
|
||||
+ worldserver.tickTimes1s.add(this.tickCount, d);
|
||||
+ worldserver.tickTimes5s.add(this.tickCount, d);
|
||||
+ worldserver.tickTimes10s.add(this.tickCount, d);
|
||||
+ worldserver.tickTimes30s.add(this.tickCount, d);
|
||||
+ worldserver.tickTimes60s.add(this.tickCount, d);
|
||||
+ // Plazma end - MSPT by world
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 14188b6e317dca2bbf98896951605f2e3742506f..137138aa1e42d4f12ed0bc54bc25918d29120333 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -598,6 +598,14 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
}
|
||||
// Paper end - lag compensation
|
||||
|
||||
+ // Plazma start - MSPT by world
|
||||
+ public final MinecraftServer.TickTimes tickTimes1s = new MinecraftServer.TickTimes(20);
|
||||
+ public final MinecraftServer.TickTimes tickTimes5s = new MinecraftServer.TickTimes(100);
|
||||
+ public final MinecraftServer.TickTimes tickTimes10s = new MinecraftServer.TickTimes(200);
|
||||
+ public final MinecraftServer.TickTimes tickTimes30s = new MinecraftServer.TickTimes(600);
|
||||
+ public final MinecraftServer.TickTimes tickTimes60s = new MinecraftServer.TickTimes(1200);
|
||||
+ // Plazma end - MSPT by world
|
||||
+
|
||||
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer
|
||||
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
|
||||
// Plazma start - Configurable Plazma
|
||||
275
patches/server/0054-SparklyPaper-Optimize-farm-check.patch
Normal file
275
patches/server/0054-SparklyPaper-Optimize-farm-check.patch
Normal file
@@ -0,0 +1,275 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 13 Dec 2024 23:36:36 +0900
|
||||
Subject: [PATCH] SparklyPaper - Optimize farm check
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
index 33c27909290ff3ab483226cf65b1a1bc2e983cbc..df4bb6a77775fe7aab3f47c13c9755a7374d0761 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
@@ -77,35 +77,52 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
|
||||
|
||||
@Override
|
||||
protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
- if (world.getRawBrightness(pos, 0) >= 9) {
|
||||
- int i = this.getAge(state);
|
||||
-
|
||||
- if (i < this.getMaxAge()) {
|
||||
- float f = CropBlock.getGrowthSpeed(this, world, pos);
|
||||
-
|
||||
- // Spigot start
|
||||
- int modifier;
|
||||
- if (this == Blocks.BEETROOTS) {
|
||||
- modifier = world.spigotConfig.beetrootModifier;
|
||||
- } else if (this == Blocks.CARROTS) {
|
||||
- modifier = world.spigotConfig.carrotModifier;
|
||||
- } else if (this == Blocks.POTATOES) {
|
||||
- modifier = world.spigotConfig.potatoModifier;
|
||||
- // Paper start - Fix Spigot growth modifiers
|
||||
- } else if (this == Blocks.TORCHFLOWER_CROP) {
|
||||
- modifier = world.spigotConfig.torchFlowerModifier;
|
||||
- // Paper end - Fix Spigot growth modifiers
|
||||
- } else {
|
||||
- modifier = world.spigotConfig.wheatModifier;
|
||||
- }
|
||||
-
|
||||
- if (random.nextFloat() < (modifier / (100.0f * (Math.floor((25.0F / f) + 1))))) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
- // Spigot end
|
||||
- CraftEventFactory.handleBlockGrowEvent(world, pos, this.getStateForAge(i + 1), 2); // CraftBukkit
|
||||
- }
|
||||
+ // Plazma start - Optimize farm check
|
||||
+ if (world.getRawBrightness(pos, 0) < 9) return;
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ int age = this.getAge(state);
|
||||
+ if (age >= this.getMaxAge()) return;
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ // Spigot start
|
||||
+ int modifier = switch (this) {
|
||||
+ case BeetrootBlock ignored -> world.spigotConfig.beetrootModifier;
|
||||
+ case CarrotBlock ignored -> world.spigotConfig.carrotModifier;
|
||||
+ case PotatoBlock ignored -> world.spigotConfig.potatoModifier;
|
||||
+ case TorchflowerCropBlock ignored -> world.spigotConfig.torchFlowerModifier;
|
||||
+ default -> world.spigotConfig.wheatModifier;
|
||||
+ };
|
||||
+
|
||||
+ if (world.plazmaConfig().block.optimizedFarmCheck.enabled) {
|
||||
+ final BlockPos below = pos.below();
|
||||
+ final BlockState belowState = world.getBlockState(below);
|
||||
+
|
||||
+ boolean isMoist = false;
|
||||
+ float growthSpeed = world.plazmaConfig().block.optimizedFarmCheck.growthSpeed.base;
|
||||
+ if (belowState.is(Blocks.FARMLAND) && belowState.getValue(FarmBlock.MOISTURE) > 0) {
|
||||
+ growthSpeed = world.plazmaConfig().block.optimizedFarmCheck.growthSpeed.moist;
|
||||
+ isMoist = true;
|
||||
+ }
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (world.plazmaConfig().block.optimizedFarmCheck.skipMiddleAges) {
|
||||
+ growthSpeed /= getMaxAge();
|
||||
+ age = getMaxAge() - 1;
|
||||
+ }
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (random.nextFloat() < (modifier / (100.0f * (Math.floor((25.0F / growthSpeed) + 1))))) {
|
||||
+ if (!CraftEventFactory.handleBlockGrowEvent(world, pos, this.getStateForAge(age + 1), 2)) return;
|
||||
+ if ((age + 1) != getMaxAge() || !isMoist || FarmBlock.isNearWater(world, below)) return;
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ CraftEventFactory.handleMoistureChangeEvent(world, below, state.setValue(FarmBlock.MOISTURE, 0), 2);
|
||||
}
|
||||
}
|
||||
-
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ float growthSpeed = CropBlock.getGrowthSpeed(this, world, pos); // Plazma - moved down
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (random.nextFloat() < (modifier / (100.0f * (Math.floor((25.0F / growthSpeed) + 1))))) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
+ // Spigot end
|
||||
+ CraftEventFactory.handleBlockGrowEvent(world, pos, this.getStateForAge(age + 1), 2); // CraftBukkit
|
||||
+ }
|
||||
+ // Plazma end - Optimize farm check
|
||||
}
|
||||
|
||||
public void growCrops(Level world, BlockPos pos, BlockState state) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
index eaac00e2534aca4eab92c7b9f9248e04b35b47df..14f807b6214529d909fd93cc7ce28eb712975f8c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
@@ -92,20 +92,29 @@ public class FarmBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
- int i = (Integer) state.getValue(FarmBlock.MOISTURE);
|
||||
- if (i > 0 && world.paperConfig().tickRates.wetFarmland != 1 && (world.paperConfig().tickRates.wetFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.wetFarmland != 0)) { return; } // Paper - Configurable random tick rates for blocks
|
||||
- if (i == 0 && world.paperConfig().tickRates.dryFarmland != 1 && (world.paperConfig().tickRates.dryFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.dryFarmland != 0)) { return; } // Paper - Configurable random tick rates for blocks
|
||||
-
|
||||
- if (!FarmBlock.isNearWater(world, pos) && !world.isRainingAt(pos.above())) {
|
||||
- if (i > 0) {
|
||||
- org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(world, pos, (BlockState) state.setValue(FarmBlock.MOISTURE, i - 1), 2); // CraftBukkit
|
||||
- } else if (!FarmBlock.shouldMaintainFarmland(world, pos)) {
|
||||
- FarmBlock.turnToDirt((Entity) null, state, world, pos);
|
||||
- }
|
||||
- } else if (i < 7) {
|
||||
- org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(world, pos, (BlockState) state.setValue(FarmBlock.MOISTURE, 7), 2); // CraftBukkit
|
||||
- }
|
||||
-
|
||||
+ // Plazma start - Optimize farm check
|
||||
+ int moistLevel = state.getValue(MOISTURE);
|
||||
+ if (world.plazmaConfig().block.optimizedFarmCheck.enabled) {
|
||||
+ if (moistLevel != 0) return;
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (isNearWater(world, pos))
|
||||
+ CraftEventFactory.handleMoistureChangeEvent(world, pos, state.setValue(MOISTURE, 7), 2);
|
||||
+ else
|
||||
+ turnToDirt(null, state, world, pos);
|
||||
+ return;
|
||||
+ } // diff on change
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (moistLevel > 0 && world.paperConfig().tickRates.wetFarmland != 1 && (world.paperConfig().tickRates.wetFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.wetFarmland != 0)) { return; } // Paper - Configurable random tick rates for blocks
|
||||
+ if (moistLevel == 0 && world.paperConfig().tickRates.dryFarmland != 1 && (world.paperConfig().tickRates.dryFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.dryFarmland != 0)) { return; } // Paper - Configurable random tick rates for blocks
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (!isNearWater(world, pos) && !world.isRainingAt(pos.above())) {
|
||||
+ if (moistLevel > 0)
|
||||
+ CraftEventFactory.handleMoistureChangeEvent(world, pos, state.setValue(MOISTURE, moistLevel - 1), 2); // CraftBukkit
|
||||
+ else if (!shouldMaintainFarmland(world, pos))
|
||||
+ turnToDirt(null, state, world, pos);
|
||||
+ } else if (moistLevel < 7)
|
||||
+ CraftEventFactory.handleMoistureChangeEvent(world, pos, state.setValue(MOISTURE, 7), 2); // CraftBukkit
|
||||
+ // Plazma end - Optimize farm check
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -169,7 +178,7 @@ public class FarmBlock extends Block {
|
||||
return world.getBlockState(pos.above()).is(BlockTags.MAINTAINS_FARMLAND);
|
||||
}
|
||||
|
||||
- private static boolean isNearWater(LevelReader world, BlockPos pos) {
|
||||
+ static boolean isNearWater(LevelReader world, BlockPos pos) { // Plazma - AT (private -> package-private)
|
||||
// Paper start - Perf: remove abstract block iteration
|
||||
int xOff = pos.getX();
|
||||
int yOff = pos.getY();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/StemBlock.java b/src/main/java/net/minecraft/world/level/block/StemBlock.java
|
||||
index 76109aceb24a4719d49c1a55e3621cf2a63bbe16..00b3275305b5f1c2ea2516dcad3c7c62f06db49f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/StemBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/StemBlock.java
|
||||
@@ -72,38 +72,66 @@ public class StemBlock extends BushBlock implements BonemealableBlock {
|
||||
|
||||
@Override
|
||||
protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
- if (world.getRawBrightness(pos, 0) >= 9) {
|
||||
- float f = CropBlock.getGrowthSpeed(this, world, pos);
|
||||
-
|
||||
- if (random.nextFloat() < ((this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) / (100.0f * (Math.floor((25.0F / f) + 1))))) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
- int i = (Integer) state.getValue(StemBlock.AGE);
|
||||
-
|
||||
- if (i < 7) {
|
||||
- state = (BlockState) state.setValue(StemBlock.AGE, i + 1);
|
||||
- CraftEventFactory.handleBlockGrowEvent(world, pos, state, 2); // CraftBukkit
|
||||
- } else {
|
||||
- Direction enumdirection = Direction.Plane.HORIZONTAL.getRandomDirection(random);
|
||||
- BlockPos blockposition1 = pos.relative(enumdirection);
|
||||
- BlockState iblockdata1 = world.getBlockState(blockposition1.below());
|
||||
-
|
||||
- if (world.getBlockState(blockposition1).isAir() && (iblockdata1.is(Blocks.FARMLAND) || iblockdata1.is(BlockTags.DIRT))) {
|
||||
- Registry<Block> iregistry = world.registryAccess().lookupOrThrow(Registries.BLOCK);
|
||||
- Optional<Block> optional = iregistry.getOptional(this.fruit);
|
||||
- Optional<Block> optional1 = iregistry.getOptional(this.attachedStem);
|
||||
-
|
||||
- if (optional.isPresent() && optional1.isPresent()) {
|
||||
- // CraftBukkit start
|
||||
- if (!CraftEventFactory.handleBlockGrowEvent(world, blockposition1, ((Block) optional.get()).defaultBlockState())) {
|
||||
- return;
|
||||
- }
|
||||
- // CraftBukkit end
|
||||
- world.setBlockAndUpdate(pos, (BlockState) ((Block) optional1.get()).defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, enumdirection));
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
+ if (world.getRawBrightness(pos, 0) < 9) return;
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (world.plazmaConfig().block.optimizedFarmCheck.enabled) {
|
||||
+ final BlockPos below = pos.below();
|
||||
+ final BlockState belowState = world.getBlockState(below);
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ boolean isMoist = false;
|
||||
+ float growthSpeed = world.plazmaConfig().block.optimizedFarmCheck.growthSpeed.base;
|
||||
+ if (belowState.is(Blocks.FARMLAND) && belowState.getValue(BlockStateProperties.MOISTURE) > 0) {
|
||||
+ growthSpeed = world.plazmaConfig().block.optimizedFarmCheck.growthSpeed.moist;
|
||||
+ isMoist = true;
|
||||
}
|
||||
-
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (random.nextFloat() >= ((this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) / (100.0f * (Math.floor((25.0F / growthSpeed) + 1))))) return;
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ int age = state.getValue(StemBlock.AGE);
|
||||
+ if (age < 7) {
|
||||
+ CraftEventFactory.handleBlockGrowEvent(world, pos, state.setValue(StemBlock.AGE, age + 1), 2);
|
||||
+ return;
|
||||
+ }
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ final Direction direction = Direction.Plane.HORIZONTAL.getRandomDirection(random);
|
||||
+ final BlockPos blockPos = pos.relative(direction);
|
||||
+ final BlockState belowState1 = world.getBlockState(blockPos.below());
|
||||
+ if (!world.getBlockState(blockPos).isAir() || (!belowState1.is(Blocks.FARMLAND) && !belowState1.is(BlockTags.DIRT))) return;
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ final Registry<Block> registry = world.registryAccess().lookupOrThrow(Registries.BLOCK);
|
||||
+ final Optional<Block> fruit = registry.getOptional(this.fruit);
|
||||
+ final Optional<Block> stem = registry.getOptional(this.attachedStem);
|
||||
+ if (fruit.isEmpty() || stem.isEmpty()) return;
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (!CraftEventFactory.handleBlockGrowEvent(world, blockPos, fruit.get().defaultBlockState())) return; // CraftBukkit
|
||||
+ if (isMoist && !FarmBlock.isNearWater(world, blockPos))
|
||||
+ CraftEventFactory.handleMoistureChangeEvent(world, blockPos, belowState1.setValue(BlockStateProperties.MOISTURE, 0), 2);
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ world.setBlockAndUpdate(pos, stem.get().defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, direction));
|
||||
+ return;
|
||||
+ }
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (random.nextFloat() >= ((this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) / (100.0f * (Math.floor((25.0F / CropBlock.getGrowthSpeed(this, world, pos)) + 1))))) return; // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ final int age = state.getValue(StemBlock.AGE);
|
||||
+ if (age < 7) {
|
||||
+ state = state.setValue(StemBlock.AGE, age + 1);
|
||||
+ CraftEventFactory.handleBlockGrowEvent(world, pos, state, 2); // CraftBukkit
|
||||
+ return;
|
||||
}
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ final Direction direction = Direction.Plane.HORIZONTAL.getRandomDirection(random);
|
||||
+ final BlockPos blockPos = pos.relative(direction);
|
||||
+ final BlockState belowState = world.getBlockState(blockPos.below());
|
||||
+ if (!world.getBlockState(blockPos).isAir() || (!belowState.is(Blocks.FARMLAND) && !belowState.is(BlockTags.DIRT))) return;
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ final Registry<Block> registry = world.registryAccess().lookupOrThrow(Registries.BLOCK);
|
||||
+ final Optional<Block> fruit = registry.getOptional(this.fruit);
|
||||
+ final Optional<Block> stem = registry.getOptional(this.attachedStem);
|
||||
+ if (fruit.isEmpty() || stem.isEmpty()) return;
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (!CraftEventFactory.handleBlockGrowEvent(world, blockPos, fruit.get().defaultBlockState())) return; // CraftBukkit
|
||||
+ world.setBlockAndUpdate(pos, stem.get().defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, direction));
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index bab5f682b8aeaa6dfcda7f07499ae297cbcbe23e..f822b544d98602be85bf0c54a6040a5907b1906e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -81,6 +81,22 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+ public OptimizedFarmCheck optimizedFarmCheck;
|
||||
+ public class OptimizedFarmCheck extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = OPTIMIZE;
|
||||
+ public boolean skipMiddleAges = false;
|
||||
+
|
||||
+ public GrowthSpeed growthSpeed;
|
||||
+ public class GrowthSpeed extends ConfigurationPart {
|
||||
+
|
||||
+ public float base = 1.0f;
|
||||
+ public float moist = 5.0f;
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
public Item item;
|
||||
146
patches/server/0055-SparklyPaper-Optimize-season-check.patch
Normal file
146
patches/server/0055-SparklyPaper-Optimize-season-check.patch
Normal file
@@ -0,0 +1,146 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 13 Dec 2024 23:37:17 +0900
|
||||
Subject: [PATCH] SparklyPaper - Optimize season check
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
index 0d3f4702c8bf3d66b01b42c5da1761e93e1d6ed2..a749adca6c758c0008ab8b27f307ac4570c82652 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
@@ -324,15 +324,19 @@ public class Bat extends AmbientCreature {
|
||||
private static boolean isSpookySeason = false;
|
||||
private static final int ONE_HOUR = 20 * 60 * 60;
|
||||
private static int lastSpookyCheck = -ONE_HOUR;
|
||||
- public static boolean isHalloweenSeason(Level level) { return level.purpurConfig.forceHalloweenSeason || isHalloween(); } // Purpur
|
||||
+
|
||||
+ public static boolean isHalloweenSeason(Level level) {
|
||||
+ return level.purpurConfig.forceHalloweenSeason || net.sparklypower.sparklypaper.HalloweenManager.isInSeason() || isHalloween();
|
||||
+ }
|
||||
+
|
||||
private static boolean isHalloween() {
|
||||
if (net.minecraft.server.MinecraftServer.currentTick - lastSpookyCheck > ONE_HOUR) {
|
||||
- LocalDate localdate = LocalDate.now();
|
||||
- int i = localdate.get(ChronoField.DAY_OF_MONTH);
|
||||
- int j = localdate.get(ChronoField.MONTH_OF_YEAR);
|
||||
+ LocalDate now = LocalDate.now();
|
||||
+ int day = now.getDayOfMonth();
|
||||
+ int month = now.getMonth().getValue();
|
||||
|
||||
- isSpookySeason = j == 10 && i >= 20 || j == 11 && i <= 3;
|
||||
- lastSpookyCheck = net.minecraft.server.MinecraftServer.currentTick;
|
||||
+ isSpookySeason = month == 10 && day >= 20 || month == 11 && day <= 3;
|
||||
+ lastSpookyCheck = net.minecraft.server.MinecraftServer.currentTick;
|
||||
}
|
||||
return isSpookySeason;
|
||||
}
|
||||
diff --git a/src/main/java/net/sparklypower/sparklypaper/HalloweenManager.java b/src/main/java/net/sparklypower/sparklypaper/HalloweenManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..530bac5a415c8597ae76ec603c1d8158535c66d0
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/sparklypower/sparklypaper/HalloweenManager.java
|
||||
@@ -0,0 +1,82 @@
|
||||
+package net.sparklypower.sparklypaper;
|
||||
+
|
||||
+import com.mojang.logging.LogUtils;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.slf4j.Logger;
|
||||
+import java.time.LocalDateTime;
|
||||
+import java.time.Month;
|
||||
+import java.time.ZoneOffset;
|
||||
+import java.util.concurrent.CountDownLatch;
|
||||
+import java.util.concurrent.Executors;
|
||||
+import java.util.concurrent.ScheduledExecutorService;
|
||||
+import java.util.concurrent.TimeUnit;
|
||||
+import java.util.concurrent.atomic.AtomicBoolean;
|
||||
+
|
||||
+public final class HalloweenManager {
|
||||
+
|
||||
+ private static final Logger LOGGER = LogUtils.getLogger();
|
||||
+ public static @Nullable net.sparklypower.sparklypaper.HalloweenManager INSTANCE;
|
||||
+
|
||||
+ private long seasonStartEpoch = 0L;
|
||||
+ private long seasonEndEpoch = 0L;
|
||||
+
|
||||
+ private final ScheduledExecutorService EXECUTOR = Executors.newSingleThreadScheduledExecutor(runnable -> {
|
||||
+ final Thread thread = new Thread(runnable);
|
||||
+ thread.setName("halloween-timer-updater");
|
||||
+ thread.setPriority(1);
|
||||
+ return thread;
|
||||
+ });
|
||||
+
|
||||
+ public HalloweenManager() {
|
||||
+ final AtomicBoolean first = new AtomicBoolean(true);
|
||||
+ final CountDownLatch LATCH = new CountDownLatch(1);
|
||||
+
|
||||
+ try {
|
||||
+ EXECUTOR.scheduleAtFixedRate(() -> {
|
||||
+ updateEpoch();
|
||||
+ if (first.get()) LATCH.countDown();
|
||||
+ first.set(false);
|
||||
+ }, 0L, 90L, TimeUnit.DAYS);
|
||||
+
|
||||
+ LATCH.await();
|
||||
+ } catch (InterruptedException e) {
|
||||
+ LOGGER.error("Interrupted while waiting for HalloweenManager to start", e);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public @Nullable HalloweenManager close() {
|
||||
+ EXECUTOR.shutdownNow();
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ public static boolean isInSeason() {
|
||||
+ return INSTANCE != null && INSTANCE.isSeason();
|
||||
+ }
|
||||
+
|
||||
+ private boolean isSeason() {
|
||||
+ return this.seasonStartEpoch <= System.currentTimeMillis() && System.currentTimeMillis() < this.seasonEndEpoch;
|
||||
+ }
|
||||
+
|
||||
+ private void updateEpoch() {
|
||||
+ LOGGER.info("Updating Spooky Season and Halloween Time");
|
||||
+ this.seasonStartEpoch = millisFromDate(20, 10, false);
|
||||
+ this.seasonEndEpoch = millisFromDate(3, 11, true);
|
||||
+ LOGGER.info("Updated Spooky Season and Halloween Time!");
|
||||
+ }
|
||||
+
|
||||
+ private static long millisFromDate(int day, int month, boolean endOfMonth) {
|
||||
+ LocalDateTime target = LocalDateTime.of(
|
||||
+ LocalDateTime.now().getYear(),
|
||||
+ Month.of(month),
|
||||
+ day,
|
||||
+ endOfMonth ? 23 : 0,
|
||||
+ endOfMonth ? 59 : 0,
|
||||
+ endOfMonth ? 59 : 0,
|
||||
+ endOfMonth ? 999_999_999 : 0
|
||||
+ );
|
||||
+
|
||||
+ return (LocalDateTime.now().isAfter(target) ? target.plusYears(1) : target)
|
||||
+ .atZone(ZoneOffset.systemDefault()).toInstant().toEpochMilli();
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 2e1cf5f79556250aa22df3ade66393fe6a947659..b5b252c79b9508200d9d0bd15f0469b0cb0fd3b3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -143,6 +143,17 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class Miscellaneous extends ConfigurationPart {
|
||||
|
||||
public boolean resetDirtyWhenLoadingMapsFromDisk = false;
|
||||
+ public boolean optimizeHalloweenCheck = OPTIMIZE;
|
||||
+
|
||||
+ @PostProcess
|
||||
+ void post() {
|
||||
+ net.sparklypower.sparklypaper.HalloweenManager manager = net.sparklypower.sparklypaper.HalloweenManager.INSTANCE;
|
||||
+
|
||||
+ if (manager == null && this.optimizeHalloweenCheck)
|
||||
+ net.sparklypower.sparklypaper.HalloweenManager.INSTANCE = new net.sparklypower.sparklypaper.HalloweenManager();
|
||||
+ else if (manager != null && !this.optimizeHalloweenCheck)
|
||||
+ net.sparklypower.sparklypaper.HalloweenManager.INSTANCE = manager.close();
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Fri, 13 Dec 2024 23:52:46 +0900
|
||||
Subject: [PATCH] SparklyPaper - Optimize tickingBlockEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 332c1d890eefb0c705200a61b8bc7369457bc3af..ca7d4efd7b813c58169d251b23cf6a6fa71c9cee 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1526,28 +1526,42 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
|
||||
int tickedEntities = 0; // Paper - rewrite chunk system
|
||||
|
||||
- int tilesThisCycle = 0;
|
||||
- var toRemove = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<TickingBlockEntity>(); // Paper - Fix MC-117075; use removeAll
|
||||
+ // Plazma start - Optimize tickingBlockEntity
|
||||
+ int shouldTickBlocksAtLastResult = -1;
|
||||
+ long shouldTickBlocksAtChunkPos = 0L;
|
||||
+ final it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<TickingBlockEntity> toRemove =
|
||||
+ new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Fix MC-117075; use removeAll
|
||||
+
|
||||
toRemove.add(null); // Paper - Fix MC-117075
|
||||
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
||||
- this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
||||
- TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
|
||||
- // Spigot end
|
||||
-
|
||||
- if (tickingblockentity.isRemoved()) {
|
||||
- // Spigot start
|
||||
- tilesThisCycle--;
|
||||
- toRemove.add(tickingblockentity); // Paper - Fix MC-117075; use removeAll
|
||||
- // Spigot end
|
||||
- } else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
||||
- tickingblockentity.tick();
|
||||
- // Paper start - rewrite chunk system
|
||||
- if ((++tickedEntities & 7) == 0) {
|
||||
- ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)(Level)(Object)this).moonrise$midTickTasks();
|
||||
+ TickingBlockEntity tickingEntity = this.blockEntityTickers.get(this.tileTickPosition);
|
||||
+
|
||||
+ if (tickingEntity.isRemoved()) {
|
||||
+ toRemove.add(tickingEntity); // Paper - Fix MC-117075; use removeAll
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (flag) {
|
||||
+ long pos = tickingEntity.getChunkCoordinateKey();
|
||||
+
|
||||
+ boolean shouldTick;
|
||||
+ if (shouldTickBlocksAtChunkPos == pos && shouldTickBlocksAtLastResult != -1) {
|
||||
+ shouldTick = shouldTickBlocksAtLastResult == 1;
|
||||
+ } else {
|
||||
+ shouldTick = this.shouldTickBlocksAt(pos);
|
||||
+ shouldTickBlocksAtLastResult = shouldTick ? 1 : 0;
|
||||
+ shouldTickBlocksAtChunkPos = pos;
|
||||
}
|
||||
- // Paper end - rewrite chunk system
|
||||
+
|
||||
+ if (!shouldTick) continue;
|
||||
+
|
||||
+ tickingEntity.tick();
|
||||
+ if ((++tickedEntities & 7) != 0) continue;
|
||||
+
|
||||
+ this.moonrise$midTickTasks();
|
||||
}
|
||||
}
|
||||
+ // Plazma end - Optimize tickingBlockEntity
|
||||
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
||||
|
||||
this.tickingBlockEntities = false;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TickingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TickingBlockEntity.java
|
||||
index 28e3b73507b988f7234cbf29c4024c88180d0aef..de15cbda0c180e0d071ce7ac41d2fd1aeca60985 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TickingBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TickingBlockEntity.java
|
||||
@@ -10,4 +10,6 @@ public interface TickingBlockEntity {
|
||||
BlockPos getPos();
|
||||
|
||||
String getType();
|
||||
+
|
||||
+ long getChunkCoordinateKey(); // Plazma - Optimize tickingBlockEntity
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 3c92e6b52394eed3ac66d44973288e4de2c133cc..2966caede97e01b5ad15a0d56232a0f5526685e2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -75,6 +75,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
public String getType() {
|
||||
return "<null>";
|
||||
}
|
||||
+
|
||||
+ @Override public long getChunkCoordinateKey() { return 0; } // Plazma - Optimize tickingBlockEntity;
|
||||
};
|
||||
private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel;
|
||||
public boolean loaded;
|
||||
@@ -995,7 +997,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
}
|
||||
|
||||
private <T extends BlockEntity> TickingBlockEntity createTicker(T blockEntity, BlockEntityTicker<T> blockEntityTicker) {
|
||||
- return new LevelChunk.BoundTickingBlockEntity<>(blockEntity, blockEntityTicker);
|
||||
+ return new LevelChunk.BoundTickingBlockEntity<>(blockEntity, blockEntityTicker, this.coordinateKey); // Plazma - Optimize tickingBlockEntity
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
@@ -1049,8 +1051,15 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
return this.ticker.getType();
|
||||
}
|
||||
|
||||
+ @Override // Plazma - minor code improvement
|
||||
public String toString() {
|
||||
- return String.valueOf(this.ticker) + " <wrapped>";
|
||||
+ return this.ticker + " <wrapped>"; // Plazma - minor code improvement
|
||||
+ }
|
||||
+
|
||||
+ // Plazma start - Optimize tickingBlockEntity
|
||||
+ @Override
|
||||
+ public long getChunkCoordinateKey() {
|
||||
+ return this.ticker.getChunkCoordinateKey();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1059,51 +1068,45 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
private final T blockEntity;
|
||||
private final BlockEntityTicker<T> ticker;
|
||||
private boolean loggedInvalidBlockState;
|
||||
+ private final long chunkCoordinateKey;
|
||||
|
||||
- BoundTickingBlockEntity(final BlockEntity tileentity, final BlockEntityTicker blockentityticker) {
|
||||
- this.blockEntity = (T) tileentity; // CraftBukkit - decompile error
|
||||
- this.ticker = blockentityticker;
|
||||
+ BoundTickingBlockEntity(final T blockEntity, final BlockEntityTicker<T> ticker, final long chunkCoordinateKey) {
|
||||
+ this.blockEntity = blockEntity;
|
||||
+ this.ticker = ticker;
|
||||
+ this.chunkCoordinateKey = chunkCoordinateKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
- if (!this.blockEntity.isRemoved() && this.blockEntity.hasLevel()) {
|
||||
- BlockPos blockposition = this.blockEntity.getBlockPos();
|
||||
+ if (this.blockEntity.isRemoved() || !this.blockEntity.hasLevel()) return;
|
||||
|
||||
- if (LevelChunk.this.isTicking(blockposition)) {
|
||||
- try {
|
||||
- //ProfilerFiller gameprofilerfiller = Profiler.get(); // Plazma - Completely remove Mojang profiler
|
||||
-
|
||||
- //gameprofilerfiller.push(this::getType); // Plazma - Completely remove Mojang profiler
|
||||
- BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
|
||||
+ BlockPos pos = this.blockEntity.getBlockPos();
|
||||
+ if (!LevelChunk.this.isTicking(pos)) return;
|
||||
|
||||
- if (this.blockEntity.getType().isValid(iblockdata)) {
|
||||
- this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), iblockdata, this.blockEntity);
|
||||
- this.loggedInvalidBlockState = false;
|
||||
- // Paper start - Remove the Block Entity if it's invalid
|
||||
- } else {
|
||||
- LevelChunk.this.removeBlockEntity(this.getPos());
|
||||
- if (!this.loggedInvalidBlockState) {
|
||||
- this.loggedInvalidBlockState = true;
|
||||
- LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), iblockdata});
|
||||
- }
|
||||
- // Paper end - Remove the Block Entity if it's invalid
|
||||
- }
|
||||
+ try {
|
||||
+ BlockState state = LevelChunk.this.getBlockState(pos);
|
||||
|
||||
- //gameprofilerfiller.pop(); // Plazma - Completely remove Mojang profiler
|
||||
- } catch (Throwable throwable) {
|
||||
- if (throwable instanceof ThreadDeath) throw throwable; // Paper
|
||||
- // Paper start - Prevent block entity and entity crashes
|
||||
- final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
|
||||
- net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
|
||||
- net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent
|
||||
- LevelChunk.this.removeBlockEntity(this.getPos());
|
||||
- // Paper end - Prevent block entity and entity crashes
|
||||
- // Spigot start
|
||||
+ if (this.blockEntity.getType().isValid(state)) {
|
||||
+ this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), state, this.blockEntity);
|
||||
+ this.loggedInvalidBlockState = false;
|
||||
+ // Paper start - Remove the Block Entity if it's invalid
|
||||
+ } else {
|
||||
+ LevelChunk.this.removeBlockEntity(this.getPos());
|
||||
+ if (!this.loggedInvalidBlockState) {
|
||||
+ this.loggedInvalidBlockState = true;
|
||||
+ LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", LogUtils.defer(this::getType), LogUtils.defer(this::getPos), state);
|
||||
}
|
||||
+ // Paper end - Remove the Block Entity if it's invalid
|
||||
}
|
||||
+ } catch (Throwable throwable) {
|
||||
+ if (throwable instanceof ThreadDeath) throw throwable; // Paper
|
||||
+ // Paper start - Prevent block entity and entity crashes
|
||||
+ final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
|
||||
+ net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
|
||||
+ LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent
|
||||
+ LevelChunk.this.removeBlockEntity(this.getPos());
|
||||
+ // Paper end - Prevent block entity and entity crashes
|
||||
}
|
||||
-
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1121,10 +1124,15 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
return BlockEntityType.getKey(this.blockEntity.getType()).toString();
|
||||
}
|
||||
|
||||
+ @Override
|
||||
public String toString() {
|
||||
- String s = this.getType();
|
||||
+ return "Level ticker for " + this.getType() + "@" + this.getPos();
|
||||
+ }
|
||||
|
||||
- return "Level ticker for " + s + "@" + String.valueOf(this.getPos());
|
||||
+ @Override
|
||||
+ public long getChunkCoordinateKey() {
|
||||
+ return this.chunkCoordinateKey;
|
||||
}
|
||||
+ // Plazma end - Optimize tickingBlockEntity
|
||||
}
|
||||
}
|
||||
227
patches/server/0057-Implement-CarpetFixes.patch
Normal file
227
patches/server/0057-Implement-CarpetFixes.patch
Normal file
@@ -0,0 +1,227 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 14 Dec 2024 00:29:15 +0900
|
||||
Subject: [PATCH] Implement CarpetFixes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
index 0503f936d0d7194f110069adabff984f51af0a3a..0ca88636cca9b8f93cddf8bc58038e626e171df8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
@@ -379,19 +379,22 @@ public class Sheep extends Animal implements Shearable {
|
||||
}
|
||||
|
||||
private DyeColor getOffspringColor(ServerLevel world, Sheep firstParent, Sheep secondParent) {
|
||||
- DyeColor enumcolor = firstParent.getColor();
|
||||
- DyeColor enumcolor1 = secondParent.getColor();
|
||||
- CraftingInput craftinginput = Sheep.makeCraftInput(enumcolor, enumcolor1);
|
||||
- Optional<Item> optional = world.recipeAccess().getRecipeFor(RecipeType.CRAFTING, craftinginput, world).map((recipeholder) -> { // CraftBukkit - decompile error
|
||||
- return ((CraftingRecipe) recipeholder.value()).assemble(craftinginput, world.registryAccess());
|
||||
- }).map(ItemStack::getItem);
|
||||
-
|
||||
- Objects.requireNonNull(DyeItem.class);
|
||||
- optional = optional.filter(DyeItem.class::isInstance);
|
||||
- Objects.requireNonNull(DyeItem.class);
|
||||
- return (DyeColor) optional.map(DyeItem.class::cast).map(DyeItem::getDyeColor).orElseGet(() -> {
|
||||
- return world.random.nextBoolean() ? enumcolor : enumcolor1;
|
||||
- });
|
||||
+ // Plazma start - Implement CarpetFixes
|
||||
+ final DyeColor firstColor = firstParent.getColor();
|
||||
+ final DyeColor secondColor = secondParent.getColor();
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ if (world.plazmaConfig().carpetFixes.preparedSheepChildColor) {
|
||||
+ final DyeColor color = org.plazmamc.plazma.util.CarpetFixes.properDyeMixin(firstColor, secondColor);
|
||||
+ if (color != null) return color;
|
||||
+ return world.random.nextBoolean() ? firstColor : secondColor;
|
||||
+ }
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ final CraftingInput input = Sheep.makeCraftInput(firstColor, secondColor);
|
||||
+// PLAZMA - REMOVE THIS
|
||||
+ Optional<Item> result = world.recipeAccess().getRecipeFor(RecipeType.CRAFTING, input, world).map((recipeholder) -> recipeholder.value().assemble(input, world.registryAccess())).map(ItemStack::getItem);
|
||||
+ result = result.filter(DyeItem.class::isInstance);
|
||||
+ return result.map(DyeItem.class::cast).map(DyeItem::getDyeColor).orElseGet(() -> world.random.nextBoolean() ? firstColor : secondColor);
|
||||
+ // Plazma end - Implement CarpetFixes
|
||||
}
|
||||
|
||||
private static CraftingInput makeCraftInput(DyeColor firstColor, DyeColor secondColor) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||
index 90f8360f547ce709fd13ee34f8e67d8bfa94b498..4e5fb377696c0a98a56f9ea11d0116b28399c8f6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||
@@ -9,6 +9,8 @@ import net.minecraft.util.Mth;
|
||||
|
||||
public class BiomeManager {
|
||||
public static final int CHUNK_CENTER_QUART = QuartPos.fromBlock(8);
|
||||
+ public static boolean PLAZMA_CARPET_FIXES = false; // Plazma - Implement CarpetFixes
|
||||
+ private static final double MAX_OFFSET = 0.450_000_000_1; // Plazma - Implement CarpetFixes
|
||||
private static final int ZOOM_BITS = 2;
|
||||
private static final int ZOOM = 4;
|
||||
private static final int ZOOM_MASK = 3;
|
||||
@@ -29,6 +31,79 @@ public class BiomeManager {
|
||||
}
|
||||
|
||||
public Holder<Biome> getBiome(BlockPos pos) {
|
||||
+ // Plazma start - Implement CarpetFixes
|
||||
+ if (PLAZMA_CARPET_FIXES) {
|
||||
+ final int x2 = pos.getX() - 2;
|
||||
+ final int y2 = pos.getY() - 2;
|
||||
+ final int z2 = pos.getZ() - 2;
|
||||
+
|
||||
+ final int x = x2 >> 2;
|
||||
+ final int y = y2 >> 2;
|
||||
+ final int z = z2 >> 2;
|
||||
+
|
||||
+ final double qX = (x2 & 3) / 4.0D;
|
||||
+ final double qY = (y2 & 3) / 4.0D;
|
||||
+ final double qZ = (z2 & 3) / 4.0D;
|
||||
+
|
||||
+ int minX = 0;
|
||||
+ double minD = Double.POSITIVE_INFINITY;
|
||||
+ for (int bX = 0; bX < 8; ++bX) {
|
||||
+ final boolean x0 = (bX & 4) == 0;
|
||||
+ final boolean y0 = (bX & 2) == 0;
|
||||
+ final boolean z0 = (bX & 1) == 0;
|
||||
+
|
||||
+ final double x1 = x0 ? qX : qX - 1.0D;
|
||||
+ final double y1 = y0 ? qY : qY - 1.0D;
|
||||
+ final double z1 = z0 ? qZ : qZ - 1.0D;
|
||||
+
|
||||
+ double maxQY = 0.0D;
|
||||
+ double maxQZ = 0.0D;
|
||||
+ if (bX != 0) {
|
||||
+ final double maxQX = Mth.square(Math.max(x1 + MAX_OFFSET, Math.abs(x1 - MAX_OFFSET)));
|
||||
+ maxQY = Mth.square(Math.max(y1 + MAX_OFFSET, Math.abs(y1 - MAX_OFFSET)));
|
||||
+ maxQZ = Mth.square(Math.max(z1 + MAX_OFFSET, Math.abs(z1 - MAX_OFFSET)));
|
||||
+
|
||||
+ if (minD < maxQY + maxQZ + maxQX) continue;
|
||||
+ }
|
||||
+
|
||||
+ int pX = x0 ? x : x + 1;
|
||||
+ int pY = y0 ? y : y + 1;
|
||||
+ int pZ = z0 ? z : z + 1;
|
||||
+
|
||||
+ long seed = this.biomeZoomSeed;
|
||||
+ seed = LinearCongruentialGenerator.next(seed, pX);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, pY);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, pZ);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, pX);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, pY);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, pZ);
|
||||
+
|
||||
+ double dX = getFiddle(seed);
|
||||
+ double sX = Mth.square(x1 + dX);
|
||||
+ if (bX != 0 && minD < sX + maxQY + maxQZ) continue;
|
||||
+
|
||||
+ seed = LinearCongruentialGenerator.next(seed, this.biomeZoomSeed);
|
||||
+ double dY = getFiddle(seed);
|
||||
+ double sY = Mth.square(y1 + dY);
|
||||
+ if (bX != 0 && minD < sX + sY + maxQZ) continue;
|
||||
+
|
||||
+ seed = LinearCongruentialGenerator.next(seed, this.biomeZoomSeed);
|
||||
+ double dZ = getFiddle(seed);
|
||||
+ double bD = sX + sY + Mth.square(z1 + dZ);
|
||||
+
|
||||
+ if (minD <= bD) continue;
|
||||
+ minX = bX;
|
||||
+ minD = bD;
|
||||
+ }
|
||||
+
|
||||
+ return this.noiseBiomeSource.getNoiseBiome(
|
||||
+ (minX & 4) == 0 ? x : x + 1,
|
||||
+ (minX & 2) == 0 ? y : y + 1,
|
||||
+ (minX & 1) == 0 ? z : z + 1
|
||||
+ );
|
||||
+ }
|
||||
+ // Plazma end - Implement CarpetFixes
|
||||
+
|
||||
int i = pos.getX() - 2;
|
||||
int j = pos.getY() - 2;
|
||||
int k = pos.getZ() - 2;
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index b5b252c79b9508200d9d0bd15f0469b0cb0fd3b3..3bc5d3f1ed3d46ae1dc8f4b3207b78bf94911fdd 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -178,4 +178,16 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+ public CarpetFixes carpetFixes;
|
||||
+ public class CarpetFixes extends ConfigurationPart {
|
||||
+
|
||||
+ boolean optimizeBiomeAccess = OPTIMIZE;
|
||||
+
|
||||
+ @PostProcess
|
||||
+ void post() {
|
||||
+ net.minecraft.world.level.biome.BiomeManager.PLAZMA_CARPET_FIXES = this.optimizeBiomeAccess;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index f822b544d98602be85bf0c54a6040a5907b1906e..ee7655924358642d4fc58c261decd808ff7f8019 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -107,4 +107,11 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
+ public CarpetFixes carpetFixes;
|
||||
+ public class CarpetFixes extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean preparedSheepChildColor = OPTIMIZE;
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/util/CarpetFixes.java b/src/main/java/org/plazmamc/plazma/util/CarpetFixes.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a5b0ce75a0ffa65e357cde2d55b7a0f116a2afad
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/plazmamc/plazma/util/CarpetFixes.java
|
||||
@@ -0,0 +1,45 @@
|
||||
+package org.plazmamc.plazma.util;
|
||||
+
|
||||
+import net.minecraft.world.item.DyeColor;
|
||||
+
|
||||
+public interface CarpetFixes {
|
||||
+
|
||||
+ static DyeColor properDyeMixin(DyeColor firstColor, DyeColor secondColor) {
|
||||
+ if (firstColor.equals(secondColor)) return firstColor;
|
||||
+
|
||||
+ return switch (firstColor) {
|
||||
+ case WHITE -> switch (secondColor) {
|
||||
+ case BLUE -> DyeColor.LIGHT_BLUE;
|
||||
+ case GRAY -> DyeColor.LIGHT_GRAY;
|
||||
+ case BLACK -> DyeColor.GRAY;
|
||||
+ case GREEN -> DyeColor.LIME;
|
||||
+ case RED -> DyeColor.PINK;
|
||||
+ default -> null;
|
||||
+ };
|
||||
+ case BLUE -> switch (secondColor) {
|
||||
+ case WHITE -> DyeColor.LIGHT_BLUE;
|
||||
+ case GREEN -> DyeColor.CYAN;
|
||||
+ case RED -> DyeColor.PURPLE;
|
||||
+ default -> null;
|
||||
+ };
|
||||
+ case RED -> switch (secondColor) {
|
||||
+ case YELLOW -> DyeColor.ORANGE;
|
||||
+ case WHITE -> DyeColor.PINK;
|
||||
+ case BLUE -> DyeColor.PURPLE;
|
||||
+ default -> null;
|
||||
+ };
|
||||
+ case GREEN -> switch (secondColor) {
|
||||
+ case BLUE -> DyeColor.CYAN;
|
||||
+ case WHITE -> DyeColor.LIME;
|
||||
+ default -> null;
|
||||
+ };
|
||||
+ case YELLOW -> secondColor.equals(DyeColor.RED) ? DyeColor.ORANGE : null;
|
||||
+ case PURPLE -> secondColor.equals(DyeColor.PINK) ? DyeColor.MAGENTA : null;
|
||||
+ case PINK -> secondColor.equals(DyeColor.PURPLE) ? DyeColor.MAGENTA : null;
|
||||
+ case GRAY -> secondColor.equals(DyeColor.WHITE) ? DyeColor.LIGHT_GRAY : null;
|
||||
+ case BLACK -> secondColor.equals(DyeColor.WHITE) ? DyeColor.GRAY : null;
|
||||
+ default -> null;
|
||||
+ };
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
@@ -1,39 +1,23 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sun, 27 Oct 2024 15:07:43 +0900
|
||||
Subject: [PATCH] TickControl System
|
||||
|
||||
Based on snackbag/TT20
|
||||
Copyright (C) 2024 snackbag, Licensed under AGPL v3.0
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
Date: Sat, 14 Dec 2024 00:39:05 +0900
|
||||
Subject: [PATCH] Ticking Controller
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 5cd9b92bc..6773081b6 100644
|
||||
index 26c5cb68b464305fde43e2e0e1a415a2425483ea..ef1b47ebb8d79fbe177d4ad08e07bd182657c5d3 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1668,6 +1668,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1689,6 +1689,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||
+ org.plazmamc.plazma.util.TickControl.tick(); // Plazma - TickControl System
|
||||
+ org.plazmamc.plazma.util.TickingController.tick(); // Plazma - TickControl System
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
long i = Util.getNanos();
|
||||
int j = this.pauseWhileEmptySeconds() * 20;
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/ServerWatchdog.java b/src/main/java/net/minecraft/server/dedicated/ServerWatchdog.java
|
||||
index 660a14203..d092bef5e 100644
|
||||
index 660a142036c4e608d3d6fed6ec700a3488400bec..d092bef5e6626f000a44a0f424f247a1a69d34af 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/ServerWatchdog.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/ServerWatchdog.java
|
||||
@@ -34,6 +34,7 @@ public class ServerWatchdog implements Runnable {
|
||||
@@ -45,30 +29,30 @@ index 660a14203..d092bef5e 100644
|
||||
long m = Util.getNanos();
|
||||
long n = m - l;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index bb168636c..b55ad2615 100644
|
||||
index e1957ad2a804f1272ccd458560bd7bde4ed0fe53..97e9f64498b9eb4d595e94cc63038363092809ae 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -579,7 +579,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
this.lastSpawnState = spawnercreature_d;
|
||||
//profiler.popPush("spawnAndTick"); // Purpur
|
||||
@@ -621,7 +621,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
// this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously
|
||||
//profiler.popPush("spawnAndTick"); // Plazma - Completely remove Mojang profiler
|
||||
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
|
||||
- int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
|
||||
+ int k = org.plazmamc.plazma.util.TickControl.calc(this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING), it -> it.accelerate.randomTick, false); // Plazma - TickControl system
|
||||
+ int k = org.plazmamc.plazma.util.TickingController.calc(this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING), it -> it.accelerate.randomTick, false); // Plazma - TickControl system
|
||||
List list1;
|
||||
|
||||
if (flag && (this.spawnEnemies || this.spawnFriendlies)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index d5662fd0b..48ea65f67 100644
|
||||
index 137138aa1e42d4f12ed0bc54bc25918d29120333..b1bdd91eb821dee6c20bed9adb019eda2e8395d7 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -879,7 +879,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -908,7 +908,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
this.setDayTime(this.preciseTime);
|
||||
} else
|
||||
// Purpur end
|
||||
- this.setDayTime(this.levelData.getDayTime() + 1L);
|
||||
+ // Plazma start - TickControl System
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().tickControl.accelerate.dayTime)
|
||||
+ this.setDayTime(this.levelData.getDayTime() + org.plazmamc.plazma.util.TickControl.missedTicks() + 1L);
|
||||
+ this.setDayTime(this.levelData.getDayTime() + org.plazmamc.plazma.util.TickingController.missedTicks() + 1L);
|
||||
+ else
|
||||
+ this.setDayTime(this.levelData.getDayTime() + 1L);
|
||||
+ // Plazma end - TickControl System
|
||||
@@ -76,19 +60,19 @@ index d5662fd0b..48ea65f67 100644
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 4653b25a8..9e9dd4ae1 100644
|
||||
index 9cd39ccca746c96809e3e1862e25240714662fb2..5f8415f510bb13f9ffe16c869cf8b010c5cbb5e8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -562,6 +562,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
this.tickEffects();
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().tickControl.delay.potionEffect) for (int i = 0; i < org.plazmamc.plazma.util.TickControl.missedTicks(); i++) this.tickEffects(); // Plazma - TickControl System
|
||||
+ if (plazma.Config.get().tickControl.delay.potionEffect) for (int i = 0; i < org.plazmamc.plazma.util.TickingController.missedTicks(); i++) this.tickEffects(); // Plazma - TickControl System
|
||||
this.animStepO = this.animStep;
|
||||
this.yBodyRotO = this.yBodyRot;
|
||||
this.yHeadRotO = this.yHeadRot;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/PortalProcessor.java b/src/main/java/net/minecraft/world/entity/PortalProcessor.java
|
||||
index b4a824996..1e6b32ad6 100644
|
||||
index b4a8249964786d484aa0767d0e73d71d2156f0e8..49505d04c737c41e4229d80a7b96d4ed0b68d083 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/PortalProcessor.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/PortalProcessor.java
|
||||
@@ -24,7 +24,7 @@ public class PortalProcessor {
|
||||
@@ -100,35 +84,35 @@ index b4a824996..1e6b32ad6 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,14 @@ public class PortalProcessor {
|
||||
this.portalTime = Math.max(this.portalTime - 4, 0);
|
||||
@@ -33,6 +33,14 @@ public class PortalProcessor {
|
||||
return this.portal.getPortalDestination(world, entity, this.entryPosition);
|
||||
}
|
||||
|
||||
+ // Plazma start - TickControl System
|
||||
+ private int increaseTick() {
|
||||
+ if (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().tickControl.delay.portalUse)
|
||||
+ this.portalTime += org.plazmamc.plazma.util.TickControl.missedTicks();
|
||||
+ if (!plazma.Config.get().tickControl.delay.portalUse)
|
||||
+ this.portalTime += org.plazmamc.plazma.util.TickingController.missedTicks();
|
||||
+ return this.portalTime++;
|
||||
+ }
|
||||
+ // Plazma end - TickControl System
|
||||
+
|
||||
public boolean hasExpired() {
|
||||
return this.portalTime <= 0;
|
||||
public Portal.Transition getPortalLocalTransition() {
|
||||
return this.portal.getLocalTransition();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 89d89a1b0..7c4228c0b 100644
|
||||
index 8c5dff4e24c1366d583ba9c7c2c15ea166a24933..96f34e3cd6fcb44f503ce25a3479997ed84c7ce7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -158,6 +158,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
if (this.getItem().isEmpty()) {
|
||||
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
} else {
|
||||
+ if (this.pickupDelay > 0 && org.plazmamc.plazma.configurations.GlobalConfiguration.get().tickControl.delay.itemPickup) this.pickupDelay = Math.max(this.pickupDelay - org.plazmamc.plazma.util.TickControl.missedTicks(), 0); // Plazma - TickControl System
|
||||
+ if (this.pickupDelay > 0 && plazma.Config.get().tickControl.delay.itemPickup) this.pickupDelay = Math.max(this.pickupDelay - org.plazmamc.plazma.util.TickingController.missedTicks(), 0); // Plazma - TickControl System
|
||||
super.tick();
|
||||
// Paper start - remove anti tick skipping measures / wall time - revert to vanilla
|
||||
if (this.pickupDelay > 0 && this.pickupDelay != 32767) {
|
||||
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 c1d068fa9..27361bde0 100644
|
||||
index f92b72ee0172cd878baef69b9710dbaf7e5c4495..7865f5375ab3938e326a76766517785821efe19a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -302,6 +302,11 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -136,15 +120,15 @@ index c1d068fa9..27361bde0 100644
|
||||
this.sleepCounter = 100;
|
||||
}
|
||||
+ // Plazma start - TickControl System
|
||||
+ else if (this.sleepCounter < 100 && org.plazmamc.plazma.configurations.GlobalConfiguration.get().tickControl.delay.sleep && org.plazmamc.plazma.util.TickControl.missedTicks() > 0) {
|
||||
+ this.sleepCounter += org.plazmamc.plazma.util.TickControl.missedTicks();
|
||||
+ else if (this.sleepCounter < 100 && plazma.Config.get().tickControl.delay.sleep && org.plazmamc.plazma.util.TickingController.missedTicks() > 0) {
|
||||
+ this.sleepCounter += org.plazmamc.plazma.util.TickingController.missedTicks();
|
||||
+ }
|
||||
+ // Plazma end - TickControl System
|
||||
|
||||
if (!this.level().isClientSide && this.level().isDay()) {
|
||||
if (/*!this.level().isClientSide &&*/ this.level().isDay()) { // Plazma - Remove persist 'isClientSide' flag
|
||||
this.stopSleepInBed(false, true);
|
||||
diff --git a/src/main/java/net/minecraft/world/item/Item.java b/src/main/java/net/minecraft/world/item/Item.java
|
||||
index 3d948c8d3..0c77997e0 100644
|
||||
index 7fc8fcab93be9076391a2981d028831cbd02a3d2..dccc95834b4cf625b7f5ce88916cbf9a865d87a4 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/Item.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/Item.java
|
||||
@@ -260,7 +260,7 @@ public class Item implements FeatureElement, ItemLike {
|
||||
@@ -152,12 +136,12 @@ index 3d948c8d3..0c77997e0 100644
|
||||
public int getUseDuration(ItemStack stack, LivingEntity user) {
|
||||
Consumable consumable = stack.get(DataComponents.CONSUMABLE);
|
||||
- return consumable != null ? consumable.consumeTicks() : 0;
|
||||
+ return consumable != null ? org.plazmamc.plazma.util.TickControl.calc(consumable.eatDurationTicks(), it -> it.delay.itemUse, true) : 0; // Plazma - TickControl System
|
||||
+ return consumable != null ? org.plazmamc.plazma.util.TickingController.calc(consumable.consumeTicks(), it -> it.delay.itemUse, true) : 0; // Plazma - TickControl System
|
||||
}
|
||||
|
||||
public boolean releaseUsing(ItemStack stack, Level world, LivingEntity user, int remainingUseTicks) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index 852bfe68a..3cb943ea4 100644
|
||||
index dcf2dcece3e995ce4646b931329246be19a4e1c2..b99945c052d62e293bd3e516c7e9e407d358bbb7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -336,13 +336,14 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -173,7 +157,7 @@ index 852bfe68a..3cb943ea4 100644
|
||||
- }
|
||||
+ // Plazma start - TickControl system
|
||||
+ if (f == -1.0F) return 0.0F;
|
||||
+ return org.plazmamc.plazma.util.TickControl.calc(
|
||||
+ return org.plazmamc.plazma.util.TickingController.calc(
|
||||
+ player.getDestroySpeed(state) / f / (player.hasCorrectToolForDrops(state) ? 30 : 100),
|
||||
+ it -> it.delay.blockBreak,
|
||||
+ false
|
||||
@@ -183,69 +167,69 @@ index 852bfe68a..3cb943ea4 100644
|
||||
|
||||
protected void spawnAfterBreak(BlockState state, ServerLevel world, BlockPos pos, ItemStack tool, boolean dropExperience) {}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 9cc1a79dd25c63af6986e721ceff5560cf56b7d1..c45224e142905921305da51139d5fd3f51583cca 100644
|
||||
index 2966caede97e01b5ad15a0d56232a0f5526685e2..f1baa2a5ba541fb4a99500b2c79326dec1cd0128 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -1036,8 +1036,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
this.chunkCoordinateKey = chunkCoordinateKey; // Plazma - Port SparklyPaper patches; Optimize TickingBlockEntity
|
||||
@@ -1076,8 +1076,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
this.chunkCoordinateKey = chunkCoordinateKey;
|
||||
}
|
||||
|
||||
+ // Plazma start - TickControl System
|
||||
+ private void tickTicker(BlockState iblockdata) {
|
||||
+ this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), iblockdata, this.blockEntity);
|
||||
+ private void tickTicker(BlockState state) {
|
||||
+ this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), state, this.blockEntity);
|
||||
+
|
||||
+ if (!org.plazmamc.plazma.util.TickControl.shouldTickAgain(iblockdata.getBlock())) return;
|
||||
+ for (int i = 0; i < org.plazmamc.plazma.util.TickControl.missedTicks(); i++)
|
||||
+ this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), iblockdata, this.blockEntity);
|
||||
+ if (!org.plazmamc.plazma.util.TickingController.shouldTickAgain(state.getBlock())) return;
|
||||
+ for (int i = 0; i < org.plazmamc.plazma.util.TickingController.missedTicks(); i++)
|
||||
+ this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), state, this.blockEntity);
|
||||
+ }
|
||||
+ // Plazma end - TickControl System
|
||||
+
|
||||
@Override
|
||||
- public void tick() {
|
||||
+ public final void tick() { // Plazma - TickControl System (make final)
|
||||
if (!this.blockEntity.isRemoved() && this.blockEntity.hasLevel()) {
|
||||
BlockPos blockposition = this.blockEntity.getBlockPos();
|
||||
if (this.blockEntity.isRemoved() || !this.blockEntity.hasLevel()) return;
|
||||
|
||||
@@ -1050,7 +1060,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
|
||||
BlockPos pos = this.blockEntity.getBlockPos();
|
||||
@@ -1087,7 +1097,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
BlockState state = LevelChunk.this.getBlockState(pos);
|
||||
|
||||
if (this.blockEntity.getType().isValid(iblockdata)) {
|
||||
- this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), iblockdata, this.blockEntity);
|
||||
+ this.tickTicker(iblockdata); // Plazma - TickControl System
|
||||
if (this.blockEntity.getType().isValid(state)) {
|
||||
- this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), state, this.blockEntity);
|
||||
+ this.tickTicker(state); // Plazma - TickControl System
|
||||
this.loggedInvalidBlockState = false;
|
||||
// Paper start - Remove the Block Entity if it's invalid
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/material/LavaFluid.java b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
||||
index 2d492d849ff73a738dfbcb16507feb89bf19a962..67206b9c754dfe90002e0bcf6995eae60b852acd 100644
|
||||
index 6e643c1a7f7e71cfd20603facaf224985ee81716..cbbbcf8a915a4146eb63e29ba5dd91354ac7228b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
|
||||
@@ -180,7 +180,7 @@ public abstract class LavaFluid extends FlowingFluid {
|
||||
@@ -181,7 +181,7 @@ public abstract class LavaFluid extends FlowingFluid {
|
||||
|
||||
@Override
|
||||
public int getTickDelay(LevelReader world) {
|
||||
- return world.dimensionType().ultraWarm() ? world.getWorldBorder().world.purpurConfig.lavaSpeedNether : world.getWorldBorder().world.purpurConfig.lavaSpeedNotNether; // Purpur
|
||||
+ return org.plazmamc.plazma.util.TickControl.calc(world.dimensionType().ultraWarm() ? world.getWorldBorder().world.purpurConfig.lavaSpeedNether : world.getWorldBorder().world.purpurConfig.lavaSpeedNotNether, it -> it.delay.lavaFluid, true); // Purpur // Plazma - TickControl system
|
||||
+ return org.plazmamc.plazma.util.TickingController.calc(world.dimensionType().ultraWarm() ? world.getWorldBorder().world.purpurConfig.lavaSpeedNether : world.getWorldBorder().world.purpurConfig.lavaSpeedNotNether, it -> it.delay.lavaFluid, true); // Purpur // Plazma - TickControl system
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/material/WaterFluid.java b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
|
||||
index 0fc89b33864000a262ec5369708f7aedeaf6dc0b..5055730053d9d9c1da0a5252654c936c75d04fb6 100644
|
||||
index 028aea6640356ba80f5d682e3cc03b7f82f5b9c7..d788849dc5a568d455cd83ca5b6e1b4ba1a9161f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/WaterFluid.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
|
||||
@@ -122,7 +122,7 @@ public abstract class WaterFluid extends FlowingFluid {
|
||||
@@ -123,7 +123,7 @@ public abstract class WaterFluid extends FlowingFluid {
|
||||
|
||||
@Override
|
||||
public int getTickDelay(LevelReader world) {
|
||||
- return world.getWorldBorder().world.plazmaConfig().block.waterFlowingTick; // Plazma - Configurable water flowing speed
|
||||
+ return org.plazmamc.plazma.util.TickControl.calc(world.getWorldBorder().world.plazmaConfig().block.waterFlowingTick, it -> it.delay.waterFluid, true); // Plazma - Configurable water flowing speed; TickControl System
|
||||
+ return org.plazmamc.plazma.util.TickingController.calc(world.getWorldBorder().world.plazmaConfig().block.waterFlowingTick, it -> it.delay.waterFluid, true); // Plazma - Configurable water flowing speed // Plazma - TickControl System
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 49bce6e28e12f3729cab5628cf3e0f508a56d0d7..2a88a25793e6d963a9a08e615a72c6ed1677a18b 100644
|
||||
index 3bc5d3f1ed3d46ae1dc8f4b3207b78bf94911fdd..3a94005e24a6a695ac4c94ace1bc9c454180139b 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -146,4 +146,39 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -190,4 +190,39 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
@@ -279,18 +263,18 @@ index 49bce6e28e12f3729cab5628cf3e0f508a56d0d7..2a88a25793e6d963a9a08e615a72c6ed
|
||||
+
|
||||
+ @PostProcess
|
||||
+ void post() {
|
||||
+ org.plazmamc.plazma.util.TickControl.post(this);
|
||||
+ org.plazmamc.plazma.util.TickingController.post(this);
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/util/TickControl.java b/src/main/java/org/plazmamc/plazma/util/TickControl.java
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/util/TickingController.java b/src/main/java/org/plazmamc/plazma/util/TickingController.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c8db7b9f590a34b38448a970baaa79dd73eab8d8
|
||||
index 0000000000000000000000000000000000000000..0e71a47a639a1a3dd0918c5a403ed827aca67966
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/plazmamc/plazma/util/TickControl.java
|
||||
@@ -0,0 +1,57 @@
|
||||
+++ b/src/main/java/org/plazmamc/plazma/util/TickingController.java
|
||||
@@ -0,0 +1,56 @@
|
||||
+package org.plazmamc.plazma.util;
|
||||
+
|
||||
+import net.minecraft.world.level.block.Block;
|
||||
@@ -301,14 +285,13 @@ index 0000000000000000000000000000000000000000..c8db7b9f590a34b38448a970baaa79dd
|
||||
+
|
||||
+import static net.minecraft.server.MinecraftServer.getServer;
|
||||
+
|
||||
+public final class TickControl {
|
||||
+public final class TickingController {
|
||||
+
|
||||
+
|
||||
+ private static @Nullable TickControl INSTANCE;
|
||||
+ private static @Nullable TickingController INSTANCE;
|
||||
+ private final GlobalConfiguration.TickControl configuration;
|
||||
+ private int missedTicks = 0;
|
||||
+
|
||||
+ private TickControl(GlobalConfiguration.TickControl configuration) {
|
||||
+ private TickingController(GlobalConfiguration.TickControl configuration) {
|
||||
+ this.configuration = configuration;
|
||||
+ }
|
||||
+
|
||||
@@ -324,7 +307,7 @@ index 0000000000000000000000000000000000000000..c8db7b9f590a34b38448a970baaa79dd
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ INSTANCE = new TickControl(configuration);
|
||||
+ INSTANCE = new TickingController(configuration);
|
||||
+ }
|
||||
+
|
||||
+ public static float calc(float original, @NonNull Function<GlobalConfiguration.TickControl, Boolean> isAffected, boolean swap) {
|
||||
@@ -0,0 +1,58 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Sat, 14 Dec 2024 01:03:07 +0900
|
||||
Subject: [PATCH] Add option to disable beacon effect ambient
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
index 69ef5c805d802575a639027fd40064d92fcfe89d..31d6bf6c1bcca32ce8a8a8810807dec4d5000ab9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
@@ -368,24 +368,20 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
}
|
||||
}
|
||||
|
||||
- private static void applyEffect(List list, @Nullable Holder<MobEffect> holder, int j, int b0, boolean isPrimary, BlockPos worldPosition) { // Paper - BeaconEffectEvent
|
||||
- if (!list.isEmpty()) { // Paper - BeaconEffectEvent
|
||||
- Iterator iterator = list.iterator();
|
||||
+ private static void applyEffect(List<Player> list, @Nullable Holder<MobEffect> holder, int j, int b0, boolean isPrimary, BlockPos worldPosition) { // Paper - BeaconEffectEvent
|
||||
+ if (list.isEmpty()) return;
|
||||
|
||||
- Player entityhuman;
|
||||
+ // Paper start - BeaconEffectEvent
|
||||
+ org.bukkit.craftbukkit.block.CraftBlock block = org.bukkit.craftbukkit.block.CraftBlock.at(list.getFirst().level(), worldPosition);
|
||||
+ PotionEffect effect = CraftPotionUtil.toBukkit(new MobEffectInstance(holder, j, b0, true, !(block).getCraftWorld().getHandle().plazmaConfig().entity.disableBeaconEffectAmbient, true));
|
||||
+ // Paper end - BeaconEffectEvent
|
||||
+
|
||||
+ for (final Player player : list) {
|
||||
// Paper start - BeaconEffectEvent
|
||||
- org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(((Player) list.get(0)).level(), worldPosition);
|
||||
- PotionEffect effect = CraftPotionUtil.toBukkit(new MobEffectInstance(holder, j, b0, true, true));
|
||||
+ BeaconEffectEvent event = new BeaconEffectEvent(block, effect, (org.bukkit.entity.Player) player.getBukkitEntity(), isPrimary);
|
||||
+ if (CraftEventFactory.callEvent(event).isCancelled()) continue;
|
||||
+ player.addEffect(new MobEffectInstance(CraftPotionUtil.fromBukkit(event.getEffect())), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.BEACON);
|
||||
// Paper end - BeaconEffectEvent
|
||||
-
|
||||
- while (iterator.hasNext()) {
|
||||
- // Paper start - BeaconEffectEvent
|
||||
- entityhuman = (ServerPlayer) iterator.next();
|
||||
- BeaconEffectEvent event = new BeaconEffectEvent(block, effect, (org.bukkit.entity.Player) entityhuman.getBukkitEntity(), isPrimary);
|
||||
- if (CraftEventFactory.callEvent(event).isCancelled()) continue;
|
||||
- entityhuman.addEffect(new MobEffectInstance(CraftPotionUtil.fromBukkit(event.getEffect())), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.BEACON);
|
||||
- // Paper end - BeaconEffectEvent
|
||||
- }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index ee7655924358642d4fc58c261decd808ff7f8019..943ef13e5a94e225725d2b390ec11bee677a6cf4 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -30,6 +30,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
|
||||
public int sensorTick = 1;
|
||||
public boolean suppressErrorsFromDirtyAttributes = OPTIMIZE;
|
||||
+ public boolean disableBeaconEffectAmbient = false;
|
||||
|
||||
public Phantom phantom;
|
||||
public class Phantom extends ConfigurationPart {
|
||||
@@ -1,62 +1,4 @@
|
||||
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
index 8f1645573780d12bf29d441d31eab1b76cd9e70f..8e35f7fbe3629ab05c16f52d72a3cd7343cf835f 100644
|
||||
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
@@ -64,7 +64,7 @@ public class PufferfishConfig {
|
||||
getString("info.version", "1.0");
|
||||
setComment("info",
|
||||
"Pufferfish Configuration",
|
||||
- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host",
|
||||
+ // "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - Sponsorblock
|
||||
"Join our Discord for support: https://discord.gg/reZw4vQV9H",
|
||||
"Download new builds at https://ci.pufferfish.host/job/Pufferfish");
|
||||
|
||||
@@ -219,7 +219,7 @@ public class PufferfishConfig {
|
||||
public static int maxProjectileLoadsPerTick;
|
||||
public static int maxProjectileLoadsPerProjectile;
|
||||
private static void projectileLoading() {
|
||||
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
|
||||
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations
|
||||
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
|
||||
|
||||
setComment("projectile", "Optimizes projectile settings");
|
||||
@@ -233,12 +233,12 @@ public class PufferfishConfig {
|
||||
public static int activationDistanceMod;
|
||||
|
||||
private static void dynamicActivationOfBrains() throws IOException {
|
||||
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
|
||||
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()); // Purpur // Plazma - Optimize default configurations
|
||||
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
|
||||
"This value determines how far away an entity has to be",
|
||||
"from the player to start being effected by DEAR.");
|
||||
startDistanceSquared = startDistance * startDistance;
|
||||
- maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
|
||||
+ maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 8, // Plazma - Optimize default configurations
|
||||
"This value defines how often in ticks, the furthest entity",
|
||||
"will get their pathfinders and behaviors ticked. 20 = 1s");
|
||||
activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
|
||||
@@ -261,8 +261,18 @@ public class PufferfishConfig {
|
||||
public static Map<String, Integer> projectileTimeouts;
|
||||
private static void projectileTimeouts() {
|
||||
// Set some defaults
|
||||
- getInt("entity_timeouts.SNOWBALL", -1);
|
||||
- getInt("entity_timeouts.LLAMA_SPIT", -1);
|
||||
+ // Plazma start - Optimize default configurations
|
||||
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) {
|
||||
+ getInt("entity_timeouts.ARROW", 200);
|
||||
+ getInt("entity_timeouts.EGG", 200);
|
||||
+ getInt("entity_timeouts.ENDER_PEARL", 200);
|
||||
+ getInt("entity_timeouts.SNOWBALL", 200);
|
||||
+ getInt("entity_timeouts.LLAMA_SPIT", 200);
|
||||
+ } else {
|
||||
+ getInt("entity_timeouts.SNOWBALL", -1);
|
||||
+ getInt("entity_timeouts.LLAMA_SPIT", -1);
|
||||
+ }
|
||||
+ // Plazma end - Optimize default configurations
|
||||
setComment("entity_timeouts",
|
||||
"These values define a entity's maximum lifespan. If an",
|
||||
"entity is in this list and it has survived for longer than",
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
index c867796f6..ecced2072 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 15 May 2024 14:30:55 +0900
|
||||
Subject: [PATCH] Add some missing Pufferfish configurations
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
index 5b024bc6166a9034eeba729bf3a53236446a03de..d4d6e9f0d8bf15315412ce5193e45c147b047575 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
@@ -161,9 +161,11 @@ public class Armadillo extends Animal {
|
||||
return ArmadilloAi.makeBrain(this.brainProvider().makeBrain(dynamic));
|
||||
}
|
||||
|
||||
+ private int behaviorTick; // Plazma - Add missing pufferfish configurations
|
||||
@Override
|
||||
protected void customServerAiStep() {
|
||||
//this.level().getProfiler().push("armadilloBrain"); // Purpur
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
|
||||
((Brain<Armadillo>) this.brain).tick((ServerLevel) this.level(), this); // CraftBukkit - decompile error
|
||||
//this.level().getProfiler().pop(); // Purpur
|
||||
//this.level().getProfiler().push("armadilloActivityUpdate"); // Purpur
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
index 00803dcc2d990046013b8a175af20359883a15fe..6781c9cda8118842e24712f335de6e5b817af82c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
@@ -164,11 +164,12 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
|
||||
return pose == Pose.SITTING ? Camel.SITTING_DIMENSIONS.scale(this.getAgeScale()) : super.getDefaultDimensions(pose);
|
||||
}
|
||||
|
||||
+ private int behaviorTick = 0; // Plazma - Add missing pufferfish configurations
|
||||
@Override
|
||||
protected void customServerAiStep() {
|
||||
//this.level().getProfiler().push("camelBrain"); // Purpur
|
||||
Brain<Camel> behaviorcontroller = (Brain<Camel>) this.getBrain(); // CraftBukkit - decompile error
|
||||
-
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
|
||||
behaviorcontroller.tick((ServerLevel) this.level(), this);
|
||||
//this.level().getProfiler().pop(); // Purpur
|
||||
//this.level().getProfiler().push("camelActivityUpdate"); // Purpur
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
index bc931f54d1087f2515b8185368ade3e8dd55a00d..65ce4ccbb91ff87762da5f9ef53e6d069149abd8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
@@ -515,9 +515,11 @@ public class Sniffer extends Animal {
|
||||
return Brain.provider(SnifferAi.MEMORY_TYPES, SnifferAi.SENSOR_TYPES);
|
||||
}
|
||||
|
||||
+ private int behaviorTick; // Plazma - Add missing pufferfish configurations
|
||||
@Override
|
||||
protected void customServerAiStep() {
|
||||
//this.level().getProfiler().push("snifferBrain"); // Purpur
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
|
||||
this.getBrain().tick((ServerLevel) this.level(), this);
|
||||
//this.level().getProfiler().popPush("snifferActivityUpdate"); // Purpur
|
||||
SnifferAi.updateActivity(this);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
index 78a5631753e5bdc16b786ac6951c8d39c4337767..7b1bf1449c2e1f1e2ea2a9f258624b128eb80918 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -320,7 +320,7 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
|
||||
//worldserver.getProfiler().push("wardenBrain"); // Purpur
|
||||
//if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - TODO: Move to Ridables patch
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Plazma - Add missing pufferfish configurations
|
||||
this.getBrain().tick(worldserver, this);
|
||||
//this.level().getProfiler().pop(); // Purpur
|
||||
super.customServerAiStep();
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
|
||||
index f164256d59b761264876ca0c85f812d101bfd5de..deaeb134c47da8710afa747bf980bd00aab846d6 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
|
||||
@@ -106,6 +106,13 @@ public final class NearbyPlayers {
|
||||
return chunk == null ? null : chunk.players[type.ordinal()];
|
||||
}
|
||||
|
||||
+ // Plazma start - Port SparklyPaper patches; Cache coordinate key used for nearby players when ticking chunks
|
||||
+ public ReferenceList<ServerPlayer> getPlayers(final long nearbyCoordKey, final NearbyMapType type) {
|
||||
+ final TrackedChunk chunk = this.byChunk.get(nearbyCoordKey);
|
||||
+ return chunk == null ? null : chunk.players[type.ordinal()];
|
||||
+ }
|
||||
+ // Plazma end - Port SparklyPaper patches; Cache coordinate key used for nearby players when ticking chunks
|
||||
+
|
||||
public ReferenceList<ServerPlayer> getPlayersByChunk(final int chunkX, final int chunkZ, final NearbyMapType type) {
|
||||
final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 5eb7bcf492ee354ef775cd8d09c7ca2bdfeb7ce2..697cb18bce2f2470a0a2347ba6709e1449b360fd 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -615,7 +615,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
// Paper start - optimise chunk tick iteration
|
||||
com.destroystokyo.paper.util.maplist.ReferenceList<ServerPlayer> playersNearby
|
||||
- = nearbyPlayers.getPlayers(chunkcoordintpair, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE);
|
||||
+ = nearbyPlayers.getPlayers(chunk1.nearbyPlayersCoordinateKey, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE);
|
||||
if (playersNearby == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Wed, 15 May 2024 14:31:47 +0900
|
||||
Subject: [PATCH] Improve biome temperature cache
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
index f9fbfb63f19decb3b15284306d7edda072e609af..81b996679f396f18a8f5948311f1069be0806756 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
@@ -118,7 +118,7 @@ public final class Biome {
|
||||
public float getTemperature(BlockPos blockPos) {
|
||||
long l = blockPos.asLong();
|
||||
// Pufferfish start
|
||||
- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get();
|
||||
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Improve biome temperature cache
|
||||
float f = cache.getValue(l);
|
||||
if (!Float.isNaN(f)) {
|
||||
return f;
|
||||
@@ -1,40 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 15:40:34 +0900
|
||||
Subject: [PATCH] CarpetFixes-Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 525fe30b6abba295709fca3d10f9b24679112571..49d5292697fdc6f23874557dd2db9d1fcda750f3 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -76,4 +76,12 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public int timerTimeOut = 0;
|
||||
|
||||
}
|
||||
+
|
||||
+ public CarpetFixes carpetFixes;
|
||||
+
|
||||
+ public class CarpetFixes extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = DO_OPTIMIZE;
|
||||
+
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index 7d5bfd3a5aa5135596f3f1ae7c504a51b02798ef..b0deec445b5ea3cd3e4802eca04e99818b539bd8 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -131,4 +131,12 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
}
|
||||
|
||||
}
|
||||
+
|
||||
+ public CarpetFixes carpetFixes;
|
||||
+
|
||||
+ public class CarpetFixes extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = DO_OPTIMIZE;
|
||||
+
|
||||
+ }
|
||||
}
|
||||
@@ -1,179 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 15:53:37 +0900
|
||||
Subject: [PATCH] CarpetFixes-Optimizations-BiomeManager
|
||||
|
||||
Original: fxmorin/carpet-fixes
|
||||
Copyright (C) 2023 fxmorin
|
||||
|
||||
Optimized getBiome call: Reduce the number of calls to the mess of
|
||||
LinearCongruentialGenerator#next(long, long) which is pretty heavy on performance.
|
||||
|
||||
We are able to do this by skipping around 370 of 512 possible calls to getBiome() by predicting the outcome
|
||||
before doing the seed mixing. This seems to be around 25% - 75% faster depending on the use case.
|
||||
We can predict much faster than the seed mixing.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||
index 5695c5116c8a338b2e41aafcb2dc9f2146856970..b2291854b9803fe01d40e8a1d76d6ff358cea114 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
|
||||
@@ -12,6 +12,7 @@ public class BiomeManager {
|
||||
private static final int ZOOM_BITS = 2;
|
||||
private static final int ZOOM = 4;
|
||||
private static final int ZOOM_MASK = 3;
|
||||
+ private static final double maxOffset = 0.4500000001D; // Plazma - CarpetFixes
|
||||
private final BiomeManager.NoiseBiomeSource noiseBiomeSource;
|
||||
private final long biomeZoomSeed;
|
||||
|
||||
@@ -29,39 +30,104 @@ public class BiomeManager {
|
||||
}
|
||||
|
||||
public Holder<Biome> getBiome(BlockPos pos) {
|
||||
- int i = pos.getX() - 2;
|
||||
- int j = pos.getY() - 2;
|
||||
- int k = pos.getZ() - 2;
|
||||
- int l = i >> 2;
|
||||
- int m = j >> 2;
|
||||
- int n = k >> 2;
|
||||
- double d = (double)(i & 3) / 4.0D;
|
||||
- double e = (double)(j & 3) / 4.0D;
|
||||
- double f = (double)(k & 3) / 4.0D;
|
||||
- int o = 0;
|
||||
- double g = Double.POSITIVE_INFINITY;
|
||||
-
|
||||
- for(int p = 0; p < 8; ++p) {
|
||||
- boolean bl = (p & 4) == 0;
|
||||
- boolean bl2 = (p & 2) == 0;
|
||||
- boolean bl3 = (p & 1) == 0;
|
||||
- int q = bl ? l : l + 1;
|
||||
- int r = bl2 ? m : m + 1;
|
||||
- int s = bl3 ? n : n + 1;
|
||||
- double h = bl ? d : d - 1.0D;
|
||||
- double t = bl2 ? e : e - 1.0D;
|
||||
- double u = bl3 ? f : f - 1.0D;
|
||||
- double v = getFiddledDistance(this.biomeZoomSeed, q, r, s, h, t, u);
|
||||
- if (g > v) {
|
||||
- o = p;
|
||||
- g = v;
|
||||
+ // Plazma start - CarpetFixes - Optimized getBiome call
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().carpetFixes.optimizedBiomeAccess()) {
|
||||
+ int xMinus2 = pos.getX() - 2;
|
||||
+ int yMinus2 = pos.getY() - 2;
|
||||
+ int zMinus2 = pos.getZ() - 2;
|
||||
+ int x = xMinus2 >> 2; // BlockPos to BiomePos
|
||||
+ int y = yMinus2 >> 2;
|
||||
+ int z = zMinus2 >> 2;
|
||||
+ double quartX = (double) (xMinus2 & 3) / 4.0D; // quartLocal divided by 4
|
||||
+ double quartY = (double) (yMinus2 & 3) / 4.0D; // 0/4, 1/4, 2/4, 3/4
|
||||
+ double quartZ = (double) (zMinus2 & 3) / 4.0D; // [0, 0.25, 0.5, 0.75]
|
||||
+ int smallestX = 0;
|
||||
+ double smallestDist = Double.POSITIVE_INFINITY;
|
||||
+ for (int biomeX = 0; biomeX < 8; ++biomeX) {
|
||||
+ boolean everyOtherQuad = (biomeX & 4) == 0; // 1 1 1 1 0 0 0 0
|
||||
+ boolean everyOtherPair = (biomeX & 2) == 0; // 1 1 0 0 1 1 0 0
|
||||
+ boolean everyOther = (biomeX & 1) == 0; // 1 0 1 0 1 0 1 0
|
||||
+ double quartXX = everyOtherQuad ? quartX : quartX - 1.0D; //[-1.0,-0.75,-0.5,-0.25,0.0,0.25,0.5,0.75]
|
||||
+ double quartYY = everyOtherPair ? quartY : quartY - 1.0D;
|
||||
+ double quartZZ = everyOther ? quartZ : quartZ - 1.0D;
|
||||
+
|
||||
+ //This code block is new
|
||||
+ double maxQuartYY = 0.0D, maxQuartZZ = 0.0D;
|
||||
+ if (biomeX != 0) {
|
||||
+ maxQuartYY = Mth.square(Math.max(quartYY + maxOffset, Math.abs(quartYY - maxOffset)));
|
||||
+ maxQuartZZ = Mth.square(Math.max(quartZZ + maxOffset, Math.abs(quartZZ - maxOffset)));
|
||||
+ double maxQuartXX = Mth.square(Math.max(quartXX + maxOffset, Math.abs(quartXX - maxOffset)));
|
||||
+ if (smallestDist < maxQuartXX + maxQuartYY + maxQuartZZ) continue;
|
||||
+ }
|
||||
+
|
||||
+ int xx = everyOtherQuad ? x : x + 1;
|
||||
+ int yy = everyOtherPair ? y : y + 1;
|
||||
+ int zz = everyOther ? z : z + 1;
|
||||
+
|
||||
+ //I transferred the code from method_38106 to here, so I could call continue halfway through
|
||||
+ long seed = LinearCongruentialGenerator.next(this.biomeZoomSeed, xx);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, yy);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, zz);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, xx);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, yy);
|
||||
+ seed = LinearCongruentialGenerator.next(seed, zz);
|
||||
+ double offsetX = getFiddle(seed);
|
||||
+ double sqrX = Mth.square(quartXX + offsetX);
|
||||
+ if (biomeX != 0 && smallestDist < sqrX + maxQuartYY + maxQuartZZ) continue; //skip the rest of the loop
|
||||
+ seed = LinearCongruentialGenerator.next(seed, this.biomeZoomSeed);
|
||||
+ double offsetY = getFiddle(seed);
|
||||
+ double sqrY = Mth.square(quartYY + offsetY);
|
||||
+ if (biomeX != 0 && smallestDist < sqrX + sqrY + maxQuartZZ) continue; // skip the rest of the loop
|
||||
+ seed = LinearCongruentialGenerator.next(seed, this.biomeZoomSeed);
|
||||
+ double offsetZ = getFiddle(seed);
|
||||
+ double biomeDist = sqrX + sqrY + Mth.square(quartZZ + offsetZ);
|
||||
+
|
||||
+ if (smallestDist > biomeDist) {
|
||||
+ smallestX = biomeX;
|
||||
+ smallestDist = biomeDist;
|
||||
+ }
|
||||
}
|
||||
- }
|
||||
+ return this.noiseBiomeSource.getNoiseBiome(
|
||||
+ (smallestX & 4) == 0 ? x : x + 1,
|
||||
+ (smallestX & 2) == 0 ? y : y + 1,
|
||||
+ (smallestX & 1) == 0 ? z : z + 1
|
||||
+ );
|
||||
+ } else {
|
||||
+ int i = pos.getX() - 2;
|
||||
+ int j = pos.getY() - 2;
|
||||
+ int k = pos.getZ() - 2;
|
||||
+ int l = i >> 2;
|
||||
+ int m = j >> 2;
|
||||
+ int n = k >> 2;
|
||||
+ double d = (double) (i & 3) / 4.0D;
|
||||
+ double e = (double) (j & 3) / 4.0D;
|
||||
+ double f = (double) (k & 3) / 4.0D;
|
||||
+ int o = 0;
|
||||
+ double g = Double.POSITIVE_INFINITY;
|
||||
+
|
||||
+ for (int p = 0; p < 8; ++p) {
|
||||
+ boolean bl = (p & 4) == 0;
|
||||
+ boolean bl2 = (p & 2) == 0;
|
||||
+ boolean bl3 = (p & 1) == 0;
|
||||
+ int q = bl ? l : l + 1;
|
||||
+ int r = bl2 ? m : m + 1;
|
||||
+ int s = bl3 ? n : n + 1;
|
||||
+ double h = bl ? d : d - 1.0D;
|
||||
+ double t = bl2 ? e : e - 1.0D;
|
||||
+ double u = bl3 ? f : f - 1.0D;
|
||||
+ double v = getFiddledDistance(this.biomeZoomSeed, q, r, s, h, t, u);
|
||||
+ if (g > v) {
|
||||
+ o = p;
|
||||
+ g = v;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- int w = (o & 4) == 0 ? l : l + 1;
|
||||
- int x = (o & 2) == 0 ? m : m + 1;
|
||||
- int y = (o & 1) == 0 ? n : n + 1;
|
||||
- return this.noiseBiomeSource.getNoiseBiome(w, x, y);
|
||||
+ int w = (o & 4) == 0 ? l : l + 1;
|
||||
+ int x = (o & 2) == 0 ? m : m + 1;
|
||||
+ int y = (o & 1) == 0 ? n : n + 1;
|
||||
+ return this.noiseBiomeSource.getNoiseBiome(w, x, y);
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
public Holder<Biome> getNoiseBiomeAtPosition(double x, double y, double z) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 49d5292697fdc6f23874557dd2db9d1fcda750f3..d329f77ab19ac781506c26909591fa4ae9dabb1e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -82,6 +82,11 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class CarpetFixes extends ConfigurationPart {
|
||||
|
||||
public boolean enabled = DO_OPTIMIZE;
|
||||
+ boolean optimizedBiomeAccess = true;
|
||||
+
|
||||
+ public boolean optimizedBiomeAccess() {
|
||||
+ return enabled && optimizedBiomeAccess;
|
||||
+ }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 16:23:56 +0900
|
||||
Subject: [PATCH] CarpetFixes-Optimizations-RecipeManager
|
||||
|
||||
Original: fxmorin/carpet-fixes
|
||||
Copyright (C) 2023 fxmorin
|
||||
|
||||
RecipeManager optimization.
|
||||
Optimized by taking out streams & doing extra early checks to quickly remove unrelated recipes
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
index 9ffb6999171f602f0b113dac40e0130410cad870..49b5fece692cd5da99ed21d7fd0864cea1609495 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
@@ -103,13 +103,38 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||
}
|
||||
|
||||
public <C extends Container, T extends Recipe<C>> Optional<T> getRecipeFor(RecipeType<T> type, C inventory, Level world) {
|
||||
- // CraftBukkit start
|
||||
- Optional<T> recipe = this.byType(type).values().stream().filter((irecipe) -> {
|
||||
- return irecipe.matches(inventory, world);
|
||||
- }).findFirst();
|
||||
- inventory.setCurrentRecipe(recipe.orElse(null)); // CraftBukkit - Clear recipe when no recipe is found
|
||||
- // CraftBukkit end
|
||||
- return recipe;
|
||||
+ // Plazma start - CarpetFixes - Optimized RecipeManager
|
||||
+ if (world.plazmaLevelConfiguration().carpetFixes.optimizedRecipeManager() && type == RecipeType.CRAFTING) {
|
||||
+ int slots = 0;
|
||||
+ int count;
|
||||
+ //compare size to quickly remove recipes that are not even close. Plus remove streams
|
||||
+ for (int slot = 0; slot < inventory.getContainerSize(); slot++)
|
||||
+ if (!inventory.getItem(slot).isEmpty()) slots++;
|
||||
+ for (Recipe<C> recipe : this.byType(type).values()) {
|
||||
+ count = 0;
|
||||
+ if (recipe instanceof CustomRecipe) {
|
||||
+ if (recipe.matches(inventory, world)) {
|
||||
+ return (Optional<T>) Optional.of(recipe);
|
||||
+ }
|
||||
+ } else {
|
||||
+ for (Ingredient ingredient : recipe.getIngredients())
|
||||
+ if (ingredient != Ingredient.EMPTY) count++;
|
||||
+ if (count == slots && recipe.matches(inventory, world)) {
|
||||
+ return (Optional<T>) Optional.of(recipe);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return Optional.empty();
|
||||
+ } else {
|
||||
+ // CraftBukkit start
|
||||
+ Optional<T> recipe = this.byType(type).values().stream().filter((irecipe) -> {
|
||||
+ return irecipe.matches(inventory, world);
|
||||
+ }).findFirst();
|
||||
+ inventory.setCurrentRecipe(recipe.orElse(null)); // CraftBukkit - Clear recipe when no recipe is found
|
||||
+ // CraftBukkit end
|
||||
+ return recipe;
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
public <C extends Container, T extends Recipe<C>> Optional<Pair<ResourceLocation, T>> getRecipeFor(RecipeType<T> type, C inventory, Level world, @Nullable ResourceLocation id) {
|
||||
@@ -134,7 +159,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||
}
|
||||
|
||||
public <C extends Container, T extends Recipe<C>> List<T> getAllRecipesFor(RecipeType<T> type) {
|
||||
- return List.copyOf(this.byType(type).values());
|
||||
+ return org.plazmamc.plazma.configurations.GlobalConfiguration.get().carpetFixes.optimizedRecipeManager() ? (List<T>) new java.util.ArrayList<>(this.byType(type).values()) : List.copyOf(this.byType(type).values()); // Plazma start - CarpetFixes - Optimized RecipeManager
|
||||
}
|
||||
|
||||
public <C extends Container, T extends Recipe<C>> List<T> getRecipesFor(RecipeType<T> type, C inventory, Level world) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index d329f77ab19ac781506c26909591fa4ae9dabb1e..36511f71fcf3a8a5da746dd087003861a4f0a8f4 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -83,10 +83,15 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public boolean enabled = DO_OPTIMIZE;
|
||||
boolean optimizedBiomeAccess = true;
|
||||
+ boolean optimizedRecipeManager = true;
|
||||
|
||||
public boolean optimizedBiomeAccess() {
|
||||
return enabled && optimizedBiomeAccess;
|
||||
}
|
||||
|
||||
+ public boolean optimizedRecipeManager() {
|
||||
+ return enabled && optimizedRecipeManager;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index b0deec445b5ea3cd3e4802eca04e99818b539bd8..e089a881600b61060bae1135b89703f6c0b5c7e8 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -137,6 +137,11 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
public class CarpetFixes extends ConfigurationPart {
|
||||
|
||||
public boolean enabled = DO_OPTIMIZE;
|
||||
+ boolean optimizedRecipeManager = true;
|
||||
+
|
||||
+ public boolean optimizedRecipeManager() {
|
||||
+ return enabled && optimizedRecipeManager;
|
||||
+ }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: IPECTER <ipectert@gmail.com>
|
||||
Date: Wed, 6 Sep 2023 16:35:34 +0900
|
||||
Subject: [PATCH] CarpetFixes-Optimizations-Sheep
|
||||
|
||||
Original: fxmorin/carpet-fixes
|
||||
Copyright (C) 2023 fxmorin
|
||||
|
||||
The game determines the child sheep's color by getting a wool block from the parents, putting them in a crafting
|
||||
recipe, getting the output wool and getting the color from that.
|
||||
I don't know in what world we would consider a data-driven method with that much overhead as a smart idea. Instead,
|
||||
we used a prebaked list of all the possible colors and combinations, however this means that you can't use a
|
||||
datapack to change it.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
index 54de1f782e45cb3e3b1442aeb56b6e8547b065c0..3b873dd76c0f10a7f29206e46c1bf9b230555170 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
@@ -432,19 +432,27 @@ public class Sheep extends Animal implements Shearable {
|
||||
}
|
||||
|
||||
private DyeColor getOffspringColor(Animal firstParent, Animal secondParent) {
|
||||
+ // Plazma start - CarpetFixes - Optimized sheep child color
|
||||
DyeColor enumcolor = ((Sheep) firstParent).getColor();
|
||||
DyeColor enumcolor1 = ((Sheep) secondParent).getColor();
|
||||
- CraftingContainer inventorycrafting = Sheep.makeContainer(enumcolor, enumcolor1);
|
||||
- Optional<Item> optional = this.level().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, inventorycrafting, this.level()).map((recipecrafting) -> { // CraftBukkit - decompile error
|
||||
- return recipecrafting.assemble(inventorycrafting, this.level().registryAccess());
|
||||
- }).map(ItemStack::getItem);
|
||||
-
|
||||
- Objects.requireNonNull(DyeItem.class);
|
||||
- optional = optional.filter(DyeItem.class::isInstance);
|
||||
- Objects.requireNonNull(DyeItem.class);
|
||||
- return (DyeColor) optional.map(DyeItem.class::cast).map(DyeItem::getDyeColor).orElseGet(() -> {
|
||||
- return this.level().random.nextBoolean() ? enumcolor : enumcolor1;
|
||||
- });
|
||||
+ if (this.level().plazmaLevelConfiguration().carpetFixes.optimizedSheepChildColor()) {
|
||||
+ DyeColor col = org.plazmamc.plazma.util.CarpetFixesUtils.properDyeMixin(enumcolor, enumcolor1);
|
||||
+ if (col == null) col = this.level().random.nextBoolean() ? enumcolor : enumcolor1;
|
||||
+ return col;
|
||||
+ } else {
|
||||
+ CraftingContainer inventorycrafting = Sheep.makeContainer(enumcolor, enumcolor1);
|
||||
+ Optional<Item> optional = this.level().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, inventorycrafting, this.level()).map((recipecrafting) -> { // CraftBukkit - decompile error
|
||||
+ return recipecrafting.assemble(inventorycrafting, this.level().registryAccess());
|
||||
+ }).map(ItemStack::getItem);
|
||||
+
|
||||
+ Objects.requireNonNull(DyeItem.class);
|
||||
+ optional = optional.filter(DyeItem.class::isInstance);
|
||||
+ Objects.requireNonNull(DyeItem.class);
|
||||
+ return (DyeColor) optional.map(DyeItem.class::cast).map(DyeItem::getDyeColor).orElseGet(() -> {
|
||||
+ return this.level().random.nextBoolean() ? enumcolor : enumcolor1;
|
||||
+ });
|
||||
+ }
|
||||
+ // Plazma end
|
||||
}
|
||||
|
||||
private static CraftingContainer makeContainer(DyeColor firstColor, DyeColor secondColor) {
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
index e089a881600b61060bae1135b89703f6c0b5c7e8..29d451f55dabc15478e9c32d2c37bd0ea2d9bebc 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
||||
@@ -138,10 +138,15 @@ public class LevelConfigurations extends ConfigurationPart {
|
||||
|
||||
public boolean enabled = DO_OPTIMIZE;
|
||||
boolean optimizedRecipeManager = true;
|
||||
+ boolean optimizedSheepChildColor = false;
|
||||
|
||||
public boolean optimizedRecipeManager() {
|
||||
return enabled && optimizedRecipeManager;
|
||||
}
|
||||
|
||||
+ public boolean optimizedSheepChildColor() {
|
||||
+ return enabled && optimizedSheepChildColor;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java b/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..aae3cf170bca4b3e6cdd0a964967dfafe2759f65
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java
|
||||
@@ -0,0 +1,48 @@
|
||||
+package org.plazmamc.plazma.util;
|
||||
+
|
||||
+import net.minecraft.world.item.DyeColor;
|
||||
+
|
||||
+public class CarpetFixesUtils {
|
||||
+
|
||||
+ //If I was actually implementing this, the color values would have been binary in order for fast calculations.
|
||||
+ //Never do this in a production build, although this is better than using the RecipeManager xD
|
||||
+ public static DyeColor properDyeMixin(DyeColor col1, DyeColor col2) {
|
||||
+ if (col1.equals(col2)) return col1;
|
||||
+ switch(col1) {
|
||||
+ case WHITE -> {
|
||||
+ switch(col2) {
|
||||
+ case BLUE -> {return DyeColor.LIGHT_BLUE;}
|
||||
+ case GRAY -> {return DyeColor.LIGHT_GRAY;}
|
||||
+ case BLACK -> {return DyeColor.GRAY;}
|
||||
+ case GREEN -> {return DyeColor.LIME;}
|
||||
+ case RED -> {return DyeColor.PINK;}
|
||||
+ }
|
||||
+ }
|
||||
+ case BLUE -> {
|
||||
+ switch(col2) {
|
||||
+ case WHITE -> {return DyeColor.LIGHT_BLUE;}
|
||||
+ case GREEN -> {return DyeColor.CYAN;}
|
||||
+ case RED -> {return DyeColor.PURPLE;}
|
||||
+ }
|
||||
+ }
|
||||
+ case RED -> {
|
||||
+ switch(col2) {
|
||||
+ case YELLOW -> {return DyeColor.ORANGE;}
|
||||
+ case WHITE -> {return DyeColor.PINK;}
|
||||
+ case BLUE -> {return DyeColor.PURPLE;}
|
||||
+ }
|
||||
+ }case GREEN -> {
|
||||
+ switch(col2) {
|
||||
+ case BLUE -> {return DyeColor.CYAN;}
|
||||
+ case WHITE -> {return DyeColor.LIME;}
|
||||
+ }
|
||||
+ }
|
||||
+ case YELLOW -> {if (col2.equals(DyeColor.RED)) return DyeColor.ORANGE;}
|
||||
+ case PURPLE -> {if (col2.equals(DyeColor.PINK)) return DyeColor.MAGENTA;}
|
||||
+ case PINK -> {if (col2.equals(DyeColor.PURPLE)) return DyeColor.MAGENTA;}
|
||||
+ case GRAY -> {if (col2.equals(DyeColor.WHITE)) return DyeColor.LIGHT_GRAY;}
|
||||
+ case BLACK -> {if (col2.equals(DyeColor.WHITE)) return DyeColor.GRAY;}
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+}
|
||||
@@ -0,0 +1,91 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Mon, 10 Jun 2024 12:27:08 -0300
|
||||
Subject: [PATCH] Add ClientboundPacketPreDispatchEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/sparklypower/sparklypaper/event/packet/ClientboundPacketPreDispatchEvent.java b/src/main/java/net/sparklypower/sparklypaper/event/packet/ClientboundPacketPreDispatchEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9a279ad0b0f9b63f5f3a37977076e0bb805cd56d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/sparklypower/sparklypaper/event/packet/ClientboundPacketPreDispatchEvent.java
|
||||
@@ -0,0 +1,79 @@
|
||||
+package net.sparklypower.sparklypaper.event.packet;
|
||||
+
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Called before a packet is dispatched to a connection.
|
||||
+ * <p>
|
||||
+ * Compared to other solutions like ProtocolLib, this has the advantage that this is called eariler on the packet sending cycle, before the packet is added to the packet queue, allowing for
|
||||
+ * main thread access of resources without worrying about race conditions.
|
||||
+ * <p>
|
||||
+ * The asynchronously state of this event is undefined, the event may be called on an async or on a sync thread, depending on where the packet was sent.
|
||||
+ */
|
||||
+public class ClientboundPacketPreDispatchEvent extends Event implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean isCancelled = false;
|
||||
+ private final Player player;
|
||||
+ private Object packet;
|
||||
+
|
||||
+ public ClientboundPacketPreDispatchEvent(boolean isAsync, @Nullable Player player, @NotNull Object packet) {
|
||||
+ super(isAsync);
|
||||
+ this.player = player;
|
||||
+ this.packet = packet;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the player associated with this packet.
|
||||
+ * <p>
|
||||
+ * Depending on which phase the packet is from, the player may be null
|
||||
+ *
|
||||
+ * @return the player associated with this packet
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Player getPlayer() {
|
||||
+ return player;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the packet associated with this event.
|
||||
+ *
|
||||
+ * @return the packet associated with this event
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Object getPacket() {
|
||||
+ return packet;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the packet associated with this event.
|
||||
+ */
|
||||
+ public void setPacket(@NotNull Object packet) {
|
||||
+ this.packet = packet;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return isCancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.isCancelled = cancel;
|
||||
+ }
|
||||
+}
|
||||
@@ -0,0 +1,76 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Mon, 10 Jun 2024 14:38:59 -0300
|
||||
Subject: [PATCH] Add PlayerBlockDestroySpeedEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/sparklypower/sparklypaper/event/block/PlayerBlockDestroySpeedEvent.java b/src/main/java/net/sparklypower/sparklypaper/event/block/PlayerBlockDestroySpeedEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d5e097dad04ed62088aade42ba59866029369326
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/sparklypower/sparklypaper/event/block/PlayerBlockDestroySpeedEvent.java
|
||||
@@ -0,0 +1,64 @@
|
||||
+package net.sparklypower.sparklypaper.event.block;
|
||||
+
|
||||
+import org.bukkit.block.Block;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.block.BlockEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when the block destroy speed is calculated for a block that a player is breaking.
|
||||
+ * <p>
|
||||
+ * Useful for custom blocks to override a server side block destroy speed to fix desynchronization issues between the server and the client. (Example: Chiseled bookshelves on the server side that are overriden by target blocks on the client side)
|
||||
+ * <p>
|
||||
+ * Keep in mind that you should use this event to synchronize the block destroy speed between the server and the client! Not keeping both destroy speeds in sync will cause desync issues!
|
||||
+ */
|
||||
+public class PlayerBlockDestroySpeedEvent extends BlockEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final Player player;
|
||||
+ private float destroySpeed;
|
||||
+
|
||||
+ public PlayerBlockDestroySpeedEvent(@NotNull Player player, @NotNull Block block, float destroySpeed) {
|
||||
+ super(block);
|
||||
+ this.player = player;
|
||||
+ this.destroySpeed = destroySpeed;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the Player that is breaking the block involved in this event.
|
||||
+ *
|
||||
+ * @return The Player that is breaking the block involved in this event
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Player getPlayer() {
|
||||
+ return player;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the block destroy speed of the block involved in this event.
|
||||
+ *
|
||||
+ * @return the block destroy speed of the block involved in this event.
|
||||
+ */
|
||||
+ public float getDestroySpeed() {
|
||||
+ return destroySpeed;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the block destroy speed of the block involved in this event.
|
||||
+ */
|
||||
+ public void setDestroySpeed(float destroySpeed) {
|
||||
+ this.destroySpeed = destroySpeed;
|
||||
+ }
|
||||
+}
|
||||
@@ -0,0 +1,83 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Tue, 25 Jun 2024 02:54:47 -0300
|
||||
Subject: [PATCH] Add CraftItemRecipeEvent
|
||||
|
||||
Used when a player OR a crafter block crafts an item, as an alternative to PrepareItemCraftEvent and CraftItemEvent, because both events are not triggered when a item is crafted from a crafter
|
||||
|
||||
diff --git a/src/main/java/net/sparklypower/sparklypaper/event/inventory/CraftItemRecipeEvent.java b/src/main/java/net/sparklypower/sparklypaper/event/inventory/CraftItemRecipeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..129e5244fd0928fc21d9aa7d4bc28e89c1408be0
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/sparklypower/sparklypaper/event/inventory/CraftItemRecipeEvent.java
|
||||
@@ -0,0 +1,70 @@
|
||||
+package net.sparklypower.sparklypaper.event.inventory;
|
||||
+
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.inventory.*;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Called when the recipe of an Item is completed inside a crafting matrix.
|
||||
+ *
|
||||
+ * This is an alternate version of [org.bukkit.event.inventory.CraftItemEvent], where this one is called for player crafting items and crafters.
|
||||
+ */
|
||||
+public class CraftItemRecipeEvent extends Event implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final Recipe recipe;
|
||||
+ private final ItemStack @Nullable [] matrix;
|
||||
+ private ItemStack result;
|
||||
+ private boolean isCancelled = false;
|
||||
+
|
||||
+ public CraftItemRecipeEvent(@NotNull ItemStack @Nullable [] matrix, @NotNull Recipe recipe, @Nullable ItemStack result) {
|
||||
+ this.matrix = matrix;
|
||||
+ this.recipe = recipe;
|
||||
+ this.result = result;
|
||||
+ }
|
||||
+
|
||||
+ public void setResult(@Nullable ItemStack result) {
|
||||
+ this.result = result;
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public ItemStack getResult() {
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return A copy of the current recipe on the crafting matrix.
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Recipe getRecipe() {
|
||||
+ return recipe;
|
||||
+ }
|
||||
+
|
||||
+ public @Nullable ItemStack[] getCraftingMatrix() {
|
||||
+ return matrix;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return isCancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.isCancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
@@ -0,0 +1,61 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Wed, 12 Jun 2024 11:53:27 -0300
|
||||
Subject: [PATCH] SPARKLYPOWER Add custom blocks
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
index 41eaa8159f8c028faa118300e95f6a0fb9cfe989..5b5ddb19b39d5201da422f9b10e2491ab9334925 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
@@ -83,6 +83,7 @@ public class MaterialTags {
|
||||
*/
|
||||
public static final MaterialSetTag CONCRETES = new MaterialSetTag(keyFor("concretes"))
|
||||
.endsWith("_CONCRETE")
|
||||
+ .notStartsWith("SPARKLYPOWER_") // SparklyPaper - custom blocks
|
||||
.ensureSize("CONCRETES", 16).lock();
|
||||
|
||||
/**
|
||||
@@ -161,6 +162,7 @@ public class MaterialTags {
|
||||
.endsWith("TERRACOTTA")
|
||||
.not(Material.TERRACOTTA)
|
||||
.notEndsWith("GLAZED_TERRACOTTA")
|
||||
+ .notStartsWith("SPARKLYPOWER_") // SparklyPaper - custom blocks
|
||||
.ensureSize("STAINED_TERRACOTTA", 16).lock();
|
||||
|
||||
/**
|
||||
@@ -168,6 +170,7 @@ public class MaterialTags {
|
||||
*/
|
||||
public static final MaterialSetTag TERRACOTTA = new MaterialSetTag(keyFor("terracotta"))
|
||||
.endsWith("TERRACOTTA")
|
||||
+ .notStartsWith("SPARKLYPOWER_") // SparklyPaper - custom blocks
|
||||
.ensureSize("TERRACOTTA", 33).lock();
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 028ac35df6c4d044d07b3869751736d418c1eb0e..dd9795e0725275b0fe5a3f4ecfd4d587a23f963f 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -3843,6 +3843,22 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
BIG_DRIPLEAF_STEM(13167, Dripleaf.class),
|
||||
POTTED_AZALEA_BUSH(20430),
|
||||
POTTED_FLOWERING_AZALEA_BUSH(10609),
|
||||
+ // SparklyPaper start - SparklyPower Survival custom blocks
|
||||
+ // The IDs themselves doesn't have any correlation with anything, Spigot invented that for backwards compatibility
|
||||
+ SPARKLYPOWER_RAINBOW_WOOL(13003),
|
||||
+ SPARKLYPOWER_RAINBOW_CONCRETE(13004),
|
||||
+ SPARKLYPOWER_RAINBOW_TERRACOTTA(13005),
|
||||
+ SPARKLYPOWER_ASPHALT_SERVER(13006),
|
||||
+ /**
|
||||
+ * BlockData: {@link Slab}
|
||||
+ */
|
||||
+ SPARKLYPOWER_ASPHALT_SERVER_SLAB(13007, Slab.class),
|
||||
+ SPARKLYPOWER_ASPHALT_PLAYER(13008),
|
||||
+ /**
|
||||
+ * BlockData: {@link Slab}
|
||||
+ */
|
||||
+ SPARKLYPOWER_ASPHALT_PLAYER_SLAB(13009, Slab.class),
|
||||
+ // SparklyPaper end
|
||||
// ----- Legacy Separator -----
|
||||
@Deprecated(since = "1.13")
|
||||
LEGACY_AIR(0, 0),
|
||||
@@ -0,0 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Raneri <kevin.raneri@gmail.com>
|
||||
Date: Tue, 9 Nov 2021 14:33:16 -0500
|
||||
Subject: [PATCH] Optimize entity coordinate key
|
||||
|
||||
When executing getCoordinateKey for entities (a hotpath), the JVM is
|
||||
required to repeatedly cast doubles to longs. The performance impact of
|
||||
this depends on the CPU architecture, but generally switching between
|
||||
FPU and ALU incurs a significant performance hit. The casted/rounded
|
||||
data is already available in the blockPosition struct, so we use that
|
||||
instead of re-doing the casting.
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
index 1d6b3fe2ce240af4ede61588795456b046eee6c9..cdcb1bff7913bfe86fed008271016a3175b6df90 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
@@ -215,7 +215,7 @@ public final class MCUtil {
|
||||
}
|
||||
|
||||
public static long getCoordinateKey(final Entity entity) {
|
||||
- return ((long)(MCUtil.fastFloor(entity.getZ()) >> 4) << 32) | ((MCUtil.fastFloor(entity.getX()) >> 4) & 0xFFFFFFFFL);
|
||||
+ return ((long)(entity.blockPosition.getZ() >> 4) << 32) | ((entity.blockPosition.getX() >> 4) & 0xFFFFFFFFL); // Pufferfish - eliminate double->long cast in hotpath
|
||||
}
|
||||
|
||||
public static long getCoordinateKey(final ChunkPos pair) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 4ee843dfd826772c9157ca421d8fe1f36f814b51..41ce41e92f3722e7ffb3423c90663d7a677bf277 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -311,7 +311,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public double yo;
|
||||
public double zo;
|
||||
private Vec3 position;
|
||||
- private BlockPos blockPosition;
|
||||
+ public BlockPos blockPosition; // Pufferfish - private->public
|
||||
private ChunkPos chunkPosition;
|
||||
private Vec3 deltaMovement;
|
||||
private float yRot;
|
||||
@@ -0,0 +1,55 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Sat, 18 Nov 2023 21:04:53 -0300
|
||||
Subject: [PATCH] Avoid unnecessary ItemFrame#getItem() calls
|
||||
|
||||
When ticking a item frame, on each tick, it checks if the item on the item frame is a map and, if it is, it adds the map to be carried by the entity player
|
||||
|
||||
However, the "getItem()" call is a bit expensive, especially because this is only really used if the item in the item frame is a map
|
||||
|
||||
We can avoid this call by checking if the "cachedMapId" is not null
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index aedf24ba0d64de855a59869052cbc2704e7dc134..f49585cfd485eed504e91887599ff25c3238c8fd 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -115,13 +115,14 @@ public class ServerEntity {
|
||||
ItemFrame entityitemframe = (ItemFrame) entity;
|
||||
|
||||
if (true || this.tickCount % 10 == 0) { // CraftBukkit - Moved below, should always enter this block
|
||||
- ItemStack itemstack = entityitemframe.getItem();
|
||||
-
|
||||
- if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable
|
||||
+ if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && entityitemframe.cachedMapId != null) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable // SparklyPaper - avoid unnecessary ItemFrame#getItem() calls
|
||||
Integer integer = entityitemframe.cachedMapId; // Paper
|
||||
MapItemSavedData worldmap = MapItem.getSavedData(integer, this.level);
|
||||
|
||||
if (worldmap != null) {
|
||||
+ // SparklyPaper start - avoid unnecessary ItemFrame#getItem() calls
|
||||
+ ItemStack itemstack = entityitemframe.getItem();
|
||||
+ if (itemstack.getItem() instanceof MapItem) { // fail-safe, what if the cached map ID is present but the item isn't a MapItem? (this should NEVER happen but, who knows)
|
||||
Iterator<ServerPlayerConnection> iterator = this.trackedPlayers.iterator(); // CraftBukkit
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -134,6 +135,7 @@ public class ServerEntity {
|
||||
entityplayer.connection.send(packet);
|
||||
}
|
||||
}
|
||||
+ } // SparklyPaper end
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
index 759ecd79534a7706f7d4a63eb9dacbefcfe54674..07739c3d74074b2668466250f944dfbe22d4dc86 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
@@ -50,7 +50,8 @@ public class ItemFrame extends HangingEntity {
|
||||
public static final int NUM_ROTATIONS = 8;
|
||||
public float dropChance;
|
||||
public boolean fixed;
|
||||
- public Integer cachedMapId; // Paper
|
||||
+ @Nullable // SparklyPaper - avoid unnecessary ItemFrame#getItem() calls
|
||||
+ public Integer cachedMapId = null; // Paper // SparklyPaper - avoid unnecessary ItemFrame#getItem() calls
|
||||
|
||||
public ItemFrame(EntityType<? extends ItemFrame> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -0,0 +1,44 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Sun, 22 Oct 2023 12:27:26 -0300
|
||||
Subject: [PATCH] Only check thundering once per world instead for every chunk
|
||||
|
||||
For some reason the isThundering check is consuming ~3% of CPU time when profiled so, instead of checking the thunder every chunk, we can cache the result and reuse on the same chunk tick
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index c02ffd419236980cd063741612e99d739d97ec94..daa5948cc7b86a719a313ea595f135cd00b6a3cc 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -599,6 +599,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
// Paper end - optimise chunk tick iteration
|
||||
|
||||
+ this.level.isCurrentlyThundering = this.level.isThundering_old(); // SparklyPaper - Only check thundering once per world instead for every chunk
|
||||
int chunksTicked = 0; // Paper
|
||||
// Paper start - optimise chunk tick iteration
|
||||
io.papermc.paper.util.player.NearbyPlayers nearbyPlayers = this.chunkMap.getNearbyPlayers(); // Paper - optimise chunk tick iteration
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 9388dd9b34bb8148ce8b5f7e24122fa4bd1bafa8..0210226d2185803a18c0020d7985c1fccb798953 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -184,6 +184,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
private int tileTickPosition;
|
||||
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
||||
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here
|
||||
+ public boolean isCurrentlyThundering; // SparklyPaper - Only check if the world is currently thundering once instead for every chunk
|
||||
|
||||
// Paper start - fix and optimise world upgrading
|
||||
// copied from below
|
||||
@@ -1614,7 +1615,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
this.rainLevel = f1;
|
||||
}
|
||||
|
||||
+ // SparklyPaper start - Only check thundering once per world instead for every chunk
|
||||
public boolean isThundering() {
|
||||
+ return isCurrentlyThundering;
|
||||
+ }
|
||||
+ public boolean isThundering_old() {
|
||||
+ // SparklyPaper end
|
||||
return this.dimensionType().hasSkyLight() && !this.dimensionType().hasCeiling() ? (double) this.getThunderLevel(1.0F) > 0.9D : false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Sat, 28 Oct 2023 19:02:12 -0300
|
||||
Subject: [PATCH] Optimize heavy EntityLookup.ArrayIterable.<init>() calls on
|
||||
tickChunks
|
||||
|
||||
For some reason, on SparklyPower allocating an ArrayIterable is expensive, taking around ~2.5% of tick time (I have no idea why tho), because tickChunks() only uses this for the NaturalSpawner, let's avoid the array allocation by passing thru the raw array data + size
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||
index 15ee41452992714108efe53b708b5a4e1da7c1ff..f5a5796dda9e0e05ed9afc069c241dedd9aaffa0 100644
|
||||
--- a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||
@@ -198,6 +198,12 @@ public final class EntityLookup implements LevelEntityGetter<Entity> {
|
||||
return Arrays.copyOf(this.accessibleEntities.getRawData(), this.accessibleEntities.size(), Entity[].class);
|
||||
}
|
||||
|
||||
+ // SparklyPaper start - Optimize heavy EntityLookup$ArrayIterable.<init>() calls on tickChunks
|
||||
+ public EntityList getAccessibleEntities() {
|
||||
+ return this.accessibleEntities;
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
+
|
||||
@Override
|
||||
public <U extends Entity> void get(final EntityTypeTest<Entity, U> filter, final AbortableIterationConsumer<U> action) {
|
||||
final Int2ReferenceOpenHashMap<Entity> entityCopy;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index f8270b78ab0d561e55301e989d80fe7b4118337a..e51d06140153e7f9a6e41b20addf02ec94e0f72c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -545,9 +545,9 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
// Paper end - per player mob spawning backoff
|
||||
}
|
||||
- spawnercreature_d = NaturalSpawner.createState(l, this.level.getAllEntities(), this::getFullChunk, null, true);
|
||||
+ spawnercreature_d = NaturalSpawner.createState(l, this.level.getEntityLookup().getAccessibleEntities().getRawData(), this.level.getEntityLookup().getAccessibleEntities().size(), this::getFullChunk, null, true); // SparklyPaper - Optimize heavy EntityLookup$ArrayIterable.<init>() calls on tickChunks
|
||||
} else {
|
||||
- spawnercreature_d = NaturalSpawner.createState(l, this.level.getAllEntities(), this::getFullChunk, !this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new LocalMobCapCalculator(this.chunkMap) : null, false);
|
||||
+ spawnercreature_d = NaturalSpawner.createState(l, this.level.getEntityLookup().getAccessibleEntities().getRawData(), this.level.getEntityLookup().getAccessibleEntities().size(), this::getFullChunk, !this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new LocalMobCapCalculator(this.chunkMap) : null, false); // SparklyPaper - Optimize heavy EntityLookup$ArrayIterable.<init>() calls on tickChunks
|
||||
}
|
||||
// Paper end
|
||||
this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index 9c2d62feff1816f5729060c6192269a5b2d34153..78bcb0af0735fe0ccf68ed06d8dc78d6e8c37064 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -74,7 +74,60 @@ public final class NaturalSpawner {
|
||||
return createState(spawningChunkCount, entities, chunkSource, densityCapper, false);
|
||||
}
|
||||
|
||||
+ // SparklyPaper start - Optimize heavy EntityLookup$ArrayIterable.<init>() calls on tickChunks
|
||||
+ public static NaturalSpawner.SpawnState createState(int spawningChunkCount, Entity[] entities, int count, NaturalSpawner.ChunkGetter chunkSource, LocalMobCapCalculator densityCapper, boolean countMobs) {
|
||||
+ PotentialCalculator spawnercreatureprobabilities = new PotentialCalculator();
|
||||
+ Object2IntOpenHashMap<MobCategory> object2intopenhashmap = new Object2IntOpenHashMap();
|
||||
+
|
||||
+ for (int index = 0; count > index; index++) {
|
||||
+ Entity entity = entities[index];
|
||||
+
|
||||
+ if (entity instanceof Mob) {
|
||||
+ Mob entityinsentient = (Mob) entity;
|
||||
+
|
||||
+ if (entityinsentient.isPersistenceRequired() || entityinsentient.requiresCustomPersistence()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ MobCategory enumcreaturetype = entity.getType().getCategory();
|
||||
+
|
||||
+ if (enumcreaturetype != MobCategory.MISC) {
|
||||
+ // Paper start - Only count natural spawns
|
||||
+ if (!entity.level().paperConfig().entities.spawning.countAllMobsForSpawning &&
|
||||
+ !(entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL ||
|
||||
+ entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ BlockPos blockposition = entity.blockPosition();
|
||||
+
|
||||
+ chunkSource.query(ChunkPos.asLong(blockposition), (chunk) -> {
|
||||
+ MobSpawnSettings.MobSpawnCost biomesettingsmobs_b = NaturalSpawner.getRoughBiome(blockposition, chunk).getMobSettings().getMobSpawnCost(entity.getType());
|
||||
+
|
||||
+ if (biomesettingsmobs_b != null) {
|
||||
+ spawnercreatureprobabilities.addCharge(entity.blockPosition(), biomesettingsmobs_b.charge());
|
||||
+ }
|
||||
+
|
||||
+ if (densityCapper != null && entity instanceof Mob) { // Paper
|
||||
+ densityCapper.addMob(chunk.getPos(), enumcreaturetype);
|
||||
+ }
|
||||
+
|
||||
+ object2intopenhashmap.addTo(enumcreaturetype, 1);
|
||||
+ // Paper start
|
||||
+ if (countMobs) {
|
||||
+ chunk.level.getChunkSource().chunkMap.updatePlayerMobTypeMap(entity);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ });
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return new NaturalSpawner.SpawnState(spawningChunkCount, object2intopenhashmap, spawnercreatureprobabilities, densityCapper);
|
||||
+ }
|
||||
+
|
||||
public static NaturalSpawner.SpawnState createState(int spawningChunkCount, Iterable<Entity> entities, NaturalSpawner.ChunkGetter chunkSource, LocalMobCapCalculator densityCapper, boolean countMobs) {
|
||||
+ // SparklyPaper end
|
||||
// Paper end
|
||||
PotentialCalculator spawnercreatureprobabilities = new PotentialCalculator();
|
||||
Object2IntOpenHashMap<MobCategory> object2intopenhashmap = new Object2IntOpenHashMap();
|
||||
@@ -0,0 +1,93 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Fri, 24 Nov 2023 23:37:24 -0300
|
||||
Subject: [PATCH] BlockEntityTickersList optimization tests
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 94eac6837c06e6fd192c108632f1e365a008d6ad..3588657da9969b4207bbeb8109bc101384c03398 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1274,8 +1274,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// Iterator iterator = this.blockEntityTickers.iterator();
|
||||
int tilesThisCycle = 0;
|
||||
// SparklyPaper start - optimize tickBlockEntities
|
||||
- // var toRemove = new it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet<TickingBlockEntity>(net.minecraft.Util.identityStrategy()); // Paper - use removeAll
|
||||
- // toRemove.add(null);
|
||||
+ var toRemoveOld = new it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet<TickingBlockEntity>(net.minecraft.Util.identityStrategy()); // Paper - use removeAll
|
||||
+ toRemoveOld.add(null);
|
||||
var toRemove = new java.util.HashSet<Integer>(); // For some reason, Java's HashSet seems to be faster than fastutil's only if we are removing HUGE amounts of tile entities, idk why
|
||||
var startSearchFromIndex = -1;
|
||||
var shouldTickBlocksAtLastResult = -1; // -1 = undefined
|
||||
@@ -1301,13 +1301,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// Spigot start
|
||||
tilesThisCycle--;
|
||||
// SparklyPaper start - optimize tickBlockEntities
|
||||
- // toRemove.add(tickingblockentity); // Paper - use removeAll
|
||||
+ toRemoveOld.add(tickingblockentity); // Paper - use removeAll
|
||||
toRemove.add(tileTickPosition);
|
||||
if (startSearchFromIndex == -1)
|
||||
startSearchFromIndex = tileTickPosition;
|
||||
// SparklyPaper end
|
||||
// Spigot end
|
||||
- // } else if (this.shouldTickBlocksAt(tickingblockentity.getPos())) { // SparklyPaper start - optimize tickBlockEntities
|
||||
+ // } else if (this.shouldTickBlocksAt(tickingblockentity.getPos())) { // SparklyPaper start - optimize tickBlockEntities
|
||||
} else {
|
||||
long chunkPos = tickingblockentity.getChunkCoordinateKey();
|
||||
boolean shouldTick;
|
||||
@@ -1319,18 +1319,47 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
shouldTickBlocksAtChunkPos = chunkPos;
|
||||
}
|
||||
if (shouldTick) {
|
||||
- tickingblockentity.tick();
|
||||
- // Paper start - execute chunk tasks during tick
|
||||
- if ((this.tileTickPosition & 7) == 0) {
|
||||
- // MinecraftServer.getServer().executeMidTickTasks(); // SparklyPaper - parallel world ticking (only run mid-tick at the end of each tick / fixes concurrency bugs related to executeMidTickTasks)
|
||||
- }
|
||||
- // Paper end - execute chunk tasks during tick
|
||||
+ tickingblockentity.tick();
|
||||
+ // Paper start - execute chunk tasks during tick
|
||||
+ if ((this.tileTickPosition & 7) == 0) {
|
||||
+ // MinecraftServer.getServer().executeMidTickTasks(); // SparklyPaper - parallel world ticking (only run mid-tick at the end of each tick / fixes concurrency bugs related to executeMidTickTasks)
|
||||
+ }
|
||||
+ // Paper end - execute chunk tasks during tick
|
||||
} // SparklyPaper end
|
||||
}
|
||||
}
|
||||
// SparklyPaper start - optimize tickBlockEntities
|
||||
- // this.blockEntityTickers.removeAll(toRemove);
|
||||
- this.blockEntityTickers.removeAllByIndex(startSearchFromIndex, toRemove); // We don't need to care about if the startSearchFromIndex can be -1 here, since if it is -1, then the toRemove list is empty and the call will fast fail
|
||||
+ java.util.ArrayList<TickingBlockEntity> oldList = new java.util.ArrayList<>(this.blockEntityTickers);
|
||||
+ long diffOld = 0;
|
||||
+ long diffNew = 0;
|
||||
+ if (toRemoveOld.size() != 1) { // the old one always have null as the first element
|
||||
+ var startOld = System.nanoTime();
|
||||
+ oldList.removeAll(toRemoveOld);
|
||||
+ var endOld = System.nanoTime();
|
||||
+ diffOld = endOld - startOld;
|
||||
+ System.out.println("Old version deleted " + toRemoveOld.size() + " elements, took " + diffOld + "ns");
|
||||
+ }
|
||||
+ if (startSearchFromIndex != -1) {
|
||||
+ var start = System.nanoTime();
|
||||
+ this.blockEntityTickers.removeAllByIndex(startSearchFromIndex, toRemove); // We don't need to care about if the startSearchFromIndex can be -1 here, since if it is -1, then the toRemove list is empty and the call will fast fail
|
||||
+ var end = System.nanoTime();
|
||||
+ System.out.println("(current tick: " + this.getServer().getTickCount() + ") startSearchFromIndex: " + startSearchFromIndex + " - toRemove: " + toRemove);
|
||||
+ diffNew = end - start;
|
||||
+ System.out.println("New version deleted " + toRemove.size() + " elements, took " + diffNew + "ns");
|
||||
+ }
|
||||
+ if (toRemove.size() != 0) {
|
||||
+ System.out.println("Equals? " + oldList.equals(this.blockEntityTickers));
|
||||
+ String winner = "Unknown";
|
||||
+ long perfIncrease = 0;
|
||||
+ if (diffOld > diffNew) {
|
||||
+ winner = "New Version";
|
||||
+ perfIncrease = diffOld - diffNew;
|
||||
+ } else {
|
||||
+ winner = "Old Version";
|
||||
+ perfIncrease = diffNew - diffOld;
|
||||
+ }
|
||||
+ System.out.println("Who won? " + winner + ", by " + perfIncrease + "ns");
|
||||
+ }
|
||||
// SparklyPaper end
|
||||
this.timings.tileEntityTick.stopTiming(); // Spigot
|
||||
this.tickingBlockEntities = false;
|
||||
@@ -0,0 +1,37 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Sun, 18 Feb 2024 14:22:37 -0300
|
||||
Subject: [PATCH] Revert "Fix MC-117075: Block entity unload lag spike"
|
||||
|
||||
This reverts commit f3453b204569ea865cc1d1302edb6d125e7f0cb3.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 8433caa61a973d81a5eedc44428926e999c21a03..db9eb10c33848ca5b342bf00e4a05738210d26b0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1458,8 +1458,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
int tickedEntities = 0; // Paper - rewrite chunk system
|
||||
|
||||
int tilesThisCycle = 0;
|
||||
- var toRemove = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<TickingBlockEntity>(); // Paper - Fix MC-117075; use removeAll
|
||||
- toRemove.add(null); // Paper - Fix MC-117075
|
||||
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
||||
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
|
||||
@@ -1468,7 +1466,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
if (tickingblockentity.isRemoved()) {
|
||||
// Spigot start
|
||||
tilesThisCycle--;
|
||||
- toRemove.add(tickingblockentity); // Paper - Fix MC-117075; use removeAll
|
||||
+ this.blockEntityTickers.remove(this.tileTickPosition--);
|
||||
// Spigot end
|
||||
} else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
||||
tickingblockentity.tick();
|
||||
@@ -1479,7 +1477,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
}
|
||||
- this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
||||
|
||||
this.tickingBlockEntities = false;
|
||||
gameprofilerfiller.pop();
|
||||
@@ -0,0 +1,123 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Sun, 26 Nov 2023 13:11:10 -0300
|
||||
Subject: [PATCH] Optimize tickBlockEntities
|
||||
|
||||
We cache the last `shouldTickBlocksAt` result, because the `shouldTickBlocksAt` is expensive because it requires pulling chunk holder info from an map for each block entity (even if the block entities are on the same chunk!) every single time. So, if the last chunk position is the same as our cached value, we use the last cached `shouldTickBlocksAt` result!
|
||||
|
||||
We could use a map for caching, but here's why this is way better than using a map: The block entity ticking list is sorted by chunks! Well, sort of... It is sorted by chunk when the chunk has been loaded, newly placed blocks will be appended to the end of the list until the chunk unloads and loads again. Most block entities are things that players placed to be there for a long time anyway (like hoppers, etc)
|
||||
|
||||
But here's the thing: We don't care if we have a small performance penalty if the players have placed new block entities, the small performance hit of when a player placed new block entities is so small ('tis just a long comparsion after all), that the performance boost from already placed block entities is bigger, this helps a lot if your server has a lot of chunks with multiple block entities, and the block entities will be automatically sorted after the chunk is unloaded and loaded again, so it ain't that bad.
|
||||
|
||||
And finally, we also cache the chunk's coordinate key when creating the block entity, which is actually "free" because we just reuse the already cached chunk coordinate key from the chunk!
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 1e20c525cd0c75079fe971ae830120c69fee362e..97b31dffbaf965e86ad706a1bba7586cd3514ead 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1458,6 +1458,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
int tickedEntities = 0; // Paper - rewrite chunk system
|
||||
|
||||
int tilesThisCycle = 0;
|
||||
+ // SparklyPaper start - optimize tickBlockEntities
|
||||
+ int shouldTickBlocksAtLastResult = -1; // -1 = undefined
|
||||
+ long shouldTickBlocksAtChunkPos = 0L;
|
||||
+ // SparklyPaper end
|
||||
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
||||
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
|
||||
@@ -1468,13 +1472,25 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
tilesThisCycle--;
|
||||
this.blockEntityTickers.markAsRemoved(this.tileTickPosition); // this.blockEntityTickers.remove(this.tileTickPosition--); // SparklyPaper - optimize block entity removals
|
||||
// Spigot end
|
||||
- } else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
||||
+ // } else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) { // SparklyPaper start - optimize tickBlockEntities
|
||||
+ } else if (flag) {
|
||||
+ long chunkPos = tickingblockentity.getChunkCoordinateKey();
|
||||
+ boolean shouldTick;
|
||||
+ if (shouldTickBlocksAtChunkPos == chunkPos && shouldTickBlocksAtLastResult != -1) {
|
||||
+ shouldTick = shouldTickBlocksAtLastResult == 1;
|
||||
+ } else {
|
||||
+ shouldTick = this.shouldTickBlocksAt(chunkPos);
|
||||
+ shouldTickBlocksAtLastResult = shouldTick ? 1 : 0;
|
||||
+ shouldTickBlocksAtChunkPos = chunkPos;
|
||||
+ }
|
||||
+ if (shouldTick) {
|
||||
tickingblockentity.tick();
|
||||
// Paper start - rewrite chunk system
|
||||
if ((++tickedEntities & 7) == 0) {
|
||||
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)(Level)(Object)this).moonrise$midTickTasks();
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
+ } // SparklyPaper end
|
||||
}
|
||||
}
|
||||
this.blockEntityTickers.removeMarkedEntries(); // SparklyPaper - optimize block entity removals
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 4640baec5bed6c2d53cc0f8ca1d273cc115abe9b..b4c16fe7c9215b5610b7e7488c29b497b5357ecc 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -75,6 +75,13 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
public String getType() {
|
||||
return "<null>";
|
||||
}
|
||||
+
|
||||
+ // SparklyPaper start - optimize tickBlockEntities
|
||||
+ @Override
|
||||
+ public long getChunkCoordinateKey() {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
};
|
||||
private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel;
|
||||
public boolean loaded;
|
||||
@@ -981,7 +988,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
}
|
||||
|
||||
private <T extends BlockEntity> TickingBlockEntity createTicker(T blockEntity, BlockEntityTicker<T> blockEntityTicker) {
|
||||
- return new LevelChunk.BoundTickingBlockEntity<>(blockEntity, blockEntityTicker);
|
||||
+ return new LevelChunk.BoundTickingBlockEntity<>(blockEntity, blockEntityTicker, this.coordinateKey); // SparklyPaper - optimize tickBlockEntities
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
@@ -1038,6 +1045,13 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
public String toString() {
|
||||
return String.valueOf(this.ticker) + " <wrapped>";
|
||||
}
|
||||
+
|
||||
+ // SparklyPaper start - optimize tickBlockEntities
|
||||
+ @Override
|
||||
+ public long getChunkCoordinateKey() {
|
||||
+ return this.ticker.getChunkCoordinateKey();
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
}
|
||||
|
||||
private class BoundTickingBlockEntity<T extends BlockEntity> implements TickingBlockEntity {
|
||||
@@ -1045,10 +1059,12 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
private final T blockEntity;
|
||||
private final BlockEntityTicker<T> ticker;
|
||||
private boolean loggedInvalidBlockState;
|
||||
+ private final long chunkCoordinateKey; // SparklyPaper - optimize tickBlockEntities
|
||||
|
||||
- BoundTickingBlockEntity(final BlockEntity tileentity, final BlockEntityTicker blockentityticker) {
|
||||
+ BoundTickingBlockEntity(final BlockEntity tileentity, final BlockEntityTicker blockentityticker, long chunkCoordinateKey) { // SparklyPaper - optimize tickBlockEntities
|
||||
this.blockEntity = (T) tileentity; // CraftBukkit - decompile error
|
||||
this.ticker = blockentityticker;
|
||||
+ this.chunkCoordinateKey = chunkCoordinateKey; // SparklyPaper - optimize tickBlockEntities
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1112,5 +1128,12 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
|
||||
return "Level ticker for " + s + "@" + String.valueOf(this.getPos());
|
||||
}
|
||||
+
|
||||
+ // SparklyPaper start - optimize tickBlockEntities
|
||||
+ @Override
|
||||
+ public long getChunkCoordinateKey() {
|
||||
+ return this.chunkCoordinateKey;
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Mon, 10 Jun 2024 12:22:15 -0300
|
||||
Subject: [PATCH] Add ClientboundPacketPreDispatchEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index 3e550f8e7cd4f4e16f499a8a2a4b95420270f07a..3bcff05a99662c28cc490579162a1f05b55b1cda 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -450,6 +450,18 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
return;
|
||||
}
|
||||
|
||||
+ // SparklyPaper start - Add ClientboundPacketPreDispatchEvent
|
||||
+ net.minecraft.server.level.ServerPlayer serverPlayer = this.getPlayer();
|
||||
+ org.bukkit.craftbukkit.entity.CraftPlayer craftPlayer = null;
|
||||
+ if (serverPlayer != null)
|
||||
+ craftPlayer = serverPlayer.getBukkitEntity();
|
||||
+ net.sparklypower.sparklypaper.event.packet.ClientboundPacketPreDispatchEvent event = new net.sparklypower.sparklypaper.event.packet.ClientboundPacketPreDispatchEvent(!org.bukkit.Bukkit.isPrimaryThread(), craftPlayer, packet);
|
||||
+ org.bukkit.Bukkit.getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled())
|
||||
+ return;
|
||||
+ packet = (Packet<?>) event.getPacket();
|
||||
+ // SparklyPaper end
|
||||
+
|
||||
packet.onPacketDispatch(this.getPlayer());
|
||||
if (connected && (InnerUtil.canSendImmediate(this, packet)
|
||||
|| (io.papermc.paper.util.MCUtil.isMainThread() && packet.isReady() && this.pendingActions.isEmpty()
|
||||
@@ -0,0 +1,144 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Mon, 10 Jun 2024 13:06:30 -0300
|
||||
Subject: [PATCH] Helpful NMS packet changes
|
||||
|
||||
Some nice changes to the packet internals to make packet sending and manipulation easier for us to avoid Reflection and JVM internals (ooo theUnsafe spooky) usage
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java
|
||||
index f66e40326c510aa3267542b1a24ed75d1ed6d3f1..797640c4f26abb32a480a611820bbcd72e43d1ac 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java
|
||||
@@ -22,7 +22,7 @@ public class ClientboundAddEntityPacket implements Packet<ClientGamePacketListen
|
||||
private static final double LIMIT = 3.9;
|
||||
private final int id;
|
||||
private final UUID uuid;
|
||||
- private final EntityType<?> type;
|
||||
+ public EntityType<?> type; // SparklyPaper - Helpful NMS packet changes: remove final and make public
|
||||
private final double x;
|
||||
private final double y;
|
||||
private final double z;
|
||||
@@ -180,6 +180,32 @@ public class ClientboundAddEntityPacket implements Packet<ClientGamePacketListen
|
||||
return Mth.unpackDegrees(this.yHeadRot);
|
||||
}
|
||||
|
||||
+ // SparklyPaper - Helpful NMS packet changes: expose raw rotational fields
|
||||
+ public int getXaRaw() {
|
||||
+ return this.xa;
|
||||
+ }
|
||||
+
|
||||
+ public int getYaRaw() {
|
||||
+ return this.ya;
|
||||
+ }
|
||||
+
|
||||
+ public int getZaRaw() {
|
||||
+ return this.za;
|
||||
+ }
|
||||
+
|
||||
+ public byte getXRotRaw() {
|
||||
+ return this.xRot;
|
||||
+ }
|
||||
+
|
||||
+ public byte getYRotRaw() {
|
||||
+ return this.yRot;
|
||||
+ }
|
||||
+
|
||||
+ public byte getYHeadRotRaw() {
|
||||
+ return this.yHeadRot;
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
+
|
||||
public int getData() {
|
||||
return this.data;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockUpdatePacket.java
|
||||
index 1e8fad30c5f5be48501c7d8584caedcdc232f6c8..772848cf83a92a8ef8d734949b21f2f1d13e3fcb 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockUpdatePacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockUpdatePacket.java
|
||||
@@ -19,7 +19,7 @@ public class ClientboundBlockUpdatePacket implements Packet<ClientGamePacketList
|
||||
ClientboundBlockUpdatePacket::new
|
||||
);
|
||||
private final BlockPos pos;
|
||||
- public final BlockState blockState;
|
||||
+ public BlockState blockState; // SparklyPaper - Helpful NMS packet changes: remove final
|
||||
|
||||
public ClientboundBlockUpdatePacket(BlockPos pos, BlockState state) {
|
||||
this.pos = pos;
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||
index 0a8d07bf68b0ceabd13c70196d357fce79dcc2c3..0b5abaf11508fa6c6809b73f53d6854aa3b3247c 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.world.level.levelgen.Heightmap;
|
||||
public class ClientboundLevelChunkPacketData {
|
||||
private static final int TWO_MEGABYTES = 2097152;
|
||||
private final CompoundTag heightmaps;
|
||||
- private final byte[] buffer;
|
||||
+ public byte[] buffer; // SparklyPaper - Helpful NMS packet changes: remove final and make public
|
||||
private final List<ClientboundLevelChunkPacketData.BlockEntityInfo> blockEntitiesData;
|
||||
// Paper start - Handle oversized block entities in chunks
|
||||
private final java.util.List<net.minecraft.network.protocol.Packet<?>> extraPackets = new java.util.ArrayList<>();
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java
|
||||
index ab44c24ce5f4570dee9d84b4216299bedfa800d8..99fbb958b82a3398564febb1e87e3ef4efca5b1a 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java
|
||||
@@ -20,6 +20,13 @@ public class ClientboundRotateHeadPacket implements Packet<ClientGamePacketListe
|
||||
this.yHeadRot = headYaw;
|
||||
}
|
||||
|
||||
+ // SparklyPaper start - Helpful NMS packet changes: add entity ID constructor
|
||||
+ public ClientboundRotateHeadPacket(int entityId, byte headYaw) {
|
||||
+ this.entityId = entityId;
|
||||
+ this.yHeadRot = headYaw;
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
+
|
||||
private ClientboundRotateHeadPacket(FriendlyByteBuf buf) {
|
||||
this.entityId = buf.readVarInt();
|
||||
this.yHeadRot = buf.readByte();
|
||||
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 1a37654aff9a9c86c9f7af10a1cf721371f0c5ec..e69ff4e6bb3919340a93ed4c68bdd6c4778669a9 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
||||
@@ -17,9 +17,9 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
|
||||
|
||||
public static final StreamCodec<FriendlyByteBuf, ClientboundSectionBlocksUpdatePacket> STREAM_CODEC = Packet.codec(ClientboundSectionBlocksUpdatePacket::write, ClientboundSectionBlocksUpdatePacket::new);
|
||||
private static final int POS_IN_SECTION_BITS = 12;
|
||||
- private final SectionPos sectionPos;
|
||||
- private final short[] positions;
|
||||
- private final BlockState[] states;
|
||||
+ public SectionPos sectionPos; // SparklyPaper - Helpful NMS packet changes: remove final and make public
|
||||
+ public short[] positions; // SparklyPaper - Helpful NMS packet changes: remove final and make public
|
||||
+ public BlockState[] states; // SparklyPaper - Helpful NMS packet changes: remove final and make public
|
||||
|
||||
public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, ShortSet positions, LevelChunkSection section) {
|
||||
this.sectionPos = sectionPos;
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetCameraPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetCameraPacket.java
|
||||
index 799f5a8c69f295216997d52fb4bc6c56d3a18115..633f10f17eebd43e8dc7c878b9101decf31190a9 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetCameraPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetCameraPacket.java
|
||||
@@ -18,6 +18,12 @@ public class ClientboundSetCameraPacket implements Packet<ClientGamePacketListen
|
||||
this.cameraId = entity.getId();
|
||||
}
|
||||
|
||||
+ // SparklyPaper - Helpful NMS packet changes: add direct entityId constructor
|
||||
+ public ClientboundSetCameraPacket(int entityId) {
|
||||
+ this.cameraId = entityId;
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
+
|
||||
private ClientboundSetCameraPacket(FriendlyByteBuf buf) {
|
||||
this.cameraId = buf.readVarInt();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Display.java b/src/main/java/net/minecraft/world/entity/Display.java
|
||||
index e6cbf4506c75046a89fad778e138b448fb4a29a9..3b705c75b840dbb0e741f46aaa3b98180a27ecf5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Display.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Display.java
|
||||
@@ -802,7 +802,7 @@ public abstract class Display extends Entity {
|
||||
public static final byte FLAG_ALIGN_RIGHT = 16;
|
||||
private static final byte INITIAL_TEXT_OPACITY = -1;
|
||||
public static final int INITIAL_BACKGROUND = 1073741824;
|
||||
- private static final EntityDataAccessor<Component> DATA_TEXT_ID = SynchedEntityData.defineId(Display.TextDisplay.class, EntityDataSerializers.COMPONENT);
|
||||
+ public static final EntityDataAccessor<Component> DATA_TEXT_ID = SynchedEntityData.defineId(Display.TextDisplay.class, EntityDataSerializers.COMPONENT); // SparklyPaper - Helpful NMS packet changes: make public
|
||||
public static final EntityDataAccessor<Integer> DATA_LINE_WIDTH_ID = SynchedEntityData.defineId(Display.TextDisplay.class, EntityDataSerializers.INT);
|
||||
public static final EntityDataAccessor<Integer> DATA_BACKGROUND_COLOR_ID = SynchedEntityData.defineId(
|
||||
Display.TextDisplay.class, EntityDataSerializers.INT
|
||||
@@ -0,0 +1,43 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Mon, 10 Jun 2024 14:39:10 -0300
|
||||
Subject: [PATCH] Add PlayerBlockDestroySpeedEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index 99fd67a78539133adf78d65e2c520ff3dd260301..96640ae707c9babe1c4f4895f39d4d7cfc71a765 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -336,6 +336,14 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
protected float getDestroyProgress(BlockState state, Player player, BlockGetter world, BlockPos pos) {
|
||||
float f = state.getDestroySpeed(world, pos);
|
||||
|
||||
+ // SparklyPaper start - Add PlayerBlockDestroySpeedEvent
|
||||
+ // *Technically* it seems that all getDestroyProgress calls use a LevelAccessor, but anyway...
|
||||
+ if (world instanceof LevelAccessor) {
|
||||
+ net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerBlockDestroySpeedEvent(player, (LevelAccessor) world, pos, f);
|
||||
+ f = event.getDestroySpeed();
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
+
|
||||
if (f == -1.0F) {
|
||||
return 0.0F;
|
||||
} else {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index e37aaf77f94b97b736cc20ef070cefdff0400188..a46f0c810ee2b9679c0530e5e6d3505b3d1f661c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2271,4 +2271,13 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
// Paper end - add EntityFertilizeEggEvent
|
||||
+
|
||||
+ // SparklyPaper start - add PlayerBlockDestroySpeedEvent
|
||||
+ public static net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent callPlayerBlockDestroySpeedEvent(net.minecraft.world.entity.player.Player player, LevelAccessor world, BlockPos blockPos, float destroySpeed) {
|
||||
+ org.bukkit.block.Block block = CraftBlock.at(world, blockPos);
|
||||
+ net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent event = new net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent((Player) player.getBukkitEntity(), block, destroySpeed);
|
||||
+ event.callEvent();
|
||||
+ return event;
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Tue, 25 Jun 2024 02:52:32 -0300
|
||||
Subject: [PATCH] Add CraftItemRecipeEvent
|
||||
|
||||
Used when a player OR a crafter block crafts an item, as an alternative to PrepareItemCraftEvent and CraftItemEvent, because both events are not triggered when a item is crafted from a crafter
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index b5d5dbc50a7b8c40739a15f164ffd08fdc534f9c..01a67fde6c823cac52a6b09720f09acc825d3f86 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -3218,6 +3218,21 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
} else {
|
||||
event = new CraftItemEvent(recipe, inventory, type, packet.getSlotNum(), click, action);
|
||||
}
|
||||
+ // SparklyPaper start - add CraftItemRecipeEvent
|
||||
+ // We will pigback a bit on the current implementation
|
||||
+ net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent craftItemRecipeEvent = new net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent(
|
||||
+ ((CraftingInventory) top).getMatrix(), // We cannot use the top inventory directly because (it seems) that the first slot is the "result" slot
|
||||
+ recipe,
|
||||
+ event.getCurrentItem()
|
||||
+ );
|
||||
+ if (craftItemRecipeEvent.callEvent()) {
|
||||
+ event.setCurrentItem(craftItemRecipeEvent.getResult());
|
||||
+ } else {
|
||||
+ event.setCancelled(true);
|
||||
+ cancelled = true;
|
||||
+ event.setCurrentItem(craftItemRecipeEvent.getResult());
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
|
||||
index 0e609b1e3abd50b415d8376dc550375a8a0251b6..8dbac20e32b70879eeee1c3563948e36c2eae342 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
|
||||
@@ -203,6 +203,13 @@ public class CrafterBlock extends BaseEntityBlock {
|
||||
}
|
||||
itemstack = CraftItemStack.asNMSCopy(event.getResult());
|
||||
// CraftBukkit end
|
||||
+ // SparklyPaper - add CraftItemRecipeEvent
|
||||
+ net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent sparklyEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callCraftItemRecipeEvent(crafterblockentity, recipeholder.toBukkitRecipe(), itemstack);
|
||||
+ if (sparklyEvent.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ itemstack = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(sparklyEvent.getResult());
|
||||
+ // SparklyPaper end
|
||||
if (itemstack.isEmpty()) {
|
||||
world.levelEvent(1050, pos, 0);
|
||||
} else {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index a46f0c810ee2b9679c0530e5e6d3505b3d1f661c..85926a55066ac793b2e4cfe3502f9ab201df91a3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1471,6 +1471,24 @@ public class CraftEventFactory {
|
||||
Bukkit.getPluginManager().callEvent(crafterCraftEvent);
|
||||
return crafterCraftEvent;
|
||||
}
|
||||
+
|
||||
+ // SparklyPaper start - add CraftItemRecipeEvent
|
||||
+ public static net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent callCraftItemRecipeEvent(net.minecraft.world.inventory.CraftingContainer container, Recipe recipe, ItemStack result) {
|
||||
+ org.bukkit.inventory.ItemStack[] matrix = new org.bukkit.inventory.ItemStack[container.getItems().size()];
|
||||
+ int i = 0;
|
||||
+ for (ItemStack item : container.getItems()) {
|
||||
+ matrix[i] = CraftItemStack.asCraftMirror(item);
|
||||
+ i++;
|
||||
+ }
|
||||
+ org.bukkit.inventory.ItemStack bukkitResult = CraftItemStack.asCraftMirror(result);
|
||||
+
|
||||
+ net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent event = new net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent(matrix, recipe, bukkitResult);
|
||||
+ Bukkit.getPluginManager().callEvent(event);
|
||||
+
|
||||
+ return event;
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
+
|
||||
// Paper start
|
||||
@Deprecated
|
||||
public static com.destroystokyo.paper.event.entity.ProjectileCollideEvent callProjectileCollideEvent(Entity entity, EntityHitResult position) {
|
||||
File diff suppressed because it is too large
Load Diff
0
patches/work/.gitkeep
Normal file
0
patches/work/.gitkeep
Normal file
@@ -1,909 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaKR93 <dev@alpha93.kr>
|
||||
Date: Thu, 25 Jan 2024 17:13:09 +0900
|
||||
Subject: [PATCH] Port SparklyPaper patches
|
||||
|
||||
SparklyPower
|
||||
Copyright (C) 2024 SparklyPower
|
||||
|
||||
Based on commit: 29212936a832106c4d68e2a2017acbea2fdd3cc4
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/command/MSPTCommand.java b/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
||||
index 8b5293b0c696ef21d0101493ffa41b60bf0bc86b..03be23690a94a14d7343526acad67ccf53b85c70 100644
|
||||
--- a/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
||||
+++ b/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
||||
@@ -78,6 +78,47 @@ public final class MSPTCommand extends Command {
|
||||
)
|
||||
)
|
||||
);
|
||||
+
|
||||
+ // Plazma start - Port SparklyPaper patches; Track World specific MSPT
|
||||
+ sender.sendMessage(text());
|
||||
+ sender.sendMessage(text().content("World tick times ").color(GOLD)
|
||||
+ .append(text().color(YELLOW)
|
||||
+ .append(
|
||||
+ text("("),
|
||||
+ text("avg", GRAY),
|
||||
+ text("/"),
|
||||
+ text("min", GRAY),
|
||||
+ text("/"),
|
||||
+ text("max", GRAY),
|
||||
+ text(")")
|
||||
+ )
|
||||
+ ).append(
|
||||
+ text(" from last 5s"),
|
||||
+ text(",", GRAY),
|
||||
+ text(" 10s"),
|
||||
+ text(",", GRAY),
|
||||
+ text(" 1m"),
|
||||
+ text(":", YELLOW)
|
||||
+ )
|
||||
+ );
|
||||
+ for (net.minecraft.server.level.ServerLevel level: server.getAllLevels()) {
|
||||
+ List<Component> worldTimes = new ArrayList<>();
|
||||
+ worldTimes.addAll(eval(level.tickTimes5s.getTimes()));
|
||||
+ worldTimes.addAll(eval(level.tickTimes10s.getTimes()));
|
||||
+ worldTimes.addAll(eval(level.tickTimes60s.getTimes()));
|
||||
+
|
||||
+ sender.sendMessage(text().content("◴ " + level.getWorld().getName() + ": ").color(GOLD)
|
||||
+ .append(text().color(GRAY)
|
||||
+ .append(
|
||||
+ worldTimes.get(0), SLASH, worldTimes.get(1), SLASH, worldTimes.get(2), text(", ", YELLOW),
|
||||
+ worldTimes.get(3), SLASH, worldTimes.get(4), SLASH, worldTimes.get(5), text(", ", YELLOW),
|
||||
+ worldTimes.get(6), SLASH, worldTimes.get(7), SLASH, worldTimes.get(8)
|
||||
+ )
|
||||
+ )
|
||||
+ );
|
||||
+ }
|
||||
+ // Plazma end - Port SparklyPaper patches; Track World specific MSPT
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
|
||||
index c03608fec96b51e1867f43d8f42e5aefb1520e46..93180066224345c0332fb33744f84204f15bba29 100644
|
||||
--- a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
|
||||
+++ b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
|
||||
@@ -41,6 +41,7 @@ public final class EntityScheduler {
|
||||
|
||||
private long tickCount = 0L;
|
||||
private static final long RETIRED_TICK_COUNT = -1L;
|
||||
+ private static final net.minecraft.server.MinecraftServer SERVER = net.minecraft.server.MinecraftServer.getServer(); // Plazma - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
||||
private final Object stateLock = new Object();
|
||||
private final Long2ObjectOpenHashMap<List<ScheduledTask>> oneTimeDelayed = new Long2ObjectOpenHashMap<>();
|
||||
|
||||
@@ -61,15 +62,15 @@ public final class EntityScheduler {
|
||||
* @throws IllegalStateException If the scheduler is already retired.
|
||||
*/
|
||||
public void retire() {
|
||||
+ final Entity thisEntity = this.entity.getHandleRaw(); // Plazma - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
||||
synchronized (this.stateLock) {
|
||||
if (this.tickCount == RETIRED_TICK_COUNT) {
|
||||
throw new IllegalStateException("Already retired");
|
||||
}
|
||||
this.tickCount = RETIRED_TICK_COUNT;
|
||||
+ SERVER.entitiesWithScheduledTasks.remove(thisEntity); // Plazma - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
||||
}
|
||||
|
||||
- final Entity thisEntity = this.entity.getHandleRaw();
|
||||
-
|
||||
// correctly handle and order retiring while running executeTick
|
||||
for (int i = 0, len = this.currentlyExecuting.size(); i < len; ++i) {
|
||||
final ScheduledTask task = this.currentlyExecuting.pollFirst();
|
||||
@@ -124,6 +125,7 @@ public final class EntityScheduler {
|
||||
if (this.tickCount == RETIRED_TICK_COUNT) {
|
||||
return false;
|
||||
}
|
||||
+ SERVER.entitiesWithScheduledTasks.add(this.entity.getHandleRaw()); // Plazma - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
||||
this.oneTimeDelayed.computeIfAbsent(this.tickCount + Math.max(1L, delay), (final long keyInMap) -> {
|
||||
return new ArrayList<>();
|
||||
}).add(task);
|
||||
@@ -143,6 +145,12 @@ public final class EntityScheduler {
|
||||
TickThread.ensureTickThread(thisEntity, "May not tick entity scheduler asynchronously");
|
||||
final List<ScheduledTask> toRun;
|
||||
synchronized (this.stateLock) {
|
||||
+ // Plazma start - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
||||
+ if (this.currentlyExecuting.isEmpty() && this.oneTimeDelayed.isEmpty()) {
|
||||
+ SERVER.entitiesWithScheduledTasks.remove(thisEntity);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Plazma end - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
||||
if (this.tickCount == RETIRED_TICK_COUNT) {
|
||||
throw new IllegalStateException("Ticking retired scheduler");
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 94eb4e0686d8235f06ea7950c178cdec8bd6e037..118832d94f96d7624f9faee35b9da0aeb9d9ded8 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -327,6 +327,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("MobSpawning"); // Pufferfish - optimize mob spawning
|
||||
+ public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // Plazma - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
@@ -1776,17 +1777,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
//MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper // Purpur
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
- getAllLevels().forEach(level -> {
|
||||
- for (final Entity entity : level.moonrise$getEntityLookup().getAllCopy()) { // Paper - rewrite chunk system
|
||||
- if (entity.isRemoved()) {
|
||||
- continue;
|
||||
- }
|
||||
- final org.bukkit.craftbukkit.entity.CraftEntity bukkit = entity.getBukkitEntityRaw();
|
||||
- if (bukkit != null) {
|
||||
- bukkit.taskScheduler.executeTick();
|
||||
- }
|
||||
- }
|
||||
- });
|
||||
+ // Plazma start - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
||||
+ for (final Entity entity : entitiesWithScheduledTasks) {
|
||||
+ if (entity.isRemoved() || entity.getBukkitEntityRaw() == null) continue;
|
||||
+ entity.getBukkitEntityRaw().taskScheduler.executeTick();
|
||||
+ }
|
||||
+ // Plazma end - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
||||
// Paper end - Folia scheduler API
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
//this.profiler.push("commandFunctions"); // Purpur
|
||||
@@ -1852,8 +1848,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
//this.profiler.push("tick"); // Purpur
|
||||
|
||||
try {
|
||||
- //worldserver.timings.doTick.startTiming(); // Spigot // Purpur
|
||||
- worldserver.tick(shouldKeepTicking);
|
||||
+ //worldserver.timings.doTick.startTiming(); // Spigot // Purpur// Plazma start - Port SparklyPaper patches; Track World specific MSPT
|
||||
+ long before = Util.getNanos();
|
||||
+ worldserver.tick(shouldKeepTicking); // diff on changes
|
||||
+ long after = Util.getNanos() - before;
|
||||
+
|
||||
+ worldserver.tickTimes5s.add(this.tickCount, after);
|
||||
+ worldserver.tickTimes10s.add(this.tickCount, after);
|
||||
+ worldserver.tickTimes60s.add(this.tickCount, after);
|
||||
+ // Plazma end - Port SparklyPaper patches; Track World specific MSPT
|
||||
//worldserver.timings.doTick.stopTiming(); // Spigot // Purpur
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 97df4706150dd198dc9bbdd3bdcecea9094d3b62..d31fabbca11b1f619bfa62487eed2cd5f19844ce 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -227,6 +227,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
this.plazmaConfigurations.initializeGlobalConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
|
||||
this.plazmaConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
|
||||
+ net.sparklypower.sparklypaper.HalloweenManager.startSyncEpochTask(); // Plazma - Port SparklyPaper patches; Optimize Spooky Season
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
// Paper start - detect running as root // Plazma - Tweak console logging (moved down)
|
||||
if (io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 1883abec14e05f8eb2e865446b4d81091b1aa5e0..adfc891ae8868bb562910ad169c116e5d30348c7 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1262,7 +1262,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper end - Configurable entity tracking range by Y
|
||||
|
||||
// CraftBukkit start - respect vanish API
|
||||
- if (flag && !player.getBukkitEntity().canSee(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;
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index dfd09004063a8d8d93357633c8d23b6acff67b73..7458cd657e809bba7483da31ddeb8f77aab1203d 100644
|
||||
--- a/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 {
|
||||
private List<SynchedEntityData.DataValue<?>> trackedDataValues;
|
||||
// CraftBukkit start
|
||||
public final Set<ServerPlayerConnection> trackedPlayers; // Purpur - private -> public
|
||||
+ public static boolean skipSqrWhenNoDeltaChanges = false; // Plazma - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
|
||||
|
||||
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
|
||||
this.trackedPlayers = trackedPlayers;
|
||||
@@ -218,20 +219,21 @@ public class ServerEntity {
|
||||
|
||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||
Vec3 vec3d1 = this.entity.getDeltaMovement();
|
||||
- double d0 = vec3d1.distanceToSqr(this.lastSentMovement);
|
||||
-
|
||||
- if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
|
||||
- this.lastSentMovement = vec3d1;
|
||||
- Entity entity1 = this.entity;
|
||||
-
|
||||
- if (entity1 instanceof AbstractHurtingProjectile) {
|
||||
- AbstractHurtingProjectile entityfireball = (AbstractHurtingProjectile) entity1;
|
||||
-
|
||||
- this.broadcast.accept(new ClientboundBundlePacket(List.of(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement), new ClientboundProjectilePowerPacket(entityfireball.getId(), entityfireball.accelerationPower))));
|
||||
- } else {
|
||||
- this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
|
||||
- }
|
||||
- }
|
||||
+ // Plazma start - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
|
||||
+ if (!skipSqrWhenNoDeltaChanges && vec3d1 != this.lastSentMovement) {
|
||||
+ double d0 = vec3d1.distanceToSqr(this.lastSentMovement);
|
||||
+ if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
|
||||
+ this.lastSentMovement = vec3d1;
|
||||
+ Entity entity1 = this.entity;
|
||||
+ if (entity1 instanceof AbstractHurtingProjectile) {
|
||||
+ AbstractHurtingProjectile entityfireball = (AbstractHurtingProjectile) entity1;
|
||||
+ this.broadcast.accept(new ClientboundBundlePacket(List.of(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement), new ClientboundProjectilePowerPacket(entityfireball.getId(), entityfireball.accelerationPower))));
|
||||
+ } else {
|
||||
+ this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
|
||||
+ }
|
||||
+ } // diff on changes
|
||||
+ } // diff on changes
|
||||
+ // Plazma end - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
|
||||
}
|
||||
|
||||
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
|
||||
index dfcd3989ffbd4aa5dc9368a34b95c1c2748c23a2..f5f944899d860d8363db43d430f3daab96e0d774 100644
|
||||
--- a/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, ca.spottedleaf.
|
||||
private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current)
|
||||
public boolean hasRidableMoveEvent = false; // Purpur
|
||||
|
||||
+ // Plazma start - Port SparklyPaper patches; Track World specific MSPT
|
||||
+ public final MinecraftServer.TickTimes tickTimes5s = new MinecraftServer.TickTimes(100);
|
||||
+ public final MinecraftServer.TickTimes tickTimes10s = new MinecraftServer.TickTimes(200);
|
||||
+ public final MinecraftServer.TickTimes tickTimes60s = new MinecraftServer.TickTimes(1200);
|
||||
+ // Plazma end - Port SparklyPaper patches; Track World specific MSPT
|
||||
+
|
||||
public LevelChunk getChunkIfLoaded(int x, int z) {
|
||||
return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
index fb7342f7a5008a283c3400c6313c637de8210dfa..8b068f6b4c52cdba60a7fbe21bc1f7a86891800a 100644
|
||||
--- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
+++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
@@ -90,12 +90,14 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
this.dirty.add(stat);
|
||||
}
|
||||
|
||||
+ /* // Plazma - Port SparklyPaper patches; Skip dirty stats copy when requesting player stats
|
||||
private Set<Stat<?>> getDirty() {
|
||||
Set<Stat<?>> set = Sets.newHashSet(this.dirty);
|
||||
|
||||
this.dirty.clear();
|
||||
return set;
|
||||
}
|
||||
+ */ // Plazma - Port SparklyPaper patches; Skip dirty stats copy when requesting player stats
|
||||
|
||||
public void parseLocal(DataFixer dataFixer, String json) {
|
||||
try {
|
||||
@@ -243,7 +245,7 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
|
||||
public void sendStats(ServerPlayer player) {
|
||||
Object2IntMap<Stat<?>> object2intmap = new Object2IntOpenHashMap();
|
||||
- Iterator iterator = this.getDirty().iterator();
|
||||
+ Iterator<Stat<?>> iterator = this.dirty.iterator(); // Plazma - SparklyPaper port; Skip dirty stats copy when requesting player stats
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Stat<?> statistic = (Stat) iterator.next();
|
||||
@@ -251,6 +253,7 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
object2intmap.put(statistic, this.getValue(statistic));
|
||||
}
|
||||
|
||||
+ this.dirty.clear(); // Plazma - SparklyPaper port; Skip dirty stats copy when requesting player stats
|
||||
player.connection.send(new ClientboundAwardStatsPacket(object2intmap));
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
index 36e5a6462675ceb3cef236c451321b1656d9fcc0..bdc2391aed4fedc2e15a0b51a6930a2d85905c90 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
@@ -307,7 +307,7 @@ public class Bat extends AmbientCreature {
|
||||
int i = world.getMaxLocalRawBrightness(pos);
|
||||
byte b0 = 4;
|
||||
|
||||
- if (Bat.isHalloweenSeason(world.getMinecraftWorld())) { // Purpur
|
||||
+ if (isSpookySeason(world.getMinecraftWorld())) { // Purpur // Plazma - Port SparklyPaper patches; Optimize Spooky Season
|
||||
b0 = 7;
|
||||
} else if (random.nextBoolean()) {
|
||||
return false;
|
||||
@@ -321,7 +321,24 @@ public class Bat extends AmbientCreature {
|
||||
private static boolean isSpookySeason = false;
|
||||
private static final int ONE_HOUR = 20 * 60 * 60;
|
||||
private static int lastSpookyCheck = -ONE_HOUR;
|
||||
- public static boolean isHalloweenSeason(Level level) { return level.purpurConfig.forceHalloweenSeason || isHalloween(); } // Purpur
|
||||
+ // Plazma start - Port SparklyPaper patches; Optimize Spooky Season
|
||||
+ private static boolean isSpookySeason(Level level) {
|
||||
+ if (level.purpurConfig.forceHalloweenSeason) return true;
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().entity.spookyOptimize)
|
||||
+ return net.sparklypower.sparklypaper.HalloweenManager.isSpookySeason()
|
||||
+ || net.sparklypower.sparklypaper.HalloweenManager.isHalloween();
|
||||
+ return isHalloween();
|
||||
+ }
|
||||
+
|
||||
+ public static boolean isHalloweenSeason(Level level) {
|
||||
+ if (level.purpurConfig.forceHalloweenSeason) return true;
|
||||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().entity.spookyOptimize)
|
||||
+ return net.sparklypower.sparklypaper.HalloweenManager.isHalloween();
|
||||
+ return isHalloween();
|
||||
+ }
|
||||
+
|
||||
+ @SuppressWarnings("RedundantExplicitChronoField")
|
||||
+ // Plazma end - Port SparklyPaper patches; Optimize Spooky Season
|
||||
private static boolean isHalloween() {
|
||||
if (net.minecraft.server.MinecraftServer.currentTick - lastSpookyCheck > ONE_HOUR) {
|
||||
LocalDate localdate = LocalDate.now();
|
||||
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
index 608390ed36710a419de1542b80340dd3fcc7299c..043f068345ca3c50209c1c3cc1feb6277a3da61a 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
@@ -268,11 +268,13 @@ public class MapItem extends ComplexItem {
|
||||
}
|
||||
}
|
||||
|
||||
+ public static boolean skipTickWhenCraftNotPresent = false; // Plazma - SparklyPaper port; Skip map item ticking if the craft map renderer is not present
|
||||
@Override
|
||||
public void inventoryTick(ItemStack stack, Level world, Entity entity, int slot, boolean selected) {
|
||||
if (!world.isClientSide) {
|
||||
MapItemSavedData mapItemSavedData = getSavedData(stack, world);
|
||||
if (mapItemSavedData != null) {
|
||||
+ if (skipTickWhenCraftNotPresent && mapItemSavedData.mapView.getRenderers().stream().noneMatch(mapRenderer -> mapRenderer.getClass() == org.bukkit.craftbukkit.map.CraftMapRenderer.class)) return; // Plazma - SparklyPaper port; Skip map item ticking if the craft map renderer is not present
|
||||
if (entity instanceof Player player) {
|
||||
mapItemSavedData.tickCarriedBy(player, stack);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 253d47418b4e9cbce74584c2461d12e17effd7bb..f3c44a2ddc52661984cc07b2ee23b3a3431a4b0a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1456,6 +1456,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
int tickedEntities = 0; // Paper - rewrite chunk system
|
||||
|
||||
int tilesThisCycle = 0;
|
||||
+ int shouldTickBlocksAtLastResult = -1; // Plazma - Port SparklyPaper patches; Optimize tickingBlockEntities
|
||||
+ long shouldTickBlocksAtChunkPos = 0; // Plazma - Port SparklyPaper patches; Optimize tickingBlockEntities
|
||||
var toRemove = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<TickingBlockEntity>(); // Paper - Fix MC-117075; use removeAll
|
||||
toRemove.add(null); // Paper - Fix MC-117075
|
||||
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
||||
@@ -1468,14 +1470,28 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
tilesThisCycle--;
|
||||
toRemove.add(tickingblockentity); // Paper - Fix MC-117075; use removeAll
|
||||
// Spigot end
|
||||
- } else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
||||
- tickingblockentity.tick();
|
||||
- // Paper start - rewrite chunk system
|
||||
- if ((++tickedEntities & 7) == 0) {
|
||||
- ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)(Level)(Object)this).moonrise$midTickTasks();
|
||||
- }
|
||||
- // Paper end - rewrite chunk system
|
||||
- }
|
||||
+ // Plazma start - Port SparklyPaper patches; Optimize tickingBlockEntities
|
||||
+ } else if (flag) {
|
||||
+ long chunkPos = tickingblockentity.getChunkCoordinateKey();
|
||||
+ boolean shouldTick;
|
||||
+ if (shouldTickBlocksAtChunkPos == chunkPos && shouldTickBlocksAtLastResult != -1)
|
||||
+ shouldTick = shouldTickBlocksAtLastResult == 1;
|
||||
+ else {
|
||||
+ shouldTick = this.shouldTickBlocksAt(chunkPos);
|
||||
+ shouldTickBlocksAtLastResult = shouldTick ? 1 : 0;
|
||||
+ shouldTickBlocksAtChunkPos = chunkPos;
|
||||
+ } // diff on changes
|
||||
+
|
||||
+ if (shouldTick) {
|
||||
+ tickingblockentity.tick();
|
||||
+ // Paper start - execute chunk tasks during tick
|
||||
+ if ((++tickedEntities & 7) == 0) {
|
||||
+ ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)(Level)(Object)this).moonrise$midTickTasks();
|
||||
+ }
|
||||
+ // Paper end - execute chunk tasks during tick
|
||||
+ } // diff on changes
|
||||
+ } // diff on changes
|
||||
+ // Plazma end - Port SparklyPaper patches; Optimize tickingBlockEntities
|
||||
}
|
||||
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
index 5a190834baef60c7b61074393f8856a933902d81..366ae05a060b5b12b85521a4b8aed1907f3f044a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
@@ -77,35 +77,57 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
|
||||
|
||||
@Override
|
||||
protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
- if (world.getRawBrightness(pos, 0) >= 9) {
|
||||
- int i = this.getAge(state);
|
||||
-
|
||||
- if (i < this.getMaxAge()) {
|
||||
- float f = CropBlock.getGrowthSpeed(this, world, pos);
|
||||
-
|
||||
- // Spigot start
|
||||
- int modifier;
|
||||
- if (this == Blocks.BEETROOTS) {
|
||||
- modifier = world.spigotConfig.beetrootModifier;
|
||||
- } else if (this == Blocks.CARROTS) {
|
||||
- modifier = world.spigotConfig.carrotModifier;
|
||||
- } else if (this == Blocks.POTATOES) {
|
||||
- modifier = world.spigotConfig.potatoModifier;
|
||||
- // Paper start - Fix Spigot growth modifiers
|
||||
- } else if (this == Blocks.TORCHFLOWER_CROP) {
|
||||
- modifier = world.spigotConfig.torchFlowerModifier;
|
||||
- // Paper end - Fix Spigot growth modifiers
|
||||
- } else {
|
||||
- modifier = world.spigotConfig.wheatModifier;
|
||||
- }
|
||||
+ // Plazma start - Port SparklyPaper patches; Optimize Farm checks
|
||||
+ if (world.getRawBrightness(pos, 0) < 9) return;
|
||||
+
|
||||
+ int age = this.getAge(state);
|
||||
+ if (age >= this.getMaxAge()) return;
|
||||
+
|
||||
+ final int modifier;
|
||||
+ if (this == Blocks.BEETROOTS) {
|
||||
+ modifier = world.spigotConfig.beetrootModifier;
|
||||
+ } else if (this == Blocks.CARROTS) {
|
||||
+ modifier = world.spigotConfig.carrotModifier;
|
||||
+ } else if (this == Blocks.POTATOES) {
|
||||
+ modifier = world.spigotConfig.potatoModifier;
|
||||
+ } else if (this == Blocks.TORCHFLOWER_CROP) {
|
||||
+ modifier = world.spigotConfig.torchFlowerModifier;
|
||||
+ } else {
|
||||
+ modifier = world.spigotConfig.wheatModifier;
|
||||
+ }
|
||||
|
||||
- if (random.nextFloat() < (modifier / (100.0f * (Math.floor((25.0F / f) + 1))))) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
- // Spigot end
|
||||
- CraftEventFactory.handleBlockGrowEvent(world, pos, this.getStateForAge(i + 1), 2); // CraftBukkit
|
||||
- }
|
||||
+ if (world.plazmaConfig().block.optimizeFarmCheck.enabled) {
|
||||
+ BlockPos current = pos.below();
|
||||
+ BlockState currentState = world.getBlockState(current);
|
||||
+
|
||||
+ boolean moist;
|
||||
+ float growthSpeed;
|
||||
+ if (currentState.is(Blocks.FARMLAND) && currentState.getValue(FarmBlock.MOISTURE) > 0) {
|
||||
+ moist = true;
|
||||
+ growthSpeed = world.plazmaConfig().block.optimizeFarmCheck.growthSpeed.moist;
|
||||
+ } else {
|
||||
+ moist = false;
|
||||
+ growthSpeed = world.plazmaConfig().block.optimizeFarmCheck.growthSpeed.normal;
|
||||
}
|
||||
+
|
||||
+ if (world.plazmaConfig().block.optimizeFarmCheck.skipMiddleAgingStageForCrops) {
|
||||
+ growthSpeed = growthSpeed / getMaxAge();
|
||||
+ age = getMaxAge() - 1;
|
||||
+ }
|
||||
+
|
||||
+ if (random.nextFloat() >= (modifier / (100.0f * Math.floor((25.0F / growthSpeed) + 1)))) return;
|
||||
+ if (!CraftEventFactory.handleBlockGrowEvent(world, pos, this.getStateForAge(age + 1), 2)) return;
|
||||
+ if (!moist || age + 1 != this.getMaxAge() || FarmBlock.isNearWater(world, current)) return;
|
||||
+
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(world, current, currentState.setValue(FarmBlock.MOISTURE, 0), 2);
|
||||
+ return;
|
||||
}
|
||||
|
||||
+ float growthSpeed = CropBlock.getGrowthSpeed(this, world, pos);
|
||||
+
|
||||
+ if (random.nextFloat() < (modifier / (100.0f * Math.floor((25.0F / growthSpeed) + 1))))
|
||||
+ CraftEventFactory.handleBlockGrowEvent(world, pos, this.getStateForAge(age + 1), 2);
|
||||
+ // Plazma end - Port SparklyPaper patches; Optimize Farm checks
|
||||
}
|
||||
|
||||
public void growCrops(Level world, BlockPos pos, BlockState state) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
index d0ec0722496ed931b48c4e7076fddbb1ed36e111..b91afbc90c138ebb7f8722934f59f953642196c9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
@@ -92,7 +92,19 @@ public class FarmBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
- int i = (Integer) state.getValue(FarmBlock.MOISTURE);
|
||||
+ // Plazma start - Port SparklyPaper patches; Optimize Farm checks
|
||||
+ int i = state.getValue(FarmBlock.MOISTURE);
|
||||
+ if (world.plazmaConfig().block.optimizeFarmCheck.enabled) {
|
||||
+ if (i != 0) return;
|
||||
+
|
||||
+ if (isNearWater(world, pos))
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(world, pos, state.setValue(MOISTURE, 7), 2);
|
||||
+ else
|
||||
+ turnToDirt(null, state, world, pos);
|
||||
+
|
||||
+ return;
|
||||
+ }
|
||||
+ // Plazma end - Port SparklyPaper patches; Optimize Farm checks
|
||||
if (i > 0 && world.paperConfig().tickRates.wetFarmland != 1 && (world.paperConfig().tickRates.wetFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.wetFarmland != 0)) { return; } // Paper - Configurable random tick rates for blocks
|
||||
if (i == 0 && world.paperConfig().tickRates.dryFarmland != 1 && (world.paperConfig().tickRates.dryFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.dryFarmland != 0)) { return; } // Paper - Configurable random tick rates for blocks
|
||||
|
||||
@@ -167,7 +179,7 @@ public class FarmBlock extends Block {
|
||||
return world.getBlockState(pos.above()).is(BlockTags.MAINTAINS_FARMLAND);
|
||||
}
|
||||
|
||||
- private static boolean isNearWater(LevelReader world, BlockPos pos) {
|
||||
+ static boolean isNearWater(LevelReader world, BlockPos pos) { // Plazma - AT (private -> package)
|
||||
// Paper start - Perf: remove abstract block iteration
|
||||
int xOff = pos.getX();
|
||||
int yOff = pos.getY();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/StemBlock.java b/src/main/java/net/minecraft/world/level/block/StemBlock.java
|
||||
index 924d80eb41d9a71d1e521c40742557251cf51832..4a30e1e6eac4b0e3dc2147a74e73e05fa76f5db2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/StemBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/StemBlock.java
|
||||
@@ -72,38 +72,82 @@ public class StemBlock extends BushBlock implements BonemealableBlock {
|
||||
|
||||
@Override
|
||||
protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
- if (world.getRawBrightness(pos, 0) >= 9) {
|
||||
- float f = CropBlock.getGrowthSpeed(this, world, pos);
|
||||
-
|
||||
- if (random.nextFloat() < ((this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) / (100.0f * (Math.floor((25.0F / f) + 1))))) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
- int i = (Integer) state.getValue(StemBlock.AGE);
|
||||
-
|
||||
- if (i < 7) {
|
||||
- state = (BlockState) state.setValue(StemBlock.AGE, i + 1);
|
||||
- CraftEventFactory.handleBlockGrowEvent(world, pos, state, 2); // CraftBukkit
|
||||
- } else {
|
||||
- Direction enumdirection = Direction.Plane.HORIZONTAL.getRandomDirection(random);
|
||||
- BlockPos blockposition1 = pos.relative(enumdirection);
|
||||
- BlockState iblockdata1 = world.getBlockState(blockposition1.below());
|
||||
-
|
||||
- if (world.getBlockState(blockposition1).isAir() && (iblockdata1.is(Blocks.FARMLAND) || iblockdata1.is(BlockTags.DIRT))) {
|
||||
- Registry<Block> iregistry = world.registryAccess().registryOrThrow(Registries.BLOCK);
|
||||
- Optional<Block> optional = iregistry.getOptional(this.fruit);
|
||||
- Optional<Block> optional1 = iregistry.getOptional(this.attachedStem);
|
||||
-
|
||||
- if (optional.isPresent() && optional1.isPresent()) {
|
||||
- // CraftBukkit start
|
||||
- if (!CraftEventFactory.handleBlockGrowEvent(world, blockposition1, ((Block) optional.get()).defaultBlockState())) {
|
||||
- return;
|
||||
- }
|
||||
- // CraftBukkit end
|
||||
- world.setBlockAndUpdate(pos, (BlockState) ((Block) optional1.get()).defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, enumdirection));
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
+ // Plazma start - Port SparklyPaper patches; Optimize Farm checks
|
||||
+ if (world.getRawBrightness(pos, 0) < 9) return;
|
||||
+
|
||||
+ int modifier = this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier;
|
||||
+
|
||||
+ if (world.plazmaConfig().block.optimizeFarmCheck.enabled) {
|
||||
+ final BlockPos current = pos.below();
|
||||
+ final BlockState currentState = world.getBlockState(current);
|
||||
+
|
||||
+ final boolean moist;
|
||||
+ final float growthSpeed;
|
||||
+ if (currentState.is(Blocks.FARMLAND) && currentState.getValue(FarmBlock.MOISTURE) > 0) {
|
||||
+ moist = true;
|
||||
+ growthSpeed = world.plazmaConfig().block.optimizeFarmCheck.growthSpeed.moist;
|
||||
+ } else {
|
||||
+ moist = false;
|
||||
+ growthSpeed = world.plazmaConfig().block.optimizeFarmCheck.growthSpeed.normal;
|
||||
}
|
||||
|
||||
+ if (random.nextFloat() >= (modifier / (100.0f * Math.floor((25.0F / growthSpeed) + 1)))) return;
|
||||
+
|
||||
+ int age = state.getValue(AGE);
|
||||
+
|
||||
+ if (age < 7) {
|
||||
+ CraftEventFactory.handleMoistureChangeEvent(world, pos, state.setValue(AGE, age + 1), 2);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ Direction direction = Direction.Plane.HORIZONTAL.getRandomDirection(random);
|
||||
+ BlockPos pos1 = pos.relative(direction);
|
||||
+ BlockState state1 = world.getBlockState(pos1.below());
|
||||
+
|
||||
+ if (!world.getBlockState(pos1).isAir() || (!state1.is(Blocks.FARMLAND) && !state1.is(BlockTags.DIRT)))
|
||||
+ return;
|
||||
+
|
||||
+ Registry<Block> registry = world.registryAccess().registryOrThrow(Registries.BLOCK);
|
||||
+ Optional<Block> fruit = registry.getOptional(this.fruit);
|
||||
+ Optional<Block> stem = registry.getOptional(this.attachedStem);
|
||||
+
|
||||
+ if (fruit.isEmpty() || stem.isEmpty()) return;
|
||||
+ if (!CraftEventFactory.handleBlockGrowEvent(world, pos1, fruit.get().defaultBlockState())) return;
|
||||
+ if (moist && !FarmBlock.isNearWater(world, current))
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(world, current, currentState.setValue(FarmBlock.MOISTURE, 0), 2);
|
||||
+
|
||||
+ world.setBlockAndUpdate(pos, stem.get().defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, direction));
|
||||
+ return;
|
||||
}
|
||||
+
|
||||
+ float f = CropBlock.getGrowthSpeed(this, world, pos);
|
||||
+
|
||||
+ if (random.nextFloat() >= (modifier / (100.0f * Math.floor((25.0F / f) + 1)))) return;
|
||||
+
|
||||
+ int age = state.getValue(StemBlock.AGE);
|
||||
+
|
||||
+ if (age < 7) {
|
||||
+ CraftEventFactory.handleBlockGrowEvent(world, pos, state.setValue(StemBlock.AGE, age + 1), 2);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ Direction direction = Direction.Plane.HORIZONTAL.getRandomDirection(random);
|
||||
+ BlockPos pos1 = pos.relative(direction);
|
||||
+ BlockState state1 = world.getBlockState(pos1.below());
|
||||
+
|
||||
+ if (!world.getBlockState(pos1).isAir() || (!state1.is(Blocks.FARMLAND) && !state1.is(BlockTags.DIRT))) return;
|
||||
+
|
||||
+ Registry<Block> registry = world.registryAccess().registryOrThrow(Registries.BLOCK);
|
||||
+ Optional<Block> fruit = registry.getOptional(this.fruit);
|
||||
+ Optional<Block> stem = registry.getOptional(this.attachedStem);
|
||||
+
|
||||
+ if (fruit.isEmpty() || stem.isEmpty()) return;
|
||||
+
|
||||
+ if (!CraftEventFactory.handleBlockGrowEvent(world, pos1, fruit.get().defaultBlockState()))
|
||||
+ return;
|
||||
+
|
||||
+ world.setBlockAndUpdate(pos, stem.get().defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, direction));
|
||||
+ // Plazma end - Port SparklyPaper patches; Optimize Farm checks
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TickingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TickingBlockEntity.java
|
||||
index 28e3b73507b988f7234cbf29c4024c88180d0aef..6239c171ca996f3f5c23060f728a62236bc8b6d5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TickingBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TickingBlockEntity.java
|
||||
@@ -10,4 +10,6 @@ public interface TickingBlockEntity {
|
||||
BlockPos getPos();
|
||||
|
||||
String getType();
|
||||
+
|
||||
+ long getChunkCoordinateKey(); // Plazma - Port SparklyPaper patches; Optimize tickingBlockEntities
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
index 75c8125e20b70433fe9d143a3193d821043327c3..80511433c184c6918c8d2e7cff6ca257e8fbf676 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
@@ -66,6 +66,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
|
||||
protected volatile boolean unsaved;
|
||||
private volatile boolean isLightCorrect;
|
||||
protected final ChunkPos chunkPos; public final long coordinateKey; public final int locX; public final int locZ; // Paper - cache coordinate key
|
||||
+ public final long nearbyPlayersCoordinateKey; // Plazma - Port SparklyPaper patches; Cache coordinate key used for nearby players when ticking chunks
|
||||
private long inhabitedTime;
|
||||
/** @deprecated */
|
||||
@Nullable
|
||||
@@ -144,6 +145,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
|
||||
public ChunkAccess(ChunkPos pos, UpgradeData upgradeData, LevelHeightAccessor heightLimitView, Registry<Biome> biomeRegistry, long inhabitedTime, @Nullable LevelChunkSection[] sectionArray, @Nullable BlendingData blendingData) {
|
||||
this.locX = pos.x; this.locZ = pos.z; // Paper - reduce need for field lookups
|
||||
this.chunkPos = pos; this.coordinateKey = ChunkPos.asLong(locX, locZ); // Paper - cache long key
|
||||
+ this.nearbyPlayersCoordinateKey = ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkKey(locX, locZ); // Plazma - Port SparklyPaper patches; Cache coordinate key used for nearby players when ticking chunks
|
||||
this.upgradeData = upgradeData;
|
||||
this.levelHeightAccessor = heightLimitView;
|
||||
this.sections = new LevelChunkSection[heightLimitView.getSectionsCount()];
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index a4578ae22409edb686d0bcbac8cbc1a2e1d7b988..9cc1a79dd25c63af6986e721ceff5560cf56b7d1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -74,6 +74,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
public String getType() {
|
||||
return "<null>";
|
||||
}
|
||||
+
|
||||
+ @Override public long getChunkCoordinateKey() { return 0; } // Plazma - Port SparklyPaper patches; Optimize tickingBlockEntities
|
||||
};
|
||||
private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel;
|
||||
public boolean loaded;
|
||||
@@ -966,7 +968,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
}
|
||||
|
||||
private <T extends BlockEntity> TickingBlockEntity createTicker(T blockEntity, BlockEntityTicker<T> blockEntityTicker) {
|
||||
- return new LevelChunk.BoundTickingBlockEntity<>(blockEntity, blockEntityTicker);
|
||||
+ return new LevelChunk.BoundTickingBlockEntity<>(blockEntity, blockEntityTicker, this.coordinateKey); // Plazma - Port SparklyPaper patches; Optimize TickingBlockEntity
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
@@ -1017,6 +1019,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
public String toString() {
|
||||
return String.valueOf(this.ticker) + " <wrapped>";
|
||||
}
|
||||
+
|
||||
+ @Override public long getChunkCoordinateKey() { return this.ticker.getChunkCoordinateKey(); } // Plazma - Port SparklyPaper patches; Optimize TickingBlockEntity
|
||||
}
|
||||
|
||||
private class BoundTickingBlockEntity<T extends BlockEntity> implements TickingBlockEntity {
|
||||
@@ -1024,10 +1028,12 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
private final T blockEntity;
|
||||
private final BlockEntityTicker<T> ticker;
|
||||
private boolean loggedInvalidBlockState;
|
||||
+ private final long chunkCoordinateKey; // Plazma - Port SparklyPaper patches; Optimize TickingBlockEntity
|
||||
|
||||
- BoundTickingBlockEntity(final BlockEntity tileentity, final BlockEntityTicker blockentityticker) {
|
||||
+ BoundTickingBlockEntity(final BlockEntity tileentity, final BlockEntityTicker blockentityticker, long chunkCoordinateKey) { // Plazma - Port SparklyPaper patches; Optimize TickingBlockEntity
|
||||
this.blockEntity = (T) tileentity; // CraftBukkit - decompile error
|
||||
this.ticker = blockentityticker;
|
||||
+ this.chunkCoordinateKey = chunkCoordinateKey; // Plazma - Port SparklyPaper patches; Optimize TickingBlockEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1095,5 +1101,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
|
||||
return "Level ticker for " + s + "@" + String.valueOf(this.getPos());
|
||||
}
|
||||
+
|
||||
+ @Override public long getChunkCoordinateKey() { return this.chunkCoordinateKey; } // Plazma - Port SparklyPaper patches; Optimize TickingBlockEntity
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/sparklypower/sparklypaper/HalloweenManager.java b/src/main/java/net/sparklypower/sparklypaper/HalloweenManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f8c26e26025d7a7b5489ed5b3274ba734db27a1d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/sparklypower/sparklypaper/HalloweenManager.java
|
||||
@@ -0,0 +1,78 @@
|
||||
+package net.sparklypower.sparklypaper;
|
||||
+
|
||||
+import com.mojang.logging.LogUtils;
|
||||
+import it.unimi.dsi.fastutil.Pair;
|
||||
+import net.minecraft.world.level.Level;
|
||||
+import org.slf4j.Logger;
|
||||
+import java.time.LocalDateTime;
|
||||
+import java.time.Month;
|
||||
+import java.time.ZoneOffset;
|
||||
+import java.util.concurrent.CountDownLatch;
|
||||
+import java.util.concurrent.Executors;
|
||||
+import java.util.concurrent.ScheduledExecutorService;
|
||||
+import java.util.concurrent.ScheduledFuture;
|
||||
+import java.util.concurrent.TimeUnit;
|
||||
+import java.util.concurrent.atomic.AtomicBoolean;
|
||||
+
|
||||
+import static org.plazmamc.plazma.configurations.GlobalConfiguration.get;
|
||||
+
|
||||
+public class HalloweenManager {
|
||||
+
|
||||
+ private static final Logger LOGGER = LogUtils.getClassLogger();
|
||||
+ private static final ScheduledExecutorService EXECUTOR = Executors.newSingleThreadScheduledExecutor(factory -> {
|
||||
+ Thread thread = new Thread(factory);
|
||||
+ thread.setName("halloween-timer-updater");
|
||||
+ thread.setPriority(1);
|
||||
+ return thread;
|
||||
+ });
|
||||
+
|
||||
+ private static ScheduledFuture<?> future;
|
||||
+ private static Pair<Long, Long> spookyEpoch;
|
||||
+ private static Pair<Long, Long> halloweenEpoch;
|
||||
+
|
||||
+ private static long getEpochMillisAtDate(Month month, int day, boolean start) {
|
||||
+ LocalDateTime now = LocalDateTime.now();
|
||||
+ LocalDateTime target = LocalDateTime.of(
|
||||
+ now.getYear(), month, day, start ? 0 : 23, start ? 0 : 59, start ? 0 : 59, start ? 0 : 999_999_999
|
||||
+ );
|
||||
+
|
||||
+ if (now.isAfter(target)) target = target.plusYears(1);
|
||||
+ return target.atZone(ZoneOffset.systemDefault()).toInstant().toEpochMilli();
|
||||
+ }
|
||||
+
|
||||
+ private static void syncEpoch() {
|
||||
+ LOGGER.info("Updating Spooky Season and Halloween epoch...");
|
||||
+ spookyEpoch = Pair.of(
|
||||
+ getEpochMillisAtDate(Month.OCTOBER, 20, true),
|
||||
+ getEpochMillisAtDate(Month.NOVEMBER, 3, false)
|
||||
+ );
|
||||
+ halloweenEpoch = Pair.of(
|
||||
+ getEpochMillisAtDate(Month.OCTOBER, 31, true),
|
||||
+ getEpochMillisAtDate(Month.OCTOBER, 31, false)
|
||||
+ );
|
||||
+ LOGGER.info("Successfully updated Spooky Season and Halloween epoch");
|
||||
+ }
|
||||
+
|
||||
+ public static void syncConfiguration() {
|
||||
+ if (get().entity.spookyOptimize && future == null) {
|
||||
+ startSyncEpochTask();
|
||||
+ } else if (!get().entity.spookyOptimize && future != null) {
|
||||
+ future.cancel(true);
|
||||
+ future = null;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static void startSyncEpochTask() {
|
||||
+ if (!get().entity.spookyOptimize) return;
|
||||
+ future = EXECUTOR.scheduleAtFixedRate(HalloweenManager::syncEpoch, 0, 90, TimeUnit.DAYS);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean isSpookySeason() {
|
||||
+ return spookyEpoch.first() <= System.currentTimeMillis() && System.currentTimeMillis() <= spookyEpoch.second();
|
||||
+ }
|
||||
+
|
||||
+ public static boolean isHalloween() {
|
||||
+ return halloweenEpoch.first() <= System.currentTimeMillis() && System.currentTimeMillis() <= halloweenEpoch.second();
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 173e4a075078af67f030750c9a6294ab3f796677..92ad49e0ff5dc17bc8e181578ff93bc96e3503ef 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -978,7 +978,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void sendMultiBlockChange(final Map<? extends io.papermc.paper.math.Position, BlockData> blockChanges) {
|
||||
if (this.getHandle().connection == null) return;
|
||||
|
||||
- Map<SectionPos, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<net.minecraft.world.level.block.state.BlockState>> sectionMap = new HashMap<>();
|
||||
+ Map<SectionPos, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<net.minecraft.world.level.block.state.BlockState>> sectionMap = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // Plazma - Port SparklyPaper patches; Optimize canSee checks
|
||||
|
||||
for (Map.Entry<? extends io.papermc.paper.math.Position, BlockData> entry : blockChanges.entrySet()) {
|
||||
BlockData blockData = entry.getValue();
|
||||
@@ -2259,9 +2259,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@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 (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 chunkMapCanSee(org.bukkit.entity.Entity entity) {
|
||||
+ return entity.isVisibleByDefault() ^ (!invertedVisibilityEntities.isEmpty() && this.invertedVisibilityEntities.containsKey(entity.getUniqueId()));
|
||||
+ }
|
||||
+ // Plazma end - Port SparklyPaper patches; Optimize canSee check
|
||||
+
|
||||
public boolean canSeePlayer(UUID uuid) {
|
||||
org.bukkit.entity.Entity entity = this.getServer().getPlayer(uuid);
|
||||
|
||||
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
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
|
||||
@@ -145,7 +145,7 @@ public class CraftMapColorCache implements MapPalette.MapColorCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
- public boolean isCached() {
|
||||
+ public synchronized boolean isCached() { // Plazma - Fix concurrency issues when using "imageToBytes" in multiple threads
|
||||
return this.cached || (!this.running.get() && this.initCache().isDone());
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
index 451723377d505f1fe15ddd4ac535ca61fa253f17..7ccf554610bd00b602eb7be11df7028d2f6a7008 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
|
||||
@@ -68,6 +68,8 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Entity entity;
|
||||
public class Entity extends ConfigurationPart {
|
||||
|
||||
+ boolean skipSqrWhenNoDeltaChanges = OPTIMIZE;
|
||||
+ public boolean spookyOptimize = OPTIMIZE;
|
||||
|
||||
public AsyncPathProcess asyncPathProcess;
|
||||
public class AsyncPathProcess extends ConfigurationPart {
|
||||
@@ -91,6 +93,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
@PostProcess
|
||||
public void post() {
|
||||
+ net.minecraft.server.level.ServerEntity.skipSqrWhenNoDeltaChanges = this.skipSqrWhenNoDeltaChanges;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -98,9 +101,11 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public World world;
|
||||
public class World extends ConfigurationPart {
|
||||
|
||||
+ boolean skipTickWhenCraftNotPresent = OPTIMIZE;
|
||||
|
||||
@PostProcess
|
||||
public void post() {
|
||||
+ net.minecraft.world.item.MapItem.skipTickWhenCraftNotPresent = this.skipTickWhenCraftNotPresent;
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
index e5989010aa752c23eda58a6df87aa6925f45671a..00ab417a8b7da0457b6f8e18e4f877373774672e 100644
|
||||
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
||||
@@ -89,7 +89,22 @@ public class WorldConfigurations extends ConfigurationPart {
|
||||
|
||||
public Block block;
|
||||
public class Block extends ConfigurationPart {
|
||||
-
|
||||
+
|
||||
+ public OptimizeFarmCheck optimizeFarmCheck;
|
||||
+ public class OptimizeFarmCheck extends ConfigurationPart {
|
||||
+
|
||||
+ public boolean enabled = OPTIMIZE;
|
||||
+ public boolean skipMiddleAgingStageForCrops = true;
|
||||
+
|
||||
+ public GrowthSpeed growthSpeed;
|
||||
+ public class GrowthSpeed extends ConfigurationPart {
|
||||
+
|
||||
+ public int normal = 1;
|
||||
+ public int moist = 4;
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user