mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2025-07-15 22:34:04 +00:00
Compare commits
140 Commits
1.19.4
...
slime/1.20
Author | SHA1 | Date | |
---|---|---|---|
a148b24dd0 | |||
11d285c279 | |||
54e9d9ec69 | |||
10addc9031 | |||
d4884cefc7 | |||
94834835af | |||
6423b04da8 | |||
488e1c3dc2 | |||
bdef90c145 | |||
c05142d907 | |||
a259c0202c | |||
414fbf6840 | |||
30341c1148 | |||
3271c24791 | |||
6dbfcd0704 | |||
0179964845 | |||
b817ef863d | |||
f678e6140b | |||
f12f438481 | |||
4c5d35e901 | |||
437e40a2f8 | |||
9e874fb21f | |||
0ef1c4d8a8 | |||
291a7fa852 | |||
1283dcdd4c | |||
6b3e59b039 | |||
acfd3e1814 | |||
e393f9b057 | |||
7ceedf9453 | |||
574452466d | |||
a394fb44d8 | |||
763df5c337 | |||
f70596845b | |||
58a5036119 | |||
e0f91f7178 | |||
c9e9ae9573 | |||
3ce7bbf9ca | |||
9bb6c35edd | |||
3acfa3fa80 | |||
f8898d0e1c | |||
d5b68d8f5c | |||
35fd7b6fc0 | |||
ddd6e20790 | |||
fb3550ad44 | |||
71a75afe98 | |||
612fc104c3 | |||
378d710612 | |||
a40d598ab1 | |||
182525b22b | |||
a5af796395 | |||
a07a38484b | |||
30b69bc059 | |||
9fc9c36cb3 | |||
b2bc2c2152 | |||
c39661c11a | |||
dc0a3610ec | |||
185c5ee1a6 | |||
76822727f6 | |||
|
511733b8d5 | ||
|
40a91ca05e | ||
ff6a9c5ff6 | |||
4d3359cb97 | |||
|
8226a3b03a | ||
|
e82a295608 | ||
d6432c162f | |||
5a7aef059d | |||
79705ff262 | |||
d013cfde88 | |||
1bbbb18b2e | |||
8bc2c95edb | |||
cbd52d38d9 | |||
|
8f2be500b5 | ||
|
3f889f5040 | ||
e8dbeb27e9 | |||
e1d2dd4813 | |||
c4826c11c8 | |||
|
44567fd8b0 | ||
1111ffabd7 | |||
a928a00e34 | |||
dce994005e | |||
4727e8db38 | |||
|
8303790110 | ||
|
6b951f73c5 | ||
36b4a55f38 | |||
|
1175851f8d | ||
896bf3f11b | |||
ed986eccd1 | |||
b4d84dc21b | |||
5d1989e36c | |||
|
3a063e3397 | ||
0d9d87dacf | |||
71a59bc142 | |||
8f81b70a32 | |||
6015aa70b7 | |||
b697c4be94 | |||
77e1aa9166 | |||
30357ec6b0 | |||
577780ddbf | |||
|
8134fe5dc1 | ||
|
503d399712 | ||
083e1d8f83 | |||
|
4c6342a24c | ||
|
5b98ad272f | ||
|
2109ba025d | ||
|
25eed98578 | ||
8bb5b4c152 | |||
|
9515027636 | ||
|
41e0723e0e | ||
|
76bd4f5ff2 | ||
|
51d07d5014 | ||
1376571cbd | |||
|
0070aa0553 | ||
|
d749843f1e | ||
|
f9f5f1b345 | ||
d2e0e16016 | |||
|
ddaee58457 | ||
|
ab658d7e35 | ||
016966e97e | |||
7bc46e28a7 | |||
345cce1b63 | |||
|
871cc5653c | ||
ca518d0329 | |||
|
70c16f6ffa | ||
9809c34764 | |||
c92c04eff6 | |||
|
f44bda2c9e | ||
0c8658f767 | |||
6b00cbdbb9 | |||
0aff8684fe | |||
|
e7512f7b6d | ||
772d2a7558 | |||
defd33d2bd | |||
adb61dab39 | |||
08e661b27a | |||
8ee33f4a4d | |||
7bebfce7df | |||
cb210eb5a1 | |||
4a8c0ce378 | |||
f128a0fc62 | |||
a40a8e3ed6 |
28
.github/workflows/build.yml
vendored
28
.github/workflows/build.yml
vendored
@@ -1,5 +1,10 @@
|
|||||||
name: Patch and Build
|
name: Patch and Build
|
||||||
on: [ push, pull_request ]
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "**" ]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# Only run on PRs if the source branch is on someone else's repo
|
# Only run on PRs if the source branch is on someone else's repo
|
||||||
@@ -7,26 +12,21 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Git Repository
|
- name: Checkout Git Repository
|
||||||
uses: actions/checkout@v2
|
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: Cache Gradle
|
- name: Setup Gradle
|
||||||
uses: actions/cache@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.gradle/caches
|
|
||||||
~/.gradle/wrapper
|
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/gradle.properties') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v2.3.0
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
- name: Configure Git User Details
|
- name: Configure Git User Details
|
||||||
run: git config --global user.email "actions@github.com" && git config --global user.name "Github Actions"
|
run: git config --global user.email "actions@github.com" && git config --global user.name "Github Actions"
|
||||||
- name: Apply Patches
|
- name: Apply Patches
|
||||||
run: ./gradlew applyPatches --stacktrace
|
run: ./gradlew applyPatches
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew build --stacktrace
|
run: ./gradlew build
|
||||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -50,3 +50,8 @@ Scissors-Server
|
|||||||
Scissors-API
|
Scissors-API
|
||||||
|
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
aswm-api/src
|
||||||
|
aswm-core/src
|
||||||
|
|
||||||
|
paper-api-generator
|
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[submodule "submodules/AdvancedSlimePaper"]
|
||||||
|
path = submodules/AdvancedSlimePaper
|
||||||
|
url = https://github.com/InfernalSuite/AdvancedSlimePaper.git
|
||||||
|
branch = mc/1.20.4
|
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -1,9 +1,15 @@
|
|||||||
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 {
|
||||||
|
@@ -16,5 +16,6 @@ should submit a pull request to this project to add their name.
|
|||||||
|
|
||||||
```text
|
```text
|
||||||
Allink (allinkdev) <arclicious@vivaldi.net>
|
Allink (allinkdev) <arclicious@vivaldi.net>
|
||||||
|
Luna (LunaWasFlaggedAgain) <lunahatesgogle@gmail.com>
|
||||||
Telesphoreo <me@telesphoreo.me>
|
Telesphoreo <me@telesphoreo.me>
|
||||||
```
|
```
|
||||||
|
20
README.md
20
README.md
@@ -1,13 +1,23 @@
|
|||||||
# Scissors [](https://ci.scissors.gg/job/Scissors/job/1.19.4/)
|
# Scissors [](https://ci.plex.us.org/job/Scissors/job/slime%252F1.20.2/)
|
||||||
|
|
||||||
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.19.4)
|
### [Scissors Javadoc](https://javadoc.scissors.gg/1.20.2)
|
||||||
### [Scissors Announcements](https://totalfreedom.me/forum/board/139)
|
### [Scissors Announcements](https://totalfreedom.tf/forums/scissors-announcements.55)
|
||||||
### [Scissors General Discussion](https://totalfreedom.me/forum/board/140)
|
### [Scissors General Discussion](https://totalfreedom.tf/forums/scissors-discussion.56/)
|
||||||
|
|
||||||
## Tasks
|
## Tasks
|
||||||
```
|
```
|
||||||
|
17
aswm-api/build.gradle.kts
Normal file
17
aswm-api/build.gradle.kts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
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
aswm-api/src
Symbolic link
1
aswm-api/src
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../submodules/AdvancedSlimePaper/api/src
|
7
aswm-core/build.gradle.kts
Normal file
7
aswm-core/build.gradle.kts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
plugins {
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly(project(":aswm-api"))
|
||||||
|
implementation("com.github.luben:zstd-jni:1.5.2-2")
|
||||||
|
}
|
1
aswm-core/src
Symbolic link
1
aswm-core/src
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../submodules/AdvancedSlimePaper/core/src
|
@@ -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.5"
|
id("io.papermc.paperweight.patcher") version "1.5.11"
|
||||||
}
|
}
|
||||||
|
|
||||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||||
@@ -15,9 +15,9 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
|
remapper("net.fabricmc:tiny-remapper:0.8.11:fat")
|
||||||
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
|
decompiler("net.minecraftforge:forgeflower:2.0.629.1")
|
||||||
paperclip("io.papermc:paperclip:3.0.3")
|
paperclip("io.papermc:paperclip:3.0.4-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
@@ -49,6 +49,7 @@ subprojects {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven(paperMavenPublicUrl)
|
maven(paperMavenPublicUrl)
|
||||||
|
maven("https://repo.rapture.pw/repository/maven-releases/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,6 +66,15 @@ paperweight {
|
|||||||
|
|
||||||
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
||||||
serverOutputDir.set(layout.projectDirectory.dir("Scissors-Server"))
|
serverOutputDir.set(layout.projectDirectory.dir("Scissors-Server"))
|
||||||
|
|
||||||
|
patchTasks {
|
||||||
|
register("generatedApi") {
|
||||||
|
isBareDirectory.set(true)
|
||||||
|
upstreamDirPath.set("paper-api-generator/generated")
|
||||||
|
patchDir.set(layout.projectDirectory.dir("patches/generatedApi"))
|
||||||
|
outputDir.set(layout.projectDirectory.dir("paper-api-generator/generated"))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
group=me.totalfreedom.scissors
|
group=me.totalfreedom.scissors
|
||||||
version=1.19.4-R0.1-SNAPSHOT
|
version=1.20.4-R0.1-SNAPSHOT
|
||||||
|
|
||||||
mcVersion=1.19.4
|
mcVersion=1.20.4
|
||||||
paperRef=483368e480eb2ec060d8e68b30e14ec96aba6c4e
|
paperRef=07b956e3a30d9cd192111829b59bdf4372f128b1
|
||||||
|
|
||||||
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
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
15
gradlew
vendored
15
gradlew
vendored
@@ -83,10 +83,8 @@ done
|
|||||||
# This is normally unused
|
# This is normally unused
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||||
# 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"'
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -133,10 +131,13 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
@@ -197,6 +198,10 @@ if "$cygwin" || "$msys" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command;
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
48
patches/api/0001-AdvancedSlimePaper-API-Changes.patch
Normal file
48
patches/api/0001-AdvancedSlimePaper-API-Changes.patch
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -6,7 +6,7 @@ Subject: [PATCH] Add MasterBlockFireEvent
|
|||||||
|
|
||||||
diff --git a/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
diff --git a/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..a24cb52a5af62012c5d5acc29e4c3558e92ae572
|
index 0000000000000000000000000000000000000000..812e6ae9f1c8eb9558e5109c522d3ce3a7deb35c
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
+++ b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
||||||
@@ -0,0 +1,51 @@
|
@@ -0,0 +1,51 @@
|
@@ -6,7 +6,7 @@ Subject: [PATCH] Add spectator teleport event
|
|||||||
|
|
||||||
diff --git a/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
diff --git a/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..d7efa63c316ed99c3eccfeadc1b0873b2ccb5d8a
|
index 0000000000000000000000000000000000000000..e4c9256c78f8b395aea86e9ea1a112f8e7426c1f
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
+++ b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
||||||
@@ -0,0 +1,60 @@
|
@@ -0,0 +1,60 @@
|
@@ -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 1d1a1d087dabc9794e0062a064da2cced4062309..1770de3705aa14232b133bce9fac56dfe89faa37 100644
|
index 9af4bc16da09e59009c47911219e99450cdf2aa5..94244872f7cd6b4a6df709c0f68b1f484538c159 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
|
||||||
@@ -1994,6 +1994,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2198,6 +2198,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
2710
patches/server/0001-AdvancedSlimePaper-Server-Changes.patch
Normal file
2710
patches/server/0001-AdvancedSlimePaper-Server-Changes.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,29 +1,30 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Luna <lunahatesgogle@gmail.com>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sat, 12 Mar 2022 22:22:22 -0300
|
Date: Thu, 21 Dec 2023 23:23:17 -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 4f2fa65ade89c5703451dad4f80eeef162b277d1..c3f3cbaf924fc6324cab8d503b92c69f0de5cd42 100644
|
index 58da26ad2f128ba0b66f86820f60853f4be352f0..9d4e802c76470eeab5550ba9a8e31d074af4265a 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -7,8 +7,12 @@ plugins {
|
@@ -13,8 +13,13 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||||
}
|
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.19.4-R0.1-SNAPSHOT") {
|
+ implementation("io.papermc.paper:paper-mojangapi:1.20.4-R0.1-SNAPSHOT") {
|
||||||
+ exclude("io.papermc.paper", "paper-api")
|
+ exclude("io.papermc.paper", "paper-api")
|
||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
// Paper start
|
// Paper start
|
||||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||||
@@ -58,11 +62,19 @@ tasks.jar {
|
@@ -66,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
|
||||||
@@ -45,7 +46,7 @@ index 4f2fa65ade89c5703451dad4f80eeef162b277d1..c3f3cbaf924fc6324cab8d503b92c69f
|
|||||||
"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,
|
||||||
@@ -134,7 +146,7 @@ fun TaskContainer.registerRunTask(
|
@@ -154,7 +167,7 @@ fun TaskContainer.registerRunTask(
|
||||||
name: String,
|
name: String,
|
||||||
block: JavaExec.() -> Unit
|
block: JavaExec.() -> Unit
|
||||||
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||||
@@ -55,7 +56,7 @@ index 4f2fa65ade89c5703451dad4f80eeef162b277d1..c3f3cbaf924fc6324cab8d503b92c69f
|
|||||||
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..a46d3f40642bbf249c2d24e689f474d07175ca09 100644
|
index 4b002e8b75d117b726b0de274a76d3596fce015b..87fd35ad9c7364124286fa5e9ef1d4b7efa73990 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 {
|
||||||
@@ -72,7 +73,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d0
|
|||||||
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-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors
|
+ paperVersion = "git-ScissorsASWM-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors
|
||||||
} else {
|
} else {
|
||||||
paperVersion = "unknown";
|
paperVersion = "unknown";
|
||||||
}
|
}
|
||||||
@@ -95,10 +96,10 @@ 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 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..c048169628a53462baf2e418136459719b2ac709 100644
|
index d6f329f4c9534d45533774ad2fadec709365297a..242d780a1ad761bf6c401369ca331d6ab6b6d4eb 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
|
||||||
@@ -1682,7 +1682,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1879,7 +1879,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
@@ -107,19 +108,6 @@ index 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..c048169628a53462baf2e41813645971
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 9f2536d9a73bdb15b5b3004d4da79ca32cee205b..247db707879b53c6ff7259efd76b9e8ff18a9d09 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
||||||
@@ -262,7 +262,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,59 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Video <videogamesm12@gmail.com>
|
|
||||||
Date: Sat, 12 Mar 2022 19:34:59 -0700
|
|
||||||
Subject: [PATCH] UUID validation
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
|
||||||
index 6dac24354192bea79a4b9eb721543110826790b2..a9c3c55eb622b18c74d8a9bd472e4e871d11b2aa 100644
|
|
||||||
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
|
||||||
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
|
||||||
@@ -78,7 +78,11 @@ public final class NbtUtils {
|
|
||||||
}
|
|
||||||
// Paper start - support string UUID's
|
|
||||||
if (nbt.contains("Id", 8)) {
|
|
||||||
- uUID = UUID.fromString(nbt.getString("Id"));
|
|
||||||
+ // Scissors start - Validate String UUIDs in game profiles
|
|
||||||
+ try {
|
|
||||||
+ uUID = UUID.fromString(nbt.getString("Id"));
|
|
||||||
+ } catch (Exception ignored) {}
|
|
||||||
+ // Scissors end
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
|
||||||
index 3ad05bbab726c59e7b67d9614af4b208d4520cb3..c0633f9553fb5aa52e8ffc863159521d09cb3bd5 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
|
||||||
@@ -174,7 +174,14 @@ public class HoverEvent {
|
|
||||||
} else {
|
|
||||||
JsonObject jsonObject = json.getAsJsonObject();
|
|
||||||
EntityType<?> entityType = BuiltInRegistries.ENTITY_TYPE.get(new ResourceLocation(GsonHelper.getAsString(jsonObject, "type")));
|
|
||||||
- UUID uUID = UUID.fromString(GsonHelper.getAsString(jsonObject, "id"));
|
|
||||||
+ // Scissors start
|
|
||||||
+ UUID uUID;
|
|
||||||
+ try {
|
|
||||||
+ uUID = UUID.fromString(GsonHelper.getAsString(jsonObject, "id"));
|
|
||||||
+ } catch (Exception ex) {
|
|
||||||
+ return null;
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
Component component = Component.Serializer.fromJson(jsonObject.get("name"));
|
|
||||||
return new HoverEvent.EntityTooltipInfo(entityType, uUID, component);
|
|
||||||
}
|
|
||||||
@@ -186,7 +193,14 @@ public class HoverEvent {
|
|
||||||
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
|
||||||
Component component = Component.Serializer.fromJson(compoundTag.getString("name"));
|
|
||||||
EntityType<?> entityType = BuiltInRegistries.ENTITY_TYPE.get(new ResourceLocation(compoundTag.getString("type")));
|
|
||||||
- UUID uUID = UUID.fromString(compoundTag.getString("id"));
|
|
||||||
+ // Scissors start
|
|
||||||
+ UUID uUID;
|
|
||||||
+ try {
|
|
||||||
+ uUID = UUID.fromString(compoundTag.getString("id"));
|
|
||||||
+ } catch (Exception ex) {
|
|
||||||
+ return null;
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
return new HoverEvent.EntityTooltipInfo(entityType, uUID, component);
|
|
||||||
} catch (Exception var5) {
|
|
||||||
return null;
|
|
34
patches/server/0003-UUID-validation.patch
Normal file
34
patches/server/0003-UUID-validation.patch
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
|
Date: Sun, 10 Dec 2023 13:11:22 -0600
|
||||||
|
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
|
||||||
|
index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..b2cc15da40aa7bbcfc234b4e147ed0e53f359efa 100644
|
||||||
|
--- a/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;
|
||||||
|
import net.minecraft.nbt.TagParser;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.util.ExtraCodecs;
|
||||||
|
+import net.minecraft.util.GsonHelper;
|
||||||
|
import net.minecraft.util.StringRepresentable;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.item.Item;
|
||||||
|
@@ -161,7 +162,14 @@ public class HoverEvent {
|
||||||
|
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
||||||
|
Component component = Component.Serializer.fromJson(compoundTag.getString("name"));
|
||||||
|
EntityType<?> entityType = BuiltInRegistries.ENTITY_TYPE.get(new ResourceLocation(compoundTag.getString("type")));
|
||||||
|
- UUID uUID = UUID.fromString(compoundTag.getString("id"));
|
||||||
|
+ // Scissors start
|
||||||
|
+ UUID uUID;
|
||||||
|
+ try {
|
||||||
|
+ uUID = UUID.fromString(compoundTag.getString("id"));
|
||||||
|
+ } catch (Exception ex) {
|
||||||
|
+ return null;
|
||||||
|
+ }
|
||||||
|
+ // Scissors end
|
||||||
|
return DataResult.success(new HoverEvent.EntityTooltipInfo(entityType, uUID, component));
|
||||||
|
} catch (Exception var5) {
|
||||||
|
return DataResult.error(() -> {
|
@@ -1,27 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Video <videogamesm12@gmail.com>
|
|
||||||
Date: Sun, 13 Mar 2022 03:01:29 -0600
|
|
||||||
Subject: [PATCH] Fixes the Blank SkullOwner exploit
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
|
||||||
index deed77a3d44bc55681483d7f47f148b5220135f2..f927156d6d7b75ff9a1c437478ae3e200962398c 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
|
||||||
@@ -11,6 +11,7 @@ import net.minecraft.nbt.CompoundTag;
|
|
||||||
import net.minecraft.nbt.NbtUtils;
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
|
||||||
import net.minecraft.world.level.block.entity.SkullBlockEntity;
|
|
||||||
+import org.apache.commons.lang3.StringUtils; // Scissors
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.NamespacedKey;
|
|
||||||
@@ -73,7 +74,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
|
||||||
|
|
||||||
if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) {
|
|
||||||
this.setProfile(NbtUtils.readGameProfile(tag.getCompound(SKULL_OWNER.NBT)));
|
|
||||||
- } else if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_STRING) && !tag.getString(SKULL_OWNER.NBT).isEmpty()) {
|
|
||||||
+ } else if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_STRING) && !StringUtils.isBlank(tag.getString(SKULL_OWNER.NBT))) { // Scissors
|
|
||||||
this.setProfile(new GameProfile(null, tag.getString(SKULL_OWNER.NBT)));
|
|
||||||
}
|
|
||||||
|
|
@@ -1,11 +1,11 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Video <videogamesm12@gmail.com>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sun, 13 Mar 2022 07:39:26 -0600
|
Date: Sun, 10 Dec 2023 13:40:21 -0600
|
||||||
Subject: [PATCH] ResourceLocation validation
|
Subject: [PATCH] ResourceLocation validation
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java
|
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java
|
||||||
index d4a8c1bbb8fef27ac42bdf27dde495b4c649e6cb..865c61accf211d28be3c82dcf158fec9778b50c1 100644
|
index 15173e715fa36546820d930a46e0f0c493d07cfc..356cc6f468975faa676db87db8fc0fa2df32f020 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java
|
--- a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java
|
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java
|
||||||
@@ -17,7 +17,7 @@ public class PaperContainerEntityLootableInventory implements PaperLootableEntit
|
@@ -17,7 +17,7 @@ public class PaperContainerEntityLootableInventory implements PaperLootableEntit
|
||||||
@@ -31,19 +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 fa724cd34a7c469ca12068e64295cd00ad215a3c..9f01b0f18bf656a7ab62f07cc98aaded96432665 100644
|
index 1f55185814125c691288294d18bf1580461c8066..259d65f8e21f9cf99585d416eafdc967dddccf57 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
|
||||||
@@ -145,7 +145,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
@@ -409,7 +409,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
||||||
}
|
|
||||||
|
|
||||||
public void setPotionType(String string) {
|
|
||||||
- this.setPotion(BuiltInRegistries.POTION.get(new ResourceLocation(string)));
|
|
||||||
+ this.setPotion(BuiltInRegistries.POTION.get(ResourceLocation.tryParse(string))); // Scissors - Validate resource locations
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
@@ -425,7 +425,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) {
|
||||||
@@ -53,11 +44,11 @@ index fa724cd34a7c469ca12068e64295cd00ad215a3c..9f01b0f18bf656a7ab62f07cc98aaded
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 ceacc0d383e2ee674783d3c0a7df0a951595faca..edd79cdca33abfc59dbc5dbf072e8b481f4c1156 100644
|
index 6cfce9755dd464a7afb01f9032e567ce3bcd5bc5..264c94f49035236e3584a3577f2516f0f430a552 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
|
||||||
@@ -588,7 +588,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
@@ -599,7 +599,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||||
}), (entity) -> {
|
if (generation) entity.generation = true; // Paper - add generation bool param
|
||||||
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"));
|
||||||
@@ -65,30 +56,8 @@ index ceacc0d383e2ee674783d3c0a7df0a951595faca..edd79cdca33abfc59dbc5dbf072e8b48
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -607,7 +607,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Optional<EntityType<?>> by(CompoundTag nbt) {
|
|
||||||
- return BuiltInRegistries.ENTITY_TYPE.getOptional(new ResourceLocation(nbt.getString("id")));
|
|
||||||
+ return BuiltInRegistries.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(nbt.getString("id"))); // Scissors
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
||||||
index 02cb6b8c1d59855ff4a8aad3024fe12007eca0ee..3f4788b7efec73929e1326f0e54a94f8a09a427f 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
||||||
@@ -615,7 +615,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
|
||||||
|
|
||||||
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
|
|
||||||
if (nbt.contains("DeathLootTable", 8)) {
|
|
||||||
- this.lootTable = new ResourceLocation(nbt.getString("DeathLootTable"));
|
|
||||||
+ this.lootTable = ResourceLocation.tryParse(nbt.getString("DeathLootTable")); // Scissors
|
|
||||||
this.lootTableSeed = nbt.getLong("DeathLootTableSeed");
|
|
||||||
}
|
|
||||||
|
|
||||||
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 a3f073066f6e2eea8964461ad2b0409ade202f35..6eecd2e609532bbdde69c0ddc5d6bc2e2e01d1ff 100644
|
index a18aadbf7ae83713e1f2b21553185d8000bc7699..f5ad7ddf13cbb6452c2927aef9b54eae3335b4c6 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
|
||||||
@@ -289,7 +289,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
@@ -289,7 +289,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||||
@@ -105,32 +74,45 @@ index a3f073066f6e2eea8964461ad2b0409ade202f35..6eecd2e609532bbdde69c0ddc5d6bc2e
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Paper start - cook speed API
|
// Paper start - cook speed API
|
||||||
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
|
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 79b01e32f89defb6b78f4764600d33d4945af592..af6ae368e6871d9db23bd1f13cf7a915005adf6c 100644
|
index b5b1831631e233a96b6fd55972a8862b0f420da8..a086f12c09a5e38f63c8de118fcb5a6a30e40b52 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrushableBlockEntity.java
|
||||||
@@ -46,7 +46,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
|
@@ -199,7 +199,7 @@ public class BrushableBlockEntity extends BlockEntity {
|
||||||
protected boolean tryLoadLootTable(CompoundTag nbt) {
|
|
||||||
this.lootableData.loadNbt(nbt); // Paper
|
private boolean tryLoadLootTable(CompoundTag nbt) {
|
||||||
if (nbt.contains("LootTable", 8)) {
|
if (nbt.contains("LootTable", 8)) {
|
||||||
- this.lootTable = new ResourceLocation(nbt.getString("LootTable"));
|
- this.lootTable = new ResourceLocation(nbt.getString("LootTable"));
|
||||||
+ this.lootTable = ResourceLocation.tryParse(nbt.getString("LootTable")); // Scissors - Validate loot tables
|
+ this.lootTable = ResourceLocation.tryParse(nbt.getString("LootTable")); // Scissors
|
||||||
try { org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(this.lootTable); } catch (IllegalArgumentException ex) { this.lootTable = null; } // Paper - validate
|
|
||||||
this.lootTableSeed = nbt.getLong("LootTableSeed");
|
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
|
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 e49eece9bff3a53469673d03a7bbf8f9cf8776b8..a49f32e9649155b6af4b1f236e4e8142d730e7e8 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
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
||||||
@@ -30,8 +30,14 @@ public abstract class CraftLootable<T extends RandomizableContainerBlockEntity>
|
@@ -34,8 +34,14 @@ public abstract class CraftLootable<T extends RandomizableContainerBlockEntity>
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
- ResourceLocation key = getSnapshot().lootTable;
|
- ResourceLocation key = this.getSnapshot().lootTable;
|
||||||
- return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
- return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
||||||
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
||||||
+ try {
|
+ try {
|
||||||
+ ResourceLocation key = getSnapshot().lootTable;
|
+ ResourceLocation key = this.getSnapshot().lootTable;
|
||||||
+ return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
+ return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
||||||
+ } catch (Exception ex) {
|
+ } catch (Exception ex) {
|
||||||
+ return null;
|
+ return null;
|
||||||
@@ -140,20 +122,21 @@ index e49eece9bff3a53469673d03a7bbf8f9cf8776b8..a49f32e9649155b6af4b1f236e4e8142
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
||||||
index 0dd0ce9a9b3253e87eda12354249ec2fd2a33cf2..b6920f9432ca1736afbe775186fbbcf11cf046fb 100644
|
index 313ee5c8737b2e57f9b5db6512c1871766b2ccd4..a115a13ec911884a804800fc13f0347be1a30932 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
||||||
@@ -33,8 +33,14 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo
|
@@ -33,8 +33,15 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo
|
||||||
return null; // return empty loot table?
|
return null; // return empty loot table?
|
||||||
}
|
}
|
||||||
|
|
||||||
- NamespacedKey key = CraftNamespacedKey.fromMinecraft(nmsTable);
|
- NamespacedKey key = CraftNamespacedKey.fromMinecraft(nmsTable);
|
||||||
- return Bukkit.getLootTable(key);
|
- return Bukkit.getLootTable(key);
|
||||||
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
||||||
+ try {
|
+ try
|
||||||
|
+ {
|
||||||
+ NamespacedKey key = CraftNamespacedKey.fromMinecraft(nmsTable);
|
+ NamespacedKey key = CraftNamespacedKey.fromMinecraft(nmsTable);
|
||||||
+ return Bukkit.getLootTable(key);
|
+ return Bukkit.getLootTable(key);
|
||||||
+ } catch (Exception ex) {
|
+ } catch (Exception exception) {
|
||||||
+ return null;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
@@ -161,17 +144,18 @@ index 0dd0ce9a9b3253e87eda12354249ec2fd2a33cf2..b6920f9432ca1736afbe775186fbbcf1
|
|||||||
|
|
||||||
@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 18b9b0dc70f6872a9d71c120bcd2edca531b0ac4..4732fff6d1198e5fc4875b4d4523aa2d152817ea 100644
|
index 5f6a1fb323782816f706ccf7df922cb203238302..21b4594379a5e904ad60f9c9512ace94e7ed5f68 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,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
@@ -80,8 +80,15 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LootTable getLootTable() {
|
public LootTable getLootTable() {
|
||||||
- NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().getLootTable());
|
- NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().getLootTable());
|
||||||
- return Bukkit.getLootTable(key);
|
- return Bukkit.getLootTable(key);
|
||||||
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
||||||
+ try {
|
+ try
|
||||||
|
+ {
|
||||||
+ NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().getLootTable());
|
+ NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().getLootTable());
|
||||||
+ return Bukkit.getLootTable(key);
|
+ return Bukkit.getLootTable(key);
|
||||||
+ } catch (Exception ex) {
|
+ } catch (Exception ex) {
|
@@ -1,18 +1,18 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Video <videogamesm12@gmail.com>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sun, 13 Mar 2022 06:10:22 -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 41c9f074203915c31c1ae7a160ce509c13383f84..8b4989593da43fc2fd661ac66bfe5ae1eb5e2780 100644
|
index dfd364ac4b7551a13c4c6c100b5e62c0dfb10595..e0b0dec10dfc5d8e336a4c0f7005e7186f925c1a 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;
|
||||||
import net.minecraft.nbt.ListTag;
|
import net.minecraft.nbt.ListTag;
|
||||||
import net.minecraft.nbt.NbtUtils;
|
import net.minecraft.nbt.NbtUtils;
|
||||||
import net.minecraft.network.protocol.game.DebugPackets;
|
import net.minecraft.network.protocol.game.DebugPackets;
|
||||||
+import net.minecraft.resources.ResourceLocation; // Scissors
|
+import net.minecraft.resources.ResourceLocation;
|
||||||
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;
|
||||||
@@ -27,6 +27,6 @@ index 41c9f074203915c31c1ae7a160ce509c13383f84..8b4989593da43fc2fd661ac66bfe5ae1
|
|||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
+
|
+
|
||||||
BeehiveBlockEntity.BeeData tileentitybeehive_hivebee = new BeehiveBlockEntity.BeeData(nbttagcompound1.getCompound("EntityData"), nbttagcompound1.getInt("TicksInHive"), nbttagcompound1.getInt("MinOccupationTicks"));
|
BeehiveBlockEntity.BeeData tileentitybeehive_hivebee = new BeehiveBlockEntity.BeeData(nbttagcompound1.getCompound("EntityData").copy(), nbttagcompound1.getInt("TicksInHive"), nbttagcompound1.getInt("MinOccupationTicks"));
|
||||||
|
|
||||||
this.stored.add(tileentitybeehive_hivebee);
|
this.stored.add(tileentitybeehive_hivebee);
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Video <videogamesm12@gmail.com>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sun, 13 Mar 2022 07:47:20 -0600
|
Date: Sun, 10 Dec 2023 16:58:55 -0600
|
||||||
Subject: [PATCH] Removes useless spammy error logging
|
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
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
index 936f8babf74b2be6240e5dbc2d0a84f8badada2e..e3d5ded703be73343d821f329175710609dc388f 100644
|
index 91bbea5cb169f96910cc8661151c04dbff057091..84c9f2b09576046c138a11a835c9192a6e347c1d 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
|
||||||
@@ -1799,8 +1799,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
@@ -1805,8 +1805,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||||
resource = CraftNamespacedKey.fromMinecraft(key);
|
resource = CraftNamespacedKey.fromMinecraft(key);
|
||||||
}
|
}
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
|
@@ -6,17 +6,17 @@ 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 08f027cdcaeeca7b545483cb8c5eb8d13e4933b9..d651acb328b52ac252a6a48c1ceccdca8cfb612a 100644
|
index 6d23c39e4eadf23616080d6d08672e13b5d3c37d..0bd5c3e3bb7074b5265e3f1bf670f993c9fe167d 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
|
@@ -139,7 +139,11 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
|
||||||
@Override
|
@Override
|
||||||
public void remove(Entity.RemovalReason reason) {
|
public void remove(Entity.RemovalReason reason) {
|
||||||
if (!this.level.isClientSide && reason.shouldDestroy()) {
|
if (!this.level().isClientSide && reason.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 {
|
||||||
+ Containers.dropContents(this.level, (Entity) this, (Container) this);
|
+ Containers.dropContents(this.level(), (Entity) this, (Container) this);
|
||||||
+ } catch (Exception ignored) {}
|
+ } catch (Exception ignored) {}
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
}
|
}
|
||||||
|
@@ -5,10 +5,10 @@ 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 d47b3ac633e7936d30abfda6fc46c2c7412d76fe..1b4d21b5960ef09bada7c707fc5ba4e5cc39630c 100644
|
index a39db702063887cf530f272deaf4f334047cc7d4..1816d8bc0716d06cb3db37730234bd37b100f573 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
|
||||||
@@ -416,11 +416,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
@@ -444,11 +444,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||||
|
|
||||||
CompoundTag nbttagcompound1 = nbt.getCompound("Item");
|
CompoundTag nbttagcompound1 = nbt.getCompound("Item");
|
||||||
|
|
||||||
|
@@ -6,15 +6,15 @@ 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 b79f4ce38a42e4dba8ebdfc97dadc531b7245c7a..9c49be7c53a1f2a8c203341b8ded9cd222d0c178 100644
|
index 37f37be56bab171df442b980ff46ff325daae283..deade19d16a7d6870171b9a60806a8cadb437db4 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<? extends Recipe<?>> optional = recipeManager.byKey(new ResourceLocation(string));
|
- Optional<RecipeHolder<?>> optional = recipeManager.byKey(new ResourceLocation(string));
|
||||||
+ Optional<? extends Recipe<?>> 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: {}", (Object)string);
|
||||||
+ // Scissors - Don't log errors caused by invalid recipes being provided
|
+ // Scissors - Don't log errors caused by invalid recipes being provided
|
||||||
@@ -31,7 +31,7 @@ index b79f4ce38a42e4dba8ebdfc97dadc531b7245c7a..9c49be7c53a1f2a8c203341b8ded9cd2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java
|
||||||
index 50fdb086ffec84edc5138737c95f08ed4757a6f3..da312b4670fc0ac07e4ab798d4793025e362783e 100644
|
index e904bf8b6a7d18a0e846c3b59e2d7f3d6e530e39..65b076b376bf6ab363a3eb62dfa2c96c45624957 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java
|
||||||
@@ -41,7 +41,11 @@ public class CraftMetaKnowledgeBook extends CraftMetaItem implements KnowledgeBo
|
@@ -41,7 +41,11 @@ public class CraftMetaKnowledgeBook extends CraftMetaItem implements KnowledgeBo
|
||||||
|
@@ -5,28 +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 a9c3c55eb622b18c74d8a9bd472e4e871d11b2aa..a78595e91cbb6a815c9ef6b4596cdb0e560f9e42 100644
|
index 80083fed4b44b9d433925f09db83e559582109a1..032fc2add6c25780a3663fd1d2e429fcfd37dc4a 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
|
||||||
@@ -235,7 +235,7 @@ public final class NbtUtils {
|
@@ -231,7 +231,7 @@ public final class NbtUtils {
|
||||||
if (!nbt.contains("Name", 8)) {
|
|
||||||
return Blocks.AIR.defaultBlockState();
|
return Blocks.AIR.defaultBlockState();
|
||||||
} else {
|
} else {
|
||||||
- ResourceLocation resourceLocation = new ResourceLocation(nbt.getString("Name"));
|
// Paper start - Validate resource location
|
||||||
|
- 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 = blockLookup.get(ResourceKey.create(Registries.BLOCK, resourceLocation));
|
Optional<? extends Holder<Block>> optional = resourceLocation != null ? blockLookup.get(ResourceKey.create(Registries.BLOCK, resourceLocation)) : Optional.empty();
|
||||||
|
// Paper end
|
||||||
if (optional.isEmpty()) {
|
if (optional.isEmpty()) {
|
||||||
return Blocks.AIR.defaultBlockState();
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
||||||
index 5d6d26cfe8f0ab68a3145214b3fc126ca7a71a66..7e0559cdcabeb33ff383be1a23f4ed04fa091867 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
||||||
@@ -541,7 +541,7 @@ public abstract class AbstractArrow extends Projectile {
|
|
||||||
this.setCritArrow(nbt.getBoolean("crit"));
|
|
||||||
this.setPierceLevel(nbt.getByte("PierceLevel"));
|
|
||||||
if (nbt.contains("SoundEvent", 8)) {
|
|
||||||
- this.soundEvent = (SoundEvent) BuiltInRegistries.SOUND_EVENT.getOptional(new ResourceLocation(nbt.getString("SoundEvent"))).orElse(this.getDefaultHitGroundSoundEvent());
|
|
||||||
+ this.soundEvent = (SoundEvent) BuiltInRegistries.SOUND_EVENT.getOptional(ResourceLocation.tryParse(nbt.getString("SoundEvent"))).orElse(this.getDefaultHitGroundSoundEvent()); // Scissors - Validate SoundEvents before trying to play them
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setShotFromCrossbow(nbt.getBoolean("ShotFromCrossbow"));
|
|
||||||
|
@@ -1,36 +1,27 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Luna <lunahatesgogle@gmail.com>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sun, 20 Mar 2022 09:31:16 -0300
|
Date: Sun, 10 Dec 2023 17:13:15 -0600
|
||||||
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 c0633f9553fb5aa52e8ffc863159521d09cb3bd5..7449a024265c42f28a6c9a1ed8d8f4b9e3096aac 100644
|
index b2cc15da40aa7bbcfc234b4e147ed0e53f359efa..dbe9f81e298a931c3e0e5b879dc13b493b3fdb52 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
|
||||||
@@ -314,7 +314,7 @@ public class HoverEvent {
|
@@ -280,7 +280,7 @@ public class HoverEvent {
|
||||||
CompoundTag compoundTag = TagParser.parseTag(string);
|
return DataResult.success(new HoverEvent.ItemStackInfo(ItemStack.of(compoundTag)));
|
||||||
return new HoverEvent.ItemStackInfo(item, i, compoundTag);
|
|
||||||
} catch (CommandSyntaxException var6) {
|
|
||||||
- HoverEvent.LOGGER.warn("Failed to parse tag: {}", string, var6);
|
|
||||||
+ // Scissors - Ignore invalid items
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -328,7 +328,7 @@ public class HoverEvent {
|
|
||||||
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
|
||||||
return new HoverEvent.ItemStackInfo(ItemStack.of(compoundTag));
|
|
||||||
} catch (CommandSyntaxException var2) {
|
} catch (CommandSyntaxException var2) {
|
||||||
- HoverEvent.LOGGER.warn("Failed to parse item tag: {}", text, var2);
|
return DataResult.error(() -> {
|
||||||
+ // Scissors - Ignore invalid items
|
- 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 30aec9dff249ae629b22318e52902361a9fa4099..f87a58097889720cbc6510345696e03722b4f0a8 100644
|
index 69912c5b300b67394dce3876d2d96872033cf156..ebc403ff31385a12e072fd6a419a7787ee76429e 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
|
||||||
@@ -432,7 +432,7 @@ public class ItemFrame extends HangingEntity {
|
@@ -436,7 +436,7 @@ public class ItemFrame extends HangingEntity {
|
||||||
ItemStack itemstack = ItemStack.of(nbttagcompound1);
|
ItemStack itemstack = ItemStack.of(nbttagcompound1);
|
||||||
|
|
||||||
if (itemstack.isEmpty()) {
|
if (itemstack.isEmpty()) {
|
||||||
|
@@ -77,10 +77,10 @@ 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 bfa091f72d6f477bcaf63d364639a1b4df9b1987..1fe26cb620e8b550790c3e110e2a1180cf0838fd 100644
|
index a74a8a027c99eef199c1a6a54232ac2c8ffb9d08..1576a201c92d8b17fd3a92ec497c42861db8ad1e 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
|
||||||
@@ -292,7 +292,7 @@ public class Main {
|
@@ -301,7 +301,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! ***");
|
||||||
|
@@ -1,42 +1,42 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Video <videogamesm12@gmail.com>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Mon, 28 Mar 2022 13:19:43 -0600
|
Date: Sun, 10 Dec 2023 17:26:11 -0600
|
||||||
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 6efb8b10f17c70b05128039376d254e6beda3841..d280d5b34614442710d64443d03a5bdee86294a9 100644
|
index 200ed770b57e1a9240abf0473968d4b85cbefe3c..1a2a3b506e2f9bce77294c3788451bfd47394548 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
|
||||||
@@ -542,13 +542,7 @@ public final class MCUtil {
|
@@ -654,12 +654,6 @@ public final class MCUtil {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String string = compound.getString(key);
|
String string = compound.getString(key);
|
||||||
- try {
|
- try {
|
||||||
- return Component.Serializer.fromJson(string);
|
- return net.minecraft.network.chat.Component.Serializer.fromJson(string);
|
||||||
- } catch (com.google.gson.JsonParseException e) {
|
- } catch (com.google.gson.JsonParseException e) {
|
||||||
- org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage());
|
- org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage());
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- return null;
|
- return null;
|
||||||
+ return Component.Serializer.fromJsonSafe(string);
|
+ return net.minecraft.network.chat.Component.Serializer.fromJsonSafe(string);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChunkStatus getChunkStatus(ChunkHolder chunk) {
|
|
||||||
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 37fc353c3e59dd5af2fd6c58ac084fb0e6e155d7..2873ed7c443ed8c8c57a8b1d3e444d229f10f07b 100644
|
index d3a80d0a23be762c05931ae8001d98e43cab2b4a..ba13650b52e39c9cc5cfa421f7720c7d4ba75678 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
|
||||||
@@ -26,6 +26,7 @@ import java.util.List;
|
@@ -23,6 +23,8 @@ import java.util.List;
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.UUID;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import net.minecraft.ChatFormatting; // Scissors
|
+
|
||||||
|
+import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
import net.minecraft.network.chat.contents.BlockDataSource;
|
|
||||||
import net.minecraft.network.chat.contents.DataSource;
|
import net.minecraft.network.chat.contents.DataSource;
|
||||||
@@ -522,6 +523,26 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
import net.minecraft.network.chat.contents.KeybindContents;
|
||||||
return GsonHelper.toStableString(Serializer.toJsonTree(text));
|
@@ -315,6 +317,26 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||||
|
return json == null ? null : Serializer.deserialize(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Scissors start
|
+ // Scissors start
|
||||||
@@ -59,42 +59,15 @@ index 37fc353c3e59dd5af2fd6c58ac084fb0e6e155d7..2873ed7c443ed8c8c57a8b1d3e444d22
|
|||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
+
|
+
|
||||||
public static JsonElement toJsonTree(Component text) {
|
@Nullable
|
||||||
return Component.Serializer.GSON.toJsonTree(text);
|
public static MutableComponent fromJsonLenient(String 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 7449a024265c42f28a6c9a1ed8d8f4b9e3096aac..487c68abc3eb5c18dc7fee762b2164001283cab7 100644
|
index dbe9f81e298a931c3e0e5b879dc13b493b3fdb52..6708290b6d096e8081c56d2e0da3c9ae2a112176 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
|
||||||
@@ -79,7 +79,7 @@ public class HoverEvent {
|
@@ -160,7 +160,7 @@ public class HoverEvent {
|
||||||
if (jsonElement != null) {
|
public static DataResult<HoverEvent.EntityTooltipInfo> legacyCreate(Component text) {
|
||||||
return action.deserialize(jsonElement);
|
|
||||||
} else {
|
|
||||||
- Component component = Component.Serializer.fromJson(json.get("value"));
|
|
||||||
+ Component component = Component.Serializer.fromJsonSafe(json.get("value")); // Scissors - Use safer method for getting Components from JSON
|
|
||||||
return component != null ? action.deserializeFromLegacy(component) : null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -94,7 +94,7 @@ public class HoverEvent {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Action<T> {
|
|
||||||
- public static final HoverEvent.Action<Component> SHOW_TEXT = new HoverEvent.Action<>("show_text", true, Component.Serializer::fromJson, Component.Serializer::toJsonTree, Function.identity());
|
|
||||||
+ public static final HoverEvent.Action<Component> SHOW_TEXT = new HoverEvent.Action<>("show_text", true, Component.Serializer::fromJsonSafe, Component.Serializer::toJsonTree, Function.identity()); // Scissors - Use safer method for getting Components from JSON
|
|
||||||
public static final HoverEvent.Action<HoverEvent.ItemStackInfo> SHOW_ITEM = new HoverEvent.Action<>("show_item", true, HoverEvent.ItemStackInfo::create, HoverEvent.ItemStackInfo::serialize, HoverEvent.ItemStackInfo::create);
|
|
||||||
public static final HoverEvent.Action<HoverEvent.EntityTooltipInfo> SHOW_ENTITY = new HoverEvent.Action<>("show_entity", true, HoverEvent.EntityTooltipInfo::create, HoverEvent.EntityTooltipInfo::serialize, HoverEvent.EntityTooltipInfo::create);
|
|
||||||
private static final Map<String, HoverEvent.Action<?>> LOOKUP = Stream.of(SHOW_TEXT, SHOW_ITEM, SHOW_ENTITY).collect(ImmutableMap.toImmutableMap(HoverEvent.Action::getName, (action) -> {
|
|
||||||
@@ -182,7 +182,7 @@ public class HoverEvent {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// Scissors end
|
|
||||||
- Component component = Component.Serializer.fromJson(jsonObject.get("name"));
|
|
||||||
+ Component component = Component.Serializer.fromJsonSafe(jsonObject.get("name")); // Scissors - Use safer method for getting Components from JSON
|
|
||||||
return new HoverEvent.EntityTooltipInfo(entityType, uUID, component);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -191,7 +191,7 @@ public class HoverEvent {
|
|
||||||
public static HoverEvent.EntityTooltipInfo create(Component text) {
|
|
||||||
try {
|
try {
|
||||||
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"));
|
||||||
@@ -103,23 +76,15 @@ index 7449a024265c42f28a6c9a1ed8d8f4b9e3096aac..487c68abc3eb5c18dc7fee762b216400
|
|||||||
// 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 97a2657bc98d41c3c1e376b266d2c85f685acc88..9d20f3f1af8e663a8c13714c8928d4a91653daa4 100644
|
index 186547674894fd084bceb478bb6017b747df4173..74c880425964da042ca57c097eb93273da59ce7e 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
|
||||||
@@ -8,6 +8,7 @@ import java.util.Optional;
|
@@ -115,10 +115,10 @@ public class NbtContents implements ComponentContents {
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
+import net.kyori.adventure.text.TextComponent; // Scissors
|
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
|
||||||
import net.minecraft.commands.arguments.NbtPathArgument;
|
|
||||||
import net.minecraft.nbt.Tag;
|
|
||||||
@@ -107,10 +108,10 @@ public class NbtContents implements ComponentContents {
|
|
||||||
Component component = DataFixUtils.orElse(ComponentUtils.updateForEntity(source, this.separator, sender, depth), ComponentUtils.DEFAULT_NO_STYLE_SEPARATOR);
|
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); // Scissors
|
+ MutableComponent mutableComponent = Component.Serializer.fromJsonSafe(text);
|
||||||
return Stream.of(ComponentUtils.updateForEntity(source, mutableComponent, sender, depth));
|
return Stream.of(ComponentUtils.updateForEntity(source, mutableComponent, sender, depth));
|
||||||
} catch (Exception var5) {
|
} catch (Exception var5) {
|
||||||
- LOGGER.warn("Failed to parse component: {}", text, var5);
|
- LOGGER.warn("Failed to parse component: {}", text, var5);
|
||||||
@@ -128,14 +93,13 @@ index 97a2657bc98d41c3c1e376b266d2c85f685acc88..9d20f3f1af8e663a8c13714c8928d4a9
|
|||||||
}
|
}
|
||||||
}).reduce((accumulator, current) -> {
|
}).reduce((accumulator, current) -> {
|
||||||
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 280ee1838106201f5e3ba7753caced6d030f7e55..ade4ed2f219d32050a372283eaebe75f9014ec78 100644
|
index 1be10c57e374ad4018c08d96cfb69397a2f541d3..2e11d0f17fc8fa4ed84c40dd9747e136675030a4 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
|
||||||
@@ -2354,12 +2354,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
@@ -2526,11 +2526,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||||
this.setRot(this.getYRot(), this.getXRot());
|
|
||||||
if (nbt.contains("CustomName", 8)) {
|
if (nbt.contains("CustomName", 8)) {
|
||||||
String s = nbt.getString("CustomName");
|
String s = nbt.getString("CustomName");
|
||||||
-
|
|
||||||
- try {
|
- try {
|
||||||
- this.setCustomName(Component.Serializer.fromJson(s));
|
- this.setCustomName(Component.Serializer.fromJson(s));
|
||||||
- } catch (Exception exception) {
|
- } catch (Exception exception) {
|
||||||
@@ -146,10 +110,10 @@ index 280ee1838106201f5e3ba7753caced6d030f7e55..ade4ed2f219d32050a372283eaebe75f
|
|||||||
|
|
||||||
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 2be7a697f08045b974579e6942b38571e744efac..84ec21c38bb44db1e9ff26c01d5c8af1a2417616 100644
|
index b49d60d20d170d16a7daf2bc874e5d8d04552b3e..56ae1fa22bb722f91a06d7344bf879210f4ef8f2 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
|
||||||
@@ -35,7 +35,7 @@ public class ScoreboardSaveData extends SavedData {
|
@@ -41,7 +41,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||||
CompoundTag compoundTag = nbt.getCompound(i);
|
CompoundTag compoundTag = nbt.getCompound(i);
|
||||||
String string = compoundTag.getString("Name");
|
String string = compoundTag.getString("Name");
|
||||||
PlayerTeam playerTeam = this.scoreboard.addPlayerTeam(string);
|
PlayerTeam playerTeam = this.scoreboard.addPlayerTeam(string);
|
||||||
@@ -158,7 +122,7 @@ index 2be7a697f08045b974579e6942b38571e744efac..84ec21c38bb44db1e9ff26c01d5c8af1
|
|||||||
if (component != null) {
|
if (component != null) {
|
||||||
playerTeam.setDisplayName(component);
|
playerTeam.setDisplayName(component);
|
||||||
}
|
}
|
||||||
@@ -53,14 +53,14 @@ public class ScoreboardSaveData extends SavedData {
|
@@ -59,14 +59,14 @@ public class ScoreboardSaveData extends SavedData {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compoundTag.contains("MemberNamePrefix", 8)) {
|
if (compoundTag.contains("MemberNamePrefix", 8)) {
|
||||||
@@ -175,12 +139,12 @@ index 2be7a697f08045b974579e6942b38571e744efac..84ec21c38bb44db1e9ff26c01d5c8af1
|
|||||||
if (component3 != null) {
|
if (component3 != null) {
|
||||||
playerTeam.setPlayerSuffix(component3);
|
playerTeam.setPlayerSuffix(component3);
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ public class ScoreboardSaveData extends SavedData {
|
@@ -126,7 +126,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||||
CompoundTag compoundTag = nbt.getCompound(i);
|
return ObjectiveCriteria.DUMMY;
|
||||||
ObjectiveCriteria.byName(compoundTag.getString("CriteriaName")).ifPresent((criterion) -> {
|
});
|
||||||
String string = compoundTag.getString("Name");
|
String string2 = compoundTag.getString("Name");
|
||||||
- Component component = Component.Serializer.fromJson(compoundTag.getString("DisplayName"));
|
- Component component = Component.Serializer.fromJson(compoundTag.getString("DisplayName"));
|
||||||
+ 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"));
|
||||||
this.scoreboard.addObjective(string, criterion, component, renderType);
|
boolean bl = compoundTag.getBoolean("display_auto_update");
|
||||||
});
|
NumberFormat numberFormat = NumberFormatTypes.CODEC.parse(NbtOps.INSTANCE, compoundTag.get("format")).result().orElse((NumberFormat)null);
|
||||||
|
@@ -5,12 +5,12 @@ 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
|
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||||
index fbfadeb83719b81f42724e79c59e92ed88fdece7..c9c0652a22760716f9dbb5fc73bc6fce5148b800 100644
|
index d364bd57b1675c8b21d781c2bc16c3e65800455c..f2e7585630ff724f966c7bcedc17e502d786870d 100644
|
||||||
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
|
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||||
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
|
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||||
@@ -6,9 +6,17 @@ import io.netty.channel.ChannelHandlerContext;
|
@@ -7,8 +7,16 @@ import io.netty.handler.codec.MessageToByteEncoder;
|
||||||
import io.netty.handler.codec.MessageToByteEncoder;
|
import io.netty.util.Attribute;
|
||||||
import io.papermc.paper.adventure.PaperAdventure; // Paper
|
import io.netty.util.AttributeKey;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
+import java.util.Collections; // Scissors
|
+import java.util.Collections; // Scissors
|
||||||
+import net.minecraft.ChatFormatting; // Scissors
|
+import net.minecraft.ChatFormatting; // Scissors
|
||||||
@@ -19,7 +19,6 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..c9c0652a22760716f9dbb5fc73bc6fce
|
|||||||
+import net.minecraft.network.chat.Component; // Scissors
|
+import net.minecraft.network.chat.Component; // Scissors
|
||||||
+import net.minecraft.network.chat.SignedMessageBody; // Scissors
|
+import net.minecraft.network.chat.SignedMessageBody; // Scissors
|
||||||
import net.minecraft.network.protocol.Packet;
|
import net.minecraft.network.protocol.Packet;
|
||||||
import net.minecraft.network.protocol.PacketFlow;
|
|
||||||
+import net.minecraft.network.protocol.game.*; // Scissors
|
+import net.minecraft.network.protocol.game.*; // Scissors
|
||||||
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
||||||
+import net.minecraft.world.item.ItemStack; // Scissors
|
+import net.minecraft.world.item.ItemStack; // Scissors
|
||||||
@@ -27,20 +26,20 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..c9c0652a22760716f9dbb5fc73bc6fce
|
|||||||
|
|
||||||
public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||||
@@ -19,6 +27,23 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
@@ -19,6 +27,23 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||||
this.flow = side;
|
this.codecKey = protocolKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Scissors start
|
+ // Scissors start
|
||||||
+ private static int tryWrite(Packet packet, FriendlyByteBuf friendlyByteBuf, ChannelHandlerContext channelHandlerContext, int i) {
|
+ private int tryWrite(Packet packet, FriendlyByteBuf friendlyByteBuf, ChannelHandlerContext channelHandlerContext, int i) {
|
||||||
+ friendlyByteBuf.writeVarInt(i);
|
+ friendlyByteBuf.writeVarInt(i);
|
||||||
+ friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(PaperAdventure.LOCALE_ATTRIBUTE).get();
|
+ friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(io.papermc.paper.adventure.PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
||||||
+
|
+
|
||||||
+ int j = friendlyByteBuf.writerIndex();
|
+ int j = friendlyByteBuf.writerIndex();
|
||||||
+ packet.write(friendlyByteBuf);
|
+ packet.write(friendlyByteBuf);
|
||||||
+ int k = friendlyByteBuf.writerIndex() - j;
|
+ int k = friendlyByteBuf.writerIndex() - j;
|
||||||
+ int packetLength = friendlyByteBuf.readableBytes();
|
+ int packetLength = friendlyByteBuf.readableBytes();
|
||||||
+ if (k > 8388608 || packetLength > MAX_PACKET_SIZE) {
|
+ if (packetLength > MAX_PACKET_SIZE) {
|
||||||
+ throw new SkipPacketException(new IllegalArgumentException("Packet too big (is " + k + "): " + packet));
|
+ throw new PacketTooLargeException(packet, this.codecKey, packetLength);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return k;
|
+ return k;
|
||||||
@@ -48,14 +47,14 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..c9c0652a22760716f9dbb5fc73bc6fce
|
|||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
+
|
+
|
||||||
protected void encode(ChannelHandlerContext channelHandlerContext, Packet<?> packet, ByteBuf byteBuf) throws Exception {
|
protected void encode(ChannelHandlerContext channelHandlerContext, Packet<?> packet, ByteBuf byteBuf) throws Exception {
|
||||||
ConnectionProtocol connectionProtocol = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get();
|
Attribute<ConnectionProtocol.CodecData<?>> attribute = channelHandlerContext.channel().attr(this.codecKey);
|
||||||
if (connectionProtocol == null) {
|
ConnectionProtocol.CodecData<?> codecData = attribute.get();
|
||||||
@@ -33,38 +58,66 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
@@ -34,46 +59,59 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||||
throw new IOException("Can't serialize unregistered packet");
|
throw new IOException("Can't serialize unregistered packet");
|
||||||
} else {
|
} else {
|
||||||
FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(byteBuf);
|
FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(byteBuf);
|
||||||
- friendlyByteBuf.writeVarInt(i);
|
- friendlyByteBuf.writeVarInt(i);
|
||||||
- friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
- friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(io.papermc.paper.adventure.PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
||||||
|
|
||||||
+ // Scissors start
|
+ // Scissors start
|
||||||
+ int k;
|
+ int k;
|
||||||
@@ -65,33 +64,41 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..c9c0652a22760716f9dbb5fc73bc6fce
|
|||||||
- int k = friendlyByteBuf.writerIndex() - j;
|
- int k = friendlyByteBuf.writerIndex() - j;
|
||||||
- if (false && k > 8388608) { // Paper - disable
|
- if (false && k > 8388608) { // Paper - disable
|
||||||
- throw new IllegalArgumentException("Packet too big (is " + k + ", should be less than 8388608): " + packet);
|
- throw new IllegalArgumentException("Packet too big (is " + k + ", should be less than 8388608): " + packet);
|
||||||
- } else {
|
|
||||||
- int l = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get().getId();
|
|
||||||
- JvmProfiler.INSTANCE.onPacketSent(l, i, channelHandlerContext.channel().remoteAddress(), k);
|
|
||||||
- }
|
- }
|
||||||
+ k = tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
-
|
||||||
} catch (Throwable var10) {
|
- JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k);
|
||||||
- LOGGER.error("Packet encoding of packet ID {} threw (skippable? {})", i, packet.isSkippable(), var10); // Paper - Give proper error message
|
+ 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()) {
|
- if (packet.isSkippable()) {
|
||||||
- throw new SkipPacketException(var10);
|
- throw new SkipPacketException(var13);
|
||||||
- } else {
|
- }
|
||||||
- throw var10;
|
-
|
||||||
|
- 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);
|
+ packet = capPacket(packet, i);
|
||||||
+ if (packet == null) {
|
+ if (packet == null) {
|
||||||
+ throw new SkipPacketException(new IllegalArgumentException("Packet too big: " + packet));
|
+ throw new SkipPacketException(new IllegalArgumentException("Packet too big: " + packet));
|
||||||
}
|
}
|
||||||
|
- // Paper end
|
||||||
|
- ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet);
|
||||||
+ friendlyByteBuf.clear();
|
+ friendlyByteBuf.clear();
|
||||||
+ k = tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
+ k = this.tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
- // Paper start
|
+ JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k);
|
||||||
- int packetLength = friendlyByteBuf.readableBytes();
|
+ ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet);
|
||||||
- if (packetLength > MAX_PACKET_SIZE) {
|
|
||||||
- throw new PacketTooLargeException(packet, packetLength);
|
|
||||||
- }
|
|
||||||
- // Paper end
|
|
||||||
+ int l = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get().getId();
|
|
||||||
+ JvmProfiler.INSTANCE.onPacketSent(l, i, channelHandlerContext.channel().remoteAddress(), k);
|
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,8 +110,6 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..c9c0652a22760716f9dbb5fc73bc6fce
|
|||||||
+ packet = new ClientboundBlockEntityDataPacket(blockEntityDataPacket.getPos(), blockEntityDataPacket.getType(), new CompoundTag());
|
+ packet = new ClientboundBlockEntityDataPacket(blockEntityDataPacket.getPos(), blockEntityDataPacket.getType(), new CompoundTag());
|
||||||
+ } else if (packet instanceof ClientboundLevelChunkPacketData chunkPacket) {
|
+ } else if (packet instanceof ClientboundLevelChunkPacketData chunkPacket) {
|
||||||
+ chunkPacket.clearNBT();
|
+ chunkPacket.clearNBT();
|
||||||
+ } else if (packet instanceof ClientboundSetEntityDataPacket) {
|
|
||||||
+ return null; // Skip
|
|
||||||
+ } else if (packet instanceof ClientboundContainerSetContentPacket containerSetContentPacket) {
|
+ } else if (packet instanceof ClientboundContainerSetContentPacket containerSetContentPacket) {
|
||||||
+ packet = new ClientboundContainerSetContentPacket(containerSetContentPacket.getContainerId(), containerSetContentPacket.getStateId(), NonNullList.create(), ItemStack.EMPTY);
|
+ packet = new ClientboundContainerSetContentPacket(containerSetContentPacket.getContainerId(), containerSetContentPacket.getStateId(), NonNullList.create(), ItemStack.EMPTY);
|
||||||
+ } else if (packet instanceof ClientboundSetEquipmentPacket setEquipmentPacket) {
|
+ } else if (packet instanceof ClientboundSetEquipmentPacket setEquipmentPacket) {
|
||||||
@@ -113,10 +118,6 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..c9c0652a22760716f9dbb5fc73bc6fce
|
|||||||
+ packet = new ClientboundContainerSetSlotPacket(containerSetSlotPacket.getContainerId(), containerSetSlotPacket.getStateId(), containerSetSlotPacket.getSlot(), ItemStack.EMPTY);
|
+ packet = new ClientboundContainerSetSlotPacket(containerSetSlotPacket.getContainerId(), containerSetSlotPacket.getStateId(), containerSetSlotPacket.getSlot(), ItemStack.EMPTY);
|
||||||
+ } else if (packet instanceof ClientboundMapItemDataPacket mapItemDataPacket) {
|
+ } else if (packet instanceof ClientboundMapItemDataPacket mapItemDataPacket) {
|
||||||
+ packet = new ClientboundMapItemDataPacket(mapItemDataPacket.getMapId(), mapItemDataPacket.getScale(), mapItemDataPacket.isLocked(), null, null);
|
+ packet = new ClientboundMapItemDataPacket(mapItemDataPacket.getMapId(), mapItemDataPacket.getScale(), mapItemDataPacket.isLocked(), null, null);
|
||||||
+ } else if (packet instanceof ClientboundSystemChatPacket) {
|
|
||||||
+ return null;
|
|
||||||
+ } else if (packet instanceof ClientboundDisguisedChatPacket) {
|
|
||||||
+ return null;
|
|
||||||
+ } else if (packet instanceof ClientboundPlayerChatPacket playerChatPacket) {
|
+ } else if (packet instanceof ClientboundPlayerChatPacket playerChatPacket) {
|
||||||
+ final SignedMessageBody.Packed body = playerChatPacket.body();
|
+ final SignedMessageBody.Packed body = playerChatPacket.body();
|
||||||
+ packet = new ClientboundPlayerChatPacket(playerChatPacket.sender(), // Not sending this packet results in a kick when someone says something.
|
+ packet = new ClientboundPlayerChatPacket(playerChatPacket.sender(), // Not sending this packet results in a kick when someone says something.
|
||||||
@@ -128,7 +129,6 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..c9c0652a22760716f9dbb5fc73bc6fce
|
|||||||
+ playerChatPacket.chatType()
|
+ playerChatPacket.chatType()
|
||||||
+ );
|
+ );
|
||||||
+ } else {
|
+ } else {
|
||||||
+ LOGGER.error("Packet with ID {} was too large and was not caught. Please report this to the Scissors developers.", i);
|
|
||||||
+ return null;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@@ -153,7 +153,7 @@ index 3944852921335c78a04a9dc301882ab5b152b1ed..96ee53c7cc862e059328c5cdf5e07f30
|
|||||||
this.type = blockEntityType;
|
this.type = blockEntityType;
|
||||||
this.tag = nbt.isEmpty() ? null : nbt;
|
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
|
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 f3fa2678796c33f3a408a02a1995ad117eac9169..2d912c6e332706371d0e8431685fe038a567e86e 100644
|
index 51e24105facfe71ce9f2757c6c881a21b58dacfd..5692fbae221fb01d32d92edc7bea0f6312e24e1c 100644
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||||
+++ b/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 {
|
@@ -33,6 +33,13 @@ public class ClientboundLevelChunkPacketData {
|
||||||
|
@@ -5,10 +5,10 @@ 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 584a58659fae6ba3d8b53858890bc6ec509ffb0e..54a7dae26854d320d9e53f63eb411a85a2d78159 100644
|
index 7daca712816a79cc4a30b084afbd3d07b5d3755f..a7e04eb4284e7d5148e1c7b991620d666785ec70 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
|
||||||
@@ -39,8 +39,9 @@ public class ComponentUtils {
|
@@ -38,8 +38,9 @@ public class ComponentUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MutableComponent updateForEntity(@Nullable CommandSourceStack source, Component text, @Nullable Entity sender, int depth) throws CommandSyntaxException {
|
public static MutableComponent updateForEntity(@Nullable CommandSourceStack source, Component text, @Nullable Entity sender, int depth) throws CommandSyntaxException {
|
||||||
@@ -19,7 +19,7 @@ index 584a58659fae6ba3d8b53858890bc6ec509ffb0e..54a7dae26854d320d9e53f63eb411a85
|
|||||||
} else {
|
} else {
|
||||||
// Paper start
|
// Paper start
|
||||||
if (text instanceof io.papermc.paper.adventure.AdventureComponent adventureComponent) {
|
if (text instanceof io.papermc.paper.adventure.AdventureComponent adventureComponent) {
|
||||||
@@ -53,8 +54,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 c07eb451a576811a39021f6f97103c77488fd001..b91d3ddf586a103770d63cdcf7ec590f95ee388f 100644
|
index a2f71a6d1a9e98133dff6cd0f625da9435a8af14..f83b2c4298bd1a5f65487f64bd6a11fb190a622d 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;
|
||||||
@@ -184,7 +184,7 @@ index 0000000000000000000000000000000000000000..797677d892d83cf54d9a60af1e277b67
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java
|
diff --git a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..38179a93c2b04421a14dfcd53d399152e593a4b4
|
index 0000000000000000000000000000000000000000..8cd2848aa6b06c5efbe797ed2d75ff4b025b3c52
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java
|
+++ b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java
|
||||||
@@ -0,0 +1,225 @@
|
@@ -0,0 +1,225 @@
|
||||||
@@ -226,7 +226,7 @@ index 0000000000000000000000000000000000000000..38179a93c2b04421a14dfcd53d399152
|
|||||||
+
|
+
|
||||||
+ Discord: https://discord.com/invite/mtVQcHn58h
|
+ Discord: https://discord.com/invite/mtVQcHn58h
|
||||||
+ Website: https://scissors.gg/\s
|
+ Website: https://scissors.gg/\s
|
||||||
+ Docs: https://javadoc.scissors.gg/1.19.4/\s
|
+ Docs: https://javadoc.scissors.gg/1.20.1/\s
|
||||||
+ """;
|
+ """;
|
||||||
+ private static final Pattern SPACE = Pattern.compile(" ");
|
+ private static final Pattern SPACE = Pattern.compile(" ");
|
||||||
+ private static final Pattern NOT_NUMERIC = Pattern.compile("[^-\\d.]");
|
+ private static final Pattern NOT_NUMERIC = Pattern.compile("[^-\\d.]");
|
||||||
@@ -414,10 +414,10 @@ index 0000000000000000000000000000000000000000..38179a93c2b04421a14dfcd53d399152
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
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 cdbf10339a8e8846a8c364de483a0ccd95cd225a..3863684cdf3d613c39935e9f46fd4e7066f95eab 100644
|
index 7573c12a77797146c51ef2dfe4b2a636df45e21a..90d9c9cbf730df6ec1800a611fd9103418cce607 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
|
||||||
@@ -136,6 +136,7 @@ public class Main {
|
@@ -141,6 +141,7 @@ public class Main {
|
||||||
// Paper start - load config files for access below if needed
|
// Paper start - load config files 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"));
|
||||||
@@ -426,7 +426,7 @@ index cdbf10339a8e8846a8c364de483a0ccd95cd225a..3863684cdf3d613c39935e9f46fd4e70
|
|||||||
|
|
||||||
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 a7e133f3495e9132a5fdae2c24f225e7b026295a..16f0daad2456ce23f8d73389f62aac9f10235100 100644
|
index 58536aabf607015939a1326f80207c0a06eed8ff..34a8c36d88eb17b7574b6766f5e14ef926ec9080 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
|
||||||
@@ -447,18 +447,18 @@ index a7e133f3495e9132a5fdae2c24f225e7b026295a..16f0daad2456ce23f8d73389f62aac9f
|
|||||||
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 247db707879b53c6ff7259efd76b9e8ff18a9d09..9bddf6e8deb1e74c6076b5190c0b9b72e39fa2a7 100644
|
index 142d2c48239d4ebe3896218536656d116cd24d7c..36fe3df8b26136a62381336c83fe266a5bf2266d 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
|
||||||
@@ -978,6 +978,7 @@ public final class CraftServer implements Server {
|
@@ -1036,6 +1036,7 @@ public final class CraftServer implements Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||||
+ me.totalfreedom.scissors.ScissorsConfig.init(((File) console.options.valueOf("scissors-settings"))); // Scissors
|
+ me.totalfreedom.scissors.ScissorsConfig.init(((File) console.options.valueOf("scissors-settings"))); // Scissors
|
||||||
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
|
||||||
@@ -1009,6 +1010,7 @@ public final class CraftServer implements Server {
|
@@ -1067,6 +1068,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 247db707879b53c6ff7259efd76b9e8ff18a9d09..9bddf6e8deb1e74c6076b5190c0b9b72
|
|||||||
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");
|
||||||
|
|
||||||
@@ -2763,6 +2765,14 @@ public final class CraftServer implements Server {
|
@@ -3011,6 +3013,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,10 +482,10 @@ index 247db707879b53c6ff7259efd76b9e8ff18a9d09..9bddf6e8deb1e74c6076b5190c0b9b72
|
|||||||
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 1fe26cb620e8b550790c3e110e2a1180cf0838fd..c3ecf912ce83810e07e95de1df4a565018429881 100644
|
index 1576a201c92d8b17fd3a92ec497c42861db8ad1e..81454e29639f428e3331c5c20bb7ad39351d2f8a 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
|
||||||
@@ -180,6 +180,20 @@ public class Main {
|
@@ -181,6 +181,20 @@ public class Main {
|
||||||
.defaultsTo("Unknown Server")
|
.defaultsTo("Unknown Server")
|
||||||
.describedAs("Name");
|
.describedAs("Name");
|
||||||
// Paper end
|
// Paper end
|
||||||
|
@@ -6,21 +6,21 @@ 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 e3d5ded703be73343d821f329175710609dc388f..d1279c60cafa2ad888227996f45011f54d711e38 100644
|
index 98118cadae93000192003b40e9051a6df216d197..36cd18534910efd410efd9dcc7e4bec27eb99a8f 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
|
||||||
@@ -46,6 +46,7 @@ import net.minecraft.nbt.NbtIo;
|
@@ -47,6 +47,7 @@ import net.minecraft.nbt.NbtIo;
|
||||||
import net.minecraft.nbt.StringTag;
|
import net.minecraft.nbt.StringTag;
|
||||||
import net.minecraft.nbt.Tag;
|
import net.minecraft.nbt.Tag;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
+import net.minecraft.resources.ResourceLocation; // Scissors
|
+import net.minecraft.resources.ResourceLocation; // Scissors
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import org.apache.commons.lang.Validate;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import org.apache.commons.lang3.EnumUtils;
|
import org.apache.commons.lang3.EnumUtils;
|
||||||
@@ -484,7 +485,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
@@ -487,7 +488,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||||
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
|
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
|
||||||
|
|
||||||
String attributeName = CraftAttributeMap.convertIfNeeded(entry.getString(ATTRIBUTES_IDENTIFIER.NBT)); // Paper
|
String attributeName = org.bukkit.craftbukkit.attribute.CraftAttributeMap.convertIfNeeded(entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT)); // Paper
|
||||||
- if (attributeName == null || attributeName.isEmpty()) {
|
- if (attributeName == null || attributeName.isEmpty()) {
|
||||||
+ if (attributeName == null || attributeName.isEmpty() || attributeName.length() > 256 || !ResourceLocation.isValidResourceLocation(attributeName)) { // Scissors
|
+ if (attributeName == null || attributeName.isEmpty() || attributeName.length() > 256 || !ResourceLocation.isValidResourceLocation(attributeName)) { // Scissors
|
||||||
continue;
|
continue;
|
||||||
|
@@ -1,29 +1,30 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Video <videogamesm12@gmail.com>
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
Date: Sat, 9 Apr 2022 13:00:27 -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 8a6799b50062c1b7b141ee1568dc523f9ee7ecfd..80e7b0889235288b60d813a569daecb7e08e108e 100644
|
index 3bec895fecb3521653fb0b88d4a4854fd3766b46..5fd278ac13c02b9d511be22dba9719cb0cb0e17b 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
|
||||||
@@ -1,5 +1,6 @@
|
@@ -8,12 +8,15 @@ import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
package net.minecraft.network.chat.contents;
|
|
||||||
|
|
||||||
+import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
|
||||||
import com.mojang.brigadier.StringReader;
|
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -11,6 +12,7 @@ import net.minecraft.commands.arguments.selector.EntitySelector;
|
import java.util.stream.Stream;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
+
|
||||||
|
+import me.totalfreedom.scissors.ScissorsConfig;
|
||||||
|
import net.minecraft.advancements.critereon.NbtPredicate;
|
||||||
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
|
import net.minecraft.commands.arguments.selector.EntitySelector;
|
||||||
import net.minecraft.commands.arguments.selector.EntitySelectorParser;
|
import net.minecraft.commands.arguments.selector.EntitySelectorParser;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
+import net.minecraft.world.entity.player.Player; // Scissors
|
+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 EntityDataSource(String rawPath) {
|
public static final MapCodec<EntityDataSource> SUB_CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
||||||
@@ -31,7 +33,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) {
|
||||||
List<? extends Entity> list = this.compiledSelector.findEntities(source);
|
List<? extends Entity> list = this.compiledSelector.findEntities(source);
|
||||||
|
@@ -5,49 +5,30 @@ Subject: [PATCH] Fixes creative-killing potion effects and certain potion
|
|||||||
effect overflows
|
effect overflows
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/effect/MobEffect.java b/src/main/java/net/minecraft/world/effect/MobEffect.java
|
diff --git a/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java b/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java
|
||||||
index 2cc714585fc3790b70a7ad1ab8034543462e2b3b..a791b9dc3e29d87bf3aa309e772aea43386da89d 100644
|
index 1c7794de5f0a7238b944c9473e2cc9d011ef2306..9c594c504611b9da5fcd119284b2dcb4b59d3bf4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/effect/MobEffect.java
|
--- a/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java
|
||||||
+++ b/src/main/java/net/minecraft/world/effect/MobEffect.java
|
+++ b/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java
|
||||||
@@ -58,6 +58,7 @@ public class MobEffect {
|
@@ -16,6 +16,11 @@ class HealOrHarmMobEffect extends InstantenousMobEffect {
|
||||||
}
|
@Override
|
||||||
|
|
||||||
public void applyEffectTick(LivingEntity entity, int amplifier) {
|
public void applyEffectTick(LivingEntity entity, int amplifier) {
|
||||||
+ boolean god = entity instanceof Player player && (player.isCreative() || player.isInvulnerable()); // Scissors
|
super.applyEffectTick(entity, amplifier);
|
||||||
if (this == MobEffects.REGENERATION) {
|
+ // Scissors start - Don't apply any healing/harming effects for Creative/Invulnerable players and cap the amplifier for those who aren't.
|
||||||
if (entity.getHealth() < entity.getMaxHealth()) {
|
+ if (entity instanceof net.minecraft.world.entity.player.Player player && (player.isCreative() || player.isInvulnerable())) return;
|
||||||
entity.heal(1.0F, RegainReason.MAGIC_REGEN); // CraftBukkit
|
|
||||||
@@ -86,17 +87,31 @@ public class MobEffect {
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
} else if ((this != MobEffects.HEAL || entity.isInvertedHealAndHarm()) && (this != MobEffects.HARM || !entity.isInvertedHealAndHarm())) {
|
|
||||||
- if (this == MobEffects.HARM && !entity.isInvertedHealAndHarm() || this == MobEffects.HEAL && entity.isInvertedHealAndHarm()) {
|
|
||||||
+ // Scissors start
|
|
||||||
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
||||||
+ if (!god && (this == MobEffects.HARM && !entity.isInvertedHealAndHarm() || this == MobEffects.HEAL && entity.isInvertedHealAndHarm())) {
|
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
entity.hurt(entity.damageSources().magic(), (float) (6 << amplifier));
|
+
|
||||||
}
|
if (this.isHarm == entity.isInvertedHealAndHarm()) {
|
||||||
|
entity.heal((float) Math.max(4 << amplifier, 0), org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.MAGIC); // CraftBukkit
|
||||||
} else {
|
} else {
|
||||||
- entity.heal((float) Math.max(4 << amplifier, 0), RegainReason.MAGIC); // CraftBukkit
|
@@ -27,6 +32,10 @@ class HealOrHarmMobEffect extends InstantenousMobEffect {
|
||||||
+ // Scissors start
|
@Override
|
||||||
+ if (!god) {
|
|
||||||
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
|
||||||
+ entity.heal((float) Math.max(4 << amplifier, 0), RegainReason.MAGIC); // CraftBukkit
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void applyInstantenousEffect(@Nullable Entity source, @Nullable Entity attacker, LivingEntity target, int amplifier, double proximity) {
|
public void applyInstantenousEffect(@Nullable Entity source, @Nullable Entity attacker, LivingEntity target, int amplifier, double proximity) {
|
||||||
int j;
|
int j;
|
||||||
+ // Scissors start - Don't apply any healing/harming effects for Creative/Invulnerable players and cap the amplifier for those who aren't.
|
+ // Scissors start - Don't apply any healing/harming effects for Creative/Invulnerable players and cap the amplifier for those who aren't.
|
||||||
+ if (target instanceof Player player && (player.isCreative() || player.isInvulnerable())) {
|
+ if (target instanceof net.minecraft.world.entity.player.Player player && (player.isCreative() || player.isInvulnerable())) return;
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
|
|
||||||
if ((this != MobEffects.HEAL || target.isInvertedHealAndHarm()) && (this != MobEffects.HARM || !target.isInvertedHealAndHarm())) {
|
if (this.isHarm == target.isInvertedHealAndHarm()) {
|
||||||
if ((this != MobEffects.HARM || target.isInvertedHealAndHarm()) && (this != MobEffects.HEAL || !target.isInvertedHealAndHarm())) {
|
j = (int) (proximity * (double) (4 << amplifier) + 0.5D);
|
||||||
|
@@ -5,15 +5,15 @@ 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 95a27d28f73039693ca64601954af62028413634..c62552b37d9dd8f0a50ab454af6090d876e0879f 100644
|
index bc908b75cb99536df658281ae7f8b4eeedbbedc9..8c81cd6a6563e4eb46a26c30baa3dfd9df3ecf1f 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
|
||||||
@@ -612,7 +612,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -628,7 +628,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);
|
||||||
}
|
}
|
||||||
|
@@ -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 ee4f924afe15c9a4d96af7a55b357076c7b28501..602337661d96a21d13c4da66622b7d845613c5de 100644
|
index c906ca07509939a06b9aaf2da0dafb172830a638..c1e91ea440202014419aa9601915f9288a41e32c 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;
|
||||||
@@ -17,28 +17,26 @@ index ee4f924afe15c9a4d96af7a55b357076c7b28501..602337661d96a21d13c4da66622b7d84
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import net.minecraft.BlockUtil;
|
import net.minecraft.BlockUtil;
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
@@ -106,6 +107,7 @@ public abstract class AbstractMinecart extends Entity {
|
@@ -104,6 +105,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||||
private double flyingX = 0.949999988079071D; // Paper - restore vanilla precision
|
private double flyingX = 0.95;
|
||||||
private double flyingY = 0.949999988079071D; // Paper - restore vanilla precision
|
private double flyingY = 0.95;
|
||||||
private double flyingZ = 0.949999988079071D; // Paper - restore vanilla precision
|
private double flyingZ = 0.95;
|
||||||
+ private long lastLargeCollision = 0L; // Scissors - Add a collision debounce
|
+ private long lastLargeCollision = 0L; // Scissors - Add a collision debounce
|
||||||
public double maxSpeed = 0.4D;
|
public double maxSpeed = 0.4D;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@@ -432,8 +434,10 @@ public abstract class AbstractMinecart extends Entity {
|
@@ -384,8 +386,8 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||||
if (this.getMinecartType() == AbstractMinecart.Type.RIDEABLE && this.getDeltaMovement().horizontalDistanceSqr() > 0.01D) {
|
if (this.getMinecartType() == AbstractMinecart.Type.RIDEABLE && this.getDeltaMovement().horizontalDistanceSqr() > 0.01D) {
|
||||||
List<Entity> list = this.level.getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
||||||
|
|
||||||
- if (!list.isEmpty()) {
|
- if (!list.isEmpty()) {
|
||||||
- for (int l = 0; l < list.size(); ++l) {
|
- Iterator iterator = list.iterator();
|
||||||
+ // Scissors start
|
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Scissors - add collision debounce, using TimeUnit for better code readability
|
||||||
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Using TimeUnit for better code readability
|
+ Iterator iterator = list.size() <= 15 ? list.iterator() : list.subList(0, 15).iterator(); // Scissors
|
||||||
+ for (int l = 0; l < Math.min(3, list.size()); ++l) {
|
|
||||||
+ // Scissors end
|
|
||||||
Entity entity = (Entity) list.get(l);
|
|
||||||
|
|
||||||
if (!(entity instanceof Player) && !(entity instanceof IronGolem) && !(entity instanceof AbstractMinecart) && !this.isVehicle() && !entity.isPassenger()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -460,6 +464,14 @@ public abstract class AbstractMinecart extends Entity {
|
Entity entity = (Entity) iterator.next();
|
||||||
|
@@ -414,6 +416,14 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||||
entity.push(this);
|
entity.push(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,9 +50,9 @@ index ee4f924afe15c9a4d96af7a55b357076c7b28501..602337661d96a21d13c4da66622b7d84
|
|||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Iterator iterator = 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 12e3209c5246ede89daaf8455fe70b4a517e12f6..c5bc5e38ea6b856b1cc3e9c3907f697235b32c50 100644
|
index c041c0b81be41cfd128c2f5ba56a5329d50b2efc..7dcbdcb30d264cf76fd975489918509e6e589127 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;
|
||||||
@@ -65,7 +63,7 @@ index 12e3209c5246ede89daaf8455fe70b4a517e12f6..c5bc5e38ea6b856b1cc3e9c3907f6972
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import net.minecraft.BlockUtil;
|
import net.minecraft.BlockUtil;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
@@ -109,6 +110,7 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
@@ -108,6 +109,7 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
|
||||||
public double unoccupiedDeceleration = -1;
|
public double unoccupiedDeceleration = -1;
|
||||||
public boolean landBoats = false;
|
public boolean landBoats = false;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -73,20 +71,19 @@ index 12e3209c5246ede89daaf8455fe70b4a517e12f6..c5bc5e38ea6b856b1cc3e9c3907f6972
|
|||||||
|
|
||||||
public Boat(EntityType<? extends Boat> type, Level world) {
|
public Boat(EntityType<? extends Boat> type, Level world) {
|
||||||
super(type, world);
|
super(type, world);
|
||||||
@@ -421,10 +423,10 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
@@ -408,9 +410,9 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
|
||||||
this.checkInsideBlocks();
|
this.checkInsideBlocks();
|
||||||
List<Entity> list = this.level.getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, -0.009999999776482582D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, -0.009999999776482582D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
||||||
|
|
||||||
- if (!list.isEmpty()) {
|
- if (!list.isEmpty()) {
|
||||||
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Scissors - add collision debounce, using TimeUnit for better code readability
|
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Scissors - add collision debounce, using TimeUnit for better code readability
|
||||||
boolean flag = !this.level.isClientSide && !(this.getControllingPassenger() instanceof Player);
|
boolean flag = !this.level().isClientSide && !(this.getControllingPassenger() instanceof Player);
|
||||||
|
- Iterator iterator = list.iterator();
|
||||||
|
+ Iterator iterator = list.size() <= 15 ? list.iterator() : list.subList(0, 15).iterator(); // Scissors
|
||||||
|
|
||||||
- for (int j = 0; j < list.size(); ++j) {
|
while (iterator.hasNext()) {
|
||||||
+ for (int j = 0; j < Math.min(3, list.size()); ++j) { // Scissors - Limit amount of vehicle collision checks to 3 maximum
|
Entity entity = (Entity) iterator.next();
|
||||||
Entity entity = (Entity) list.get(j);
|
@@ -423,6 +425,14 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
|
||||||
|
|
||||||
if (!entity.hasPassenger((Entity) this)) {
|
|
||||||
@@ -435,6 +437,14 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -41,10 +41,10 @@ index 0000000000000000000000000000000000000000..754b578b575137a9c48cb20dee965a93
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/me/totalfreedom/scissors/NbtUtility.java b/src/main/java/me/totalfreedom/scissors/NbtUtility.java
|
diff --git a/src/main/java/me/totalfreedom/scissors/NbtUtility.java b/src/main/java/me/totalfreedom/scissors/NbtUtility.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..b724baaef8d565e41db1af6393d0890e919a5aa8
|
index 0000000000000000000000000000000000000000..b3efac47ee700d5a7ff26452d6bcbf2f687a32cf
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/totalfreedom/scissors/NbtUtility.java
|
+++ b/src/main/java/me/totalfreedom/scissors/NbtUtility.java
|
||||||
@@ -0,0 +1,74 @@
|
@@ -0,0 +1,75 @@
|
||||||
+package me.totalfreedom.scissors;
|
+package me.totalfreedom.scissors;
|
||||||
+
|
+
|
||||||
+import java.nio.charset.StandardCharsets;
|
+import java.nio.charset.StandardCharsets;
|
||||||
@@ -75,6 +75,7 @@ index 0000000000000000000000000000000000000000..b724baaef8d565e41db1af6393d0890e
|
|||||||
+ CompoundTag compoundTag = (CompoundTag) tag;
|
+ CompoundTag compoundTag = (CompoundTag) tag;
|
||||||
+ for (String key : compoundTag.getAllKeys())
|
+ for (String key : compoundTag.getAllKeys())
|
||||||
+ {
|
+ {
|
||||||
|
+ size += key.getBytes(StandardCharsets.UTF_8).length;
|
||||||
+ size += getTagSize(compoundTag.get(key), depth + 1);
|
+ size += getTagSize(compoundTag.get(key), depth + 1);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@@ -121,10 +122,10 @@ index 0000000000000000000000000000000000000000..b724baaef8d565e41db1af6393d0890e
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/me/totalfreedom/scissors/PositionUtility.java b/src/main/java/me/totalfreedom/scissors/PositionUtility.java
|
diff --git a/src/main/java/me/totalfreedom/scissors/PositionUtility.java b/src/main/java/me/totalfreedom/scissors/PositionUtility.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..7c7e39ea96449f8eb5472cd9eca0f45f690b1861
|
index 0000000000000000000000000000000000000000..c5dcc833d6f2c0daa1d0c2a7ab81430f25e0b2f3
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/totalfreedom/scissors/PositionUtility.java
|
+++ b/src/main/java/me/totalfreedom/scissors/PositionUtility.java
|
||||||
@@ -0,0 +1,52 @@
|
@@ -0,0 +1,53 @@
|
||||||
+package me.totalfreedom.scissors;
|
+package me.totalfreedom.scissors;
|
||||||
+
|
+
|
||||||
+import net.minecraft.core.BlockPos;
|
+import net.minecraft.core.BlockPos;
|
||||||
@@ -135,6 +136,7 @@ index 0000000000000000000000000000000000000000..7c7e39ea96449f8eb5472cd9eca0f45f
|
|||||||
+
|
+
|
||||||
+public class PositionUtility
|
+public class PositionUtility
|
||||||
+{
|
+{
|
||||||
|
+
|
||||||
+ public static Vec3 getValidVec3FromBlockPos(BlockPos blockPos, Entity entity)
|
+ public static Vec3 getValidVec3FromBlockPos(BlockPos blockPos, Entity entity)
|
||||||
+ {
|
+ {
|
||||||
+ final BlockPos validBlockPos = getValidBlockPos(blockPos, entity);
|
+ final BlockPos validBlockPos = getValidBlockPos(blockPos, entity);
|
||||||
@@ -144,7 +146,7 @@ index 0000000000000000000000000000000000000000..7c7e39ea96449f8eb5472cd9eca0f45f
|
|||||||
+
|
+
|
||||||
+ public static BlockPos getValidBlockPos(BlockPos blockPos, Entity entity)
|
+ public static BlockPos getValidBlockPos(BlockPos blockPos, Entity entity)
|
||||||
+ {
|
+ {
|
||||||
+ final Level level = entity.level;
|
+ final Level level = entity.level();
|
||||||
+
|
+
|
||||||
+ try
|
+ try
|
||||||
+ {
|
+ {
|
||||||
|
@@ -59,10 +59,10 @@ 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 d81fcbadc5c0b3d4b54dde5d47a0f847d8ec6918..4c2f3f932654dec5dcbf2d8b0a61122905315e56 100644
|
index de277d61b718fe07a87d75a2547bb1c7f8553aa1..e2dbfe581717cc107d89206c1ba46014a6965693 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
|
||||||
@@ -20,6 +20,7 @@ import java.util.function.Predicate;
|
@@ -23,6 +23,7 @@ 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;
|
||||||
@@ -70,7 +70,7 @@ index d81fcbadc5c0b3d4b54dde5d47a0f847d8ec6918..4c2f3f932654dec5dcbf2d8b0a611229
|
|||||||
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;
|
||||||
@@ -258,6 +259,12 @@ public final class ItemStack {
|
@@ -277,6 +278,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 +83,7 @@ index d81fcbadc5c0b3d4b54dde5d47a0f847d8ec6918..4c2f3f932654dec5dcbf2d8b0a611229
|
|||||||
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)) {
|
||||||
@@ -538,7 +545,11 @@ public final class ItemStack {
|
@@ -584,7 +591,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 +96,7 @@ index d81fcbadc5c0b3d4b54dde5d47a0f847d8ec6918..4c2f3f932654dec5dcbf2d8b0a611229
|
|||||||
}
|
}
|
||||||
|
|
||||||
return nbt;
|
return nbt;
|
||||||
@@ -874,6 +885,7 @@ public final class ItemStack {
|
@@ -918,6 +929,7 @@ public final class ItemStack {
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
public void setTag(@Nullable CompoundTag nbt) {
|
public void setTag(@Nullable CompoundTag nbt) {
|
||||||
@@ -105,7 +105,7 @@ index d81fcbadc5c0b3d4b54dde5d47a0f847d8ec6918..4c2f3f932654dec5dcbf2d8b0a611229
|
|||||||
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 6eecd2e609532bbdde69c0ddc5d6bc2e2e01d1ff..907e163e5377335aac828c137deed42af9d2ce38 100644
|
index f5ad7ddf13cbb6452c2927aef9b54eae3335b4c6..041e3c8fb7c9ca69a7c7c1c952ed9915a75d7752 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,7 @@ import java.util.Iterator;
|
||||||
@@ -252,7 +252,7 @@ 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 aac5572c1d40a10cd1d17f89c9eb836718837577..e31ce92c8381ff2b1e5777f6f5351adcd137cdc5 100644
|
index d4dcf7fe26474ae07374e7761d823bc5c8b54f97..7352183f7eaa1ddcd028e53f4b66a1c34e32b988 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,7 @@ import java.util.function.BooleanSupplier;
|
||||||
@@ -282,10 +282,10 @@ index aac5572c1d40a10cd1d17f89c9eb836718837577..e31ce92c8381ff2b1e5777f6f5351adc
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 b7686fd63b7c5d88c3a12ec4ee9bc01a17f997e0..db3a4a8cd19da9775bb0884c33494f1e8591b1fa 100644
|
index 1fa22445a4ecc8c08dbcf0cc6bd39dc5003604c4..9f12fbcd8d0c75de1d8c06bed2c64a0acdc877c9 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
|
||||||
@@ -3,6 +3,7 @@ package net.minecraft.world.level.block.entity;
|
@@ -4,6 +4,7 @@ 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;
|
||||||
@@ -293,7 +293,7 @@ index b7686fd63b7c5d88c3a12ec4ee9bc01a17f997e0..db3a4a8cd19da9775bb0884c33494f1e
|
|||||||
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;
|
||||||
@@ -60,6 +61,17 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
@@ -61,6 +62,17 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||||
public boolean opened;
|
public boolean opened;
|
||||||
|
|
||||||
public List<ItemStack> getContents() {
|
public List<ItemStack> getContents() {
|
||||||
|
@@ -5,11 +5,11 @@ 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 c62552b37d9dd8f0a50ab454af6090d876e0879f..2f4c606562c08189c817280a601a32632959614e 100644
|
index 8c81cd6a6563e4eb46a26c30baa3dfd9df3ecf1f..b01c443746f0c4c8c37fb5955351eff1689be1c4 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
|
||||||
@@ -844,7 +844,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -860,7 +860,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) {
|
||||||
- LivingEntity.LOGGER.warn("Unable to add mob to team \"{}\" (that team probably doesn't exist)", s);
|
- LivingEntity.LOGGER.warn("Unable to add mob to team \"{}\" (that team probably doesn't exist)", s);
|
||||||
|
@@ -5,15 +5,15 @@ 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 f7d031e9a5aa533d78a49ed6147dd47dd0f27f01..68bd4f64e85f26071640b219bb91b868f8e8aded 100644
|
index 5f4c42c4ba44923cabb873bfad33abc2b1362e73..6608c98d1a517c307e16669e536dda6eb9f1e082 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
|
||||||
@@ -271,6 +271,13 @@ public abstract class HangingEntity extends Entity {
|
@@ -279,6 +279,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"));
|
||||||
|
|
||||||
+ // Scissors start - Fixes exploit where bad TileX, TileY, and TileZ coordinates can crash servers
|
+ // Scissors start - Fixes exploit where bad TileX, TileY, and TileZ coordinates can crash servers
|
||||||
+ if (level.isLoadedAndInBounds(blockposition))
|
+ if (level().isLoadedAndInBounds(blockposition))
|
||||||
+ {
|
+ {
|
||||||
+ this.pos = blockposition;
|
+ this.pos = blockposition;
|
||||||
+ }
|
+ }
|
||||||
|
@@ -1,35 +1,35 @@
|
|||||||
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, 4 Jul 2022 22:12:19 +0100
|
Date: Sun, 10 Dec 2023 18:11:55 -0600
|
||||||
Subject: [PATCH] Add MasterBlockFireEvent
|
Subject: [PATCH] Add MasterBlockFireEvent
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/CommandBlock.java b/src/main/java/net/minecraft/world/level/block/CommandBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/CommandBlock.java b/src/main/java/net/minecraft/world/level/block/CommandBlock.java
|
||||||
index 2e7c03b00bc941b86df6a7f1b2b188c9f0aede22..0ae03d3934ad7b2b38afa45a65c7753dcbe796d2 100644
|
index 7ef14e4441a329c680a5dfe4bfb5033ffcb8f9d5..eff5bdf00b0aa7a9925ff59a62ead72509dc67b8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/CommandBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/CommandBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/CommandBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/CommandBlock.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -4,6 +4,7 @@ import com.mojang.logging.LogUtils;
|
||||||
package net.minecraft.world.level.block;
|
import com.mojang.serialization.Codec;
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
+import me.totalfreedom.scissors.event.block.MasterBlockFireEvent; // Scissors
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
import com.mojang.logging.LogUtils;
|
+import me.totalfreedom.scissors.event.block.MasterBlockFireEvent;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
@@ -25,6 +26,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
@@ -28,6 +29,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||||
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
+import org.bukkit.Location; // Scissors
|
+import org.bukkit.Location;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
||||||
@@ -117,6 +119,15 @@ public class CommandBlock extends BaseEntityBlock implements GameMasterBlock {
|
@@ -130,6 +132,14 @@ public class CommandBlock extends BaseEntityBlock implements GameMasterBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void execute(BlockState state, Level world, BlockPos pos, BaseCommandBlock executor, boolean hasCommand) {
|
private void execute(BlockState state, Level world, BlockPos pos, BaseCommandBlock executor, boolean hasCommand) {
|
||||||
+ // Scissors start - Add master block fire event
|
+ // Scissors start - Add master block fire event
|
||||||
+ final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
+ final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
||||||
+
|
|
||||||
+ if (!event.callEvent())
|
+ if (!event.callEvent())
|
||||||
+ {
|
+ {
|
||||||
+ return;
|
+ return;
|
||||||
@@ -40,26 +40,27 @@ index 2e7c03b00bc941b86df6a7f1b2b188c9f0aede22..0ae03d3934ad7b2b38afa45a65c7753d
|
|||||||
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 182e16c1d968707a11329150d71b7d01df6c6e52..8582a9369cffe0eebeb82a81fc413d0bf4ad28ed 100644
|
index 3a210e138b6ae065fd32e1b1e0e49999e20c4667..183c47a6fbf5201c38d5eb182049643862ca0964 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,7 @@ package net.minecraft.world.level.block.entity;
|
@@ -2,6 +2,8 @@ package net.minecraft.world.level.block.entity;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
+import me.totalfreedom.scissors.event.block.MasterBlockFireEvent; // Scissors
|
+
|
||||||
|
+import me.totalfreedom.scissors.event.block.MasterBlockFireEvent;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Holder;
|
import net.minecraft.core.Holder;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
@@ -17,6 +18,7 @@ import net.minecraft.world.level.block.JigsawBlock;
|
@@ -17,6 +19,7 @@ import net.minecraft.world.level.block.JigsawBlock;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement;
|
import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement;
|
||||||
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
|
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
|
||||||
+import org.bukkit.Location; // Scissors
|
+import org.bukkit.Location;
|
||||||
|
|
||||||
public class JigsawBlockEntity extends BlockEntity {
|
public class JigsawBlockEntity extends BlockEntity {
|
||||||
public static final String TARGET = "target";
|
public static final String TARGET = "target";
|
||||||
@@ -107,6 +109,16 @@ public class JigsawBlockEntity extends BlockEntity {
|
@@ -131,6 +134,16 @@ public class JigsawBlockEntity extends BlockEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) {
|
public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) {
|
||||||
@@ -77,26 +78,27 @@ index 182e16c1d968707a11329150d71b7d01df6c6e52..8582a9369cffe0eebeb82a81fc413d0b
|
|||||||
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 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616fd3f73eb 100644
|
index 60c941bd67dc899ea923f8ee49412de01ce199db..9bcd07f8b5d266c39034e5c021da9ffb7262b474 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,7 @@ import java.util.Objects;
|
@@ -5,6 +5,8 @@ import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import me.totalfreedom.scissors.event.block.MasterBlockFireEvent; // Scissors
|
+
|
||||||
|
+import me.totalfreedom.scissors.event.block.MasterBlockFireEvent;
|
||||||
import net.minecraft.ResourceLocationException;
|
import net.minecraft.ResourceLocationException;
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
@@ -29,6 +30,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.BlockRotProce
|
@@ -29,6 +31,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.BlockRotProce
|
||||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings;
|
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings;
|
||||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
|
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
|
||||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
|
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
|
||||||
+import org.bukkit.Location; // Scissors
|
+import org.bukkit.Location;
|
||||||
|
|
||||||
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;
|
||||||
@@ -264,7 +266,7 @@ public class StructureBlockEntity extends BlockEntity {
|
@@ -261,7 +264,7 @@ public class StructureBlockEntity extends BlockEntity {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
BlockPos blockPos = this.getBlockPos();
|
BlockPos blockPos = this.getBlockPos();
|
||||||
@@ -105,10 +107,10 @@ index 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616
|
|||||||
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);
|
||||||
@@ -321,6 +323,16 @@ public class StructureBlockEntity extends BlockEntity {
|
@@ -320,6 +323,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||||
|
if (this.structureName == null) {
|
||||||
public boolean saveStructure(boolean bl) {
|
return false;
|
||||||
if (this.mode == StructureMode.SAVE && !this.level.isClientSide && this.structureName != null) {
|
} else {
|
||||||
+ // Scissors start - Add master block fire event
|
+ // Scissors start - Add master block fire event
|
||||||
+ final BlockPos pos = this.getBlockPos();
|
+ final BlockPos pos = this.getBlockPos();
|
||||||
+ final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(this.getLevel().getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
+ final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(this.getLevel().getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
||||||
@@ -122,10 +124,10 @@ index 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616
|
|||||||
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();
|
||||||
@@ -358,6 +370,16 @@ public class StructureBlockEntity extends BlockEntity {
|
@@ -371,6 +384,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||||
|
if (structureTemplate == null) {
|
||||||
public boolean loadStructure(ServerLevel world, boolean bl) {
|
return false;
|
||||||
if (this.mode == StructureMode.LOAD && this.structureName != null) {
|
} else {
|
||||||
+ // Scissors start - Add master block fire event
|
+ // Scissors start - Add master block fire event
|
||||||
+ final BlockPos blockPos = this.getBlockPos();
|
+ final BlockPos blockPos = this.getBlockPos();
|
||||||
+ final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(this.getLevel().getWorld(), blockPos.getX(), blockPos.getY(), blockPos.getZ()));
|
+ final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(this.getLevel().getWorld(), blockPos.getX(), blockPos.getY(), blockPos.getZ()));
|
||||||
@@ -136,10 +138,10 @@ index 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616
|
|||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
+
|
+
|
||||||
StructureTemplateManager structureTemplateManager = world.getStructureManager();
|
this.loadStructureInfo(structureTemplate);
|
||||||
|
return true;
|
||||||
Optional<StructureTemplate> optional;
|
}
|
||||||
@@ -403,6 +425,16 @@ public class StructureBlockEntity extends BlockEntity {
|
@@ -407,6 +430,15 @@ public class StructureBlockEntity extends BlockEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unloadStructure() {
|
public void unloadStructure() {
|
||||||
@@ -152,7 +154,6 @@ index 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616
|
|||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
+
|
|
||||||
if (this.structureName != null) {
|
if (this.structureName != null) {
|
||||||
ServerLevel serverLevel = (ServerLevel)this.level;
|
ServerLevel serverLevel = (ServerLevel)this.level;
|
||||||
StructureTemplateManager structureTemplateManager = serverLevel.getStructureManager();
|
StructureTemplateManager structureTemplateManager = serverLevel.getStructureManager();
|
||||||
|
@@ -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 aa287d7f37f38d938d195114408cb6dbda59063d..e46febba49530c4c71a15bfc75d731c45fcb48f2 100644
|
index 64255f7db85886421d5029766e8a6d1eadb94cff..2a3f4e6bfc6b122bb2102163381de8c78f06f1b5 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 @@
|
||||||
@@ -14,19 +14,17 @@ index aa287d7f37f38d938d195114408cb6dbda59063d..e46febba49530c4c71a15bfc75d731c4
|
|||||||
+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;
|
||||||
import com.mojang.brigadier.ParseResults;
|
import com.mojang.authlib.GameProfile;
|
||||||
@@ -2056,6 +2057,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -2037,6 +2038,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
Entity entity = packet.getEntity(worldserver);
|
Entity entity = packet.getEntity(worldserver);
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
+ // Scissors start - Add spectator teleport event
|
+ // Scissors start - Add spectator teleport event
|
||||||
+ final SpectatorTeleportEvent event = new SpectatorTeleportEvent(this.player.getBukkitEntity(), entity.getBukkitEntity());
|
+ final SpectatorTeleportEvent event = new SpectatorTeleportEvent(this.player.getBukkitEntity(), entity.getBukkitEntity());
|
||||||
+
|
+ if (!event.callEvent()) {
|
||||||
+ if(!event.callEvent()) {
|
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
+
|
|
||||||
this.player.teleportTo(worldserver, entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot(), org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.SPECTATE); // CraftBukkit
|
this.player.teleportTo(worldserver, entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot(), org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.SPECTATE); // CraftBukkit
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -5,18 +5,18 @@ 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 e46febba49530c4c71a15bfc75d731c45fcb48f2..798ffda66ccbc98a073b276208e04d643b04e1b2 100644
|
index 2a3f4e6bfc6b122bb2102163381de8c78f06f1b5..2ac044f9e4c4c80263a34f9294cb69829bca132e 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
|
||||||
@@ -30,6 +30,7 @@ import java.util.function.UnaryOperator;
|
@@ -29,6 +29,7 @@ import java.util.function.UnaryOperator;
|
||||||
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 net.kyori.adventure.text.format.NamedTextColor; // Scissors
|
+import net.kyori.adventure.text.format.NamedTextColor; // Scissors
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.CrashReport;
|
import net.minecraft.SharedConstants;
|
||||||
import net.minecraft.CrashReportCategory;
|
import net.minecraft.Util;
|
||||||
@@ -2996,6 +2997,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -2909,6 +2910,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,31 +1,31 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Luna <lunahatesgogle@gmail.com>
|
From: Luna <lunahatesgogle@gmail.com>
|
||||||
Date: Mon, 11 Jul 2022 17:29:12 -0300
|
Date: Mon, 11 Jul 2022 17:29:12 -0300
|
||||||
Subject: [PATCH] Validate block entity tag query positions
|
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 798ffda66ccbc98a073b276208e04d643b04e1b2..d428490171bb1c0209ca9a279c2b1e1e1dfcf914 100644
|
index 2ac044f9e4c4c80263a34f9294cb69829bca132e..889f142b6f87d4ccf4c1d2ffd379c96fbbfddd44 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
|
||||||
@@ -1359,7 +1359,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1265,7 +1265,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
if (this.player.hasPermissions(2)) {
|
if (this.player.hasPermissions(2)) {
|
||||||
Entity entity = this.player.getLevel().getEntity(packet.getEntityId());
|
Entity entity = this.player.level().getEntity(packet.getEntityId());
|
||||||
|
|
||||||
- if (entity != null) {
|
- if (entity != null) {
|
||||||
+ if (entity != null && this.player.distanceToSqr(entity.position().x, entity.position().y, entity.position().z) < 32 * 32) { // Scissors - Validate entity tag query positions
|
+ if (entity != null && this.player.distanceToSqr(entity.position().x, entity.position().y, entity.position().z) < 32 * 32) { // Scissors - Validate entity tag query positions
|
||||||
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));
|
||||||
@@ -1371,7 +1371,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1297,7 +1297,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
|
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
- if (this.player.hasPermissions(2)) {
|
- if (this.player.hasPermissions(2)) {
|
||||||
+ // Scissors start - Validate block entity tag query positions
|
+ // Scissors start - Validate block entity tag query positions
|
||||||
+ if (this.player.hasPermissions(2) && this.player.getLevel().isLoadedAndInBounds(packet.getPos())
|
+ if (this.player.hasPermissions(2) && this.player.level().isLoadedAndInBounds(packet.getPos())
|
||||||
+ && this.player.distanceToSqr(packet.getPos().getX(), packet.getPos().getY(), packet.getPos().getZ()) < 32 * 32) {
|
+ && this.player.distanceToSqr(packet.getPos().getX(), packet.getPos().getY(), packet.getPos().getZ()) < 32 * 32) {
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
BlockEntity tileentity = this.player.getLevel().getBlockEntity(packet.getPos());
|
BlockEntity tileentity = this.player.level().getBlockEntity(packet.getPos());
|
||||||
CompoundTag nbttagcompound = tileentity != null ? tileentity.saveWithoutMetadata() : null;
|
CompoundTag nbttagcompound = tileentity != null ? tileentity.saveWithoutMetadata() : null;
|
||||||
|
|
@@ -5,12 +5,12 @@ 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 4da4edae517a0efec6e03a719ec47b700509dab1..96e330e024384503496f834a9767122f6b4d86d6 100644
|
index a3ec2f522be2d02b9e37810799cecc2ba14f58f3..97d4d9f85ee20aa1dd894d24deefe33478fe1cee 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
|
||||||
@@ -4,8 +4,10 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
@@ -8,8 +8,10 @@ import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Function;
|
import java.util.function.UnaryOperator;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
+import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
||||||
import net.minecraft.commands.CommandSource;
|
import net.minecraft.commands.CommandSource;
|
||||||
@@ -18,43 +18,50 @@ index 4da4edae517a0efec6e03a719ec47b700509dab1..96e330e024384503496f834a9767122f
|
|||||||
+import net.minecraft.commands.Commands; // Scissors
|
+import net.minecraft.commands.Commands; // Scissors
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.ClickEvent;
|
import net.minecraft.nbt.NbtOps;
|
||||||
@@ -15,6 +17,7 @@ import net.minecraft.network.chat.ComponentUtils;
|
@@ -19,6 +21,7 @@ import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
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; // Scissors
|
||||||
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.util.FormattedCharSequence;
|
import net.minecraft.server.network.FilteredText;
|
||||||
@@ -24,6 +27,8 @@ import net.minecraft.world.item.DyeColor;
|
@@ -32,6 +35,7 @@ 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.slf4j.Logger;
|
||||||
|
import org.bukkit.block.sign.Side;
|
||||||
|
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
|
+import org.bukkit.craftbukkit.CraftServer; // Scissors
|
||||||
+import org.bukkit.craftbukkit.entity.CraftPlayer; // Scissors
|
|
||||||
|
|
||||||
public class SignBlockEntity extends BlockEntity implements CommandSource { // CraftBukkit - implements
|
public class SignBlockEntity extends BlockEntity implements CommandSource { // CraftBukkit - implements
|
||||||
private static final boolean CONVERT_LEGACY_SIGNS = Boolean.getBoolean("convertLegacySigns"); // Paper
|
|
||||||
@@ -272,6 +277,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()), event.getMessage());
|
player.getServer().getCommands().performPrefixedCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle(), world, pos), event.getMessage());
|
||||||
// Paper end
|
// Paper end
|
||||||
+ // 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;
|
||||||
+ final CraftPlayer craftPlayer = player.getBukkitEntity();
|
+ final CraftHumanEntity craftPlayer = player.getBukkitEntity();
|
||||||
+ final Commands commands = vanillaServer.getCommands();
|
+ final Commands commands = vanillaServer.getCommands();
|
||||||
+
|
+
|
||||||
+ if (ScissorsConfig.commandSignsBypassPermissions)
|
+ if (ScissorsConfig.commandSignsBypassPermissions)
|
||||||
+ {
|
+ {
|
||||||
+ commands.performPrefixedCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle()), event.getMessage());
|
+ commands.performPrefixedCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle(), world, pos), event.getMessage());
|
||||||
+ }
|
+ }
|
||||||
+ else
|
+ else
|
||||||
+ {
|
+ {
|
||||||
+ craftServer.dispatchCommand(craftPlayer, command.substring(1));
|
+ craftServer.dispatchCommand(craftPlayer, command.substring(1));
|
||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
|
flag1 = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,10 +5,10 @@ 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 0f70be614f8f5350ad558d0ae645cdf0027e1e76..c006ac8531cf2c029fd2fac449f96736a4afed0d 100644
|
index 730d8e3cf2d9ca05b2d6219cf1856b8721871a37..63e71c5cb4ac4d17d2cfa5324fd842a0d3c61eb5 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
|
||||||
@@ -199,6 +199,7 @@ public final class CraftChatMessage {
|
@@ -198,6 +198,7 @@ public final class CraftChatMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Component[] fromString(String message, boolean keepNewlines, boolean plain) {
|
public static Component[] fromString(String message, boolean keepNewlines, boolean plain) {
|
||||||
|
@@ -1,38 +1,44 @@
|
|||||||
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: Sun, 27 Nov 2022 05:14:18 +0000
|
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 2096e8a0bdbcfc865f175f3a01ab688542481531..2ad58d4e4fd361d17803f57c3496a92bd233c857 100644
|
index c4ecc5faa4f61e7974e8c475762924a89615b377..1c14b87f84b678b36adede9d2aa9a18453ce4278 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,5 +1,6 @@
|
@@ -1,6 +1,8 @@
|
||||||
package net.minecraft.world.entity.projectile;
|
package net.minecraft.world.entity.projectile;
|
||||||
|
|
||||||
+import me.totalfreedom.scissors.MathUtility; // Scissors
|
import javax.annotation.Nullable;
|
||||||
|
+
|
||||||
|
+import me.totalfreedom.scissors.MathUtility;
|
||||||
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;
|
||||||
@@ -41,9 +42,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -47,12 +49,15 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||||
|
// CraftBukkit end
|
||||||
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
||||||
|
|
||||||
if (d6 != 0.0D) {
|
- if (d6 != 0.0D) {
|
||||||
- this.xPower = d3 / d6 * 0.1D;
|
- this.xPower = d3 / d6 * 0.1D;
|
||||||
- this.yPower = d4 / d6 * 0.1D;
|
- this.yPower = d4 / d6 * 0.1D;
|
||||||
- this.zPower = d5 / d6 * 0.1D;
|
- this.zPower = d5 / d6 * 0.1D;
|
||||||
|
+ if (d6 != 0.0D)
|
||||||
|
+ {
|
||||||
+ // Scissors start - Prevent projectile velocity freeze
|
+ // Scissors start - Prevent projectile velocity freeze
|
||||||
+ //this.xPower = d3 / d6 * 0.1D;
|
+ //this.xPower = d3 / d6 * 0.1D;
|
||||||
+ //this.yPower = d4 / d6 * 0.1D;
|
+ //this.yPower = d4 / d6 * 0.1D;
|
||||||
+ //this.zPower = d5 / d6 * 0.1D;
|
+ //this.zPower = d5 / d6 * 0.1D;
|
||||||
+
|
|
||||||
+ setPower(d3 / d6 * .1d, d4 / d6 * .1d, d5 / d6 * .1d);
|
+ setPower(d3 / d6 * .1d, d4 / d6 * .1d, d5 / d6 * .1d);
|
||||||
|
}
|
||||||
|
-
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public AbstractHurtingProjectile(EntityType<? extends AbstractHurtingProjectile> type, LivingEntity owner, double directionX, double directionY, double directionZ, Level world) {
|
||||||
@@ -141,6 +146,25 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -164,6 +169,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}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +64,7 @@ index 2096e8a0bdbcfc865f175f3a01ab688542481531..2ad58d4e4fd361d17803f57c3496a92b
|
|||||||
@Override
|
@Override
|
||||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||||
super.readAdditionalSaveData(nbt);
|
super.readAdditionalSaveData(nbt);
|
||||||
@@ -148,9 +172,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -171,9 +195,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) {
|
||||||
@@ -75,7 +81,7 @@ index 2096e8a0bdbcfc865f175f3a01ab688542481531..2ad58d4e4fd361d17803f57c3496a92b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,9 +212,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -207,9 +235,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||||
Vec3 vec3d = entity.getLookAngle();
|
Vec3 vec3d = entity.getLookAngle();
|
||||||
|
|
||||||
this.setDeltaMovement(vec3d);
|
this.setDeltaMovement(vec3d);
|
||||||
|
@@ -1,26 +1,26 @@
|
|||||||
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: Tue, 31 Jan 2023 23:16:52 +0000
|
Date: Sun, 10 Dec 2023 18:48:55 -0600
|
||||||
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..516c61cbb8299828b2f28d4564d08ae1829649b5 100644
|
index 74cf1c043beef03cfd5adf481414a5ee78bef2a6..939f4a0639c847b94cfc9acf1409a7a3fc5ae58f 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 @@
|
||||||
package net.minecraft.network.chat;
|
package net.minecraft.network.chat;
|
||||||
|
|
||||||
+import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
+import me.totalfreedom.scissors.ScissorsConfig;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
|
|
||||||
public interface OutgoingChatMessage {
|
public interface OutgoingChatMessage {
|
||||||
@@ -44,10 +45,21 @@ public interface OutgoingChatMessage {
|
@@ -44,10 +45,22 @@ 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
|
||||||
- if (!playerChatMessage.isFullyFiltered()) {
|
- if (!playerChatMessage.isFullyFiltered()) {
|
||||||
+ // Scissors start
|
+ // Sccissors start
|
||||||
+ if (!playerChatMessage.isFullyFiltered() && ScissorsConfig.chatSignaturesEnabled) {
|
+ if (!playerChatMessage.isFullyFiltered() && ScissorsConfig.chatSignaturesEnabled) {
|
||||||
sender.connection.sendPlayerChatMessage(playerChatMessage, params);
|
sender.connection.sendPlayerChatMessage(playerChatMessage, params);
|
||||||
+ return;
|
+ return;
|
||||||
@@ -35,22 +35,24 @@ index 74cf1c043beef03cfd5adf481414a5ee78bef2a6..516c61cbb8299828b2f28d4564d08ae1
|
|||||||
+ playerChatMessage.result()
|
+ 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 c0a80824a0307ea673805015119cc834b268f0dc..9f28f86b1b56ea55ab39f6ac988c1f47c5312c6c 100644
|
index 85a8a687b1568a56e3e646b37ef78b562c1b8a82..68e2edd39dcbcc9199aeaecff9b3280914ba9270 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
|
||||||
@@ -4,6 +4,7 @@ import com.mojang.logging.LogUtils;
|
@@ -5,6 +5,8 @@ import java.time.Instant;
|
||||||
import java.time.Instant;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.function.BooleanSupplier;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
+
|
||||||
|
+import me.totalfreedom.scissors.ScissorsConfig;
|
||||||
import net.minecraft.util.SignatureUpdater;
|
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;
|
||||||
@@ -41,7 +42,7 @@ public class SignedMessageChain {
|
@@ -46,7 +48,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 {
|
||||||
@@ -60,26 +62,26 @@ index c0a80824a0307ea673805015119cc834b268f0dc..9f28f86b1b56ea55ab39f6ac988c1f47
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 d428490171bb1c0209ca9a279c2b1e1e1dfcf914..9e9e299b491d9b3641a87c12f7a4ec74b17517fe 100644
|
index 889f142b6f87d4ccf4c1d2ffd379c96fbbfddd44..4bdd2e731102c7e3a312ad3144537042dce46923 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 @@
|
||||||
package net.minecraft.server.network;
|
package net.minecraft.server.network;
|
||||||
|
|
||||||
+import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
+import me.totalfreedom.scissors.ScissorsConfig;
|
||||||
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;
|
||||||
@@ -2311,7 +2312,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -2247,7 +2248,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());
|
||||||
- if (exception.shouldDisconnect()) {
|
- if (exception.shouldDisconnect()) {
|
||||||
+ if (exception.shouldDisconnect() && ScissorsConfig.chatSignaturesEnabled) { // Scissors - Do not kick when chat signatures are disabled
|
+ if (exception.shouldDisconnect() && ScissorsConfig.chatSignaturesEnabled) { // Scissors - Do not kick when chat signatures are disabled
|
||||||
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));
|
||||||
@@ -2367,6 +2368,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -2295,6 +2296,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()) {
|
||||||
@@ -87,7 +89,7 @@ index d428490171bb1c0209ca9a279c2b1e1e1dfcf914..9e9e299b491d9b3641a87c12f7a4ec74
|
|||||||
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
|
||||||
}
|
}
|
||||||
@@ -2602,6 +2604,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -2493,6 +2495,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
|
||||||
synchronized (this.lastSeenMessages) {
|
synchronized (this.lastSeenMessages) {
|
||||||
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
|
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
|
||||||
@@ -95,10 +97,10 @@ index d428490171bb1c0209ca9a279c2b1e1e1dfcf914..9e9e299b491d9b3641a87c12f7a4ec74
|
|||||||
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
|
||||||
}
|
}
|
||||||
@@ -3641,6 +3644,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -3471,6 +3474,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) {
|
public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
+ if (!ScissorsConfig.chatSignaturesEnabled) return; // Scissors
|
+ if (!ScissorsConfig.chatSignaturesEnabled) return; // Scissors
|
||||||
RemoteChatSession.Data remotechatsession_a = packet.chatSession();
|
RemoteChatSession.Data remotechatsession_a = packet.chatSession();
|
||||||
ProfilePublicKey.Data profilepublickey_a = this.chatSession != null ? this.chatSession.profilePublicKey().data() : null;
|
ProfilePublicKey.Data profilepublickey_a = this.chatSession != null ? this.chatSession.profilePublicKey().data() : null;
|
||||||
|
@@ -0,0 +1,76 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Telesphoreo <me@telesphoreo.me>
|
||||||
|
Date: Sun, 10 Dec 2023 18:57:50 -0600
|
||||||
|
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
|
||||||
|
index d87ffb5ed4550757016c2fabaa2845a6aaac74d7..7e8cf65ac53f595292d161da0735bf97081e832a 100644
|
||||||
|
--- a/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> {
|
||||||
|
|
||||||
|
public static record Doubles(Optional<Double> min, Optional<Double> max, Optional<Double> minSq, Optional<Double> maxSq) implements MinMaxBounds<Double> {
|
||||||
|
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.<Double, MinMaxBounds.Doubles>createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new); // Scissors - compile fixes
|
||||||
|
|
||||||
|
- private Doubles(Optional<Double> min, Optional<Double> max) {
|
||||||
|
+ public Doubles(Optional<Double> min, Optional<Double> max) {
|
||||||
|
this(min, max, squareOpt(min), squareOpt(max));
|
||||||
|
- }
|
||||||
|
+ } // Scissors - private -> public
|
||||||
|
|
||||||
|
private static MinMaxBounds.Doubles create(StringReader reader, Optional<Double> min, Optional<Double> max) throws CommandSyntaxException {
|
||||||
|
if (min.isPresent() && max.isPresent() && min.get() > max.get()) {
|
||||||
|
@@ -188,7 +188,7 @@ public interface MinMaxBounds<T extends Number> {
|
||||||
|
|
||||||
|
public static record Ints(Optional<Integer> min, Optional<Integer> max, Optional<Long> minSq, Optional<Long> maxSq) implements MinMaxBounds<Integer> {
|
||||||
|
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.<Integer, MinMaxBounds.Ints>createCodec(Codec.INT, MinMaxBounds.Ints::new); // Scissors - compile fixes
|
||||||
|
|
||||||
|
private Ints(Optional<Integer> min, Optional<Integer> max) {
|
||||||
|
this(min, max, min.map((i) -> {
|
||||||
|
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
|
||||||
|
--- a/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;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
+
|
||||||
|
+import me.totalfreedom.scissors.MathUtility;
|
||||||
|
import net.minecraft.advancements.critereon.MinMaxBounds;
|
||||||
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
|
import net.minecraft.commands.arguments.EntityArgument;
|
||||||
|
@@ -60,9 +62,26 @@ public class EntitySelector {
|
||||||
|
this.includesEntities = includesNonPlayers;
|
||||||
|
this.worldLimited = localWorldOnly;
|
||||||
|
this.predicate = basePredicate;
|
||||||
|
- this.range = distance;
|
||||||
|
+ // Scissors start - Patch large selector distance crash
|
||||||
|
+ this.range = new MinMaxBounds.Doubles(
|
||||||
|
+ distance.min().map(min -> Math.min(min, 1024)),
|
||||||
|
+ distance.max().map(max -> Math.min(max, 1024))
|
||||||
|
+ );
|
||||||
|
this.position = positionOffset;
|
||||||
|
- this.aabb = box;
|
||||||
|
+ if (box != null) {
|
||||||
|
+ this.aabb = new AABB(
|
||||||
|
+ MathUtility.clampDouble(box.minX, -1024, 1025),
|
||||||
|
+ MathUtility.clampDouble(box.minY, -1024, 1025),
|
||||||
|
+ MathUtility.clampDouble(box.minZ, -1024, 1025),
|
||||||
|
+ MathUtility.clampDouble(box.maxX, -1024, 1025),
|
||||||
|
+ MathUtility.clampDouble(box.maxY, -1024, 1025),
|
||||||
|
+ MathUtility.clampDouble(box.maxZ, -1024, 1025),
|
||||||
|
+ false
|
||||||
|
+ );
|
||||||
|
+ } else {
|
||||||
|
+ this.aabb = null;
|
||||||
|
+ }
|
||||||
|
+ // Scissors end
|
||||||
|
this.order = sorter;
|
||||||
|
this.currentEntity = senderOnly;
|
||||||
|
this.playerName = playerName;
|
@@ -5,19 +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 ade4ed2f219d32050a372283eaebe75f9014ec78..88d119605eba1b59fad431d94882f054f0074b80 100644
|
index 2e11d0f17fc8fa4ed84c40dd9747e136675030a4..acd0dcf69a23ec6dda8e58621b8634076ba8eec1 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
|
||||||
@@ -4482,7 +4482,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
@@ -4745,7 +4745,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||||
|
|
||||||
public void setYRot(float yaw) {
|
|
||||||
if (!Float.isFinite(yaw)) {
|
|
||||||
- Util.logAndPauseIfInIde("Invalid entity rotation: " + yaw + ", discarding.");
|
|
||||||
+ // Scissors - Patch invalid entity rotation log spam
|
|
||||||
} else {
|
|
||||||
this.yRot = yaw;
|
|
||||||
}
|
|
||||||
@@ -4494,7 +4494,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
||||||
|
|
||||||
public void setXRot(float pitch) {
|
public void setXRot(float pitch) {
|
||||||
if (!Float.isFinite(pitch)) {
|
if (!Float.isFinite(pitch)) {
|
@@ -1,61 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Luna <lunahatesgogle@gmail.com>
|
|
||||||
Date: Sun, 2 Apr 2023 16:29:51 -0300
|
|
||||||
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
|
|
||||||
index 60d32afe2eecdfebdc91531ca3672f8f130ac30e..73b0f516f80ef810379860ea74697a3429c646e5 100644
|
|
||||||
--- a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
|
||||||
+++ b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
|
||||||
@@ -177,7 +177,7 @@ public abstract class MinMaxBounds<T extends Number> {
|
|
||||||
return value == null ? null : value * value;
|
|
||||||
}
|
|
||||||
|
|
||||||
- private Doubles(@Nullable Double min, @Nullable Double max) {
|
|
||||||
+ public Doubles(@Nullable Double min, @Nullable Double max) { // Scissors - private -> public
|
|
||||||
super(min, max);
|
|
||||||
this.minSq = squareOpt(min);
|
|
||||||
this.maxSq = 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
|
|
||||||
index f25b9330e068c7d9e12cb57a7761cfef9ebaf7bc..e8cf963f0190438bbf65f827d144775ab0b02b63 100644
|
|
||||||
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
|
||||||
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
|
||||||
@@ -10,6 +10,7 @@ import java.util.function.BiConsumer;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
+import me.totalfreedom.scissors.MathUtility; // Scissors
|
|
||||||
import net.minecraft.advancements.critereon.MinMaxBounds;
|
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
|
||||||
import net.minecraft.commands.arguments.EntityArgument;
|
|
||||||
@@ -60,9 +61,27 @@ public class EntitySelector {
|
|
||||||
this.includesEntities = includesNonPlayers;
|
|
||||||
this.worldLimited = localWorldOnly;
|
|
||||||
this.predicate = basePredicate;
|
|
||||||
- this.range = distance;
|
|
||||||
+
|
|
||||||
+ // Scissors start - Patch large selector distance crash
|
|
||||||
+ this.range = new MinMaxBounds.Doubles(
|
|
||||||
+ distance.getMin() != null ? Math.min(distance.getMin(), 1024) : null,
|
|
||||||
+ distance.getMax() != null ? Math.min(distance.getMax(), 1024) : null
|
|
||||||
+ );
|
|
||||||
this.position = positionOffset;
|
|
||||||
- this.aabb = box;
|
|
||||||
+ if (box != null) {
|
|
||||||
+ this.aabb = new AABB(
|
|
||||||
+ MathUtility.clampDouble(box.minX, -1024, 1025),
|
|
||||||
+ MathUtility.clampDouble(box.minY, -1024, 1025),
|
|
||||||
+ MathUtility.clampDouble(box.minZ, -1024, 1025),
|
|
||||||
+ MathUtility.clampDouble(box.maxX, -1024, 1025),
|
|
||||||
+ MathUtility.clampDouble(box.maxY, -1024, 1025),
|
|
||||||
+ MathUtility.clampDouble(box.maxZ, -1024, 1025),
|
|
||||||
+ false
|
|
||||||
+ );
|
|
||||||
+ } else {
|
|
||||||
+ this.aabb = null;
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
this.order = sorter;
|
|
||||||
this.currentEntity = senderOnly;
|
|
||||||
this.playerName = playerName;
|
|
@@ -5,14 +5,15 @@ Subject: [PATCH] Limit sculk catalyst cursor positions
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/SculkSpreader.java b/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/SculkSpreader.java b/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
||||||
index ab732f0e52ef3c3d3be6ddc827d693fe294e4167..9785f2d8c94552b4a1139fa6d936fdaa61e5827c 100644
|
index 01e13e6d3ebd84cff0019f56efff16747420dc95..d4058bc31ca291cbc95eeef594fc35e1ff6a3dde 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
--- a/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
+++ b/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
||||||
@@ -141,6 +141,7 @@ public class SculkSpreader {
|
@@ -181,7 +181,7 @@ public class SculkSpreader {
|
||||||
Object2IntMap<BlockPos> object2IntMap = new Object2IntOpenHashMap<>();
|
|
||||||
|
|
||||||
for(SculkSpreader.ChargeCursor chargeCursor : this.cursors) {
|
while (iterator.hasNext()) {
|
||||||
+ if (!world.getMinecraftWorld().isLoadedAndInBounds(chargeCursor.getPos())) continue; // Scissors
|
SculkSpreader.ChargeCursor sculkspreader_a = (SculkSpreader.ChargeCursor) iterator.next();
|
||||||
chargeCursor.update(world, pos, random, this, shouldConvertToBlock);
|
-
|
||||||
if (chargeCursor.charge <= 0) {
|
+ if (!world.getMinecraftWorld().isLoadedAndInBounds(sculkspreader_a.getPos())) continue; // Scissors
|
||||||
world.levelEvent(3006, chargeCursor.getPos(), 0);
|
sculkspreader_a.update(world, pos, random, this, shouldConvertToBlock);
|
||||||
|
if (sculkspreader_a.charge <= 0) {
|
||||||
|
world.levelEvent(3006, sculkspreader_a.getPos(), 0);
|
||||||
|
@@ -4,35 +4,25 @@ Date: Fri, 28 Apr 2023 16:29:23 -0300
|
|||||||
Subject: [PATCH] Limit map decorations
|
Subject: [PATCH] Limit map decorations
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.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 347d2914f9560a3ee8cea59444bc0dfbb7cf3456..b6a38b1458957bd444fea439fa81d2976ffb86e0 100644
|
index 17343d515044f3678b4edf070ee7ca244adc4228..8ade519114bec879bed8e8e23707a85327da131b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||||
@@ -2,6 +2,7 @@ package net.minecraft.world.level.saveddata.maps;
|
@@ -65,7 +65,8 @@ public class ClientboundMapItemDataPacket implements Packet<ClientGamePacketList
|
||||||
|
b.writeByte(icon.x());
|
||||||
import java.util.Objects;
|
b.writeByte(icon.y());
|
||||||
import javax.annotation.Nullable;
|
b.writeByte(icon.rot() & 15);
|
||||||
+import net.minecraft.ChatFormatting; // Scissors
|
- b.writeNullable(icon.name(), FriendlyByteBuf::writeComponent);
|
||||||
import net.minecraft.network.chat.Component;
|
+ final boolean passedNameCap = icon.name() == null || icon.name().getString().length() <= 32; // Scissors
|
||||||
import net.minecraft.util.Mth;
|
+ b.writeNullable(passedNameCap ? icon.name() : null, FriendlyByteBuf::writeComponent); // Scissors
|
||||||
|
});
|
||||||
@@ -14,6 +15,11 @@ public class MapDecoration {
|
});
|
||||||
private final Component name;
|
if (this.colorPatch != null) {
|
||||||
|
|
||||||
public MapDecoration(MapDecoration.Type type, byte x, byte z, byte rotation, @Nullable Component text) {
|
|
||||||
+ // Scissors start - Limit decoration text length
|
|
||||||
+ if (text != null && text.getString().length() > 32) {
|
|
||||||
+ text = null;
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
this.type = type;
|
|
||||||
this.x = x;
|
|
||||||
this.y = z;
|
|
||||||
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 25a64250ce57fe4cd90f8b95d1e003d961662152..65c2b553711e9f9ded87a422c4a0aacd7de8d8c1 100644
|
index e4c4948e076cd64686dfd16ae0568fafc1437140..eff53c21b18574750b691b784fb1688885d4ace7 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
|
||||||
@@ -356,6 +356,11 @@ public class MapItemSavedData extends SavedData {
|
@@ -361,6 +361,11 @@ public class MapItemSavedData extends SavedData {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addDecoration(MapDecoration.Type type, @Nullable LevelAccessor world, String key, double x, double z, double rotation, @Nullable Component text) {
|
private void addDecoration(MapDecoration.Type type, @Nullable LevelAccessor world, String key, double x, double z, double rotation, @Nullable Component text) {
|
||||||
|
@@ -5,15 +5,14 @@ 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 45804711255f04110e9509df8d60900314aa10b7..b1fd209b2893d2d6bfc2ae552c7919ab8abda695 100644
|
index ca309311928654ca7e971e98114d7c16d8341a55..4d3faab706e04c1ad495a59e6523524730a48f70 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
|
||||||
@@ -1468,7 +1468,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1693,7 +1693,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().toString());
|
ServerLevel.LOGGER.warn("Force-added player with duplicate UUID {}", player.getUUID());
|
||||||
entity.unRide();
|
entity.unRide();
|
||||||
- this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED);
|
- this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED);
|
||||||
+
|
|
||||||
+ // Scissors start - Prevent player banning using duplicate UUIDs
|
+ // Scissors start - Prevent player banning using duplicate UUIDs
|
||||||
+ if (entity instanceof ServerPlayer serverPlayer) {
|
+ if (entity instanceof ServerPlayer serverPlayer) {
|
||||||
+ this.removePlayerImmediately(serverPlayer, Entity.RemovalReason.DISCARDED);
|
+ this.removePlayerImmediately(serverPlayer, Entity.RemovalReason.DISCARDED);
|
||||||
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't warn on duplicate entity UUIDs
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
diff --git a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||||
index 61c170555c8854b102c640b0b6a615f9f732edbf..29f46a137584a5f52f3c30b4c352d58ca61488a3 100644
|
index 15ee41452992714108efe53b708b5a4e1da7c1ff..5054dce35127cb0132431021578c345fcbb1f92a 100644
|
||||||
--- a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
--- a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||||
+++ b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
+++ b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||||
@@ -366,7 +366,7 @@ public final class EntityLookup implements LevelEntityGetter<Entity> {
|
@@ -415,7 +415,7 @@ public final class EntityLookup implements LevelEntityGetter<Entity> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.entityByUUID.containsKey(entity.getUUID())) {
|
if (this.entityByUUID.containsKey(entity.getUUID())) {
|
||||||
|
@@ -1,18 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Luna <lunahatesgogle@gmail.com>
|
|
||||||
Date: Mon, 29 May 2023 19:34:50 -0300
|
|
||||||
Subject: [PATCH] Fix component extra empty array exploit
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
|
||||||
index 2873ed7c443ed8c8c57a8b1d3e444d229f10f07b..a2149452ee461002ea74189c5aa49cddd943d0cf 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
|
||||||
@@ -266,6 +266,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
if (!jsonelement.isJsonObject()) {
|
|
||||||
if (jsonelement.isJsonArray()) {
|
|
||||||
JsonArray jsonarray = jsonelement.getAsJsonArray();
|
|
||||||
+ if (jsonarray.size() <= 0) throw new JsonParseException("Unexpected empty array of components"); // Scissors
|
|
||||||
|
|
||||||
ichatmutablecomponent = null;
|
|
||||||
Iterator iterator = jsonarray.iterator();
|
|
@@ -1,6 +1,6 @@
|
|||||||
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 20:55:18 +0100
|
Date: Mon, 11 Dec 2023 12:27:44 -0600
|
||||||
Subject: [PATCH] Implement command block events
|
Subject: [PATCH] Implement command block events
|
||||||
|
|
||||||
|
|
||||||
@@ -18,41 +18,41 @@ 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 8274514733caf0fb3c3db5836a3ab9bd204c4378..ca6b809f56cf4d28d5a6514c18322419c8184f30 100644
|
index 4bdd2e731102c7e3a312ad3144537042dce46923..1f7dc235f8cf848d740ef6a8cf879d253b56c1c8 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 @@
|
||||||
package net.minecraft.server.network;
|
package net.minecraft.server.network;
|
||||||
|
|
||||||
import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
import me.totalfreedom.scissors.ScissorsConfig;
|
||||||
+import me.totalfreedom.scissors.event.block.CommandBlockPlayerEditEvent; // Scissors
|
+import me.totalfreedom.scissors.event.block.CommandBlockPlayerEditEvent;
|
||||||
+import me.totalfreedom.scissors.event.block.CommandMinecartPlayerEditEvent; // Scissors
|
+import me.totalfreedom.scissors.event.block.CommandMinecartPlayerEditEvent;
|
||||||
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;
|
||||||
@@ -159,6 +161,7 @@ import net.minecraft.world.entity.player.Inventory;
|
@@ -155,6 +157,7 @@ import net.minecraft.world.entity.player.Inventory;
|
||||||
import net.minecraft.world.entity.player.ProfilePublicKey;
|
import net.minecraft.world.entity.player.ProfilePublicKey;
|
||||||
import net.minecraft.world.entity.projectile.AbstractArrow;
|
import net.minecraft.world.entity.projectile.AbstractArrow;
|
||||||
import net.minecraft.world.entity.vehicle.Boat;
|
import net.minecraft.world.entity.vehicle.Boat;
|
||||||
+import net.minecraft.world.entity.vehicle.MinecartCommandBlock; // Scissors
|
+import net.minecraft.world.entity.vehicle.MinecartCommandBlock;
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||||
import net.minecraft.world.item.BucketItem;
|
import net.minecraft.world.inventory.AnvilMenu;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.inventory.BeaconMenu;
|
||||||
@@ -187,6 +190,8 @@ import net.minecraft.world.phys.Vec3;
|
@@ -189,6 +192,8 @@ import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraft.world.phys.shapes.BooleanOp;
|
import net.minecraft.world.phys.shapes.BooleanOp;
|
||||||
import net.minecraft.world.phys.shapes.Shapes;
|
import net.minecraft.world.phys.shapes.Shapes;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
+import org.bukkit.craftbukkit.block.CraftCommandBlock; // Scissors
|
+import org.bukkit.craftbukkit.block.CraftCommandBlock;
|
||||||
+import org.bukkit.craftbukkit.entity.CraftMinecartCommand; // Scissors
|
+import org.bukkit.craftbukkit.entity.CraftMinecartCommand;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -993,6 +998,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -894,6 +899,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
this.player.level.getChunkAt(blockposition).setBlockEntity(tileentity);
|
this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Scissors start
|
+ // Scissors start
|
||||||
+ CommandBlockPlayerEditEvent event = new CommandBlockPlayerEditEvent(this.getCraftPlayer(), commandblocklistenerabstract.getCommand(), s, new CraftCommandBlock(this.player.level.getWorld(), tileentitycommand));
|
+ CommandBlockPlayerEditEvent event = new CommandBlockPlayerEditEvent(this.getCraftPlayer(), commandblocklistenerabstract.getCommand(), s, new CraftCommandBlock(this.player.level().getWorld(), tileentitycommand));
|
||||||
+
|
+
|
||||||
+ if (!event.callEvent()) {
|
+ if (!event.callEvent()) {
|
||||||
+ return;
|
+ return;
|
||||||
@@ -64,14 +64,14 @@ index 8274514733caf0fb3c3db5836a3ab9bd204c4378..ca6b809f56cf4d28d5a6514c18322419
|
|||||||
commandblocklistenerabstract.setCommand(s);
|
commandblocklistenerabstract.setCommand(s);
|
||||||
commandblocklistenerabstract.setTrackOutput(flag);
|
commandblocklistenerabstract.setTrackOutput(flag);
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
@@ -1024,7 +1039,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -925,7 +940,18 @@ 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) {
|
||||||
- commandblocklistenerabstract.setCommand(packet.getCommand());
|
- commandblocklistenerabstract.setCommand(packet.getCommand());
|
||||||
+ // Scissors start - Implement command block events
|
+ // Scissors start - Implement command block events
|
||||||
+ String command = packet.getCommand();
|
+ String command = packet.getCommand();
|
||||||
+ CommandMinecartPlayerEditEvent event = new CommandMinecartPlayerEditEvent(this.getCraftPlayer(), commandblocklistenerabstract.getCommand(), command, new CraftMinecartCommand(this.cserver, (MinecartCommandBlock) this.player.level.getEntity(packet.entity)));
|
+ CommandMinecartPlayerEditEvent event = new CommandMinecartPlayerEditEvent(this.getCraftPlayer(), commandblocklistenerabstract.getCommand(), command, new CraftMinecartCommand(this.cserver, (MinecartCommandBlock) this.player.level().getEntity(packet.entity)));
|
||||||
+
|
+
|
||||||
+ if (!event.callEvent()) {
|
+ if (!event.callEvent()) {
|
||||||
+ return;
|
+ return;
|
@@ -1,125 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Luna <lunahatesgogle@gmail.com>
|
|
||||||
Date: Wed, 31 May 2023 18:14:00 -0300
|
|
||||||
Subject: [PATCH] Add depth limit to Component deserializer
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
|
||||||
index a2149452ee461002ea74189c5aa49cddd943d0cf..f1d1501211a923c0ccab6b5982887c3a9262889b 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
|
||||||
@@ -26,6 +26,7 @@ import java.util.List;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Optional;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
+import me.totalfreedom.scissors.ScissorsConfig; // Scissors
|
|
||||||
import net.minecraft.ChatFormatting; // Scissors
|
|
||||||
import net.minecraft.Util;
|
|
||||||
import net.minecraft.network.chat.contents.BlockDataSource;
|
|
||||||
@@ -44,6 +45,7 @@ import net.minecraft.util.GsonHelper;
|
|
||||||
import net.minecraft.util.LowerCaseEnumTypeAdapterFactory;
|
|
||||||
// CraftBukkit start
|
|
||||||
import com.google.common.collect.Streams;
|
|
||||||
+import java.util.regex.Pattern; // Scissors
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
@@ -254,10 +256,16 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
throw new IllegalStateException("Couldn't get field 'lineStart' for JsonReader", nosuchfieldexception);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
+ private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("%[0-9]+\\$s"); // Scissors
|
|
||||||
|
|
||||||
public Serializer() {}
|
|
||||||
|
|
||||||
- public MutableComponent deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
|
|
||||||
+ // Scissors start
|
|
||||||
+ private MutableComponent deserialize(JsonElement jsonelement, JsonDeserializationContext jsondeserializationcontext, int depth) throws JsonParseException {
|
|
||||||
+ if (depth > ScissorsConfig.componentDepthLimit) {
|
|
||||||
+ throw new JsonParseException("Depth limit exceeded");
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
if (jsonelement.isJsonPrimitive()) {
|
|
||||||
return Component.literal(jsonelement.getAsString());
|
|
||||||
} else {
|
|
||||||
@@ -273,7 +281,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
JsonElement jsonelement1 = (JsonElement) iterator.next();
|
|
||||||
- MutableComponent ichatmutablecomponent1 = this.deserialize(jsonelement1, jsonelement1.getClass(), jsondeserializationcontext);
|
|
||||||
+ MutableComponent ichatmutablecomponent1 = this.deserialize(jsonelement1, jsondeserializationcontext, depth + 1); // Scissors
|
|
||||||
|
|
||||||
if (ichatmutablecomponent == null) {
|
|
||||||
ichatmutablecomponent = ichatmutablecomponent1;
|
|
||||||
@@ -297,12 +305,17 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
s = GsonHelper.getAsString(jsonobject, "translate");
|
|
||||||
String s1 = GsonHelper.getAsString(jsonobject, "fallback", (String) null);
|
|
||||||
|
|
||||||
+ // Scissors start - Penalize depth for placeholders in translate & fallback
|
|
||||||
+ long translate_placeholders = PLACEHOLDER_PATTERN.matcher(s).results().count();
|
|
||||||
+ long fallback_placeholders = s1 != null ? PLACEHOLDER_PATTERN.matcher(s1).results().count() : 0;
|
|
||||||
+ int penalty = (int)Math.max(translate_placeholders, fallback_placeholders) * 12;
|
|
||||||
+ // Scissors end
|
|
||||||
if (jsonobject.has("with")) {
|
|
||||||
JsonArray jsonarray1 = GsonHelper.getAsJsonArray(jsonobject, "with");
|
|
||||||
Object[] aobject = new Object[jsonarray1.size()];
|
|
||||||
|
|
||||||
for (int i = 0; i < aobject.length; ++i) {
|
|
||||||
- aobject[i] = Serializer.unwrapTextArgument(this.deserialize(jsonarray1.get(i), type, jsondeserializationcontext));
|
|
||||||
+ aobject[i] = Serializer.unwrapTextArgument(this.deserialize(jsonarray1.get(i), jsondeserializationcontext, depth + 1 + penalty)); // Scissors
|
|
||||||
}
|
|
||||||
|
|
||||||
ichatmutablecomponent = Component.translatableWithFallback(s, s1, aobject);
|
|
||||||
@@ -318,7 +331,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
|
|
||||||
ichatmutablecomponent = Component.score(GsonHelper.getAsString(jsonobject1, "name"), GsonHelper.getAsString(jsonobject1, "objective"));
|
|
||||||
} else if (jsonobject.has("selector")) {
|
|
||||||
- Optional<Component> optional = this.parseSeparator(type, jsondeserializationcontext, jsonobject);
|
|
||||||
+ Optional<Component> optional = this.parseSeparator(jsondeserializationcontext, jsonobject, depth + 1); // Scissors
|
|
||||||
|
|
||||||
ichatmutablecomponent = Component.selector(GsonHelper.getAsString(jsonobject, "selector"), optional);
|
|
||||||
} else if (jsonobject.has("keybind")) {
|
|
||||||
@@ -329,7 +342,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
}
|
|
||||||
|
|
||||||
s = GsonHelper.getAsString(jsonobject, "nbt");
|
|
||||||
- Optional<Component> optional1 = this.parseSeparator(type, jsondeserializationcontext, jsonobject);
|
|
||||||
+ Optional<Component> optional1 = this.parseSeparator(jsondeserializationcontext, jsonobject, depth + 1); // Scissors
|
|
||||||
boolean flag = GsonHelper.getAsBoolean(jsonobject, "interpret", false);
|
|
||||||
Object object;
|
|
||||||
|
|
||||||
@@ -356,7 +369,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int j = 0; j < jsonarray2.size(); ++j) {
|
|
||||||
- ichatmutablecomponent.append((Component) this.deserialize(jsonarray2.get(j), type, jsondeserializationcontext));
|
|
||||||
+ ichatmutablecomponent.append((Component) this.deserialize(jsonarray2.get(j), jsondeserializationcontext, depth + 1)); // Scissors
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -366,6 +379,12 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Scissors start
|
|
||||||
+ public MutableComponent deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
|
|
||||||
+ return this.deserialize(jsonelement, jsondeserializationcontext, 1);
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
+
|
|
||||||
private static Object unwrapTextArgument(Object text) {
|
|
||||||
if (text instanceof Component) {
|
|
||||||
Component ichatbasecomponent = (Component) text;
|
|
||||||
@@ -384,8 +403,10 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
|
||||||
return text;
|
|
||||||
}
|
|
||||||
|
|
||||||
- private Optional<Component> parseSeparator(Type type, JsonDeserializationContext context, JsonObject json) {
|
|
||||||
- return json.has("separator") ? Optional.of(this.deserialize(json.get("separator"), type, context)) : Optional.empty();
|
|
||||||
+ // Scissors start
|
|
||||||
+ private Optional<Component> parseSeparator(JsonDeserializationContext context, JsonObject json, int depth) {
|
|
||||||
+ return json.has("separator") ? Optional.of(this.deserialize(json.get("separator"), context, depth + 1)) : Optional.empty();
|
|
||||||
+ // Scissors end
|
|
||||||
}
|
|
||||||
|
|
||||||
private void serializeStyle(Style style, JsonObject json, JsonSerializationContext context) {
|
|
@@ -5,18 +5,17 @@ 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 fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..426425e38698b06d46c5e6a41b39d362176a4ee3 100644
|
index 5bec54239a2b185284c10d58854e5a13e33daae5..f112d82b0a9e5513395fa7c1b05d1fe9e28c64ca 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
|
||||||
@@ -169,8 +169,56 @@ public class TagParser {
|
@@ -179,9 +179,56 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.expect('}');
|
this.expect('}');
|
||||||
- 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
|
||||||
+ }
|
}
|
||||||
+
|
|
||||||
+ // Scissors start - Add depth limit to SNBT
|
+ // Scissors start - Add depth limit to SNBT
|
||||||
+ private boolean exceedsDepthLimit(Tag tag) {
|
+ private boolean exceedsDepthLimit(Tag tag) {
|
||||||
+ return this.exceedsDepthLimit(0, tag);
|
+ return this.exceedsDepthLimit(0, tag);
|
||||||
@@ -61,12 +60,13 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..426425e38698b06d46c5e6a41b39d362
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return false;
|
+ return false;
|
||||||
}
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
|
+
|
||||||
private Tag readListTag() throws CommandSyntaxException {
|
private Tag readListTag() throws CommandSyntaxException {
|
||||||
this.expect('[');
|
this.expect('[');
|
||||||
@@ -203,7 +251,7 @@ public class TagParser {
|
this.reader.skipWhitespace();
|
||||||
|
@@ -213,7 +260,7 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.expect(']');
|
this.expect(']');
|
||||||
@@ -75,7 +75,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..426425e38698b06d46c5e6a41b39d362
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +276,7 @@ public class TagParser {
|
@@ -238,7 +285,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 {
|
||||||
@@ -84,7 +84,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..426425e38698b06d46c5e6a41b39d362
|
|||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
if (this.reader.peek() != ']') {
|
if (this.reader.peek() != ']') {
|
||||||
@@ -241,11 +289,11 @@ public class TagParser {
|
@@ -251,11 +298,11 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeReader == ByteTag.TYPE) {
|
if (typeReader == ByteTag.TYPE) {
|
||||||
@@ -99,7 +99,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..426425e38698b06d46c5e6a41b39d362
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasElementSeparator()) {
|
if (this.hasElementSeparator()) {
|
||||||
@@ -257,7 +305,7 @@ public class TagParser {
|
@@ -267,7 +314,7 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.expect(']');
|
this.expect(']');
|
@@ -5,10 +5,10 @@ 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 ef740d1ad6352ca4af299001a081b720bc472d2e..63c569e05a86a590021ae6828918e5c5fce7b637 100644
|
index f13943db6f2fb923c52dcf9e8bf7000041d0a362..2fdcc47dd6a813d5f7a32dc58ca67b6b965c8749 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
|
||||||
@@ -83,7 +83,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
@@ -87,7 +87,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||||
private double effectRange = -1;
|
private double effectRange = -1;
|
||||||
|
|
||||||
public double getEffectRange() {
|
public double getEffectRange() {
|
||||||
@@ -17,7 +17,7 @@ index ef740d1ad6352ca4af299001a081b720bc472d2e..63c569e05a86a590021ae6828918e5c5
|
|||||||
return this.levels * 10 + 10;
|
return this.levels * 10 + 10;
|
||||||
} else {
|
} else {
|
||||||
return effectRange;
|
return effectRange;
|
||||||
@@ -415,6 +415,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
|
@@ -5,7 +5,7 @@ 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 b1c594dc6a6b8a6c737b99272acab9e7dbd0ed63..1cc2e5a82652838b29a2e935d4284e5cc134724e 100644
|
index 598dc0d3a2b9387e76d7e4e19e54c4573a24bc54..9eed28bf8bc7e2fa528729cde01a535bc7040815 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 {
|
@@ -56,7 +56,7 @@ public class CollectingNeighborUpdater implements NeighborUpdater {
|
@@ -5,42 +5,42 @@ 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 ca6b809f56cf4d28d5a6514c18322419c8184f30..6bbf1a5620a5ab52add56b9fcf9ce92288498dab 100644
|
index 1f7dc235f8cf848d740ef6a8cf879d253b56c1c8..2ef6fd0fadaf6b912c4f242210c1ce2756ccddd7 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
|
||||||
@@ -958,7 +958,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -859,7 +859,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"));
|
||||||
- } else {
|
- } else {
|
||||||
+ } else if (this.player.level.isLoadedAndInBounds(packet.getPos())) { // Scissors
|
+ } else if (this.player.level().isLoadedAndInBounds(packet.getPos())) { // Scissors
|
||||||
BaseCommandBlock commandblocklistenerabstract = null;
|
BaseCommandBlock commandblocklistenerabstract = null;
|
||||||
CommandBlockEntity tileentitycommand = null;
|
CommandBlockEntity tileentitycommand = null;
|
||||||
BlockPos blockposition = packet.getPos();
|
BlockPos blockposition = packet.getPos();
|
||||||
@@ -1122,7 +1122,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1026,7 +1026,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
- if (this.player.canUseGameMasterBlocks()) {
|
- if (this.player.canUseGameMasterBlocks()) {
|
||||||
+ if (this.player.canUseGameMasterBlocks() && this.player.level.isLoadedAndInBounds(packet.getPos())) { // Scissors
|
+ if (this.player.canUseGameMasterBlocks() && this.player.level().isLoadedAndInBounds(packet.getPos())) { // Scissors
|
||||||
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);
|
||||||
@@ -1180,7 +1180,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1084,7 +1084,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
- if (this.player.canUseGameMasterBlocks()) {
|
- if (this.player.canUseGameMasterBlocks()) {
|
||||||
+ if (this.player.canUseGameMasterBlocks() && this.player.level.isLoadedAndInBounds(packet.getPos())) { // Scissors
|
+ if (this.player.canUseGameMasterBlocks() && this.player.level().isLoadedAndInBounds(packet.getPos())) { // Scissors
|
||||||
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);
|
||||||
@@ -1203,7 +1203,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1109,7 +1109,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
- if (this.player.canUseGameMasterBlocks()) {
|
- if (this.player.canUseGameMasterBlocks()) {
|
||||||
+ if (this.player.canUseGameMasterBlocks() && this.player.level.isLoadedAndInBounds(packet.getPos())) { // Scissors
|
+ if (this.player.canUseGameMasterBlocks() && this.player.level().isLoadedAndInBounds(packet.getPos())) { // Scissors
|
||||||
BlockPos blockposition = packet.getPos();
|
BlockPos blockposition = packet.getPos();
|
||||||
BlockEntity tileentity = this.player.level.getBlockEntity(blockposition);
|
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
||||||
|
|
@@ -5,10 +5,10 @@ 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 c33e5c51839c8e6ec04c1b302127d2bf0f48664c..c59094fbcb772ec9d671d02f38c2214cb0c94990 100644
|
index a87a34b0c4c8e5d0cf079025c230b1434c919b54..7cbcbbed6ec45a32bbfe8118bf186c6580f065ca 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
|
||||||
@@ -223,8 +223,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
@@ -234,8 +234,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
@Override
|
@Override
|
||||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||||
this.hivePos = null;
|
this.hivePos = null;
|
||||||
@@ -18,13 +18,13 @@ index c33e5c51839c8e6ec04c1b302127d2bf0f48664c..c59094fbcb772ec9d671d02f38c2214c
|
|||||||
+ {
|
+ {
|
||||||
+ // Scissors start - Limit HivePos
|
+ // Scissors start - Limit HivePos
|
||||||
+ final BlockPos savedHivePos = NbtUtils.readBlockPos(nbt.getCompound("HivePos"));
|
+ final BlockPos savedHivePos = NbtUtils.readBlockPos(nbt.getCompound("HivePos"));
|
||||||
+ this.hivePos = this.level.isLoadedAndInBounds(savedHivePos) ? savedHivePos : null;
|
+ this.hivePos = this.level().isLoadedAndInBounds(savedHivePos) ? savedHivePos : null;
|
||||||
+ // Scissors end - Limit HivePos
|
+ // Scissors end - Limit HivePos
|
||||||
}
|
}
|
||||||
|
|
||||||
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 bb5c2f90bef5e3c57ffde996853e122d108b2789..4505af9d995df1ed2912814249bc336127be4f06 100644
|
index 30ea3f64234fd1fda8dada3c7fb12be0730322a8..b621b9a50047c5283b259d67019989ec823576e0 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 {
|
||||||
@@ -37,7 +37,7 @@ index bb5c2f90bef5e3c57ffde996853e122d108b2789..4505af9d995df1ed2912814249bc3361
|
|||||||
+ {
|
+ {
|
||||||
+ // Scissors start - Limit Vex bound origin
|
+ // Scissors start - Limit Vex bound origin
|
||||||
+ final BlockPos savedBoundOrigin = new BlockPos(nbt.getInt("BoundX"), nbt.getInt("BoundY"), nbt.getInt("BoundZ"));
|
+ final BlockPos savedBoundOrigin = new BlockPos(nbt.getInt("BoundX"), nbt.getInt("BoundY"), nbt.getInt("BoundZ"));
|
||||||
+ this.boundOrigin = this.level.isLoadedAndInBounds(savedBoundOrigin) ? savedBoundOrigin : null;
|
+ this.boundOrigin = this.level().isLoadedAndInBounds(savedBoundOrigin) ? savedBoundOrigin : null;
|
||||||
+ // Scissors end - Limit Vex bound origin
|
+ // Scissors end - Limit Vex bound origin
|
||||||
}
|
}
|
||||||
|
|
@@ -5,10 +5,10 @@ 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 dd1102d5291ef6f18e82400a6d8a0a376cc071e9..d304612325d6c70a4100582d6c0fbfeecd8716d1 100644
|
index 7204b973c3ad9239e82355513f6d538107102e48..2463444778f19f937b18173798c04d9d9788a824 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
|
||||||
@@ -145,7 +145,7 @@ public class AttributeMap {
|
@@ -147,7 +147,7 @@ public class AttributeMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
}, () -> {
|
}, () -> {
|
||||||
@@ -18,10 +18,10 @@ index dd1102d5291ef6f18e82400a6d8a0a376cc071e9..d304612325d6c70a4100582d6c0fbfee
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 8de09eea46c27db9d8c472e84f768976769d1b0b..c8d05d35368e0cf593bcc3589b6c108a901bdc22 100644
|
index 1b0db545f93b51368c2d384dd1ba45b93d9eff87..5c3633aa6a256a197502c8139cbf61c2f493bda7 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
|
||||||
@@ -90,7 +90,7 @@ public class AttributeModifier {
|
@@ -86,7 +86,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) {
|
@@ -18,7 +18,7 @@ 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 c2a14305cb737fbc6447c555d8a15e2d3977e3fa..402663c4ffca762df0bfb245e0d5a1ea42ef2150 100644
|
index a3456b35db4e938f91d6bc32d4d202a011bf13c4..aad0b066e4fd63195aa117c5a03f64846bf46fbd 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 {
|
@@ -32,7 +32,7 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance {
|
@@ -0,0 +1,19 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Allink <arclicious@vivaldi.net>
|
||||||
|
Date: Fri, 25 Aug 2023 11:51:47 +0100
|
||||||
|
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
|
||||||
|
index 4430520d32024d897c93c1d9f8652ccb2c202c01..ceef1a7fd41751f553f21784217f95a210bd24d9 100644
|
||||||
|
--- a/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 {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nbt.contains("note_block_sound", 8)) {
|
||||||
|
- this.noteBlockSound = ResourceLocation.tryParse(nbt.getString("note_block_sound"));
|
||||||
|
+ this.noteBlockSound = ResourceLocation.tryParse(StringUtil.truncateStringIfNecessary(nbt.getString("note_block_sound"), 32767, false)); // Scissors - Add length limit to note block sound
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -7,4 +7,4 @@ pluginManagement {
|
|||||||
|
|
||||||
rootProject.name = "Scissors"
|
rootProject.name = "Scissors"
|
||||||
|
|
||||||
include("Scissors-API", "Scissors-Server")
|
include("aswm-api", "aswm-core", "Scissors-API", "Scissors-Server")
|
||||||
|
1
submodules/AdvancedSlimePaper
Submodule
1
submodules/AdvancedSlimePaper
Submodule
Submodule submodules/AdvancedSlimePaper added at 220f37ce02
Reference in New Issue
Block a user