mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2025-07-15 15:38:35 +00:00
Compare commits
76 Commits
slime/1.20
...
1.20.4
Author | SHA1 | Date | |
---|---|---|---|
32cf791cac | |||
0870033b8a | |||
6f4b9b1167 | |||
1e08d8b5bc | |||
190be49a0e | |||
43afa1c23f | |||
c3dd448f88 | |||
ac2baba217 | |||
fecb246032 | |||
6ba3922c46 | |||
63022cd9de | |||
ce9b94d9b1 | |||
ec0768f1a5 | |||
d26b8a780c | |||
9b193ef9ee | |||
fb7262b998 | |||
5f694b695b | |||
e7b13dc764 | |||
f00572a121 | |||
0030c335bf | |||
2ac80d43d3 | |||
67380cf6e1 | |||
a17100a2ff | |||
3c75bc7ebf | |||
7f5d59731b | |||
6aca64966f | |||
cb2a824130 | |||
a2e1f7fd86 | |||
c401e92012 | |||
b156f2a789 | |||
ed167e8f2a | |||
b421b3b91f | |||
fc9c32b5cb | |||
646c9914a3 | |||
f35902f754 | |||
d0c2d7d2ac | |||
5cbb0c1915 | |||
4818054bee | |||
3fa66587c3 | |||
be3f342ab4 | |||
0d530ef31f | |||
c5c9121833 | |||
747552d1a2 | |||
569338c315 | |||
031de7abb1 | |||
e57b14d8c7 | |||
8c424d257e | |||
86c36bd01d | |||
8a3fc4f053 | |||
b17300cb6b | |||
c454da9e1a | |||
5e8dbab98c | |||
cbd4b8c045 | |||
27e30f29d6 | |||
ba578b3eec | |||
7d9b628fac | |||
66f40c0905 | |||
343f0b78b2 | |||
f7e1e35ffc | |||
367d03e949 | |||
c5f38c235c | |||
f15dbbc6d3 | |||
8fc04a818b | |||
1050894e5a | |||
c268904a94 | |||
d3cf82a23f | |||
3a1a4b68b9 | |||
f3bd200608 | |||
227341fc66 | |||
0e2564c3fa | |||
ccc2be8000 | |||
cc6f512333 | |||
37e93142a5 | |||
5a93f07bd7 | |||
cd87d4fc61 | |||
5cbac48e6f |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -13,8 +13,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Git Repository
|
- name: Checkout Git Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- name: Validate Gradle wrapper
|
- name: Validate Gradle wrapper
|
||||||
uses: gradle/wrapper-validation-action@v1
|
uses: gradle/wrapper-validation-action@v1
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -51,7 +51,4 @@ Scissors-API
|
|||||||
|
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
aswm-api/src
|
paper-api-generator
|
||||||
aswm-core/src
|
|
||||||
|
|
||||||
paper-api-generator
|
|
||||||
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -1,4 +0,0 @@
|
|||||||
[submodule "submodules/AdvancedSlimePaper"]
|
|
||||||
path = submodules/AdvancedSlimePaper
|
|
||||||
url = https://github.com/InfernalSuite/AdvancedSlimePaper.git
|
|
||||||
branch = mc/1.20.4
|
|
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@ -1,15 +1,9 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
options { skipDefaultCheckout() }
|
|
||||||
agent any
|
agent any
|
||||||
environment {
|
environment {
|
||||||
GITHUB_BRANCH = "${BRANCH_NAME}"
|
GITHUB_BRANCH = "${BRANCH_NAME}"
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('checkout') {
|
|
||||||
steps {
|
|
||||||
checkout scmGit(branches: [[name: '*/slime/1.20.4']], extensions: [submodule(parentCredentials: true, recursiveSubmodules: true, reference: 'https://github.com/InfernalSuite/AdvancedSlimePaper')], userRemoteConfigs: [[url: 'https://github.com/AtlasMediaGroup/Scissors']])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('applyPatches') {
|
stage('applyPatches') {
|
||||||
steps {
|
steps {
|
||||||
withGradle {
|
withGradle {
|
||||||
@ -46,4 +40,4 @@ pipeline {
|
|||||||
cleanWs()
|
cleanWs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
14
README.md
14
README.md
@ -1,21 +1,11 @@
|
|||||||
# Scissors [](https://ci.plex.us.org/job/Scissors/job/slime%252F1.20.2/)
|
# Scissors [](https://ci.scissors.gg/job/Scissors/job/1.20.4/)
|
||||||
|
|
||||||
Scissors is a fork of Paper that aims to fix exploits possible in Creative Mode. Many of these exploits are ones that
|
Scissors is a fork of Paper that aims to fix exploits possible in Creative Mode. Many of these exploits are ones that
|
||||||
Paper's own team has either refused to fix or would have.
|
Paper's own team has either refused to fix or would have.
|
||||||
|
|
||||||
All SWM patches/SWM API belongs to [AdvancedSlimePaper and InfernalSuite](https://github.com/InfernalSuite/AdvancedSlimePaper)
|
|
||||||
|
|
||||||
Note: This will not compile on Windows by default. To make it compile, you need to delete the `aswm-core/src`
|
|
||||||
and `aswm-api/src` files. Then open up Command Prompt as an administrator and run the following for the api project:
|
|
||||||
```mklink /D C:\full\path\to\project\aswm-api\src C:\full\path\to\project\submodules\AdvancedSlimePaper\api\src```. Now,
|
|
||||||
run the same thing again for the core
|
|
||||||
project: ```mklink /D C:\full\path\to\project\aswm-core\src C:\full\path\to\project\submodules\AdvancedSlimePaper\core\src```
|
|
||||||
Make sure you replace the placeholder `C:\full\path\to\project` with the actual full path to the root project on your
|
|
||||||
local machine. You do not need to do this if you are compiling on macOS or Linux.
|
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
### [Scissors Download](https://ci.plex.us.org/job/Scissors)
|
### [Scissors Download](https://ci.plex.us.org/job/Scissors)
|
||||||
### [Scissors Javadoc](https://javadoc.scissors.gg/1.20.2)
|
### [Scissors Javadoc](https://javadoc.scissors.gg/1.20.4)
|
||||||
### [Scissors Announcements](https://totalfreedom.tf/forums/scissors-announcements.55)
|
### [Scissors Announcements](https://totalfreedom.tf/forums/scissors-announcements.55)
|
||||||
### [Scissors General Discussion](https://totalfreedom.tf/forums/scissors-discussion.56/)
|
### [Scissors General Discussion](https://totalfreedom.tf/forums/scissors-discussion.56/)
|
||||||
|
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
plugins {
|
|
||||||
`java-library`
|
|
||||||
`maven-publish`
|
|
||||||
signing
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
api("com.flowpowered:flow-nbt:2.0.2")
|
|
||||||
api("org.jetbrains:annotations:23.0.0")
|
|
||||||
|
|
||||||
compileOnly("io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT")
|
|
||||||
}
|
|
||||||
|
|
||||||
java {
|
|
||||||
withSourcesJar()
|
|
||||||
withJavadocJar()
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
../submodules/AdvancedSlimePaper/api/src
|
|
@ -1,7 +0,0 @@
|
|||||||
plugins {
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compileOnly(project(":aswm-api"))
|
|
||||||
implementation("com.github.luben:zstd-jni:1.5.2-2")
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
../submodules/AdvancedSlimePaper/core/src
|
|
@ -8,9 +8,5 @@
|
|||||||
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
||||||
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
||||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||||
|
minecraft net.minecraft.network.chat.FormattedText
|
||||||
## Used in Scissors 1.19
|
minecraft net.minecraft.network.chat.contents.TranslatableContents.java
|
||||||
#minecraft net/minecraft/world/ContainerHelper
|
|
||||||
#minecraft net/minecraft/network/chat/contents/NbtContents
|
|
||||||
#minecraft net/minecraft/network/chat/ComponentUtils
|
|
||||||
#minecraft net/minecraft/network/chat/contents/EntityDataSource
|
|
@ -2,7 +2,7 @@ plugins {
|
|||||||
java
|
java
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||||
id("io.papermc.paperweight.patcher") version "1.5.11"
|
id("io.papermc.paperweight.patcher") version "1.5.15"
|
||||||
}
|
}
|
||||||
|
|
||||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||||
@ -49,7 +49,6 @@ subprojects {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven(paperMavenPublicUrl)
|
maven(paperMavenPublicUrl)
|
||||||
maven("https://repo.rapture.pw/repository/maven-releases/")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@ group=me.totalfreedom.scissors
|
|||||||
version=1.20.4-R0.1-SNAPSHOT
|
version=1.20.4-R0.1-SNAPSHOT
|
||||||
|
|
||||||
mcVersion=1.20.4
|
mcVersion=1.20.4
|
||||||
paperRef=07b956e3a30d9cd192111829b59bdf4372f128b1
|
paperRef=ba31f4128208e954d6648001724887352f71ece9
|
||||||
|
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
org.gradle.vfs.watch=false
|
org.gradle.vfs.watch=false
|
||||||
org.gradle.jvmargs=-Xmx4096m
|
org.gradle.jvmargs=-Xmx4096m
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
14
gradlew
vendored
14
gradlew
vendored
@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@ -202,11 +202,11 @@ fi
|
|||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
|
|
||||||
Date: Mon, 26 Dec 2022 12:08:15 -0500
|
|
||||||
Subject: [PATCH] AdvancedSlimePaper API Changes
|
|
||||||
|
|
||||||
AdvancedSlimePaper
|
|
||||||
Copyright (C) 2023 InfernalSuite
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
||||||
index 3e3ea0e4e4ceb3283ad2b99957e3795d66a9a716..e2db0e69bd254fca5177781d67f4664b69a18625 100644
|
|
||||||
--- a/build.gradle.kts
|
|
||||||
+++ b/build.gradle.kts
|
|
||||||
@@ -28,6 +28,7 @@ configurations.api {
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// api dependencies are listed transitively to API consumers
|
|
||||||
+ api(project(":aswm-api")) // ASWM
|
|
||||||
api("com.google.guava:guava:32.1.2-jre")
|
|
||||||
api("com.google.code.gson:gson:2.10.1")
|
|
||||||
// Paper start - adventure
|
|
||||||
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
|
||||||
index f9b57b872780aa6b9b959494874b57c7a8ff0c53..c3c5f24f1d70995641216934a3a9e88ac75e365a 100644
|
|
||||||
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
|
||||||
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
|
||||||
@@ -265,7 +265,9 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
|
||||||
// Paper end
|
|
||||||
super.close();
|
|
||||||
} finally {
|
|
||||||
- jar.close();
|
|
||||||
+ if (this.plugin == null || !this.plugin.getName().equals("SlimeWorldManager")) { // ASWM - Don't close
|
|
||||||
+ jar.close();
|
|
||||||
+ } // ASWM - Don't close
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add Scissors configuration file
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
index 9af4bc16da09e59009c47911219e99450cdf2aa5..94244872f7cd6b4a6df709c0f68b1f484538c159 100644
|
index 4ff1b38eb65f97344257204cf018f176f247ed36..be766fc9c24bedcc58dac2cb1991345bf5ed17e0 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
@@ -2198,6 +2198,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2235,6 +2235,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,20 +1,19 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Thu, 21 Dec 2023 23:23:17 -0600
|
Date: Sun, 10 Dec 2023 12:34:45 -0600
|
||||||
Subject: [PATCH] Build changes
|
Subject: [PATCH] Build changes
|
||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 58da26ad2f128ba0b66f86820f60853f4be352f0..9d4e802c76470eeab5550ba9a8e31d074af4265a 100644
|
index bcfe59b6efb628ee1e7f9d60667360d4d885fb6a..855784d7f9c2993c5d91f67c9b8cc46fe6e4147e 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -13,8 +13,13 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||||
val alsoShade: Configuration by configurations.creating
|
val alsoShade: Configuration by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
- implementation(project(":paper-api"))
|
- implementation(project(":paper-api"))
|
||||||
- implementation(project(":paper-mojangapi"))
|
- implementation(project(":paper-mojangapi"))
|
||||||
+ implementation(project(":aswm-core"))
|
|
||||||
+ // Scissors start
|
+ // Scissors start
|
||||||
+ implementation(project(":Scissors-API"))
|
+ implementation(project(":Scissors-API"))
|
||||||
+ implementation("io.papermc.paper:paper-mojangapi:1.20.4-R0.1-SNAPSHOT") {
|
+ implementation("io.papermc.paper:paper-mojangapi:1.20.4-R0.1-SNAPSHOT") {
|
||||||
@ -24,7 +23,7 @@ index 58da26ad2f128ba0b66f86820f60853f4be352f0..9d4e802c76470eeab5550ba9a8e31d07
|
|||||||
// Paper start
|
// Paper start
|
||||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||||
@@ -66,11 +71,19 @@ tasks.jar {
|
@@ -67,11 +71,19 @@ tasks.jar {
|
||||||
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
||||||
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
||||||
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
||||||
@ -46,7 +45,7 @@ index 58da26ad2f128ba0b66f86820f60853f4be352f0..9d4e802c76470eeab5550ba9a8e31d07
|
|||||||
"Implementation-Vendor" to date, // Paper
|
"Implementation-Vendor" to date, // Paper
|
||||||
"Specification-Title" to "Bukkit",
|
"Specification-Title" to "Bukkit",
|
||||||
"Specification-Version" to project.version,
|
"Specification-Version" to project.version,
|
||||||
@@ -154,7 +167,7 @@ fun TaskContainer.registerRunTask(
|
@@ -150,7 +162,7 @@ fun TaskContainer.registerRunTask(
|
||||||
name: String,
|
name: String,
|
||||||
block: JavaExec.() -> Unit
|
block: JavaExec.() -> Unit
|
||||||
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||||
@ -56,7 +55,7 @@ index 58da26ad2f128ba0b66f86820f60853f4be352f0..9d4e802c76470eeab5550ba9a8e31d07
|
|||||||
standardInput = System.`in`
|
standardInput = System.`in`
|
||||||
workingDir = rootProject.layout.projectDirectory
|
workingDir = rootProject.layout.projectDirectory
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
index 4b002e8b75d117b726b0de274a76d3596fce015b..87fd35ad9c7364124286fa5e9ef1d4b7efa73990 100644
|
index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d07175ca09 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
@@ -593,7 +593,7 @@ public class Metrics {
|
@@ -593,7 +593,7 @@ public class Metrics {
|
||||||
@ -73,7 +72,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..87fd35ad9c7364124286fa5e9ef1d4b7
|
|||||||
if (implVersion != null) {
|
if (implVersion != null) {
|
||||||
final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
||||||
- paperVersion = "git-Paper-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash);
|
- paperVersion = "git-Paper-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash);
|
||||||
+ paperVersion = "git-ScissorsASWM-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors
|
+ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors
|
||||||
} else {
|
} else {
|
||||||
paperVersion = "unknown";
|
paperVersion = "unknown";
|
||||||
}
|
}
|
||||||
@ -96,18 +95,31 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..21ded7c14c56a40feaa7741131be5166
|
|||||||
.completer(new ConsoleCommandCompleter(this.server))
|
.completer(new ConsoleCommandCompleter(this.server))
|
||||||
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index d6f329f4c9534d45533774ad2fadec709365297a..242d780a1ad761bf6c401369ca331d6ab6b6d4eb 100644
|
index c8772c773f9933ed1d1debfe707af4373c458152..05b0d82114aadbb713b7e5dad94ee0fe6221856a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1879,7 +1879,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1865,7 +1865,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
- return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
- return "Paper"; // Paper
|
||||||
+ return "Scissors"; // Scissors - Scissors > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
+ return "Scissors"; // Scissors
|
||||||
}
|
}
|
||||||
|
|
||||||
public SystemReport fillSystemReport(SystemReport details) {
|
public SystemReport fillSystemReport(SystemReport details) {
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
|
index c490a29bcf7410bc54959ee71375605964379ed5..f192db9868129bd1ee45e2b29c0c7479af33ebe1 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
|
@@ -266,7 +266,7 @@ import javax.annotation.Nullable; // Paper
|
||||||
|
import javax.annotation.Nonnull; // Paper
|
||||||
|
|
||||||
|
public final class CraftServer implements Server {
|
||||||
|
- private final String serverName = "Paper"; // Paper
|
||||||
|
+ private final String serverName = "Scissors"; // Scissors > // Paper
|
||||||
|
private final String serverVersion;
|
||||||
|
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||||
|
private final Logger logger = Logger.getLogger("Minecraft");
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||||
index 774556a62eb240da42e84db4502e2ed43495be17..741c76c4dfa0bb34cc23bd795c194bdea10418cc 100644
|
index 774556a62eb240da42e84db4502e2ed43495be17..741c76c4dfa0bb34cc23bd795c194bdea10418cc 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
@ -1,11 +1,11 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Video <videogamesm12@gmail.com>
|
||||||
Date: Sun, 10 Dec 2023 13:11:22 -0600
|
Date: Sun, 10 Dec 2023 13:11:22 -0600
|
||||||
Subject: [PATCH] UUID validation
|
Subject: [PATCH] UUID validation
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..b2cc15da40aa7bbcfc234b4e147ed0e53f359efa 100644
|
index 9067bab8ec695417d479393f07d9bc6432427d73..433e586bed53a8c17adec74b3088899c748d4be3 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
@@ -20,6 +20,7 @@ import net.minecraft.nbt.CompoundTag;
|
@@ -20,6 +20,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||||
@ -16,7 +16,7 @@ index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..b2cc15da40aa7bbcfc234b4e147ed0e5
|
|||||||
import net.minecraft.util.StringRepresentable;
|
import net.minecraft.util.StringRepresentable;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
@@ -161,7 +162,14 @@ public class HoverEvent {
|
@@ -148,7 +149,14 @@ public class HoverEvent {
|
||||||
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
||||||
Component component = Component.Serializer.fromJson(compoundTag.getString("name"));
|
Component component = Component.Serializer.fromJson(compoundTag.getString("name"));
|
||||||
EntityType<?> entityType = BuiltInRegistries.ENTITY_TYPE.get(new ResourceLocation(compoundTag.getString("type")));
|
EntityType<?> entityType = BuiltInRegistries.ENTITY_TYPE.get(new ResourceLocation(compoundTag.getString("type")));
|
||||||
@ -31,4 +31,4 @@ index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..b2cc15da40aa7bbcfc234b4e147ed0e5
|
|||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
return DataResult.success(new HoverEvent.EntityTooltipInfo(entityType, uUID, component));
|
return DataResult.success(new HoverEvent.EntityTooltipInfo(entityType, uUID, component));
|
||||||
} catch (Exception var5) {
|
} catch (Exception var5) {
|
||||||
return DataResult.error(() -> {
|
return DataResult.error(() -> "Failed to parse tooltip: " + var5.getMessage());
|
@ -1,11 +1,11 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Video <videogamesm12@gmail.com>
|
||||||
Date: Sun, 10 Dec 2023 16:57:48 -0600
|
Date: Sun, 10 Dec 2023 16:57:48 -0600
|
||||||
Subject: [PATCH] Fixes log spam caused by invalid entities in beehives
|
Subject: [PATCH] Fixes log spam caused by invalid entities in beehives
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||||
index dfd364ac4b7551a13c4c6c100b5e62c0dfb10595..e0b0dec10dfc5d8e336a4c0f7005e7186f925c1a 100644
|
index d445ed0895293dd45c36226051f5809be8587ebe..b9c8b70fb0bf47ffe62cf0d082156479d07da331 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||||
@@ -11,6 +11,7 @@ import net.minecraft.nbt.CompoundTag;
|
@@ -11,6 +11,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||||
@ -16,7 +16,7 @@ index dfd364ac4b7551a13c4c6c100b5e62c0dfb10595..e0b0dec10dfc5d8e336a4c0f7005e718
|
|||||||
import net.minecraft.sounds.SoundEvents;
|
import net.minecraft.sounds.SoundEvents;
|
||||||
import net.minecraft.sounds.SoundSource;
|
import net.minecraft.sounds.SoundSource;
|
||||||
import net.minecraft.tags.BlockTags;
|
import net.minecraft.tags.BlockTags;
|
||||||
@@ -370,6 +371,13 @@ public class BeehiveBlockEntity extends BlockEntity {
|
@@ -380,6 +381,13 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||||
|
|
||||||
for (int i = 0; i < nbttaglist.size(); ++i) {
|
for (int i = 0; i < nbttaglist.size(); ++i) {
|
||||||
CompoundTag nbttagcompound1 = nbttaglist.getCompound(i);
|
CompoundTag nbttagcompound1 = nbttaglist.getCompound(i);
|
@ -1,6 +1,6 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Video <videogamesm12@gmail.com>
|
||||||
Date: Sun, 10 Dec 2023 13:40:21 -0600
|
Date: Wed, 24 Jan 2024 16:28:16 -0600
|
||||||
Subject: [PATCH] ResourceLocation validation
|
Subject: [PATCH] ResourceLocation validation
|
||||||
|
|
||||||
|
|
||||||
@ -31,10 +31,10 @@ index 2ee4ee14ab3345486dad6b24fd9a4fcc6c746b99..c5ac6cda91a81d3075f5c763e30dc009
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||||
index 1f55185814125c691288294d18bf1580461c8066..259d65f8e21f9cf99585d416eafdc967dddccf57 100644
|
index 094ab43e5a209ea848bf0994db9018281c64e08d..c6faba7da6809e24d734b7d6b0b787d20163b051 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
--- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
+++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||||
@@ -409,7 +409,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
@@ -410,7 +410,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
||||||
try {
|
try {
|
||||||
this.setParticle(ParticleArgument.readParticle(new StringReader(nbt.getString("Particle")), (HolderLookup) BuiltInRegistries.PARTICLE_TYPE.asLookup()));
|
this.setParticle(ParticleArgument.readParticle(new StringReader(nbt.getString("Particle")), (HolderLookup) BuiltInRegistries.PARTICLE_TYPE.asLookup()));
|
||||||
} catch (CommandSyntaxException commandsyntaxexception) {
|
} catch (CommandSyntaxException commandsyntaxexception) {
|
||||||
@ -44,11 +44,11 @@ index 1f55185814125c691288294d18bf1580461c8066..259d65f8e21f9cf99585d416eafdc967
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
index 6cfce9755dd464a7afb01f9032e567ce3bcd5bc5..264c94f49035236e3584a3577f2516f0f430a552 100644
|
index 09e8445a3f8c6b3ebc852a75a9a25b41a51ba659..cfb2ce684da0ae97a844554b5ad3d41290058f32 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
@@ -599,7 +599,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
@@ -595,7 +595,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||||
if (generation) entity.generation = true; // Paper - add generation bool param
|
if (generation) entity.generation = true; // Paper - Don't fire sync event during generation
|
||||||
entity.load(nbt);
|
entity.load(nbt);
|
||||||
}, () -> {
|
}, () -> {
|
||||||
- EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id"));
|
- EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id"));
|
||||||
@ -56,50 +56,6 @@ index 6cfce9755dd464a7afb01f9032e567ce3bcd5bc5..264c94f49035236e3584a3577f2516f0
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
|
||||||
index a18aadbf7ae83713e1f2b21553185d8000bc7699..f5ad7ddf13cbb6452c2927aef9b54eae3335b4c6 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
|
||||||
@@ -289,7 +289,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
String s = (String) iterator.next();
|
|
||||||
|
|
||||||
- this.recipesUsed.put(new ResourceLocation(s), nbttagcompound1.getInt(s));
|
|
||||||
+ // Scissors start
|
|
||||||
+ final ResourceLocation rl = ResourceLocation.tryParse(s);
|
|
||||||
+ if (rl != null) {
|
|
||||||
+ this.recipesUsed.put(rl, nbttagcompound1.getInt(s));
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
}
|
|
||||||
|
|
||||||
// Paper start - cook speed API
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
|
||||||
index b5b1831631e233a96b6fd55972a8862b0f420da8..a086f12c09a5e38f63c8de118fcb5a6a30e40b52 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
|
||||||
@@ -199,7 +199,7 @@ public class BrushableBlockEntity extends BlockEntity {
|
|
||||||
|
|
||||||
private boolean tryLoadLootTable(CompoundTag nbt) {
|
|
||||||
if (nbt.contains("LootTable", 8)) {
|
|
||||||
- this.lootTable = new ResourceLocation(nbt.getString("LootTable"));
|
|
||||||
+ this.lootTable = ResourceLocation.tryParse(nbt.getString("LootTable")); // Scissors
|
|
||||||
this.lootTableSeed = nbt.getLong("LootTableSeed");
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
|
||||||
index 64875525df244db838560f5fefb7b1b07b0f1f51..fd490db7431404b0324e5ade474ec95d694aa489 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
|
||||||
@@ -50,7 +50,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
|
||||||
// Copied from super with changes, always check the original method
|
|
||||||
this.lootableData.loadNbt(nbt); // Paper
|
|
||||||
if (nbt.contains("LootTable", 8)) {
|
|
||||||
- this.setLootTable(new ResourceLocation(nbt.getString("LootTable")));
|
|
||||||
+ this.setLootTable(ResourceLocation.tryParse((nbt.getString("LootTable")))); // Scissors - Validate loot tables
|
|
||||||
try { org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(this.lootTable); } catch (IllegalArgumentException ex) { this.lootTable = null; } // Paper - validate
|
|
||||||
this.setLootTableSeed(nbt.getLong("LootTableSeed"));
|
|
||||||
return false; // Paper - always load the items, table may still remain
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
||||||
index f6942cb3ef1f9ef03708d4bc932ea9aeb1c13894..8b32864bafb3c1948993688be8f639dd6492057e 100644
|
index f6942cb3ef1f9ef03708d4bc932ea9aeb1c13894..8b32864bafb3c1948993688be8f639dd6492057e 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
||||||
@ -144,7 +100,7 @@ index 313ee5c8737b2e57f9b5db6512c1871766b2ccd4..a115a13ec911884a804800fc13f0347b
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
index 5f6a1fb323782816f706ccf7df922cb203238302..21b4594379a5e904ad60f9c9512ace94e7ed5f68 100644
|
index 31f62fbb54ec7b270fbd8afba7bd7c4bfafa09e3..684e69753be0398ebe57172454aba8cc45cf6502 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
@@ -80,8 +80,15 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
@@ -80,8 +80,15 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||||
|
@ -6,13 +6,13 @@ Subject: [PATCH] Ignore errors thrown when trying to remove minecart entities
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||||
index 6d23c39e4eadf23616080d6d08672e13b5d3c37d..0bd5c3e3bb7074b5265e3f1bf670f993c9fe167d 100644
|
index 756d0434472921992c9d84597d7c9c824e93614c..77e9e106c522712a484d01bf7e7434c380de3621 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||||
@@ -139,7 +139,11 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
|
@@ -147,7 +147,11 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
|
||||||
@Override
|
public void remove(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) {
|
||||||
public void remove(Entity.RemovalReason reason) {
|
// CraftBukkit end
|
||||||
if (!this.level().isClientSide && reason.shouldDestroy()) {
|
if (!this.level().isClientSide && entity_removalreason.shouldDestroy()) {
|
||||||
- Containers.dropContents(this.level(), (Entity) this, (Container) this);
|
- Containers.dropContents(this.level(), (Entity) this, (Container) this);
|
||||||
+ // Scissors start - Ignore errors thrown when trying to remove minecart entities with content in them
|
+ // Scissors start - Ignore errors thrown when trying to remove minecart entities with content in them
|
||||||
+ try {
|
+ try {
|
||||||
@ -21,4 +21,4 @@ index 6d23c39e4eadf23616080d6d08672e13b5d3c37d..0bd5c3e3bb7074b5265e3f1bf670f993
|
|||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
}
|
}
|
||||||
|
|
||||||
super.remove(reason);
|
super.remove(entity_removalreason, cause); // CraftBukkit - add Bukkit remove cause
|
@ -5,19 +5,20 @@ Subject: [PATCH] ItemEntity - Check if items are air before calling setItem
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
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 a39db702063887cf530f272deaf4f334047cc7d4..1816d8bc0716d06cb3db37730234bd37b100f573 100644
|
index c7f06c3cfb737bd17a706798bf9cf0e1af5f0cc0..4fd00227d035284688e641cb2c55a3214dcbaa38 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
@@ -444,11 +444,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
@@ -445,11 +445,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||||
|
|
||||||
CompoundTag nbttagcompound1 = nbt.getCompound("Item");
|
CompoundTag nbttagcompound1 = nbt.getCompound("Item");
|
||||||
|
|
||||||
- this.setItem(ItemStack.of(nbttagcompound1));
|
- this.setItem(ItemStack.of(nbttagcompound1));
|
||||||
- if (this.getItem().isEmpty()) {
|
- if (this.getItem().isEmpty()) {
|
||||||
|
- this.discard(null); // CraftBukkit - add Bukkit remove cause
|
||||||
+ // Scissors start
|
+ // Scissors start
|
||||||
+ ItemStack item = ItemStack.of(nbttagcompound1);
|
+ ItemStack item = ItemStack.of(nbttagcompound1);
|
||||||
+ if (item.isEmpty()) {
|
+ if (item.isEmpty()) {
|
||||||
this.discard();
|
+ this.discard(null);
|
||||||
+ return;
|
+ return;
|
||||||
}
|
}
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
|
||||||
Date: Sun, 10 Dec 2023 16:58:55 -0600
|
|
||||||
Subject: [PATCH] Removes useless spammy error logging
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
|
||||||
index 91bbea5cb169f96910cc8661151c04dbff057091..84c9f2b09576046c138a11a835c9192a6e347c1d 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
|
||||||
@@ -1805,8 +1805,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
|
||||||
resource = CraftNamespacedKey.fromMinecraft(key);
|
|
||||||
}
|
|
||||||
} catch (IllegalArgumentException ex) {
|
|
||||||
- org.bukkit.Bukkit.getLogger().warning("Namespaced resource does not validate: " + key.toString());
|
|
||||||
- ex.printStackTrace();
|
|
||||||
+ // Scissors - Don't log errors thrown by invalid namespaces when an error is thrown
|
|
||||||
}
|
|
||||||
|
|
||||||
return resource;
|
|
@ -6,17 +6,17 @@ Subject: [PATCH] Fixes Knowledge Books causing log spam when invalid data is
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
diff --git a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
||||||
index 37f37be56bab171df442b980ff46ff325daae283..deade19d16a7d6870171b9a60806a8cadb437db4 100644
|
index 5ebc309aed545a4c22970e617519fe916a29fa3c..14a35465e41c9ecb51bea5b084e2637ebd21d295 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
--- a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
+++ b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
||||||
@@ -40,9 +40,9 @@ public class KnowledgeBookItem extends Item {
|
@@ -40,9 +40,9 @@ public class KnowledgeBookItem extends Item {
|
||||||
|
|
||||||
for(int i = 0; i < listTag.size(); ++i) {
|
for (int i = 0; i < listTag.size(); i++) {
|
||||||
String string = listTag.getString(i);
|
String string = listTag.getString(i);
|
||||||
- Optional<RecipeHolder<?>> optional = recipeManager.byKey(new ResourceLocation(string));
|
- Optional<RecipeHolder<?>> optional = recipeManager.byKey(new ResourceLocation(string));
|
||||||
+ Optional<RecipeHolder<?>> optional = recipeManager.byKey(ResourceLocation.tryParse(string)); // Scissors - Validate resource locations
|
+ Optional<RecipeHolder<?>> optional = recipeManager.byKey(ResourceLocation.tryParse(string)); // Scissors - Validate resource locations
|
||||||
if (!optional.isPresent()) {
|
if (!optional.isPresent()) {
|
||||||
- LOGGER.error("Invalid recipe: {}", (Object)string);
|
- LOGGER.error("Invalid recipe: {}", string);
|
||||||
+ // Scissors - Don't log errors caused by invalid recipes being provided
|
+ // Scissors - Don't log errors caused by invalid recipes being provided
|
||||||
return InteractionResultHolder.fail(itemStack);
|
return InteractionResultHolder.fail(itemStack);
|
||||||
}
|
}
|
||||||
@ -25,7 +25,7 @@ index 37f37be56bab171df442b980ff46ff325daae283..deade19d16a7d6870171b9a60806a8ca
|
|||||||
|
|
||||||
return InteractionResultHolder.sidedSuccess(itemStack, world.isClientSide());
|
return InteractionResultHolder.sidedSuccess(itemStack, world.isClientSide());
|
||||||
} else {
|
} else {
|
||||||
- LOGGER.error("Tag not valid: {}", (Object)compoundTag);
|
- LOGGER.error("Tag not valid: {}", compoundTag);
|
||||||
+ // Scissors - Don't throw errors into the logs if an NBT compound isn't present or is missing the Recipes tag.
|
+ // Scissors - Don't throw errors into the logs if an NBT compound isn't present or is missing the Recipes tag.
|
||||||
return InteractionResultHolder.fail(itemStack);
|
return InteractionResultHolder.fail(itemStack);
|
||||||
}
|
}
|
@ -5,15 +5,15 @@ Subject: [PATCH] Validate BlockState and SoundEvent values
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||||
index 80083fed4b44b9d433925f09db83e559582109a1..032fc2add6c25780a3663fd1d2e429fcfd37dc4a 100644
|
index fe4bea6af0d8734f3a5b972dce5f1e3914d6690e..0ee64be4288f59240beec26c470b78cc1aeac424 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||||
@@ -231,7 +231,7 @@ public final class NbtUtils {
|
@@ -223,7 +223,7 @@ public final class NbtUtils {
|
||||||
return Blocks.AIR.defaultBlockState();
|
return Blocks.AIR.defaultBlockState();
|
||||||
} else {
|
} else {
|
||||||
// Paper start - Validate resource location
|
// Paper start - Validate resource location
|
||||||
- ResourceLocation resourceLocation = ResourceLocation.tryParse(nbt.getString("Name"));
|
- ResourceLocation resourceLocation = ResourceLocation.tryParse(nbt.getString("Name"));
|
||||||
+ ResourceLocation resourceLocation = ResourceLocation.tryParse(nbt.getString("Name")); // Scissors - Validate BlockState
|
+ ResourceLocation resourceLocation = ResourceLocation.tryParse(nbt.getString("Name")); // Scissors - Validate BlockState
|
||||||
Optional<? extends Holder<Block>> optional = resourceLocation != null ? blockLookup.get(ResourceKey.create(Registries.BLOCK, resourceLocation)) : Optional.empty();
|
Optional<? extends Holder<Block>> optional = resourceLocation != null ? blockLookup.get(ResourceKey.create(Registries.BLOCK, resourceLocation)) : Optional.empty();
|
||||||
// Paper end
|
// Paper end - Validate resource location
|
||||||
if (optional.isEmpty()) {
|
if (optional.isEmpty()) {
|
@ -1,24 +1,24 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sun, 10 Dec 2023 17:13:15 -0600
|
Date: Mon, 15 Apr 2024 22:26:14 -0500
|
||||||
Subject: [PATCH] Do not log invalid items in HoverEvent and ItemFrame
|
Subject: [PATCH] Do not log invalid items in HoverEvent and ItemFrame
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
index b2cc15da40aa7bbcfc234b4e147ed0e53f359efa..dbe9f81e298a931c3e0e5b879dc13b493b3fdb52 100644
|
index 433e586bed53a8c17adec74b3088899c748d4be3..a82b4e39c3160114aded3f33c85fad2e95065b72 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
@@ -280,7 +280,7 @@ public class HoverEvent {
|
@@ -261,7 +261,7 @@ public class HoverEvent {
|
||||||
|
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
||||||
return DataResult.success(new HoverEvent.ItemStackInfo(ItemStack.of(compoundTag)));
|
return DataResult.success(new HoverEvent.ItemStackInfo(ItemStack.of(compoundTag)));
|
||||||
} catch (CommandSyntaxException var2) {
|
} catch (CommandSyntaxException var2) {
|
||||||
return DataResult.error(() -> {
|
- return DataResult.error(() -> "Failed to parse item tag: " + var2.getMessage());
|
||||||
- return "Failed to parse item tag: " + var2.getMessage();
|
+ return null;
|
||||||
+ return null;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
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 69912c5b300b67394dce3876d2d96872033cf156..ebc403ff31385a12e072fd6a419a7787ee76429e 100644
|
index c34701f95580e4cf45fe086115563127432a28c5..fc7547381a5dd7c0aae352c0cae72a980953b98f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||||
@@ -436,7 +436,7 @@ public class ItemFrame extends HangingEntity {
|
@@ -436,7 +436,7 @@ public class ItemFrame extends HangingEntity {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Reject oversized components from updating
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/ComponentUtils.java b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
diff --git a/src/main/java/net/minecraft/network/chat/ComponentUtils.java b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
||||||
index 7daca712816a79cc4a30b084afbd3d07b5d3755f..a7e04eb4284e7d5148e1c7b991620d666785ec70 100644
|
index 3365aed2b67ae0e4dd0410f5190ba474f146139b..43b62a07b040b1d7d76dc8f940f35b51d1d5f868 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
--- a/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
+++ b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
||||||
@@ -38,8 +38,9 @@ public class ComponentUtils {
|
@@ -38,8 +38,9 @@ public class ComponentUtils {
|
||||||
@ -17,7 +17,7 @@ index 7daca712816a79cc4a30b084afbd3d07b5d3755f..a7e04eb4284e7d5148e1c7b991620d66
|
|||||||
- return text.copy();
|
- return text.copy();
|
||||||
+ result = text.copy(); // Scissors
|
+ result = text.copy(); // Scissors
|
||||||
} else {
|
} else {
|
||||||
// Paper start
|
// Paper start - adventure; pass actual vanilla component
|
||||||
if (text instanceof io.papermc.paper.adventure.AdventureComponent adventureComponent) {
|
if (text instanceof io.papermc.paper.adventure.AdventureComponent adventureComponent) {
|
||||||
@@ -52,8 +53,9 @@ public class ComponentUtils {
|
@@ -52,8 +53,9 @@ public class ComponentUtils {
|
||||||
mutableComponent.append(updateForEntity(source, component, sender, depth + 1));
|
mutableComponent.append(updateForEntity(source, component, sender, depth + 1));
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add Scissors configuration file & command
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||||
index a2f71a6d1a9e98133dff6cd0f625da9435a8af14..f83b2c4298bd1a5f65487f64bd6a11fb190a622d 100644
|
index 7620c72a4c243cbeea245203ce03a97cbfa7d922..a05a348c299a68a61fabcbdcc689a89a81d1301f 100644
|
||||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||||
@@ -25,6 +25,7 @@ package co.aikar.timings;
|
@@ -25,6 +25,7 @@ package co.aikar.timings;
|
||||||
@ -16,7 +16,7 @@ index a2f71a6d1a9e98133dff6cd0f625da9435a8af14..f83b2c4298bd1a5f65487f64bd6a11fb
|
|||||||
import net.kyori.adventure.text.event.ClickEvent;
|
import net.kyori.adventure.text.event.ClickEvent;
|
||||||
import net.kyori.adventure.text.format.NamedTextColor;
|
import net.kyori.adventure.text.format.NamedTextColor;
|
||||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||||
@@ -242,7 +243,8 @@ public class TimingsExport extends Thread {
|
@@ -240,7 +241,8 @@ public class TimingsExport extends Thread {
|
||||||
parent.put("config", createObject(
|
parent.put("config", createObject(
|
||||||
pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
||||||
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||||
@ -414,24 +414,24 @@ index 0000000000000000000000000000000000000000..8cd2848aa6b06c5efbe797ed2d75ff4b
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||||
index 7573c12a77797146c51ef2dfe4b2a636df45e21a..90d9c9cbf730df6ec1800a611fd9103418cce607 100644
|
index bc391d27399d8c22e78735ca39aa8ab45efb6413..ce5d500ff4642e646a84c09dcff07375b9d80176 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Main.java
|
--- a/src/main/java/net/minecraft/server/Main.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||||
@@ -141,6 +141,7 @@ public class Main {
|
@@ -130,6 +130,7 @@ public class Main {
|
||||||
// Paper start - load config files for access below if needed
|
// Paper start - load config files early for access below if needed
|
||||||
org.bukkit.configuration.file.YamlConfiguration bukkitConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("bukkit-settings"));
|
org.bukkit.configuration.file.YamlConfiguration bukkitConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("bukkit-settings"));
|
||||||
org.bukkit.configuration.file.YamlConfiguration spigotConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("spigot-settings"));
|
org.bukkit.configuration.file.YamlConfiguration spigotConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("spigot-settings"));
|
||||||
+ org.bukkit.configuration.file.YamlConfiguration scissorsConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("scissors-settings")); // Scissors - TODO Change this
|
+ org.bukkit.configuration.file.YamlConfiguration scissorsConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("scissors-settings")); // Scissors - TODO Change this
|
||||||
// Paper end
|
// Paper end - load config files early for access below if needed
|
||||||
|
|
||||||
if (optionset.has("initSettings")) { // CraftBukkit
|
if (optionset.has("initSettings")) { // CraftBukkit
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 58536aabf607015939a1326f80207c0a06eed8ff..34a8c36d88eb17b7574b6766f5e14ef926ec9080 100644
|
index 68d268b6fff126e8645b6deec3fb549ea2286b77..5cb58e351d38b7214e2002bf608512024744f0ee 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -222,6 +222,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -222,6 +222,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
|
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||||
// Paper end
|
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // Paper - init PaperBrigadierProvider
|
||||||
|
|
||||||
+ // Scissors start
|
+ // Scissors start
|
||||||
+ try {
|
+ try {
|
||||||
@ -447,10 +447,10 @@ index 58536aabf607015939a1326f80207c0a06eed8ff..34a8c36d88eb17b7574b6766f5e14ef9
|
|||||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||||
this.setMotd(dedicatedserverproperties.motd);
|
this.setMotd(dedicatedserverproperties.motd);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 142d2c48239d4ebe3896218536656d116cd24d7c..36fe3df8b26136a62381336c83fe266a5bf2266d 100644
|
index f192db9868129bd1ee45e2b29c0c7479af33ebe1..1233d9b15d86079b2710e167ada03a4d0898642f 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -1036,6 +1036,7 @@ public final class CraftServer implements Server {
|
@@ -1053,6 +1053,7 @@ public final class CraftServer implements Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||||
@ -458,7 +458,7 @@ index 142d2c48239d4ebe3896218536656d116cd24d7c..36fe3df8b26136a62381336c83fe266a
|
|||||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||||
for (ServerLevel world : this.console.getAllLevels()) {
|
for (ServerLevel world : this.console.getAllLevels()) {
|
||||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||||
@@ -1067,6 +1068,7 @@ public final class CraftServer implements Server {
|
@@ -1084,6 +1085,7 @@ public final class CraftServer implements Server {
|
||||||
this.reloadData();
|
this.reloadData();
|
||||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||||
@ -466,7 +466,7 @@ index 142d2c48239d4ebe3896218536656d116cd24d7c..36fe3df8b26136a62381336c83fe266a
|
|||||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||||
|
|
||||||
@@ -3011,6 +3013,14 @@ public final class CraftServer implements Server {
|
@@ -3028,6 +3030,14 @@ public final class CraftServer implements Server {
|
||||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,7 +482,7 @@ index 142d2c48239d4ebe3896218536656d116cd24d7c..36fe3df8b26136a62381336c83fe266a
|
|||||||
public void restart() {
|
public void restart() {
|
||||||
org.spigotmc.RestartCommand.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
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
index 1576a201c92d8b17fd3a92ec497c42861db8ad1e..81454e29639f428e3331c5c20bb7ad39351d2f8a 100644
|
index 8d626fadcd4743b6472a2954d2b1b2ec89669814..c0538206a53f0e6d9b54bddde0259b89ac73d675 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
@@ -181,6 +181,20 @@ public class Main {
|
@@ -181,6 +181,20 @@ public class Main {
|
@ -1,14 +1,14 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sun, 10 Dec 2023 17:26:11 -0600
|
Date: Mon, 15 Apr 2024 22:36:13 -0500
|
||||||
Subject: [PATCH] Better handling of invalid JSON components
|
Subject: [PATCH] Better handling of invalid JSON components
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||||
index 200ed770b57e1a9240abf0473968d4b85cbefe3c..1a2a3b506e2f9bce77294c3788451bfd47394548 100644
|
index e028353e0261310afc42ca0454b723d9f1ffc131..ed8810319db2ce754245193a62ea7a9a32ac13ec 100644
|
||||||
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||||
@@ -654,12 +654,6 @@ public final class MCUtil {
|
@@ -675,12 +675,6 @@ public final class MCUtil {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String string = compound.getString(key);
|
String string = compound.getString(key);
|
||||||
@ -19,23 +19,14 @@ index 200ed770b57e1a9240abf0473968d4b85cbefe3c..1a2a3b506e2f9bce77294c3788451bfd
|
|||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- return null;
|
- return null;
|
||||||
+ return net.minecraft.network.chat.Component.Serializer.fromJsonSafe(string);
|
+ return net.minecraft.network.chat.Component.Serializer.fromJsonSafe(string); // Scissors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
index d3a80d0a23be762c05931ae8001d98e43cab2b4a..ba13650b52e39c9cc5cfa421f7720c7d4ba75678 100644
|
index d3a80d0a23be762c05931ae8001d98e43cab2b4a..ae84d06564b2560e13404f6d89f88ad71dbc2cc6 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
@@ -23,6 +23,8 @@ import java.util.List;
|
@@ -315,6 +315,26 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.UUID;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
+
|
|
||||||
+import net.minecraft.ChatFormatting;
|
|
||||||
import net.minecraft.Util;
|
|
||||||
import net.minecraft.network.chat.contents.DataSource;
|
|
||||||
import net.minecraft.network.chat.contents.KeybindContents;
|
|
||||||
@@ -315,6 +317,26 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
return json == null ? null : Serializer.deserialize(json);
|
return json == null ? null : Serializer.deserialize(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,10 +54,10 @@ index d3a80d0a23be762c05931ae8001d98e43cab2b4a..ba13650b52e39c9cc5cfa421f7720c7d
|
|||||||
public static MutableComponent fromJsonLenient(String json) {
|
public static MutableComponent fromJsonLenient(String json) {
|
||||||
JsonReader jsonreader = new JsonReader(new StringReader(json));
|
JsonReader jsonreader = new JsonReader(new StringReader(json));
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
index dbe9f81e298a931c3e0e5b879dc13b493b3fdb52..6708290b6d096e8081c56d2e0da3c9ae2a112176 100644
|
index a82b4e39c3160114aded3f33c85fad2e95065b72..e1f15ac481ab598e420ad79bcf289251d9f1c99a 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
@@ -160,7 +160,7 @@ public class HoverEvent {
|
@@ -147,7 +147,7 @@ public class HoverEvent {
|
||||||
public static DataResult<HoverEvent.EntityTooltipInfo> legacyCreate(Component text) {
|
public static DataResult<HoverEvent.EntityTooltipInfo> legacyCreate(Component text) {
|
||||||
try {
|
try {
|
||||||
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
||||||
@ -76,27 +67,27 @@ index dbe9f81e298a931c3e0e5b879dc13b493b3fdb52..6708290b6d096e8081c56d2e0da3c9ae
|
|||||||
// Scissors start
|
// Scissors start
|
||||||
UUID uUID;
|
UUID uUID;
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/contents/NbtContents.java b/src/main/java/net/minecraft/network/chat/contents/NbtContents.java
|
diff --git a/src/main/java/net/minecraft/network/chat/contents/NbtContents.java b/src/main/java/net/minecraft/network/chat/contents/NbtContents.java
|
||||||
index 186547674894fd084bceb478bb6017b747df4173..74c880425964da042ca57c097eb93273da59ce7e 100644
|
index c5673657ca6332147a5cbd2f4107fee13b9b7f47..3fec6f3e0adef6e2094157ef9040c7c6dc41a6c2 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/contents/NbtContents.java
|
--- a/src/main/java/net/minecraft/network/chat/contents/NbtContents.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/contents/NbtContents.java
|
+++ b/src/main/java/net/minecraft/network/chat/contents/NbtContents.java
|
||||||
@@ -115,10 +115,10 @@ public class NbtContents implements ComponentContents {
|
@@ -124,10 +124,10 @@ public class NbtContents implements ComponentContents {
|
||||||
Component component = DataFixUtils.orElse(ComponentUtils.updateForEntity(source, this.separator, sender, depth), ComponentUtils.DEFAULT_NO_STYLE_SEPARATOR);
|
);
|
||||||
return stream.flatMap((text) -> {
|
return stream.flatMap(text -> {
|
||||||
try {
|
try {
|
||||||
- MutableComponent mutableComponent = Component.Serializer.fromJson(text);
|
- MutableComponent mutableComponent = Component.Serializer.fromJson(text);
|
||||||
+ MutableComponent mutableComponent = Component.Serializer.fromJsonSafe(text);
|
+ MutableComponent mutableComponent = Component.Serializer.fromJsonSafe(text); // Scissors
|
||||||
return Stream.of(ComponentUtils.updateForEntity(source, mutableComponent, sender, depth));
|
return Stream.of(ComponentUtils.updateForEntity(source, mutableComponent, sender, depth));
|
||||||
} catch (Exception var5) {
|
} catch (Exception var5x) {
|
||||||
- LOGGER.warn("Failed to parse component: {}", text, var5);
|
- LOGGER.warn("Failed to parse component: {}", text, var5x);
|
||||||
+ // Scissors - don't log
|
+ // Scissors - don't log
|
||||||
return Stream.of();
|
return Stream.of();
|
||||||
}
|
}
|
||||||
}).reduce((accumulator, current) -> {
|
}).reduce((accumulator, current) -> accumulator.append(component).append(current)).orElseGet(Component::empty);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 1be10c57e374ad4018c08d96cfb69397a2f541d3..2e11d0f17fc8fa4ed84c40dd9747e136675030a4 100644
|
index 637478fd8a284e6833cf8f5fa17ccf9d73d1dd3f..2ecf2d8ff546ed097cb3b547db22d28a31d29ec4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2526,11 +2526,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -2545,11 +2545,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||||
if (nbt.contains("CustomName", 8)) {
|
if (nbt.contains("CustomName", 8)) {
|
||||||
String s = nbt.getString("CustomName");
|
String s = nbt.getString("CustomName");
|
||||||
|
|
||||||
@ -110,7 +101,7 @@ index 1be10c57e374ad4018c08d96cfb69397a2f541d3..2e11d0f17fc8fa4ed84c40dd9747e136
|
|||||||
|
|
||||||
this.setCustomNameVisible(nbt.getBoolean("CustomNameVisible"));
|
this.setCustomNameVisible(nbt.getBoolean("CustomNameVisible"));
|
||||||
diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
||||||
index b49d60d20d170d16a7daf2bc874e5d8d04552b3e..56ae1fa22bb722f91a06d7344bf879210f4ef8f2 100644
|
index 7eb1c28886741bdfe7985d16b6824f3e85ffae50..a6b7ff2e50c9700589428cc7d61b5ef9f9082ea8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
--- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
||||||
+++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
+++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
||||||
@@ -41,7 +41,7 @@ public class ScoreboardSaveData extends SavedData {
|
@@ -41,7 +41,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||||
@ -139,7 +130,7 @@ index b49d60d20d170d16a7daf2bc874e5d8d04552b3e..56ae1fa22bb722f91a06d7344bf87921
|
|||||||
if (component3 != null) {
|
if (component3 != null) {
|
||||||
playerTeam.setPlayerSuffix(component3);
|
playerTeam.setPlayerSuffix(component3);
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ public class ScoreboardSaveData extends SavedData {
|
@@ -123,7 +123,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||||
return ObjectiveCriteria.DUMMY;
|
return ObjectiveCriteria.DUMMY;
|
||||||
});
|
});
|
||||||
String string2 = compoundTag.getString("Name");
|
String string2 = compoundTag.getString("Name");
|
||||||
@ -147,4 +138,4 @@ index b49d60d20d170d16a7daf2bc874e5d8d04552b3e..56ae1fa22bb722f91a06d7344bf87921
|
|||||||
+ Component component = Component.Serializer.fromJsonSafe(compoundTag.getString("DisplayName")); // Scissors - Use safer method for getting Components from JSON
|
+ Component component = Component.Serializer.fromJsonSafe(compoundTag.getString("DisplayName")); // Scissors - Use safer method for getting Components from JSON
|
||||||
ObjectiveCriteria.RenderType renderType = ObjectiveCriteria.RenderType.byId(compoundTag.getString("RenderType"));
|
ObjectiveCriteria.RenderType renderType = ObjectiveCriteria.RenderType.byId(compoundTag.getString("RenderType"));
|
||||||
boolean bl = compoundTag.getBoolean("display_auto_update");
|
boolean bl = compoundTag.getBoolean("display_auto_update");
|
||||||
NumberFormat numberFormat = NumberFormatTypes.CODEC.parse(NbtOps.INSTANCE, compoundTag.get("format")).result().orElse((NumberFormat)null);
|
NumberFormat numberFormat = NumberFormatTypes.CODEC.parse(NbtOps.INSTANCE, compoundTag.get("format")).result().orElse(null);
|
@ -6,7 +6,7 @@ Subject: [PATCH] Prevent attributes with invalid namespaces from being applied
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
index 98118cadae93000192003b40e9051a6df216d197..36cd18534910efd410efd9dcc7e4bec27eb99a8f 100644
|
index 5cd0fbac267f9c69c5de4c200a95860f5c56d42e..f2ccf2af05524be91eb0f4855cb8006dea2aede4 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
@@ -47,6 +47,7 @@ import net.minecraft.nbt.NbtIo;
|
@@ -47,6 +47,7 @@ import net.minecraft.nbt.NbtIo;
|
||||||
@ -17,7 +17,7 @@ index 98118cadae93000192003b40e9051a6df216d197..36cd18534910efd410efd9dcc7e4bec2
|
|||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import org.apache.commons.lang3.EnumUtils;
|
import org.apache.commons.lang3.EnumUtils;
|
||||||
@@ -487,7 +488,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
@@ -488,7 +489,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||||
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
|
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
|
||||||
|
|
||||||
String attributeName = org.bukkit.craftbukkit.attribute.CraftAttributeMap.convertIfNeeded(entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT)); // Paper
|
String attributeName = org.bukkit.craftbukkit.attribute.CraftAttributeMap.convertIfNeeded(entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT)); // Paper
|
@ -1,180 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: ayunami2000 <spwilliamsiam@gmail.com>
|
|
||||||
Date: Mon, 28 Mar 2022 17:02:21 -0400
|
|
||||||
Subject: [PATCH] Block server-side chunkbans
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
|
|
||||||
index d364bd57b1675c8b21d781c2bc16c3e65800455c..f2e7585630ff724f966c7bcedc17e502d786870d 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
|
|
||||||
@@ -7,8 +7,16 @@ import io.netty.handler.codec.MessageToByteEncoder;
|
|
||||||
import io.netty.util.Attribute;
|
|
||||||
import io.netty.util.AttributeKey;
|
|
||||||
import java.io.IOException;
|
|
||||||
+import java.util.Collections; // Scissors
|
|
||||||
+import net.minecraft.ChatFormatting; // Scissors
|
|
||||||
+import net.minecraft.core.NonNullList; // Scissors
|
|
||||||
+import net.minecraft.nbt.CompoundTag; // Scissors
|
|
||||||
+import net.minecraft.network.chat.Component; // Scissors
|
|
||||||
+import net.minecraft.network.chat.SignedMessageBody; // Scissors
|
|
||||||
import net.minecraft.network.protocol.Packet;
|
|
||||||
+import net.minecraft.network.protocol.game.*; // Scissors
|
|
||||||
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
|
||||||
+import net.minecraft.world.item.ItemStack; // Scissors
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
|
|
||||||
public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
|
||||||
@@ -19,6 +27,23 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
|
||||||
this.codecKey = protocolKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Scissors start
|
|
||||||
+ private int tryWrite(Packet packet, FriendlyByteBuf friendlyByteBuf, ChannelHandlerContext channelHandlerContext, int i) {
|
|
||||||
+ friendlyByteBuf.writeVarInt(i);
|
|
||||||
+ friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(io.papermc.paper.adventure.PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
|
||||||
+
|
|
||||||
+ int j = friendlyByteBuf.writerIndex();
|
|
||||||
+ packet.write(friendlyByteBuf);
|
|
||||||
+ int k = friendlyByteBuf.writerIndex() - j;
|
|
||||||
+ int packetLength = friendlyByteBuf.readableBytes();
|
|
||||||
+ if (packetLength > MAX_PACKET_SIZE) {
|
|
||||||
+ throw new PacketTooLargeException(packet, this.codecKey, packetLength);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return k;
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
+
|
|
||||||
protected void encode(ChannelHandlerContext channelHandlerContext, Packet<?> packet, ByteBuf byteBuf) throws Exception {
|
|
||||||
Attribute<ConnectionProtocol.CodecData<?>> attribute = channelHandlerContext.channel().attr(this.codecKey);
|
|
||||||
ConnectionProtocol.CodecData<?> codecData = attribute.get();
|
|
||||||
@@ -34,46 +59,59 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
|
||||||
throw new IOException("Can't serialize unregistered packet");
|
|
||||||
} else {
|
|
||||||
FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(byteBuf);
|
|
||||||
- friendlyByteBuf.writeVarInt(i);
|
|
||||||
- friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(io.papermc.paper.adventure.PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
|
||||||
|
|
||||||
+ // Scissors start
|
|
||||||
+ int k;
|
|
||||||
try {
|
|
||||||
- int j = friendlyByteBuf.writerIndex();
|
|
||||||
- packet.write(friendlyByteBuf);
|
|
||||||
- int k = friendlyByteBuf.writerIndex() - j;
|
|
||||||
- if (false && k > 8388608) { // Paper - disable
|
|
||||||
- throw new IllegalArgumentException("Packet too big (is " + k + ", should be less than 8388608): " + packet);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k);
|
|
||||||
+ k = this.tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
|
||||||
} catch (Throwable var13) {
|
|
||||||
- // Paper start - Give proper error message
|
|
||||||
- String packetName = io.papermc.paper.util.ObfHelper.INSTANCE.deobfClassName(packet.getClass().getName());
|
|
||||||
- if (packetName.contains(".")) {
|
|
||||||
- packetName = packetName.substring(packetName.lastIndexOf(".") + 1);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- LOGGER.error("Packet encoding of packet {} (ID: {}) threw (skippable? {})", packetName, i, packet.isSkippable(), var13);
|
|
||||||
- // Paper end
|
|
||||||
- if (packet.isSkippable()) {
|
|
||||||
- throw new SkipPacketException(var13);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- throw var13;
|
|
||||||
- } finally {
|
|
||||||
- // Paper start
|
|
||||||
- int packetLength = friendlyByteBuf.readableBytes();
|
|
||||||
- if (packetLength > MAX_PACKET_SIZE) {
|
|
||||||
- throw new PacketTooLargeException(packet, this.codecKey, packetLength);
|
|
||||||
+ packet = capPacket(packet, i);
|
|
||||||
+ if (packet == null) {
|
|
||||||
+ throw new SkipPacketException(new IllegalArgumentException("Packet too big: " + packet));
|
|
||||||
}
|
|
||||||
- // Paper end
|
|
||||||
- ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet);
|
|
||||||
+ friendlyByteBuf.clear();
|
|
||||||
+ k = this.tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k);
|
|
||||||
+ ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet);
|
|
||||||
+ // Scissors end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Scissors start
|
|
||||||
+ private static Packet capPacket(Packet packet, int i) {
|
|
||||||
+ if (packet instanceof ClientboundBlockEntityDataPacket blockEntityDataPacket) {
|
|
||||||
+ packet = new ClientboundBlockEntityDataPacket(blockEntityDataPacket.getPos(), blockEntityDataPacket.getType(), new CompoundTag());
|
|
||||||
+ } else if (packet instanceof ClientboundLevelChunkPacketData chunkPacket) {
|
|
||||||
+ chunkPacket.clearNBT();
|
|
||||||
+ } else if (packet instanceof ClientboundContainerSetContentPacket containerSetContentPacket) {
|
|
||||||
+ packet = new ClientboundContainerSetContentPacket(containerSetContentPacket.getContainerId(), containerSetContentPacket.getStateId(), NonNullList.create(), ItemStack.EMPTY);
|
|
||||||
+ } else if (packet instanceof ClientboundSetEquipmentPacket setEquipmentPacket) {
|
|
||||||
+ packet = new ClientboundSetEquipmentPacket(setEquipmentPacket.getEntity(), Collections.emptyList());
|
|
||||||
+ } else if (packet instanceof ClientboundContainerSetSlotPacket containerSetSlotPacket) {
|
|
||||||
+ packet = new ClientboundContainerSetSlotPacket(containerSetSlotPacket.getContainerId(), containerSetSlotPacket.getStateId(), containerSetSlotPacket.getSlot(), ItemStack.EMPTY);
|
|
||||||
+ } else if (packet instanceof ClientboundMapItemDataPacket mapItemDataPacket) {
|
|
||||||
+ packet = new ClientboundMapItemDataPacket(mapItemDataPacket.getMapId(), mapItemDataPacket.getScale(), mapItemDataPacket.isLocked(), null, null);
|
|
||||||
+ } else if (packet instanceof ClientboundPlayerChatPacket playerChatPacket) {
|
|
||||||
+ final SignedMessageBody.Packed body = playerChatPacket.body();
|
|
||||||
+ packet = new ClientboundPlayerChatPacket(playerChatPacket.sender(), // Not sending this packet results in a kick when someone says something.
|
|
||||||
+ playerChatPacket.index(),
|
|
||||||
+ playerChatPacket.signature(),
|
|
||||||
+ playerChatPacket.body(),
|
|
||||||
+ Component.empty().append("** Message too large **").withStyle(ChatFormatting.RED),
|
|
||||||
+ playerChatPacket.filterMask(),
|
|
||||||
+ playerChatPacket.chatType()
|
|
||||||
+ );
|
|
||||||
+ } else {
|
|
||||||
+ return null;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return packet;
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
+
|
|
||||||
// Paper start
|
|
||||||
private static int MAX_PACKET_SIZE = 8388608;
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
|
|
||||||
index 3944852921335c78a04a9dc301882ab5b152b1ed..96ee53c7cc862e059328c5cdf5e07f309df6a79e 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
|
|
||||||
@@ -24,7 +24,7 @@ public class ClientboundBlockEntityDataPacket implements Packet<ClientGamePacket
|
|
||||||
return create(blockEntity, BlockEntity::getUpdateTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
- private ClientboundBlockEntityDataPacket(BlockPos pos, BlockEntityType<?> blockEntityType, CompoundTag nbt) {
|
|
||||||
+ public ClientboundBlockEntityDataPacket(BlockPos pos, BlockEntityType<?> blockEntityType, CompoundTag nbt) { // Scissors - private -> public
|
|
||||||
this.pos = pos;
|
|
||||||
this.type = blockEntityType;
|
|
||||||
this.tag = nbt.isEmpty() ? null : nbt;
|
|
||||||
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 51e24105facfe71ce9f2757c6c881a21b58dacfd..5692fbae221fb01d32d92edc7bea0f6312e24e1c 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
|
||||||
@@ -33,6 +33,13 @@ public class ClientboundLevelChunkPacketData {
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
|
|
||||||
+ // Scissors start
|
|
||||||
+ public void clearNBT() {
|
|
||||||
+ this.blockEntitiesData.clear();
|
|
||||||
+ this.extraPackets.clear();
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
+
|
|
||||||
// Paper start - Anti-Xray - Add chunk packet info
|
|
||||||
@Deprecated @io.papermc.paper.annotation.DoNotUse public ClientboundLevelChunkPacketData(LevelChunk chunk) { this(chunk, null); }
|
|
||||||
public ClientboundLevelChunkPacketData(LevelChunk chunk, com.destroystokyo.paper.antixray.ChunkPacketInfo<net.minecraft.world.level.block.state.BlockState> chunkPacketInfo) {
|
|
||||||
@@ -58,6 +65,7 @@ public class ClientboundLevelChunkPacketData {
|
|
||||||
int totalTileEntities = 0; // Paper
|
|
||||||
|
|
||||||
for(Map.Entry<BlockPos, BlockEntity> entry2 : chunk.getBlockEntities().entrySet()) {
|
|
||||||
+ if (this.extraPackets.size() > 50) break; // Scissors - Limit extraPackets size
|
|
||||||
// Paper start
|
|
||||||
if (++totalTileEntities > TE_LIMIT) {
|
|
||||||
var packet = entry2.getValue().getUpdatePacket();
|
|
@ -1,11 +1,11 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Video <videogamesm12@gmail.com>
|
||||||
Date: Sun, 10 Dec 2023 17:39:52 -0600
|
Date: Sun, 10 Dec 2023 17:39:52 -0600
|
||||||
Subject: [PATCH] Don't query player data in the `nbt` component
|
Subject: [PATCH] Don't query player data in the `nbt` component
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java b/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java
|
diff --git a/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java b/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java
|
||||||
index 3bec895fecb3521653fb0b88d4a4854fd3766b46..5fd278ac13c02b9d511be22dba9719cb0cb0e17b 100644
|
index 2750702cff35762bc817ffbe5bf81631e86bc49b..8714c3be77490a87aa6df0ff36a87557c6b99e25 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java
|
--- a/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java
|
+++ b/src/main/java/net/minecraft/network/chat/contents/EntityDataSource.java
|
||||||
@@ -8,12 +8,15 @@ import com.mojang.serialization.codecs.RecordCodecBuilder;
|
@@ -8,12 +8,15 @@ import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
@ -23,7 +23,7 @@ index 3bec895fecb3521653fb0b88d4a4854fd3766b46..5fd278ac13c02b9d511be22dba9719cb
|
|||||||
+import net.minecraft.world.entity.player.Player;
|
+import net.minecraft.world.entity.player.Player;
|
||||||
|
|
||||||
public record EntityDataSource(String selectorPattern, @Nullable EntitySelector compiledSelector) implements DataSource {
|
public record EntityDataSource(String selectorPattern, @Nullable EntitySelector compiledSelector) implements DataSource {
|
||||||
public static final MapCodec<EntityDataSource> SUB_CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
public static final MapCodec<EntityDataSource> SUB_CODEC = RecordCodecBuilder.mapCodec(
|
||||||
@@ -39,7 +42,11 @@ public record EntityDataSource(String selectorPattern, @Nullable EntitySelector
|
@@ -39,7 +42,11 @@ public record EntityDataSource(String selectorPattern, @Nullable EntitySelector
|
||||||
public Stream<CompoundTag> getData(CommandSourceStack source) throws CommandSyntaxException {
|
public Stream<CompoundTag> getData(CommandSourceStack source) throws CommandSyntaxException {
|
||||||
if (this.compiledSelector != null) {
|
if (this.compiledSelector != null) {
|
@ -5,32 +5,32 @@ Subject: [PATCH] Limit string tag visitors to 1024 elements
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java b/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java
|
diff --git a/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java b/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java
|
||||||
index e07cc7970955ce240754cfe424d768c2bba0241a..a4f41bb4ec6cb20f782668c714229b61415cfdfb 100644
|
index b45bb4ddf6b586ba1285db230e0bc3d1b5e447e8..4a46935cac263325a87a1b0bf32302839a75516e 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java
|
--- a/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java
|
+++ b/src/main/java/net/minecraft/nbt/SnbtPrinterTagVisitor.java
|
||||||
@@ -89,6 +89,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor {
|
@@ -89,6 +89,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor {
|
||||||
public void visitByteArray(ByteArrayTag element) {
|
public void visitByteArray(ByteArrayTag element) {
|
||||||
StringBuilder stringBuilder = (new StringBuilder("[")).append("B").append(";");
|
StringBuilder stringBuilder = new StringBuilder("[").append("B").append(";");
|
||||||
byte[] bs = element.getAsByteArray();
|
byte[] bs = element.getAsByteArray();
|
||||||
+ if (bs.length > 1024) { this.result = stringBuilder.append("]").toString(); return; } // Scissors
|
+ if (bs.length > 1024) { this.result = stringBuilder.append("]").toString(); return; } // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < bs.length; ++i) {
|
for (int i = 0; i < bs.length; i++) {
|
||||||
stringBuilder.append(" ").append((int)bs[i]).append("B");
|
stringBuilder.append(" ").append(bs[i]).append("B");
|
||||||
@@ -105,6 +106,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor {
|
@@ -105,6 +106,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor {
|
||||||
public void visitIntArray(IntArrayTag element) {
|
public void visitIntArray(IntArrayTag element) {
|
||||||
StringBuilder stringBuilder = (new StringBuilder("[")).append("I").append(";");
|
StringBuilder stringBuilder = new StringBuilder("[").append("I").append(";");
|
||||||
int[] is = element.getAsIntArray();
|
int[] is = element.getAsIntArray();
|
||||||
+ if (is.length > 1024) { this.result = stringBuilder.append("]").toString(); return; } // Scissors
|
+ if (is.length > 1024) { this.result = stringBuilder.append("]").toString(); return; } // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < is.length; ++i) {
|
for (int i = 0; i < is.length; i++) {
|
||||||
stringBuilder.append(" ").append(is[i]);
|
stringBuilder.append(" ").append(is[i]);
|
||||||
@@ -122,6 +124,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor {
|
@@ -122,6 +124,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor {
|
||||||
String string = "L";
|
String string = "L";
|
||||||
StringBuilder stringBuilder = (new StringBuilder("[")).append("L").append(";");
|
StringBuilder stringBuilder = new StringBuilder("[").append("L").append(";");
|
||||||
long[] ls = element.getAsLongArray();
|
long[] ls = element.getAsLongArray();
|
||||||
+ if (ls.length > 1024) { this.result = stringBuilder.append("]").toString(); return; } // Scissors
|
+ if (ls.length > 1024) { this.result = stringBuilder.append("]").toString(); return; } // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < ls.length; ++i) {
|
for (int i = 0; i < ls.length; i++) {
|
||||||
stringBuilder.append(" ").append(ls[i]).append("L");
|
stringBuilder.append(" ").append(ls[i]).append("L");
|
||||||
@@ -136,7 +139,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor {
|
@@ -136,7 +139,7 @@ public class SnbtPrinterTagVisitor implements TagVisitor {
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ index e07cc7970955ce240754cfe424d768c2bba0241a..a4f41bb4ec6cb20f782668c714229b61
|
|||||||
} else {
|
} else {
|
||||||
StringBuilder stringBuilder = new StringBuilder("{");
|
StringBuilder stringBuilder = new StringBuilder("{");
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/StringTagVisitor.java b/src/main/java/net/minecraft/nbt/StringTagVisitor.java
|
diff --git a/src/main/java/net/minecraft/nbt/StringTagVisitor.java b/src/main/java/net/minecraft/nbt/StringTagVisitor.java
|
||||||
index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a9940e327 100644
|
index d8892641d5671fa100aeb43d42ebb6103a2d280c..d10242ecd6f8442e1af3f4cd13f769517b33058a 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/StringTagVisitor.java
|
--- a/src/main/java/net/minecraft/nbt/StringTagVisitor.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/StringTagVisitor.java
|
+++ b/src/main/java/net/minecraft/nbt/StringTagVisitor.java
|
||||||
@@ -53,6 +53,7 @@ public class StringTagVisitor implements TagVisitor {
|
@@ -53,6 +53,7 @@ public class StringTagVisitor implements TagVisitor {
|
||||||
@ -60,7 +60,7 @@ index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a
|
|||||||
byte[] bs = element.getAsByteArray();
|
byte[] bs = element.getAsByteArray();
|
||||||
+ if (bs.length > 1024) { this.builder.append(']'); return; } // Scissors
|
+ if (bs.length > 1024) { this.builder.append(']'); return; } // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < bs.length; ++i) {
|
for (int i = 0; i < bs.length; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
@@ -69,6 +70,7 @@ public class StringTagVisitor implements TagVisitor {
|
@@ -69,6 +70,7 @@ public class StringTagVisitor implements TagVisitor {
|
||||||
public void visitIntArray(IntArrayTag element) {
|
public void visitIntArray(IntArrayTag element) {
|
||||||
@ -68,7 +68,7 @@ index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a
|
|||||||
int[] is = element.getAsIntArray();
|
int[] is = element.getAsIntArray();
|
||||||
+ if (is.length > 1024) { this.builder.append(']'); return; } // Scissors
|
+ if (is.length > 1024) { this.builder.append(']'); return; } // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < is.length; ++i) {
|
for (int i = 0; i < is.length; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
@@ -85,6 +87,7 @@ public class StringTagVisitor implements TagVisitor {
|
@@ -85,6 +87,7 @@ public class StringTagVisitor implements TagVisitor {
|
||||||
public void visitLongArray(LongArrayTag element) {
|
public void visitLongArray(LongArrayTag element) {
|
||||||
@ -76,7 +76,7 @@ index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a
|
|||||||
long[] ls = element.getAsLongArray();
|
long[] ls = element.getAsLongArray();
|
||||||
+ if (ls.length > 1024) { this.builder.append(']'); return; } // Scissors
|
+ if (ls.length > 1024) { this.builder.append(']'); return; } // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < ls.length; ++i) {
|
for (int i = 0; i < ls.length; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
@@ -100,6 +103,7 @@ public class StringTagVisitor implements TagVisitor {
|
@@ -100,6 +103,7 @@ public class StringTagVisitor implements TagVisitor {
|
||||||
@Override
|
@Override
|
||||||
@ -84,7 +84,7 @@ index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a
|
|||||||
this.builder.append('[');
|
this.builder.append('[');
|
||||||
+ if (element.size() > 1024) { this.builder.append(']'); return; } // Scissors
|
+ if (element.size() > 1024) { this.builder.append(']'); return; } // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < element.size(); ++i) {
|
for (int i = 0; i < element.size(); i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
@@ -116,6 +120,7 @@ public class StringTagVisitor implements TagVisitor {
|
@@ -116,6 +120,7 @@ public class StringTagVisitor implements TagVisitor {
|
||||||
public void visitCompound(CompoundTag compound) {
|
public void visitCompound(CompoundTag compound) {
|
||||||
@ -93,9 +93,9 @@ index a687a0f17df30126d53a1e3a669dc6d157c23ed5..2c50f41dd8034af16fcceca75eeb6c7a
|
|||||||
+ if (list.size() > 1024) { this.builder.append('}'); return; } // Scissors
|
+ if (list.size() > 1024) { this.builder.append('}'); return; } // Scissors
|
||||||
Collections.sort(list);
|
Collections.sort(list);
|
||||||
|
|
||||||
for(String string : list) {
|
for (String string : list) {
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java b/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java
|
diff --git a/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java b/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java
|
||||||
index 149def3da0b92f64e4fc04630965dce44884f938..c9d753f37bd65e35f8a4e2eb5c6fe8f74d5d1606 100644
|
index 4e238ae29347c5e976ff0d506e94972df0aa7362..9776b9741a7ec46c603b2c2bccd5f006c15cee41 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java
|
--- a/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java
|
+++ b/src/main/java/net/minecraft/nbt/TextComponentTagVisitor.java
|
||||||
@@ -97,6 +97,7 @@ public class TextComponentTagVisitor implements TagVisitor {
|
@@ -97,6 +97,7 @@ public class TextComponentTagVisitor implements TagVisitor {
|
||||||
@ -104,15 +104,15 @@ index 149def3da0b92f64e4fc04630965dce44884f938..c9d753f37bd65e35f8a4e2eb5c6fe8f7
|
|||||||
byte[] bs = element.getAsByteArray();
|
byte[] bs = element.getAsByteArray();
|
||||||
+ if (bs.length > 1024) { this.result = mutableComponent.append("]"); return; } // Scissors
|
+ if (bs.length > 1024) { this.result = mutableComponent.append("]"); return; } // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < bs.length; ++i) {
|
for (int i = 0; i < bs.length; i++) {
|
||||||
MutableComponent mutableComponent2 = Component.literal(String.valueOf((int)bs[i])).withStyle(SYNTAX_HIGHLIGHTING_NUMBER);
|
MutableComponent mutableComponent2 = Component.literal(String.valueOf(bs[i])).withStyle(SYNTAX_HIGHLIGHTING_NUMBER);
|
||||||
@@ -115,6 +116,7 @@ public class TextComponentTagVisitor implements TagVisitor {
|
@@ -115,6 +116,7 @@ public class TextComponentTagVisitor implements TagVisitor {
|
||||||
Component component = Component.literal("I").withStyle(SYNTAX_HIGHLIGHTING_NUMBER_TYPE);
|
Component component = Component.literal("I").withStyle(SYNTAX_HIGHLIGHTING_NUMBER_TYPE);
|
||||||
MutableComponent mutableComponent = Component.literal("[").append(component).append(";");
|
MutableComponent mutableComponent = Component.literal("[").append(component).append(";");
|
||||||
int[] is = element.getAsIntArray();
|
int[] is = element.getAsIntArray();
|
||||||
+ if (is.length > 1024) { this.result = mutableComponent.append("]"); return; } // Scissors
|
+ if (is.length > 1024) { this.result = mutableComponent.append("]"); return; } // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < is.length; ++i) {
|
for (int i = 0; i < is.length; i++) {
|
||||||
mutableComponent.append(" ").append(Component.literal(String.valueOf(is[i])).withStyle(SYNTAX_HIGHLIGHTING_NUMBER));
|
mutableComponent.append(" ").append(Component.literal(String.valueOf(is[i])).withStyle(SYNTAX_HIGHLIGHTING_NUMBER));
|
||||||
@@ -132,6 +134,7 @@ public class TextComponentTagVisitor implements TagVisitor {
|
@@ -132,6 +134,7 @@ public class TextComponentTagVisitor implements TagVisitor {
|
||||||
Component component = Component.literal("L").withStyle(SYNTAX_HIGHLIGHTING_NUMBER_TYPE);
|
Component component = Component.literal("L").withStyle(SYNTAX_HIGHLIGHTING_NUMBER_TYPE);
|
||||||
@ -120,7 +120,7 @@ index 149def3da0b92f64e4fc04630965dce44884f938..c9d753f37bd65e35f8a4e2eb5c6fe8f7
|
|||||||
long[] ls = element.getAsLongArray();
|
long[] ls = element.getAsLongArray();
|
||||||
+ if (ls.length > 1024) { this.result = mutableComponent.append("]"); return; } // Scissors
|
+ if (ls.length > 1024) { this.result = mutableComponent.append("]"); return; } // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < ls.length; ++i) {
|
for (int i = 0; i < ls.length; i++) {
|
||||||
Component component2 = Component.literal(String.valueOf(ls[i])).withStyle(SYNTAX_HIGHLIGHTING_NUMBER);
|
Component component2 = Component.literal(String.valueOf(ls[i])).withStyle(SYNTAX_HIGHLIGHTING_NUMBER);
|
||||||
@@ -147,7 +150,7 @@ public class TextComponentTagVisitor implements TagVisitor {
|
@@ -147,7 +150,7 @@ public class TextComponentTagVisitor implements TagVisitor {
|
||||||
|
|
@ -1,19 +1,19 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Allink <arclicious@vivaldi.net>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Mon, 18 Apr 2022 16:55:19 +0100
|
Date: Sat, 24 Feb 2024 15:32:48 -0600
|
||||||
Subject: [PATCH] Fix negative death times
|
Subject: [PATCH] Fix negative death times
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index bc908b75cb99536df658281ae7f8b4eeedbbedc9..8c81cd6a6563e4eb46a26c30baa3dfd9df3ecf1f 100644
|
index e9bb7feb591032904516d1b9374f486d8a7d066c..60961c54e870148b5c649045e7347ca1064b6bde 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -628,7 +628,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -629,7 +629,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
|
|
||||||
protected void tickDeath() {
|
protected void tickDeath() {
|
||||||
++this.deathTime;
|
++this.deathTime;
|
||||||
- if (this.deathTime >= 20 && !this.level().isClientSide() && !this.isRemoved()) {
|
- if (this.deathTime >= 20 && !this.level().isClientSide() && !this.isRemoved()) {
|
||||||
+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level().isClientSide() && !this.isRemoved()) { // Scissors
|
+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level().isClientSide() && !this.isRemoved()) { // Scissors
|
||||||
this.level().broadcastEntityEvent(this, (byte) 60);
|
this.level().broadcastEntityEvent(this, (byte) 60);
|
||||||
this.remove(Entity.RemovalReason.KILLED);
|
this.remove(Entity.RemovalReason.KILLED, EntityRemoveEvent.Cause.DEATH); // CraftBukkit - add Bukkit remove cause
|
||||||
}
|
}
|
@ -6,7 +6,7 @@ Subject: [PATCH] Limit amount of vehicle collision checks to 3 and discard
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||||
index c906ca07509939a06b9aaf2da0dafb172830a638..c1e91ea440202014419aa9601915f9288a41e32c 100644
|
index d514ec1e4cbdc579c3a61533998437903afdc8b6..7ee1f3552b81bff834c6f414e611e8b05463fc6f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||||
@@ -8,6 +8,7 @@ import com.mojang.datafixers.util.Pair;
|
@@ -8,6 +8,7 @@ import com.mojang.datafixers.util.Pair;
|
||||||
@ -43,7 +43,7 @@ index c906ca07509939a06b9aaf2da0dafb172830a638..c1e91ea440202014419aa9601915f928
|
|||||||
+
|
+
|
||||||
+ // Scissors start - Add a collision debounce
|
+ // Scissors start - Add a collision debounce
|
||||||
+ if (list.size() > 15) {
|
+ if (list.size() > 15) {
|
||||||
+ this.discard();
|
+ this.discard(null);
|
||||||
+ } else if (list.size() > 3) {
|
+ } else if (list.size() > 3) {
|
||||||
+ lastLargeCollision = System.currentTimeMillis();
|
+ lastLargeCollision = System.currentTimeMillis();
|
||||||
+ }
|
+ }
|
||||||
@ -52,7 +52,7 @@ index c906ca07509939a06b9aaf2da0dafb172830a638..c1e91ea440202014419aa9601915f928
|
|||||||
} else {
|
} else {
|
||||||
Iterator iterator1 = this.level().getEntities(this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D)).iterator();
|
Iterator iterator1 = this.level().getEntities(this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D)).iterator();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||||
index c041c0b81be41cfd128c2f5ba56a5329d50b2efc..7dcbdcb30d264cf76fd975489918509e6e589127 100644
|
index db6aa75d642f4a7258f197933671907faf79c8f2..e4490494a865e129c69d7df3742f61860763a8d8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||||
@@ -5,6 +5,7 @@ import com.google.common.collect.UnmodifiableIterator;
|
@@ -5,6 +5,7 @@ import com.google.common.collect.UnmodifiableIterator;
|
||||||
@ -90,7 +90,7 @@ index c041c0b81be41cfd128c2f5ba56a5329d50b2efc..7dcbdcb30d264cf76fd975489918509e
|
|||||||
+
|
+
|
||||||
+ // Scissors start - Add collision debounce
|
+ // Scissors start - Add collision debounce
|
||||||
+ if (list.size() > 15) {
|
+ if (list.size() > 15) {
|
||||||
+ this.discard();
|
+ this.discard(null);
|
||||||
+ } else if (list.size() > 3) {
|
+ } else if (list.size() > 3) {
|
||||||
+ lastLargeCollision = System.currentTimeMillis();
|
+ lastLargeCollision = System.currentTimeMillis();
|
||||||
+ }
|
+ }
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't log invalid teams to console
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 8c81cd6a6563e4eb46a26c30baa3dfd9df3ecf1f..b01c443746f0c4c8c37fb5955351eff1689be1c4 100644
|
index 60961c54e870148b5c649045e7347ca1064b6bde..0ce25857188029335d0afd0a9f0c22b79d4b0b69 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -860,7 +860,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -869,7 +869,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
boolean flag = scoreboardteam != null && this.level().getScoreboard().addPlayerToTeam(this.getStringUUID(), scoreboardteam);
|
boolean flag = scoreboardteam != null && this.level().getScoreboard().addPlayerToTeam(this.getStringUUID(), scoreboardteam);
|
||||||
|
|
||||||
if (!flag) {
|
if (!flag) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fixes out of bounds HangingEntity crash exploit
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||||
index 5f4c42c4ba44923cabb873bfad33abc2b1362e73..6608c98d1a517c307e16669e536dda6eb9f1e082 100644
|
index eaad15a4d201356c34c1a09c7fbe5c35f76a2176..e166411e05287d97ea7c9d35b19d4ae3106401c3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||||
@@ -279,6 +279,13 @@ public abstract class HangingEntity extends Entity {
|
@@ -280,6 +280,13 @@ public abstract class HangingEntity extends Entity {
|
||||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||||
BlockPos blockposition = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ"));
|
BlockPos blockposition = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ"));
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Allink <arclicious@vivaldi.net>
|
||||||
Date: Sun, 10 Dec 2023 18:11:55 -0600
|
Date: Sun, 10 Dec 2023 18:11:55 -0600
|
||||||
Subject: [PATCH] Add MasterBlockFireEvent
|
Subject: [PATCH] Add MasterBlockFireEvent
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ index 7ef14e4441a329c680a5dfe4bfb5033ffcb8f9d5..eff5bdf00b0aa7a9925ff59a62ead725
|
|||||||
executor.performCommand(world);
|
executor.performCommand(world);
|
||||||
} else {
|
} else {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
||||||
index 3a210e138b6ae065fd32e1b1e0e49999e20c4667..183c47a6fbf5201c38d5eb182049643862ca0964 100644
|
index 447b0359922011fe12b1bb9628d23a47c9d7dc89..0d6be671e1512074ae1265fe93a5d5437f3929dd 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
||||||
@@ -2,6 +2,8 @@ package net.minecraft.world.level.block.entity;
|
@@ -2,6 +2,8 @@ package net.minecraft.world.level.block.entity;
|
||||||
@ -60,7 +60,7 @@ index 3a210e138b6ae065fd32e1b1e0e49999e20c4667..183c47a6fbf5201c38d5eb1820496438
|
|||||||
|
|
||||||
public class JigsawBlockEntity extends BlockEntity {
|
public class JigsawBlockEntity extends BlockEntity {
|
||||||
public static final String TARGET = "target";
|
public static final String TARGET = "target";
|
||||||
@@ -131,6 +134,16 @@ public class JigsawBlockEntity extends BlockEntity {
|
@@ -134,6 +137,16 @@ public class JigsawBlockEntity extends BlockEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) {
|
public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) {
|
||||||
@ -78,7 +78,7 @@ index 3a210e138b6ae065fd32e1b1e0e49999e20c4667..183c47a6fbf5201c38d5eb1820496438
|
|||||||
Registry<StructureTemplatePool> registry = world.registryAccess().registryOrThrow(Registries.TEMPLATE_POOL);
|
Registry<StructureTemplatePool> registry = world.registryAccess().registryOrThrow(Registries.TEMPLATE_POOL);
|
||||||
// Paper start - Replace getHolderOrThrow with a null check
|
// Paper start - Replace getHolderOrThrow with a null check
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
||||||
index 60c941bd67dc899ea923f8ee49412de01ce199db..9bcd07f8b5d266c39034e5c021da9ffb7262b474 100644
|
index 29c59e4a1283ac211b18b953ed6c03834a2587bd..fb385cd66226200ed0b8439cb6659dbac6c2b229 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
||||||
@@ -5,6 +5,8 @@ import java.util.Objects;
|
@@ -5,6 +5,8 @@ import java.util.Objects;
|
||||||
@ -98,7 +98,7 @@ index 60c941bd67dc899ea923f8ee49412de01ce199db..9bcd07f8b5d266c39034e5c021da9ffb
|
|||||||
|
|
||||||
public class StructureBlockEntity extends BlockEntity {
|
public class StructureBlockEntity extends BlockEntity {
|
||||||
private static final int SCAN_CORNER_BLOCKS_RANGE = 5;
|
private static final int SCAN_CORNER_BLOCKS_RANGE = 5;
|
||||||
@@ -261,7 +264,7 @@ public class StructureBlockEntity extends BlockEntity {
|
@@ -259,7 +262,7 @@ public class StructureBlockEntity extends BlockEntity {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
BlockPos blockPos = this.getBlockPos();
|
BlockPos blockPos = this.getBlockPos();
|
||||||
@ -107,7 +107,7 @@ index 60c941bd67dc899ea923f8ee49412de01ce199db..9bcd07f8b5d266c39034e5c021da9ffb
|
|||||||
BlockPos blockPos2 = new BlockPos(blockPos.getX() - 80, this.level.getMinBuildHeight(), blockPos.getZ() - 80);
|
BlockPos blockPos2 = new BlockPos(blockPos.getX() - 80, this.level.getMinBuildHeight(), blockPos.getZ() - 80);
|
||||||
BlockPos blockPos3 = new BlockPos(blockPos.getX() + 80, this.level.getMaxBuildHeight() - 1, blockPos.getZ() + 80);
|
BlockPos blockPos3 = new BlockPos(blockPos.getX() + 80, this.level.getMaxBuildHeight() - 1, blockPos.getZ() + 80);
|
||||||
Stream<BlockPos> stream = this.getRelatedCorners(blockPos2, blockPos3);
|
Stream<BlockPos> stream = this.getRelatedCorners(blockPos2, blockPos3);
|
||||||
@@ -320,6 +323,16 @@ public class StructureBlockEntity extends BlockEntity {
|
@@ -316,6 +319,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||||
if (this.structureName == null) {
|
if (this.structureName == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -124,7 +124,7 @@ index 60c941bd67dc899ea923f8ee49412de01ce199db..9bcd07f8b5d266c39034e5c021da9ffb
|
|||||||
BlockPos blockPos = this.getBlockPos().offset(this.structurePos);
|
BlockPos blockPos = this.getBlockPos().offset(this.structurePos);
|
||||||
ServerLevel serverLevel = (ServerLevel)this.level;
|
ServerLevel serverLevel = (ServerLevel)this.level;
|
||||||
StructureTemplateManager structureTemplateManager = serverLevel.getStructureManager();
|
StructureTemplateManager structureTemplateManager = serverLevel.getStructureManager();
|
||||||
@@ -371,6 +384,16 @@ public class StructureBlockEntity extends BlockEntity {
|
@@ -367,6 +380,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||||
if (structureTemplate == null) {
|
if (structureTemplate == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
@ -1,35 +1,36 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Allink <arclicious@vivaldi.net>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Mon, 18 Apr 2022 03:56:09 +0100
|
Date: Mon, 15 Apr 2024 22:49:31 -0500
|
||||||
Subject: [PATCH] Reset large tags
|
Subject: [PATCH] Reset large tags
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/ContainerHelper.java b/src/main/java/net/minecraft/world/ContainerHelper.java
|
diff --git a/src/main/java/net/minecraft/world/ContainerHelper.java b/src/main/java/net/minecraft/world/ContainerHelper.java
|
||||||
index 4092c7a8c2b0d9d26e6f4d97386735236300d132..04c47cf1a920ae6c356449df801227ee14f6dfb7 100644
|
index 4105bb71b1f1614b3e91478b40b85add94a9257b..52d2a8fd6e16c8d85f2544ffdb9ed4d18b298e1c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/ContainerHelper.java
|
--- a/src/main/java/net/minecraft/world/ContainerHelper.java
|
||||||
+++ b/src/main/java/net/minecraft/world/ContainerHelper.java
|
+++ b/src/main/java/net/minecraft/world/ContainerHelper.java
|
||||||
@@ -2,6 +2,7 @@ package net.minecraft.world;
|
@@ -2,6 +2,8 @@ package net.minecraft.world;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
+
|
||||||
+import me.totalfreedom.scissors.NbtUtility; // Scissors
|
+import me.totalfreedom.scissors.NbtUtility; // Scissors
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.nbt.ListTag;
|
import net.minecraft.nbt.ListTag;
|
||||||
@@ -22,10 +23,12 @@ public class ContainerHelper {
|
@@ -22,10 +24,12 @@ public class ContainerHelper {
|
||||||
|
|
||||||
public static CompoundTag saveAllItems(CompoundTag nbt, NonNullList<ItemStack> stacks, boolean setIfEmpty) {
|
public static CompoundTag saveAllItems(CompoundTag nbt, NonNullList<ItemStack> stacks, boolean setIfEmpty) {
|
||||||
ListTag listTag = new ListTag();
|
ListTag listTag = new ListTag();
|
||||||
+ long total = 0; // Scissors
|
+ long total = 0; // Scissors
|
||||||
|
|
||||||
for(int i = 0; i < stacks.size(); ++i) {
|
for (int i = 0; i < stacks.size(); i++) {
|
||||||
ItemStack itemStack = stacks.get(i);
|
ItemStack itemStack = stacks.get(i);
|
||||||
if (!itemStack.isEmpty()) {
|
if (!itemStack.isEmpty()) {
|
||||||
+ total += NbtUtility.getTagSize(itemStack.getTag()); // Scissors
|
+ total += NbtUtility.getTagSize(itemStack.getTag()); // Scissors
|
||||||
CompoundTag compoundTag = new CompoundTag();
|
CompoundTag compoundTag = new CompoundTag();
|
||||||
compoundTag.putByte("Slot", (byte)i);
|
compoundTag.putByte("Slot", (byte)i);
|
||||||
itemStack.save(compoundTag);
|
itemStack.save(compoundTag);
|
||||||
@@ -33,7 +36,7 @@ public class ContainerHelper {
|
@@ -33,7 +37,7 @@ public class ContainerHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,13 +39,13 @@ index 4092c7a8c2b0d9d26e6f4d97386735236300d132..04c47cf1a920ae6c356449df801227ee
|
|||||||
nbt.put("Items", listTag);
|
nbt.put("Items", listTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,11 +45,19 @@ public class ContainerHelper {
|
@@ -42,11 +46,19 @@ public class ContainerHelper {
|
||||||
|
|
||||||
public static void loadAllItems(CompoundTag nbt, NonNullList<ItemStack> stacks) {
|
public static void loadAllItems(CompoundTag nbt, NonNullList<ItemStack> stacks) {
|
||||||
ListTag listTag = nbt.getList("Items", 10);
|
ListTag listTag = nbt.getList("Items", 10);
|
||||||
+ long total = 0; // Scissors - Account for items inside containers
|
+ long total = 0; // Scissors - Account for items inside containers
|
||||||
|
|
||||||
for(int i = 0; i < listTag.size(); ++i) {
|
for (int i = 0; i < listTag.size(); i++) {
|
||||||
CompoundTag compoundTag = listTag.getCompound(i);
|
CompoundTag compoundTag = listTag.getCompound(i);
|
||||||
int j = compoundTag.getByte("Slot") & 255;
|
int j = compoundTag.getByte("Slot") & 255;
|
||||||
if (j >= 0 && j < stacks.size()) {
|
if (j >= 0 && j < stacks.size()) {
|
||||||
@ -59,18 +60,19 @@ index 4092c7a8c2b0d9d26e6f4d97386735236300d132..04c47cf1a920ae6c356449df801227ee
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
index de277d61b718fe07a87d75a2547bb1c7f8553aa1..e2dbfe581717cc107d89206c1ba46014a6965693 100644
|
index 1ad126d992d95062a3db08374db7a927f23a0cac..6af963d383293a4a6f8d517e2dc179ab70744b31 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
@@ -23,6 +23,7 @@ import java.util.function.Predicate;
|
@@ -23,6 +23,8 @@ import java.util.function.Predicate;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import me.totalfreedom.scissors.NbtUtility; // Scissors
|
+
|
||||||
|
+import me.totalfreedom.scissors.NbtUtility;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
import net.minecraft.advancements.CriteriaTriggers;
|
import net.minecraft.advancements.CriteriaTriggers;
|
||||||
@@ -277,6 +278,12 @@ public final class ItemStack {
|
@@ -278,6 +280,12 @@ public final class ItemStack {
|
||||||
|
|
||||||
// CraftBukkit - break into own method
|
// CraftBukkit - break into own method
|
||||||
private void load(CompoundTag nbttagcompound) {
|
private void load(CompoundTag nbttagcompound) {
|
||||||
@ -83,7 +85,7 @@ index de277d61b718fe07a87d75a2547bb1c7f8553aa1..e2dbfe581717cc107d89206c1ba46014
|
|||||||
this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id")));
|
this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id")));
|
||||||
this.count = nbttagcompound.getByte("Count");
|
this.count = nbttagcompound.getByte("Count");
|
||||||
if (nbttagcompound.contains("tag", 10)) {
|
if (nbttagcompound.contains("tag", 10)) {
|
||||||
@@ -584,7 +591,11 @@ public final class ItemStack {
|
@@ -585,7 +593,11 @@ public final class ItemStack {
|
||||||
nbt.putString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
|
nbt.putString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
|
||||||
nbt.putByte("Count", (byte) this.count);
|
nbt.putByte("Count", (byte) this.count);
|
||||||
if (this.tag != null) {
|
if (this.tag != null) {
|
||||||
@ -96,7 +98,7 @@ index de277d61b718fe07a87d75a2547bb1c7f8553aa1..e2dbfe581717cc107d89206c1ba46014
|
|||||||
}
|
}
|
||||||
|
|
||||||
return nbt;
|
return nbt;
|
||||||
@@ -918,6 +929,7 @@ public final class ItemStack {
|
@@ -919,6 +931,7 @@ public final class ItemStack {
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
public void setTag(@Nullable CompoundTag nbt) {
|
public void setTag(@Nullable CompoundTag nbt) {
|
||||||
@ -105,18 +107,19 @@ index de277d61b718fe07a87d75a2547bb1c7f8553aa1..e2dbfe581717cc107d89206c1ba46014
|
|||||||
this.processEnchantOrder(this.tag); // Paper
|
this.processEnchantOrder(this.tag); // Paper
|
||||||
if (this.getItem().canBeDepleted()) {
|
if (this.getItem().canBeDepleted()) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
index f5ad7ddf13cbb6452c2927aef9b54eae3335b4c6..041e3c8fb7c9ca69a7c7c1c952ed9915a75d7752 100644
|
index 89d06253b00604114e543ebbe12a9993ae95dc41..d0af3a9b956b37126811080d65474eacd76bc083 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
@@ -9,6 +9,7 @@ import java.util.Iterator;
|
@@ -9,6 +9,8 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import me.totalfreedom.scissors.NbtUtility; // Scissors
|
+
|
||||||
|
+import me.totalfreedom.scissors.NbtUtility;
|
||||||
import net.minecraft.SharedConstants;
|
import net.minecraft.SharedConstants;
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
@@ -212,6 +213,17 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
@@ -213,6 +215,17 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||||
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||||
|
|
||||||
public List<ItemStack> getContents() {
|
public List<ItemStack> getContents() {
|
||||||
@ -135,13 +138,13 @@ index f5ad7ddf13cbb6452c2927aef9b54eae3335b4c6..041e3c8fb7c9ca69a7c7c1c952ed9915
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||||
index 416aa989ebb18a8741cc9d605a1180ab830f6643..a9a8c9e68e5b767dec2c26495685da88e0caa627 100644
|
index 416aa989ebb18a8741cc9d605a1180ab830f6643..af7ed06c083161212784f746290129a17523575a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
package net.minecraft.world.level.block.entity;
|
package net.minecraft.world.level.block.entity;
|
||||||
|
|
||||||
+import me.totalfreedom.scissors.NbtUtility; // Scissors
|
+import me.totalfreedom.scissors.NbtUtility;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
@ -164,18 +167,19 @@ index 416aa989ebb18a8741cc9d605a1180ab830f6643..a9a8c9e68e5b767dec2c26495685da88
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||||
index c57efcb9a79337ec791e4e8f6671612f0a82b441..2cbb8170953cb555411db8c171a3d1d91eb799bb 100644
|
index 9bb542ce3a8c52e1688bb1f66fc916dd23a5fd10..d8386aa10dc1616c4da87bc8078548d13bff5bdf 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||||
@@ -3,6 +3,7 @@ package net.minecraft.world.level.block.entity;
|
@@ -3,6 +3,8 @@ package net.minecraft.world.level.block.entity;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import me.totalfreedom.scissors.NbtUtility; // Scissors
|
+
|
||||||
|
+import me.totalfreedom.scissors.NbtUtility;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
@@ -73,6 +74,17 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
@@ -73,6 +75,17 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ItemStack> getContents() {
|
public List<ItemStack> getContents() {
|
||||||
@ -194,13 +198,13 @@ index c57efcb9a79337ec791e4e8f6671612f0a82b441..2cbb8170953cb555411db8c171a3d1d9
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||||
index a71414397bd45ee7bcacfeef0041d80dfa25f114..f51abf1722e98d7ce9e616d84472d847e597eafb 100644
|
index 9b1243d96e0694c62fc9e82e9be540bce0d2b3ad..2cf4a854a40aabbfff2f6ee4fb9e36e8d466afd5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
package net.minecraft.world.level.block.entity;
|
package net.minecraft.world.level.block.entity;
|
||||||
|
|
||||||
+import me.totalfreedom.scissors.NbtUtility; // Scissors
|
+import me.totalfreedom.scissors.NbtUtility;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
@ -223,13 +227,13 @@ index a71414397bd45ee7bcacfeef0041d80dfa25f114..f51abf1722e98d7ce9e616d84472d847
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||||
index 881379681c39230a00b3a1f11cd87498984396c7..d0513b72cdaec3b67b9341d251367b193bafa40c 100644
|
index 881379681c39230a00b3a1f11cd87498984396c7..8e1ef455c1b563844c416021c478b2a34b90c418 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
package net.minecraft.world.level.block.entity;
|
package net.minecraft.world.level.block.entity;
|
||||||
|
|
||||||
+import me.totalfreedom.scissors.NbtUtility; // Scissors
|
+import me.totalfreedom.scissors.NbtUtility;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
@ -252,18 +256,19 @@ index 881379681c39230a00b3a1f11cd87498984396c7..d0513b72cdaec3b67b9341d251367b19
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
index d4dcf7fe26474ae07374e7761d823bc5c8b54f97..7352183f7eaa1ddcd028e53f4b66a1c34e32b988 100644
|
index cdb739df2a285032d25d84f4464f202a7a3fa578..69845474c207220c0146891be90e3232ac8a3547 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
@@ -6,6 +6,7 @@ import java.util.function.BooleanSupplier;
|
@@ -6,6 +6,8 @@ import java.util.function.BooleanSupplier;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import me.totalfreedom.scissors.NbtUtility; // Scissors
|
+
|
||||||
|
+import me.totalfreedom.scissors.NbtUtility;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
@@ -56,6 +57,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
@@ -57,6 +59,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||||
private int maxStack = MAX_STACK;
|
private int maxStack = MAX_STACK;
|
||||||
|
|
||||||
public List<ItemStack> getContents() {
|
public List<ItemStack> getContents() {
|
||||||
@ -282,18 +287,19 @@ index d4dcf7fe26474ae07374e7761d823bc5c8b54f97..7352183f7eaa1ddcd028e53f4b66a1c3
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
index 1fa22445a4ecc8c08dbcf0cc6bd39dc5003604c4..9f12fbcd8d0c75de1d8c06bed2c64a0acdc877c9 100644
|
index 1fa22445a4ecc8c08dbcf0cc6bd39dc5003604c4..c37f0f12283f528d16fd0450075eab1974ba5057 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
@@ -4,6 +4,7 @@ import java.util.Iterator;
|
@@ -4,6 +4,8 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import me.totalfreedom.scissors.NbtUtility; // Scissors
|
+
|
||||||
|
+import me.totalfreedom.scissors.NbtUtility;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
@@ -61,6 +62,17 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
@@ -61,6 +63,17 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||||
public boolean opened;
|
public boolean opened;
|
||||||
|
|
||||||
public List<ItemStack> getContents() {
|
public List<ItemStack> getContents() {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add spectator teleport event
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 64255f7db85886421d5029766e8a6d1eadb94cff..2a3f4e6bfc6b122bb2102163381de8c78f06f1b5 100644
|
index fe2ef36ab5dc4b933abf24dbfd0e811c53239cf0..f14e5f5867b0319c1f3f25ac607ac5e2b0992991 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
@ -15,7 +15,7 @@ index 64255f7db85886421d5029766e8a6d1eadb94cff..2a3f4e6bfc6b122bb2102163381de8c7
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.primitives.Floats;
|
import com.google.common.primitives.Floats;
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
@@ -2037,6 +2038,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -2033,6 +2034,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
Entity entity = packet.getEntity(worldserver);
|
Entity entity = packet.getEntity(worldserver);
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent invalid container events
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 2a3f4e6bfc6b122bb2102163381de8c78f06f1b5..2ac044f9e4c4c80263a34f9294cb69829bca132e 100644
|
index f14e5f5867b0319c1f3f25ac607ac5e2b0992991..4582ef637075e64c0b6ff234d3c0cd30ba074b38 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -29,6 +29,7 @@ import java.util.function.UnaryOperator;
|
@@ -29,6 +29,7 @@ import java.util.function.UnaryOperator;
|
||||||
@ -16,7 +16,7 @@ index 2a3f4e6bfc6b122bb2102163381de8c78f06f1b5..2ac044f9e4c4c80263a34f9294cb6982
|
|||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.SharedConstants;
|
import net.minecraft.SharedConstants;
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
@@ -2909,6 +2910,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -2898,6 +2899,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Disable running commands in books by default
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/WrittenBookItem.java b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
diff --git a/src/main/java/net/minecraft/world/item/WrittenBookItem.java b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
||||||
index 31911c09fe15753ae32fa39417bdc9e9de552a88..b810a5afcb2343174e37efb7dd8a36b968b07c3a 100644
|
index 793ab8acd7445984cff2628e3f001661dc20c8e5..0e6e0d6a9c645db0121637262a6cf90172d3c385 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
--- a/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
+++ b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
||||||
@@ -2,6 +2,7 @@ package net.minecraft.world.item;
|
@@ -2,6 +2,7 @@ package net.minecraft.world.item;
|
||||||
@ -26,7 +26,7 @@ index 31911c09fe15753ae32fa39417bdc9e9de552a88..b810a5afcb2343174e37efb7dd8a36b9
|
|||||||
import net.minecraft.stats.Stats;
|
import net.minecraft.stats.Stats;
|
||||||
import net.minecraft.util.StringUtil;
|
import net.minecraft.util.StringUtil;
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
@@ -161,9 +161,43 @@ public class WrittenBookItem extends Item {
|
@@ -162,9 +162,43 @@ public class WrittenBookItem extends Item {
|
||||||
component2 = Component.literal(text);
|
component2 = Component.literal(text);
|
||||||
}
|
}
|
||||||
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Validate block entity/entity tag query positions
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 2ac044f9e4c4c80263a34f9294cb69829bca132e..889f142b6f87d4ccf4c1d2ffd379c96fbbfddd44 100644
|
index 4582ef637075e64c0b6ff234d3c0cd30ba074b38..80f0f88258770862f419e4faba4cfca4c0457b2c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -1265,7 +1265,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -1278,7 +1278,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
if (this.player.hasPermissions(2)) {
|
if (this.player.hasPermissions(2)) {
|
||||||
Entity entity = this.player.level().getEntity(packet.getEntityId());
|
Entity entity = this.player.level().getEntity(packet.getEntityId());
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ index 2ac044f9e4c4c80263a34f9294cb69829bca132e..889f142b6f87d4ccf4c1d2ffd379c96f
|
|||||||
CompoundTag nbttagcompound = entity.saveWithoutId(new CompoundTag());
|
CompoundTag nbttagcompound = entity.saveWithoutId(new CompoundTag());
|
||||||
|
|
||||||
this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound));
|
this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound));
|
||||||
@@ -1297,7 +1297,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -1310,7 +1310,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
|
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
@ -5,7 +5,7 @@ Subject: [PATCH] Refuse to convert legacy messages over 1k characters
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
||||||
index 730d8e3cf2d9ca05b2d6219cf1856b8721871a37..63e71c5cb4ac4d17d2cfa5324fd842a0d3c61eb5 100644
|
index 753200057e74b8e2d5274894b982e6ee946a559e..25df28c8a2061a754cb576634b63d5ca6e5011d1 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
||||||
@@ -198,6 +198,7 @@ public final class CraftChatMessage {
|
@@ -198,6 +198,7 @@ public final class CraftChatMessage {
|
@ -1,21 +1,21 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Allink <arclicious@vivaldi.net>
|
From: Allink <arclicious@vivaldi.net>
|
||||||
Date: Wed, 13 Jul 2022 12:13:22 +0100
|
Date: Tue, 23 Jan 2024 19:04:22 -0600
|
||||||
Subject: [PATCH] Fix ClickEvents on Signs bypassing permissions
|
Subject: [PATCH] Fix ClickEvents on Signs bypassing permissions
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||||
index a3ec2f522be2d02b9e37810799cecc2ba14f58f3..97d4d9f85ee20aa1dd894d24deefe33478fe1cee 100644
|
index 927c7ea03560be0c86884cec70ee8e408e66cb07..c4bb1739ddcfd473ef788f97afa1019e24da8561 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||||
@@ -8,8 +8,10 @@ import java.util.Objects;
|
@@ -8,8 +8,10 @@ import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.UnaryOperator;
|
import java.util.function.UnaryOperator;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
+import me.totalfreedom.scissors.ScissorsConfig;
|
||||||
import net.minecraft.commands.CommandSource;
|
import net.minecraft.commands.CommandSource;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
+import net.minecraft.commands.Commands; // Scissors
|
+import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.nbt.NbtOps;
|
import net.minecraft.nbt.NbtOps;
|
||||||
@ -23,30 +23,23 @@ index a3ec2f522be2d02b9e37810799cecc2ba14f58f3..97d4d9f85ee20aa1dd894d24deefe334
|
|||||||
import net.minecraft.network.chat.ComponentUtils;
|
import net.minecraft.network.chat.ComponentUtils;
|
||||||
import net.minecraft.network.chat.Style;
|
import net.minecraft.network.chat.Style;
|
||||||
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
||||||
+import net.minecraft.server.MinecraftServer; // Scissors
|
+import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.server.network.FilteredText;
|
import net.minecraft.server.network.FilteredText;
|
||||||
@@ -32,6 +35,7 @@ import net.minecraft.world.level.block.SignBlock;
|
@@ -32,6 +35,8 @@ import net.minecraft.world.level.block.SignBlock;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.Vec2;
|
import net.minecraft.world.phys.Vec2;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; // Scissors
|
+import org.bukkit.craftbukkit.CraftServer;
|
||||||
|
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.bukkit.block.sign.Side;
|
import org.bukkit.block.sign.Side;
|
||||||
import org.bukkit.craftbukkit.block.CraftBlock;
|
import org.bukkit.craftbukkit.block.CraftBlock;
|
||||||
@@ -39,6 +43,7 @@ import org.bukkit.craftbukkit.util.CraftChatMessage;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.block.SignChangeEvent;
|
|
||||||
// CraftBukkit end
|
|
||||||
+import org.bukkit.craftbukkit.CraftServer; // Scissors
|
|
||||||
|
|
||||||
public class SignBlockEntity extends BlockEntity implements CommandSource { // CraftBukkit - implements
|
|
||||||
|
|
||||||
@@ -289,6 +294,21 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
@@ -289,6 +294,21 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
||||||
}
|
}
|
||||||
player.getServer().getCommands().performPrefixedCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle(), world, pos), event.getMessage());
|
player.getServer().getCommands().performPrefixedCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle(), world, pos), event.getMessage());
|
||||||
// Paper end
|
// Paper end - Fix commands from signs not firing command events
|
||||||
+ // Scissors start - Add optional permissions to command signs
|
+ // Scissors start - Add optional permissions to command signs
|
||||||
+ final MinecraftServer vanillaServer = player.getServer();
|
+ final MinecraftServer vanillaServer = player.getServer();
|
||||||
+ final CraftServer craftServer = vanillaServer.server;
|
+ final CraftServer craftServer = vanillaServer.server;
|
@ -1,11 +1,11 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Allink <arclicious@vivaldi.net>
|
||||||
Date: Sun, 10 Dec 2023 18:41:18 -0600
|
Date: Sun, 10 Dec 2023 18:41:18 -0600
|
||||||
Subject: [PATCH] Prevent velocity freeze
|
Subject: [PATCH] Prevent velocity freeze
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||||
index c4ecc5faa4f61e7974e8c475762924a89615b377..1c14b87f84b678b36adede9d2aa9a18453ce4278 100644
|
index 20ce474b72894a8bb3fc21018b9d79bbdc8bb14b..b5c87bb5f5d3526600520913f04cfc6614a62b81 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||||
@@ -1,6 +1,8 @@
|
@@ -1,6 +1,8 @@
|
||||||
@ -17,7 +17,7 @@ index c4ecc5faa4f61e7974e8c475762924a89615b377..1c14b87f84b678b36adede9d2aa9a184
|
|||||||
import net.minecraft.core.particles.ParticleOptions;
|
import net.minecraft.core.particles.ParticleOptions;
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
@@ -47,12 +49,15 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -50,12 +52,15 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ index c4ecc5faa4f61e7974e8c475762924a89615b377..1c14b87f84b678b36adede9d2aa9a184
|
|||||||
}
|
}
|
||||||
|
|
||||||
public AbstractHurtingProjectile(EntityType<? extends AbstractHurtingProjectile> type, LivingEntity owner, double directionX, double directionY, double directionZ, Level world) {
|
public AbstractHurtingProjectile(EntityType<? extends AbstractHurtingProjectile> type, LivingEntity owner, double directionX, double directionY, double directionZ, Level world) {
|
||||||
@@ -164,6 +169,25 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -167,6 +172,25 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||||
nbt.put("power", this.newDoubleList(new double[]{this.xPower, this.yPower, this.zPower}));
|
nbt.put("power", this.newDoubleList(new double[]{this.xPower, this.yPower, this.zPower}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ index c4ecc5faa4f61e7974e8c475762924a89615b377..1c14b87f84b678b36adede9d2aa9a184
|
|||||||
@Override
|
@Override
|
||||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||||
super.readAdditionalSaveData(nbt);
|
super.readAdditionalSaveData(nbt);
|
||||||
@@ -171,9 +195,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -174,9 +198,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||||
ListTag nbttaglist = nbt.getList("power", 6);
|
ListTag nbttaglist = nbt.getList("power", 6);
|
||||||
|
|
||||||
if (nbttaglist.size() == 3) {
|
if (nbttaglist.size() == 3) {
|
||||||
@ -81,7 +81,7 @@ index c4ecc5faa4f61e7974e8c475762924a89615b377..1c14b87f84b678b36adede9d2aa9a184
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,9 +235,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -210,9 +238,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||||
Vec3 vec3d = entity.getLookAngle();
|
Vec3 vec3d = entity.getLookAngle();
|
||||||
|
|
||||||
this.setDeltaMovement(vec3d);
|
this.setDeltaMovement(vec3d);
|
@ -1,16 +1,16 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Luna <lunahatesgogle@gmail.com>
|
||||||
Date: Sun, 10 Dec 2023 18:57:50 -0600
|
Date: Sun, 10 Dec 2023 18:57:50 -0600
|
||||||
Subject: [PATCH] Patch large selector distance crash
|
Subject: [PATCH] Patch large selector distance crash
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
diff --git a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
||||||
index d87ffb5ed4550757016c2fabaa2845a6aaac74d7..7e8cf65ac53f595292d161da0735bf97081e832a 100644
|
index f62640152027b874d4266d868574af062bd684d7..f94385837d5ed1ef52458b73410df5fd186d66e2 100644
|
||||||
--- a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
--- a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
||||||
+++ b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
+++ b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
||||||
@@ -123,11 +123,11 @@ public interface MinMaxBounds<T extends Number> {
|
@@ -123,11 +123,11 @@ public interface MinMaxBounds<T extends Number> {
|
||||||
|
public static record Doubles(@Override Optional<Double> min, @Override Optional<Double> max, Optional<Double> minSq, Optional<Double> maxSq)
|
||||||
public static record Doubles(Optional<Double> min, Optional<Double> max, Optional<Double> minSq, Optional<Double> maxSq) implements MinMaxBounds<Double> {
|
implements MinMaxBounds<Double> {
|
||||||
public static final MinMaxBounds.Doubles ANY = new MinMaxBounds.Doubles(Optional.empty(), Optional.empty());
|
public static final MinMaxBounds.Doubles ANY = new MinMaxBounds.Doubles(Optional.empty(), Optional.empty());
|
||||||
- public static final Codec<MinMaxBounds.Doubles> CODEC = MinMaxBounds.createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new);
|
- public static final Codec<MinMaxBounds.Doubles> CODEC = MinMaxBounds.createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new);
|
||||||
+ public static final Codec<MinMaxBounds.Doubles> CODEC = MinMaxBounds.<Double, MinMaxBounds.Doubles>createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new); // Scissors - compile fixes
|
+ public static final Codec<MinMaxBounds.Doubles> CODEC = MinMaxBounds.<Double, MinMaxBounds.Doubles>createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new); // Scissors - compile fixes
|
||||||
@ -23,17 +23,17 @@ index d87ffb5ed4550757016c2fabaa2845a6aaac74d7..7e8cf65ac53f595292d161da0735bf97
|
|||||||
|
|
||||||
private static MinMaxBounds.Doubles create(StringReader reader, Optional<Double> min, Optional<Double> max) throws CommandSyntaxException {
|
private static MinMaxBounds.Doubles create(StringReader reader, Optional<Double> min, Optional<Double> max) throws CommandSyntaxException {
|
||||||
if (min.isPresent() && max.isPresent() && min.get() > max.get()) {
|
if (min.isPresent() && max.isPresent() && min.get() > max.get()) {
|
||||||
@@ -188,7 +188,7 @@ public interface MinMaxBounds<T extends Number> {
|
@@ -179,7 +179,7 @@ public interface MinMaxBounds<T extends Number> {
|
||||||
|
public static record Ints(@Override Optional<Integer> min, @Override Optional<Integer> max, Optional<Long> minSq, Optional<Long> maxSq)
|
||||||
public static record Ints(Optional<Integer> min, Optional<Integer> max, Optional<Long> minSq, Optional<Long> maxSq) implements MinMaxBounds<Integer> {
|
implements MinMaxBounds<Integer> {
|
||||||
public static final MinMaxBounds.Ints ANY = new MinMaxBounds.Ints(Optional.empty(), Optional.empty());
|
public static final MinMaxBounds.Ints ANY = new MinMaxBounds.Ints(Optional.empty(), Optional.empty());
|
||||||
- public static final Codec<MinMaxBounds.Ints> CODEC = MinMaxBounds.createCodec(Codec.INT, MinMaxBounds.Ints::new);
|
- public static final Codec<MinMaxBounds.Ints> CODEC = MinMaxBounds.createCodec(Codec.INT, MinMaxBounds.Ints::new);
|
||||||
+ public static final Codec<MinMaxBounds.Ints> CODEC = MinMaxBounds.<Integer, MinMaxBounds.Ints>createCodec(Codec.INT, MinMaxBounds.Ints::new); // Scissors - compile fixes
|
+ public static final Codec<MinMaxBounds.Ints> CODEC = MinMaxBounds.<Integer, MinMaxBounds.Ints>createCodec(Codec.INT, MinMaxBounds.Ints::new); // Scissors - compile fixes
|
||||||
|
|
||||||
private Ints(Optional<Integer> min, Optional<Integer> max) {
|
private Ints(Optional<Integer> min, Optional<Integer> max) {
|
||||||
this(min, max, min.map((i) -> {
|
this(min, max, min.map(i -> i.longValue() * i.longValue()), squareOpt(max));
|
||||||
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||||
index 73c15a0c56a103ba4e62f0a51af8d42566b07245..f0a84efe86407ab3d7a9f064140c12df43265adc 100644
|
index 676a1499747b071515479130875157263d3a8352..6a65850101b8ea348a4bfeaeca805a39987b06fc 100644
|
||||||
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||||
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||||
@@ -10,6 +10,8 @@ import java.util.function.BiConsumer;
|
@@ -10,6 +10,8 @@ import java.util.function.BiConsumer;
|
@ -5,10 +5,10 @@ Subject: [PATCH] Patch invalid entity rotation log spam
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 2e11d0f17fc8fa4ed84c40dd9747e136675030a4..acd0dcf69a23ec6dda8e58621b8634076ba8eec1 100644
|
index 2ecf2d8ff546ed097cb3b547db22d28a31d29ec4..36b1a1cc66b9852d3b10c09cbf39262f51996663 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -4745,7 +4745,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -4751,7 +4751,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||||
|
|
||||||
public void setXRot(float pitch) {
|
public void setXRot(float pitch) {
|
||||||
if (!Float.isFinite(pitch)) {
|
if (!Float.isFinite(pitch)) {
|
@ -1,11 +1,11 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sun, 10 Dec 2023 18:48:55 -0600
|
Date: Mon, 15 Apr 2024 23:01:26 -0500
|
||||||
Subject: [PATCH] Add configuration option to disable chat signatures
|
Subject: [PATCH] Add configuration option to disable chat signatures
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java b/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java
|
diff --git a/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java b/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java
|
||||||
index 74cf1c043beef03cfd5adf481414a5ee78bef2a6..939f4a0639c847b94cfc9acf1409a7a3fc5ae58f 100644
|
index c87b708c368713a23a10ad97704575ee4df27891..4a8ab800d4a974aaf14872d50dcf01c806a0fe3b 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java
|
--- a/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java
|
+++ b/src/main/java/net/minecraft/network/chat/OutgoingChatMessage.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
@ -15,7 +15,7 @@ index 74cf1c043beef03cfd5adf481414a5ee78bef2a6..939f4a0639c847b94cfc9acf1409a7a3
|
|||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
|
|
||||||
public interface OutgoingChatMessage {
|
public interface OutgoingChatMessage {
|
||||||
@@ -44,10 +45,22 @@ public interface OutgoingChatMessage {
|
@@ -46,9 +47,19 @@ public interface OutgoingChatMessage {
|
||||||
// Paper end
|
// Paper end
|
||||||
PlayerChatMessage playerChatMessage = this.message.filter(filterMaskEnabled);
|
PlayerChatMessage playerChatMessage = this.message.filter(filterMaskEnabled);
|
||||||
playerChatMessage = unsigned != null ? playerChatMessage.withUnsignedContent(unsigned) : playerChatMessage; // Paper
|
playerChatMessage = unsigned != null ? playerChatMessage.withUnsignedContent(unsigned) : playerChatMessage; // Paper
|
||||||
@ -25,22 +25,19 @@ index 74cf1c043beef03cfd5adf481414a5ee78bef2a6..939f4a0639c847b94cfc9acf1409a7a3
|
|||||||
sender.connection.sendPlayerChatMessage(playerChatMessage, params);
|
sender.connection.sendPlayerChatMessage(playerChatMessage, params);
|
||||||
+ return;
|
+ return;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ sender.connection.sendPlayerChatMessage(new PlayerChatMessage(
|
+ sender.connection.sendPlayerChatMessage(new PlayerChatMessage(
|
||||||
+ SignedMessageLink.unsigned(playerChatMessage.sender()),
|
+ SignedMessageLink.unsigned(playerChatMessage.sender()),
|
||||||
+ null,
|
+ null,
|
||||||
+ SignedMessageBody.unsigned(playerChatMessage.signedContent()),
|
+ SignedMessageBody.unsigned(playerChatMessage.signedContent()),
|
||||||
+ unsigned,
|
+ unsigned,
|
||||||
+ playerChatMessage.filterMask(),
|
+ playerChatMessage.filterMask()
|
||||||
+ playerChatMessage.result()
|
|
||||||
+ ), params);
|
+ ), params);
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
+
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
|
diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
index 85a8a687b1568a56e3e646b37ef78b562c1b8a82..68e2edd39dcbcc9199aeaecff9b3280914ba9270 100644
|
index 0af9ed92824ccf30814eceb6a2c2e5c12661c991..c92374104b4aed2f952b250c5559ab9cc83532da 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
|
--- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
|
+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
@@ -5,6 +5,8 @@ import java.time.Instant;
|
@@ -5,6 +5,8 @@ import java.time.Instant;
|
||||||
@ -49,20 +46,20 @@ index 85a8a687b1568a56e3e646b37ef78b562c1b8a82..68e2edd39dcbcc9199aeaecff9b32809
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+
|
+
|
||||||
+import me.totalfreedom.scissors.ScissorsConfig;
|
+import me.totalfreedom.scissors.ScissorsConfig;
|
||||||
import net.minecraft.util.SignatureUpdater;
|
|
||||||
import net.minecraft.util.SignatureValidator;
|
import net.minecraft.util.SignatureValidator;
|
||||||
import net.minecraft.util.Signer;
|
import net.minecraft.util.Signer;
|
||||||
@@ -46,7 +48,7 @@ public class SignedMessageChain {
|
import net.minecraft.world.entity.player.ProfilePublicKey;
|
||||||
|
@@ -45,7 +47,7 @@ public class SignedMessageChain {
|
||||||
if (!playerChatMessage.verify(signatureValidator)) {
|
if (!playerChatMessage.verify(signatureValidator)) {
|
||||||
throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.unsigned_chat"), true, org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event causes
|
throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.unsigned_chat"), true, org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event causes
|
||||||
} else {
|
} else {
|
||||||
- if (playerChatMessage.hasExpiredServer(Instant.now())) {
|
- if (playerChatMessage.hasExpiredServer(Instant.now())) {
|
||||||
+ if (playerChatMessage.hasExpiredServer(Instant.now()) && ScissorsConfig.chatSignaturesEnabled) { // Scissors
|
+ if (playerChatMessage.hasExpiredServer(Instant.now()) && ScissorsConfig.chatSignaturesEnabled) { // Scissors
|
||||||
LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", (Object)body.content());
|
LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", body.content());
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 889f142b6f87d4ccf4c1d2ffd379c96fbbfddd44..4bdd2e731102c7e3a312ad3144537042dce46923 100644
|
index 80f0f88258770862f419e4faba4cfca4c0457b2c..c0aa9520d547d6d77169fd1dbb02844b90ef4a1d 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
@ -72,7 +69,7 @@ index 889f142b6f87d4ccf4c1d2ffd379c96fbbfddd44..4bdd2e731102c7e3a312ad3144537042
|
|||||||
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.primitives.Floats;
|
import com.google.common.primitives.Floats;
|
||||||
@@ -2247,7 +2248,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -2243,7 +2244,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
|
||||||
private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
|
private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
|
||||||
ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString());
|
ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString());
|
||||||
@ -81,7 +78,7 @@ index 889f142b6f87d4ccf4c1d2ffd379c96fbbfddd44..4bdd2e731102c7e3a312ad3144537042
|
|||||||
this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes
|
this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes
|
||||||
} else {
|
} else {
|
||||||
this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED));
|
this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED));
|
||||||
@@ -2295,6 +2296,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -2291,6 +2292,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment);
|
Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment);
|
||||||
|
|
||||||
if (optional.isEmpty()) {
|
if (optional.isEmpty()) {
|
||||||
@ -89,7 +86,7 @@ index 889f142b6f87d4ccf4c1d2ffd379c96fbbfddd44..4bdd2e731102c7e3a312ad3144537042
|
|||||||
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
|
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
|
||||||
this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes
|
this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes
|
||||||
}
|
}
|
||||||
@@ -2493,6 +2495,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -2489,6 +2491,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
|
||||||
synchronized (this.lastSeenMessages) {
|
synchronized (this.lastSeenMessages) {
|
||||||
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
|
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
|
||||||
@ -97,7 +94,7 @@ index 889f142b6f87d4ccf4c1d2ffd379c96fbbfddd44..4bdd2e731102c7e3a312ad3144537042
|
|||||||
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
|
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
|
||||||
this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes
|
this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes
|
||||||
}
|
}
|
||||||
@@ -3471,6 +3474,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -3473,6 +3476,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) {
|
public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
@ -5,21 +5,21 @@ Subject: [PATCH] Limit map decorations
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||||
index 17343d515044f3678b4edf070ee7ca244adc4228..8ade519114bec879bed8e8e23707a85327da131b 100644
|
index 02e3d1c9c18952ba53507f7b6887fd3c81af33a9..61573844b236838fd219526ea35df8c7b0c94026 100644
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||||
@@ -65,7 +65,8 @@ public class ClientboundMapItemDataPacket implements Packet<ClientGamePacketList
|
@@ -63,7 +63,8 @@ public class ClientboundMapItemDataPacket implements Packet<ClientGamePacketList
|
||||||
b.writeByte(icon.x());
|
b.writeByte(icon.x());
|
||||||
b.writeByte(icon.y());
|
b.writeByte(icon.y());
|
||||||
b.writeByte(icon.rot() & 15);
|
b.writeByte(icon.rot() & 15);
|
||||||
- b.writeNullable(icon.name(), FriendlyByteBuf::writeComponent);
|
- b.writeNullable(icon.name(), FriendlyByteBuf::writeComponent);
|
||||||
+ final boolean passedNameCap = icon.name() == null || icon.name().getString().length() <= 32; // Scissors
|
+ final boolean passedNameCap = icon.name() == null || icon.name().getString().length() <= 32; // Scissors
|
||||||
+ b.writeNullable(passedNameCap ? icon.name() : null, FriendlyByteBuf::writeComponent); // Scissors
|
+ b.writeNullable(passedNameCap ? icon.name() : null, FriendlyByteBuf::writeComponent); // Scissors
|
||||||
});
|
}));
|
||||||
});
|
|
||||||
if (this.colorPatch != null) {
|
if (this.colorPatch != null) {
|
||||||
|
buf.writeByte(this.colorPatch.width);
|
||||||
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
|
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 e4c4948e076cd64686dfd16ae0568fafc1437140..eff53c21b18574750b691b784fb1688885d4ace7 100644
|
index 45269115e63cfc3bd7dc740a5694e2cc7c35bcb1..85ea95f55fd6177748edf921e2380142d93b8b06 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||||
@@ -361,6 +361,11 @@ public class MapItemSavedData extends SavedData {
|
@@ -361,6 +361,11 @@ public class MapItemSavedData extends SavedData {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Prevent player banning using duplicate UUIDs
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index ca309311928654ca7e971e98114d7c16d8341a55..4d3faab706e04c1ad495a59e6523524730a48f70 100644
|
index 502bdc726b7890b00ee36871d905dea44e8719e3..1fbc8b372271bb4cd4375ca6b6b1d7e7961094fb 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -1693,7 +1693,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1667,7 +1667,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
ServerLevel.LOGGER.warn("Force-added player with duplicate UUID {}", player.getUUID());
|
ServerLevel.LOGGER.warn("Force-added player with duplicate UUID {}", player.getUUID());
|
||||||
entity.unRide();
|
entity.unRide();
|
||||||
@ -17,7 +17,7 @@ index ca309311928654ca7e971e98114d7c16d8341a55..4d3faab706e04c1ad495a59e65235247
|
|||||||
+ if (entity instanceof ServerPlayer serverPlayer) {
|
+ if (entity instanceof ServerPlayer serverPlayer) {
|
||||||
+ this.removePlayerImmediately(serverPlayer, Entity.RemovalReason.DISCARDED);
|
+ this.removePlayerImmediately(serverPlayer, Entity.RemovalReason.DISCARDED);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ entity.discard();
|
+ entity.discard(null);
|
||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
}
|
}
|
@ -5,7 +5,7 @@ Subject: [PATCH] Limit beacon effectRange
|
|||||||
|
|
||||||
|
|
||||||
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
|
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 f13943db6f2fb923c52dcf9e8bf7000041d0a362..2fdcc47dd6a813d5f7a32dc58ca67b6b965c8749 100644
|
index 4b81b0180dfc96fc6a88646838a886ca5b5d301b..63ea77b3e965ff18571492d511ef7c1082441f9d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||||
@@ -87,7 +87,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
@@ -87,7 +87,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||||
@ -20,7 +20,7 @@ index f13943db6f2fb923c52dcf9e8bf7000041d0a362..2fdcc47dd6a813d5f7a32dc58ca67b6b
|
|||||||
@@ -456,6 +456,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
@@ -456,6 +456,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||||
|
|
||||||
this.lockKey = LockCode.fromTag(nbt);
|
this.lockKey = LockCode.fromTag(nbt);
|
||||||
this.effectRange = nbt.contains(PAPER_RANGE_TAG, 6) ? nbt.getDouble(PAPER_RANGE_TAG) : -1; // Paper
|
this.effectRange = nbt.contains(PAPER_RANGE_TAG, 6) ? nbt.getDouble(PAPER_RANGE_TAG) : -1; // Paper - Custom beacon ranges
|
||||||
+ if (this.effectRange > 256) this.effectRange = 256; // Scissors
|
+ if (this.effectRange > 256) this.effectRange = 256; // Scissors
|
||||||
}
|
}
|
||||||
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't log on too many chained updates
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
||||||
index 598dc0d3a2b9387e76d7e4e19e54c4573a24bc54..9eed28bf8bc7e2fa528729cde01a535bc7040815 100644
|
index 106af2b2c7ff72c7549975aef75cdcff8d9a7d97..ecdcf4cf8650270ce7595905ce9d498eee520dcd 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
--- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
+++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
||||||
@@ -56,7 +56,7 @@ public class CollectingNeighborUpdater implements NeighborUpdater {
|
@@ -58,7 +58,7 @@ public class CollectingNeighborUpdater implements NeighborUpdater {
|
||||||
this.stack.push(entry);
|
this.stack.push(entry);
|
||||||
}
|
}
|
||||||
} else if (this.count - 1 == this.maxChainedNeighborUpdates) {
|
} else if (this.count - 1 == this.maxChainedNeighborUpdates) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix packet-related lag exploits
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 1f7dc235f8cf848d740ef6a8cf879d253b56c1c8..2ef6fd0fadaf6b912c4f242210c1ce2756ccddd7 100644
|
index c0aa9520d547d6d77169fd1dbb02844b90ef4a1d..843793437737305bbdec598326a813f84b820d12 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -859,7 +859,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -865,7 +865,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
|
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
|
||||||
} else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission
|
} else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission
|
||||||
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
|
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
|
||||||
@ -17,7 +17,7 @@ index 1f7dc235f8cf848d740ef6a8cf879d253b56c1c8..2ef6fd0fadaf6b912c4f242210c1ce27
|
|||||||
BaseCommandBlock commandblocklistenerabstract = null;
|
BaseCommandBlock commandblocklistenerabstract = null;
|
||||||
CommandBlockEntity tileentitycommand = null;
|
CommandBlockEntity tileentitycommand = null;
|
||||||
BlockPos blockposition = packet.getPos();
|
BlockPos blockposition = packet.getPos();
|
||||||
@@ -1026,7 +1026,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -1013,7 +1013,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
@ -26,7 +26,7 @@ index 1f7dc235f8cf848d740ef6a8cf879d253b56c1c8..2ef6fd0fadaf6b912c4f242210c1ce27
|
|||||||
BlockPos blockposition = packet.getPos();
|
BlockPos blockposition = packet.getPos();
|
||||||
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
||||||
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
||||||
@@ -1084,7 +1084,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -1071,7 +1071,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
@ -35,7 +35,7 @@ index 1f7dc235f8cf848d740ef6a8cf879d253b56c1c8..2ef6fd0fadaf6b912c4f242210c1ce27
|
|||||||
BlockPos blockposition = packet.getPos();
|
BlockPos blockposition = packet.getPos();
|
||||||
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
||||||
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
||||||
@@ -1109,7 +1109,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -1096,7 +1096,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
@ -1,6 +1,6 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Mon, 11 Dec 2023 12:27:44 -0600
|
Date: Mon, 15 Apr 2024 23:27:16 -0500
|
||||||
Subject: [PATCH] Implement command block events
|
Subject: [PATCH] Implement command block events
|
||||||
|
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ index c99fc118013cb3d4043638e2001a8297e79ddf9c..cdaa81e1f2167b29ec01cc25e51a8400
|
|||||||
private final boolean trackOutput;
|
private final boolean trackOutput;
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 4bdd2e731102c7e3a312ad3144537042dce46923..1f7dc235f8cf848d740ef6a8cf879d253b56c1c8 100644
|
index 843793437737305bbdec598326a813f84b820d12..bbe76d46b599fb2f8211f3e62a76430db120f66f 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -1,6 +1,8 @@
|
@@ -1,6 +1,8 @@
|
||||||
@ -47,7 +47,7 @@ index 4bdd2e731102c7e3a312ad3144537042dce46923..1f7dc235f8cf848d740ef6a8cf879d25
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -894,6 +899,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -905,6 +910,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity);
|
this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ index 4bdd2e731102c7e3a312ad3144537042dce46923..1f7dc235f8cf848d740ef6a8cf879d25
|
|||||||
commandblocklistenerabstract.setCommand(s);
|
commandblocklistenerabstract.setCommand(s);
|
||||||
commandblocklistenerabstract.setTrackOutput(flag);
|
commandblocklistenerabstract.setTrackOutput(flag);
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
@@ -925,7 +940,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -936,7 +951,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level());
|
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level());
|
||||||
|
|
||||||
if (commandblocklistenerabstract != null) {
|
if (commandblocklistenerabstract != null) {
|
||||||
@ -79,7 +79,6 @@ index 4bdd2e731102c7e3a312ad3144537042dce46923..1f7dc235f8cf848d740ef6a8cf879d25
|
|||||||
+
|
+
|
||||||
+ command = event.getNewCommand();
|
+ command = event.getNewCommand();
|
||||||
+ commandblocklistenerabstract.setCommand(command);
|
+ commandblocklistenerabstract.setCommand(command);
|
||||||
+
|
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
commandblocklistenerabstract.setTrackOutput(packet.isTrackOutput());
|
commandblocklistenerabstract.setTrackOutput(packet.isTrackOutput());
|
||||||
if (!packet.isTrackOutput()) {
|
if (!packet.isTrackOutput()) {
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Limit save data for Bees and Vexes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
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 a87a34b0c4c8e5d0cf079025c230b1434c919b54..7cbcbbed6ec45a32bbfe8118bf186c6580f065ca 100644
|
index f9521a6e115f0c975a7885b024c99eae300b63bf..c1598d0caee40a7d73af549b31b61ee7aae77315 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||||
@@ -234,8 +234,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
@@ -234,8 +234,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
@ -24,7 +24,7 @@ index a87a34b0c4c8e5d0cf079025c230b1434c919b54..7cbcbbed6ec45a32bbfe8118bf186c65
|
|||||||
|
|
||||||
this.savedFlowerPos = null;
|
this.savedFlowerPos = null;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Vex.java b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Vex.java b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||||
index 30ea3f64234fd1fda8dada3c7fb12be0730322a8..b621b9a50047c5283b259d67019989ec823576e0 100644
|
index f443006c1e32feee97b32312814e2447a50c45e2..ad418449f5ffd4bcceb5834b1385dc69259f3a21 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||||
@@ -118,8 +118,12 @@ public class Vex extends Monster implements TraceableEntity {
|
@@ -118,8 +118,12 @@ public class Vex extends Monster implements TraceableEntity {
|
@ -1,17 +1,17 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Allink <arclicious@vivaldi.net>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Fri, 2 Jun 2023 22:13:54 +0100
|
Date: Mon, 15 Apr 2024 23:40:27 -0500
|
||||||
Subject: [PATCH] Add depth limit to SNBT
|
Subject: [PATCH] Add depth limit to SNBT
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java
|
diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java
|
||||||
index 5bec54239a2b185284c10d58854e5a13e33daae5..f112d82b0a9e5513395fa7c1b05d1fe9e28c64ca 100644
|
index c77860a141064aea6a0b510bb44d35fea90aee42..3be3dd61b8a27b3a8ca3c72ae5ffa2ea8fa00231 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/TagParser.java
|
--- a/src/main/java/net/minecraft/nbt/TagParser.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/TagParser.java
|
+++ b/src/main/java/net/minecraft/nbt/TagParser.java
|
||||||
@@ -179,9 +179,56 @@ public class TagParser {
|
@@ -184,9 +184,47 @@ public class TagParser {
|
||||||
}
|
|
||||||
|
|
||||||
this.expect('}');
|
this.expect('}');
|
||||||
|
this.depth--; // Paper
|
||||||
- return compoundTag;
|
- return compoundTag;
|
||||||
+ return exceedsDepthLimit(compoundTag) ? new CompoundTag() : compoundTag; // Scissors - Add depth limit to SNBT
|
+ return exceedsDepthLimit(compoundTag) ? new CompoundTag() : compoundTag; // Scissors - Add depth limit to SNBT
|
||||||
}
|
}
|
||||||
@ -21,39 +21,30 @@ index 5bec54239a2b185284c10d58854e5a13e33daae5..f112d82b0a9e5513395fa7c1b05d1fe9
|
|||||||
+ return this.exceedsDepthLimit(0, tag);
|
+ return this.exceedsDepthLimit(0, tag);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ private boolean exceedsDepthLimit(long depth, Tag tag)
|
+ private boolean exceedsDepthLimit(long depth, Tag tag) {
|
||||||
+ {
|
+ if (depth > 256) {
|
||||||
+ if (depth > 256)
|
|
||||||
+ {
|
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (tag instanceof ListTag listTag)
|
+ if (tag instanceof ListTag listTag) {
|
||||||
+ {
|
+ for (Tag childTag : listTag) {
|
||||||
+ for (Tag childTag : listTag)
|
|
||||||
+ {
|
|
||||||
+ boolean returnValue = this.exceedsDepthLimit(depth + 1, childTag);
|
+ boolean returnValue = this.exceedsDepthLimit(depth + 1, childTag);
|
||||||
+
|
+
|
||||||
+ if (returnValue)
|
+ if (returnValue) {
|
||||||
+ {
|
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ } else if (tag instanceof CompoundTag compoundTag)
|
+ } else if (tag instanceof CompoundTag compoundTag) {
|
||||||
+ {
|
+ for (String key : compoundTag.getAllKeys()) {
|
||||||
+ for (String key: compoundTag.getAllKeys())
|
|
||||||
+ {
|
|
||||||
+ Tag childTag = compoundTag.get(key);
|
+ Tag childTag = compoundTag.get(key);
|
||||||
+
|
+
|
||||||
+ if (childTag == null)
|
+ if (childTag == null) {
|
||||||
+ {
|
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ boolean returnValue = this.exceedsDepthLimit(depth + 1, childTag);
|
+ boolean returnValue = this.exceedsDepthLimit(depth + 1, childTag);
|
||||||
+
|
+
|
||||||
+ if (returnValue)
|
+ if (returnValue) {
|
||||||
+ {
|
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@ -66,45 +57,45 @@ index 5bec54239a2b185284c10d58854e5a13e33daae5..f112d82b0a9e5513395fa7c1b05d1fe9
|
|||||||
private Tag readListTag() throws CommandSyntaxException {
|
private Tag readListTag() throws CommandSyntaxException {
|
||||||
this.expect('[');
|
this.expect('[');
|
||||||
this.reader.skipWhitespace();
|
this.reader.skipWhitespace();
|
||||||
@@ -213,7 +260,7 @@ public class TagParser {
|
@@ -220,7 +258,7 @@ public class TagParser {
|
||||||
}
|
|
||||||
|
|
||||||
this.expect(']');
|
this.expect(']');
|
||||||
|
this.depth--; // Paper
|
||||||
- return listTag;
|
- return listTag;
|
||||||
+ return exceedsDepthLimit(listTag) ? new ListTag() : listTag; // Scissors - Add depth limit to SNBT
|
+ return exceedsDepthLimit(listTag) ? new ListTag() : listTag; // Scissors - Add depth limit to SNBT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,7 +285,7 @@ public class TagParser {
|
@@ -245,7 +283,7 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
private <T extends Number> List<T> readArray(TagType<?> arrayTypeReader, TagType<?> typeReader) throws CommandSyntaxException {
|
private <T extends Number> List<T> readArray(TagType<?> arrayTypeReader, TagType<?> typeReader) throws CommandSyntaxException {
|
||||||
- List<T> list = Lists.newArrayList();
|
- List<T> list = Lists.newArrayList();
|
||||||
+ List<Number> list = Lists.newArrayList(); // Scissors - List<T> -> List<Number>
|
+ List<Number> list = Lists.newArrayList(); // Scissors - List<T> -> List<Number>
|
||||||
|
|
||||||
while(true) {
|
while (this.reader.peek() != ']') {
|
||||||
if (this.reader.peek() != ']') {
|
int i = this.reader.getCursor();
|
||||||
@@ -251,11 +298,11 @@ public class TagParser {
|
@@ -257,11 +295,11 @@ public class TagParser {
|
||||||
}
|
|
||||||
|
|
||||||
if (typeReader == ByteTag.TYPE) {
|
|
||||||
- list.add((T)((NumericTag)tag).getAsByte());
|
|
||||||
+ list.add(((NumericTag)tag).getAsByte()); // Scissors - Remove (T) cast
|
|
||||||
} else if (typeReader == LongTag.TYPE) {
|
|
||||||
- list.add((T)((NumericTag)tag).getAsLong());
|
|
||||||
+ list.add(((NumericTag)tag).getAsLong()); // Scissors - Remove (T) cast
|
|
||||||
} else {
|
|
||||||
- list.add((T)((NumericTag)tag).getAsInt());
|
|
||||||
+ list.add(((NumericTag)tag).getAsInt()); // Scissors - Remove (T) cast
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.hasElementSeparator()) {
|
|
||||||
@@ -267,7 +314,7 @@ public class TagParser {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.expect(']');
|
if (typeReader == ByteTag.TYPE) {
|
||||||
- return list;
|
- list.add((T)(Byte)((NumericTag)tag).getAsByte()); // Paper - decompile fix
|
||||||
+ return (List<T>) list; // Scissors - Cast to List<T>
|
+ list.add(((NumericTag)tag).getAsByte()); // Scissors - Remove (T) cast
|
||||||
|
} else if (typeReader == LongTag.TYPE) {
|
||||||
|
- list.add((T)(Long)((NumericTag)tag).getAsLong()); // Paper - decompile fix
|
||||||
|
+ list.add(((NumericTag)tag).getAsLong()); // Scissors - Remove (T) cast
|
||||||
|
} else {
|
||||||
|
- list.add((T)(Integer)((NumericTag)tag).getAsInt()); // Paper - decompile fix
|
||||||
|
+ list.add(((NumericTag)tag).getAsInt()); // Scissors - Remove (T) cast
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.hasElementSeparator()) {
|
||||||
|
@@ -274,7 +312,7 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.expect(']');
|
||||||
|
- return list;
|
||||||
|
+ return (List<T>) list; // Scissors - Cast to List<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean hasElementSeparator() {
|
@ -5,28 +5,31 @@ Subject: [PATCH] Mute invalid attributes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
index 7204b973c3ad9239e82355513f6d538107102e48..2463444778f19f937b18173798c04d9d9788a824 100644
|
index b99a080ab27e24d8131fda931ca70d6d271bb01c..f88b31d9bfc8b332230fa318ba2c1de14d5cc9be 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
@@ -147,7 +147,7 @@ public class AttributeMap {
|
@@ -135,7 +135,10 @@ public class AttributeMap {
|
||||||
|
if (attributeInstance != null) {
|
||||||
|
attributeInstance.load(compoundTag);
|
||||||
}
|
}
|
||||||
|
- }, () -> LOGGER.warn("Ignoring unknown attribute '{}'", string));
|
||||||
}, () -> {
|
+
|
||||||
- LOGGER.warn("Ignoring unknown attribute '{}'", (Object)string);
|
+ }, () -> {
|
||||||
+ // LOGGER.warn("Ignoring unknown attribute '{}'", (Object)string); // Scissors - Mute invalid attributes
|
+ // LOGGER.warn("Ignoring unknown attribute '{}'", (Object)string); // Scissors - Mute invalid attributes
|
||||||
});
|
+ });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
||||||
index 1b0db545f93b51368c2d384dd1ba45b93d9eff87..5c3633aa6a256a197502c8139cbf61c2f493bda7 100644
|
index a38e91552ead256bd8dd3b74794d742555681c2d..116af10e6e2467a3e3b0095c4968a79ebb4a19d6 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
||||||
@@ -86,7 +86,7 @@ public class AttributeModifier {
|
@@ -90,7 +90,7 @@ public class AttributeModifier {
|
||||||
AttributeModifier.Operation operation = AttributeModifier.Operation.fromValue(nbt.getInt("Operation"));
|
AttributeModifier.Operation operation = AttributeModifier.Operation.fromValue(nbt.getInt("Operation"));
|
||||||
return new AttributeModifier(uUID, nbt.getString("Name"), nbt.getDouble("Amount"), operation);
|
return new AttributeModifier(uUID, nbt.getString("Name"), nbt.getDouble("Amount"), operation);
|
||||||
} catch (Exception var3) {
|
} catch (Exception var3) {
|
||||||
- LOGGER.warn("Unable to create attribute: {}", (Object)var3.getMessage());
|
- LOGGER.warn("Unable to create attribute: {}", var3.getMessage());
|
||||||
+ // LOGGER.warn("Unable to create attribute: {}", (Object)var3.getMessage()); // Scissors - Mute invalid attributes
|
+ // LOGGER.warn("Unable to create attribute: {}", var3.getMessage()); // Scissors - Mute invalid attributes
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,7 @@ Subject: [PATCH] Mute invalid Enderdragon phases
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java
|
||||||
index bca131e9c428e2cb073ae2ef517dda12f73a5dcd..b9d603c82b12299e94c31928b36c9517834cff62 100644
|
index 1b1a210a86121049e507a497649727a99452c0a2..a8bcadbf64d5034b172427e16b1468b4c91c4518 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java
|
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java
|
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java
|
||||||
@@ -20,7 +20,7 @@ public class DragonChargePlayerPhase extends AbstractDragonPhaseInstance {
|
@@ -20,7 +20,7 @@ public class DragonChargePlayerPhase extends AbstractDragonPhaseInstance {
|
||||||
@ -18,10 +18,10 @@ index bca131e9c428e2cb073ae2ef517dda12f73a5dcd..b9d603c82b12299e94c31928b36c9517
|
|||||||
} else if (this.timeSinceCharge > 0 && this.timeSinceCharge++ >= 10) {
|
} else if (this.timeSinceCharge > 0 && this.timeSinceCharge++ >= 10) {
|
||||||
this.dragon.getPhaseManager().setPhase(EnderDragonPhase.HOLDING_PATTERN);
|
this.dragon.getPhaseManager().setPhase(EnderDragonPhase.HOLDING_PATTERN);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
||||||
index a3456b35db4e938f91d6bc32d4d202a011bf13c4..aad0b066e4fd63195aa117c5a03f64846bf46fbd 100644
|
index c5269c3117901b8521720d1b32689d7f600f20a3..3a8839ee4cb8cafb927ad49a9e8f9a2955eef973 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
||||||
@@ -32,7 +32,7 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance {
|
@@ -31,7 +31,7 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance {
|
||||||
@Override
|
@Override
|
||||||
public void doServerTick() {
|
public void doServerTick() {
|
||||||
if (this.attackTarget == null) {
|
if (this.attackTarget == null) {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add length limit to note block sound
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
||||||
index 4430520d32024d897c93c1d9f8652ccb2c202c01..ceef1a7fd41751f553f21784217f95a210bd24d9 100644
|
index 6f52256bfb668aee7fd1628c1c0c7b3434b847a6..74f1227ecf664cf0d4f62d6f9c3e65ffc07b146e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
||||||
@@ -113,7 +113,7 @@ public class SkullBlockEntity extends BlockEntity {
|
@@ -113,7 +113,7 @@ public class SkullBlockEntity extends BlockEntity {
|
@ -1,14 +1,14 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Telesphoreo <me@telesphoreo.me>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sat, 26 Mar 2022 21:51:07 -0500
|
Date: Tue, 23 Jan 2024 19:01:02 -0600
|
||||||
Subject: [PATCH] Change version fetcher to AMG
|
Subject: [PATCH] Change version fetcher to AMG
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..bc5ed619e05f24f3ad50a6a81306d120869f57a1 100644
|
index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..48dd50d0e443a59835e92616874c9856c7cbc401 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
@@ -4,11 +4,13 @@ import com.destroystokyo.paper.util.VersionFetcher;
|
@@ -4,6 +4,7 @@ import com.destroystokyo.paper.util.VersionFetcher;
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import com.google.common.io.Resources;
|
import com.google.common.io.Resources;
|
||||||
import com.google.gson.*;
|
import com.google.gson.*;
|
||||||
@ -16,14 +16,12 @@ index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..bc5ed619e05f24f3ad50a6a81306d120
|
|||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.event.ClickEvent;
|
import net.kyori.adventure.text.event.ClickEvent;
|
||||||
import net.kyori.adventure.text.format.NamedTextColor;
|
import net.kyori.adventure.text.format.NamedTextColor;
|
||||||
import net.kyori.adventure.text.format.TextDecoration;
|
@@ -16,11 +17,12 @@ import java.io.*;
|
||||||
import net.kyori.adventure.text.TextComponent;
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.stream.StreamSupport;
|
||||||
+import org.bukkit.Bukkit; // Scissors
|
+import org.bukkit.Bukkit; // Scissors
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
@@ -19,8 +21,8 @@ import java.util.stream.StreamSupport;
|
|
||||||
|
|
||||||
public class PaperVersionFetcher implements VersionFetcher {
|
public class PaperVersionFetcher implements VersionFetcher {
|
||||||
private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end
|
private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end
|
||||||
- private static final String GITHUB_BRANCH_NAME = "master";
|
- private static final String GITHUB_BRANCH_NAME = "master";
|
||||||
@ -77,15 +75,15 @@ index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..bc5ed619e05f24f3ad50a6a81306d120
|
|||||||
switch (distance) {
|
switch (distance) {
|
||||||
case -1:
|
case -1:
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
index a74a8a027c99eef199c1a6a54232ac2c8ffb9d08..1576a201c92d8b17fd3a92ec497c42861db8ad1e 100644
|
index c0538206a53f0e6d9b54bddde0259b89ac73d675..5ebb80ed81d9bbd4c69a14ccd0be6c67de2fcf0d 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
@@ -301,7 +301,7 @@ public class Main {
|
@@ -315,7 +315,7 @@ public class Main {
|
||||||
if (buildDate.before(deadline.getTime())) {
|
if (buildDate.before(deadline.getTime())) {
|
||||||
// Paper start - This is some stupid bullshit
|
// Paper start - This is some stupid bullshit
|
||||||
System.err.println("*** Warning, you've not updated in a while! ***");
|
System.err.println("*** Warning, you've not updated in a while! ***");
|
||||||
- System.err.println("*** Please download a new build as per instructions from https://papermc.io/downloads/paper ***"); // Paper
|
- System.err.println("*** Please download a new build as per instructions from https://papermc.io/downloads/paper ***"); // Paper
|
||||||
+ System.err.println("*** Please download a new build from https://ci.scissors.gg/job/Scissors ***"); // Scissors > // Paper
|
+ System.err.println("*** Please download a new build as per instructions from https://ci.scissors.gg/job/Scissors ***"); // Paper
|
||||||
//System.err.println("*** Server will start in 20 seconds ***");
|
//System.err.println("*** Server will start in 20 seconds ***");
|
||||||
//Thread.sleep(TimeUnit.SECONDS.toMillis(20));
|
//Thread.sleep(TimeUnit.SECONDS.toMillis(20));
|
||||||
// Paper End
|
// Paper end
|
@ -0,0 +1,117 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Focusvity <nathan.curran10012@gmail.com>
|
||||||
|
Date: Mon, 5 Feb 2024 19:39:23 +1100
|
||||||
|
Subject: [PATCH] Add depth limit to Component deserialization
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
|
index ae84d06564b2560e13404f6d89f88ad71dbc2cc6..df3c03aeaee5c12c5d57584535c9c7aa01be7dd3 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
|
@@ -3,9 +3,11 @@ package net.minecraft.network.chat;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
+import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonDeserializationContext;
|
||||||
|
import com.google.gson.JsonDeserializer;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
+import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParseException;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
import com.google.gson.JsonSerializationContext;
|
||||||
|
@@ -13,6 +15,7 @@ import com.google.gson.JsonSerializer;
|
||||||
|
import com.google.gson.stream.JsonReader;
|
||||||
|
import com.mojang.brigadier.Message;
|
||||||
|
import com.mojang.serialization.JsonOps;
|
||||||
|
+
|
||||||
|
import java.io.StringReader;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
@@ -23,6 +26,9 @@ import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.UUID;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
+
|
||||||
|
+import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
||||||
|
+import net.minecraft.ChatFormatting;
|
||||||
|
import net.minecraft.Util;
|
||||||
|
import net.minecraft.network.chat.contents.DataSource;
|
||||||
|
import net.minecraft.network.chat.contents.KeybindContents;
|
||||||
|
@@ -33,8 +39,10 @@ import net.minecraft.network.chat.contents.SelectorContents;
|
||||||
|
import net.minecraft.network.chat.contents.TranslatableContents;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.util.FormattedCharSequence;
|
||||||
|
+import net.minecraft.util.GsonHelper;
|
||||||
|
import net.minecraft.world.level.ChunkPos;
|
||||||
|
// CraftBukkit start
|
||||||
|
+import java.util.regex.Pattern; // Scissors
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
|
@@ -284,10 +292,65 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||||
|
public static class Serializer {
|
||||||
|
|
||||||
|
private static final Gson GSON = (new GsonBuilder()).disableHtmlEscaping().create();
|
||||||
|
+ private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("%[0-9]+\\$s"); // Scissors
|
||||||
|
|
||||||
|
private Serializer() {}
|
||||||
|
|
||||||
|
+ // Scissors start
|
||||||
|
+ static int depthChecker(int depth) {
|
||||||
|
+ depth = depth + 1;
|
||||||
|
+ if (depth > ScissorsConfig.componentDepthLimit) {
|
||||||
|
+ throw new JsonParseException("Depth limit exceeded");
|
||||||
|
+ }
|
||||||
|
+ return depth;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ static int getPenalty(String string) {
|
||||||
|
+ if (PLACEHOLDER_PATTERN.matcher(string).find()) {
|
||||||
|
+ long translate_placeholders = PLACEHOLDER_PATTERN.matcher(string).results().count();
|
||||||
|
+ return (int) translate_placeholders * 12;
|
||||||
|
+ }
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
static MutableComponent deserialize(JsonElement json) {
|
||||||
|
+ int depth = 1;
|
||||||
|
+ if (!json.isJsonPrimitive()) {
|
||||||
|
+ if (!json.isJsonObject()) {
|
||||||
|
+ if (json.isJsonArray()) {
|
||||||
|
+ JsonArray jsonArray = json.getAsJsonArray();
|
||||||
|
+ if (jsonArray.size() <= 0) throw new JsonParseException("Unexpected empty array of components");
|
||||||
|
+
|
||||||
|
+ for (JsonElement ignored : jsonArray) {
|
||||||
|
+ depth = depthChecker(depth);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ JsonObject jsonObject = json.getAsJsonObject();
|
||||||
|
+ if (jsonObject.has("translate")) {
|
||||||
|
+ String s = GsonHelper.getAsString(jsonObject, "translate");
|
||||||
|
+ int penalty = getPenalty(s);
|
||||||
|
+ depth = depthChecker(depth + penalty);
|
||||||
|
+
|
||||||
|
+ if (jsonObject.has("with")) {
|
||||||
|
+ String s1 = GsonHelper.getAsJsonArray(jsonObject, "with").toString();
|
||||||
|
+ penalty = getPenalty(s1);
|
||||||
|
+ depth = depthChecker(depth + penalty);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (jsonObject.has("extra")) {
|
||||||
|
+ JsonArray jsonArray = GsonHelper.getAsJsonArray(jsonObject, "extra");
|
||||||
|
+ if (jsonArray.size() <= 0) throw new JsonParseException("Unexpected empty array of components");
|
||||||
|
+
|
||||||
|
+ for (JsonElement ignored : jsonArray) {
|
||||||
|
+ depth = depthChecker(depth);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // Scissors end
|
||||||
|
+
|
||||||
|
return (MutableComponent) Util.getOrThrow(ComponentSerialization.CODEC.parse(JsonOps.INSTANCE, json), JsonParseException::new);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Focusvity <nathan.curran10012@gmail.com>
|
||||||
|
Date: Sun, 11 Feb 2024 19:44:20 +1100
|
||||||
|
Subject: [PATCH] Add depth limit to updateCustomBlockEntityTag
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||||
|
index 8d2c0accadaf0c5d28e7db6e62a05f6c619cf02f..75d31897711cf5917bc6f8082edddbb502c46a95 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||||
|
@@ -4,12 +4,19 @@ import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
+// Scissors start
|
||||||
|
+import java.util.regex.Matcher;
|
||||||
|
+import java.util.regex.Pattern;
|
||||||
|
+// Scissors end
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
+
|
||||||
|
+import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
||||||
|
import net.minecraft.advancements.CriteriaTriggers;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
import net.minecraft.nbt.ListTag;
|
||||||
|
+import net.minecraft.nbt.Tag; // Scissors
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
@@ -240,6 +247,35 @@ public class BlockItem extends Item {
|
||||||
|
if (nbttagcompound != null) {
|
||||||
|
BlockEntity tileentity = world.getBlockEntity(pos);
|
||||||
|
|
||||||
|
+ // Scissors start
|
||||||
|
+ if (nbttagcompound.contains("CustomName")) {
|
||||||
|
+ String customName = nbttagcompound.getString("CustomName");
|
||||||
|
+ Pattern EXTRA_PATTERN = Pattern.compile("\"extra\":(\\[(.*?)\\{|\\[\\{)");
|
||||||
|
+ Matcher matcher = EXTRA_PATTERN.matcher(customName);
|
||||||
|
+ if (matcher.find()) {
|
||||||
|
+ String matcherString = matcher.group();
|
||||||
|
+ int penalty = (matcherString.startsWith("\"extra\":[{") ? (int) matcher.results().count() : matcher.group().replace("\"extra\":", "").replace("{", "").length()) * 12;
|
||||||
|
+ if (penalty > ScissorsConfig.componentDepthLimit) {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ for (Tag tag : nbttagcompound.tags.values()) {
|
||||||
|
+ if (tag instanceof CompoundTag compoundTag && compoundTag.contains("messages")) {
|
||||||
|
+ ListTag messagesList = compoundTag.getList("messages", 8);
|
||||||
|
+ Pattern TRANSLATE_PLACEHOLDER_PATTERN = Pattern.compile("%[0-9]+\\$s");
|
||||||
|
+ Matcher matcher = TRANSLATE_PLACEHOLDER_PATTERN.matcher(messagesList.toString());
|
||||||
|
+ if (matcher.find()) {
|
||||||
|
+ int penalty = (int) matcher.results().count() * 12;
|
||||||
|
+ if (penalty > ScissorsConfig.componentDepthLimit) {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // Scissors end
|
||||||
|
+
|
||||||
|
if (tileentity != null) {
|
||||||
|
if (!world.isClientSide && tileentity.onlyOpCanSetNbt() && (player == null || !(player.canUseGameMasterBlocks() || (player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.nbt.place"))))) { // Spigot - add permission
|
||||||
|
return false;
|
@ -7,4 +7,4 @@ pluginManagement {
|
|||||||
|
|
||||||
rootProject.name = "Scissors"
|
rootProject.name = "Scissors"
|
||||||
|
|
||||||
include("aswm-api", "aswm-core", "Scissors-API", "Scissors-Server")
|
include("Scissors-API", "Scissors-Server")
|
||||||
|
Submodule submodules/AdvancedSlimePaper deleted from 220f37ce02
Reference in New Issue
Block a user