mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2025-07-15 09:38:35 +00:00
Compare commits
52 Commits
1.20.2
...
slime/1.20
Author | SHA1 | Date | |
---|---|---|---|
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 | |||
3acfa3fa80 | |||
f8898d0e1c | |||
d5b68d8f5c | |||
fb3550ad44 | |||
612fc104c3 | |||
a40d598ab1 | |||
182525b22b | |||
a5af796395 | |||
30b69bc059 | |||
9fc9c36cb3 | |||
b2bc2c2152 | |||
c39661c11a | |||
dc0a3610ec | |||
185c5ee1a6 | |||
76822727f6 | |||
511733b8d5 | |||
40a91ca05e | |||
ff6a9c5ff6 | |||
8226a3b03a | |||
d6432c162f | |||
79705ff262 | |||
d013cfde88 | |||
1bbbb18b2e | |||
8bc2c95edb | |||
cbd52d38d9 | |||
8f2be500b5 | |||
3f889f5040 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -13,6 +13,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout Git Repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'true'
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
- name: Setup Gradle
|
||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -50,3 +50,8 @@ Scissors-Server
|
||||
Scissors-API
|
||||
|
||||
!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 = main
|
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -1,9 +1,15 @@
|
||||
pipeline {
|
||||
options { skipDefaultCheckout() }
|
||||
agent any
|
||||
environment {
|
||||
GITHUB_BRANCH = "${BRANCH_NAME}"
|
||||
}
|
||||
stages {
|
||||
stage('checkout') {
|
||||
steps {
|
||||
checkout scmGit(branches: [[name: '*/slime/1.20.2']], extensions: [submodule(parentCredentials: true, recursiveSubmodules: true, reference: 'https://github.com/InfernalSuite/AdvancedSlimePaper')], userRemoteConfigs: [[url: 'https://github.com/AtlasMediaGroup/Scissors']])
|
||||
}
|
||||
}
|
||||
stage('applyPatches') {
|
||||
steps {
|
||||
withGradle {
|
||||
|
18
README.md
18
README.md
@ -1,13 +1,23 @@
|
||||
# Scissors [](https://ci.scissors.gg/job/Scissors/job/1.20.1/)
|
||||
# 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
|
||||
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
|
||||
### [Scissors Download](https://ci.plex.us.org/job/Scissors)
|
||||
### [Scissors Javadoc](https://javadoc.scissors.gg/1.20.1)
|
||||
### [Scissors Announcements](https://totalfreedom.me/forum/board/139)
|
||||
### [Scissors General Discussion](https://totalfreedom.me/forum/board/140)
|
||||
### [Scissors Javadoc](https://javadoc.scissors.gg/1.20.2)
|
||||
### [Scissors Announcements](https://totalfreedom.tf/forums/scissors-announcements.55)
|
||||
### [Scissors General Discussion](https://totalfreedom.tf/forums/scissors-discussion.56/)
|
||||
|
||||
## 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
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||
id("io.papermc.paperweight.patcher") version "1.5.7-SNAPSHOT"
|
||||
id("io.papermc.paperweight.patcher") version "1.5.10"
|
||||
}
|
||||
|
||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||
@ -15,7 +15,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.9:fat")
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.11:fat")
|
||||
decompiler("net.minecraftforge:forgeflower:2.0.629.1")
|
||||
paperclip("io.papermc:paperclip:3.0.4-SNAPSHOT")
|
||||
}
|
||||
@ -49,6 +49,7 @@ subprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven(paperMavenPublicUrl)
|
||||
maven("https://repo.rapture.pw/repository/maven-releases/")
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,6 +66,15 @@ paperweight {
|
||||
|
||||
serverPatchDir.set(layout.projectDirectory.dir("patches/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,8 +1,8 @@
|
||||
group=me.totalfreedom.scissors
|
||||
version=1.20.1-R0.1-SNAPSHOT
|
||||
version=1.20.2-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion=1.20.1
|
||||
paperRef=773dd724469bae89d0c2075edc3d1ddc8d5b0b18
|
||||
mcVersion=1.20.2
|
||||
paperRef=931781c220b98dde0159c9a3c8dce06c3b2b1e13
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
|
33
patches/api/0001-AdvancedSlimePaper-API-Changes.patch
Normal file
33
patches/api/0001-AdvancedSlimePaper-API-Changes.patch
Normal file
@ -0,0 +1,33 @@
|
||||
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 e827ee211e3c65dc68ac5867fd8476639df63645..4bf0c234eacc8398333fe7704acadfecff21c505 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")
|
||||
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") // Paper
|
@ -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
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a24cb52a5af62012c5d5acc29e4c3558e92ae572
|
||||
index 0000000000000000000000000000000000000000..812e6ae9f1c8eb9558e5109c522d3ce3a7deb35c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
||||
@@ -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
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d7efa63c316ed99c3eccfeadc1b0873b2ccb5d8a
|
||||
index 0000000000000000000000000000000000000000..e4c9256c78f8b395aea86e9ea1a112f8e7426c1f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
||||
@@ -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
|
||||
index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..9fd0d55bac867322e8c72dcf4a17bd18f7aa423c 100644
|
||||
index d0c634629aa0b6bac0da93655dd86ad3aea0ce30..5729362a327f6cc67e86d4ebf5328fc60ed710f7 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2121,6 +2121,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2190,6 +2190,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
}
|
||||
// Paper end
|
||||
|
2840
patches/server/0001-AdvancedSlimePaper-Server-Changes.patch
Normal file
2840
patches/server/0001-AdvancedSlimePaper-Server-Changes.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,25 +5,26 @@ Subject: [PATCH] Build changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index fb98936bb8a5488db75d676c5bcb4060597fbbf8..904bf48288e0865db9bbe8d2ca183b8385f73407 100644
|
||||
index 79beac737c17412913983614bd478d33e3c6ed58..27d5dd68175641152cb78e6aba69890c00ef9b51 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
@@ -13,8 +13,13 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
val alsoShade: Configuration by configurations.creating
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":paper-api"))
|
||||
- implementation(project(":paper-mojangapi"))
|
||||
+ implementation(project(":aswm-core"))
|
||||
+ // Scissors start
|
||||
+ implementation(project(":Scissors-API"))
|
||||
+ implementation("io.papermc.paper:paper-mojangapi:1.20.1-R0.1-SNAPSHOT") {
|
||||
+ implementation("io.papermc.paper:paper-mojangapi:1.20.2-R0.1-SNAPSHOT") {
|
||||
+ exclude("io.papermc.paper", "paper-api")
|
||||
+ }
|
||||
+ // Scissors end
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
@@ -68,11 +72,19 @@ tasks.jar {
|
||||
@@ -66,11 +71,19 @@ tasks.jar {
|
||||
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
||||
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
||||
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
||||
@ -45,7 +46,7 @@ index fb98936bb8a5488db75d676c5bcb4060597fbbf8..904bf48288e0865db9bbe8d2ca183b83
|
||||
"Implementation-Vendor" to date, // Paper
|
||||
"Specification-Title" to "Bukkit",
|
||||
"Specification-Version" to project.version,
|
||||
@@ -149,7 +161,7 @@ fun TaskContainer.registerRunTask(
|
||||
@@ -154,7 +167,7 @@ fun TaskContainer.registerRunTask(
|
||||
name: String,
|
||||
block: JavaExec.() -> Unit
|
||||
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||
@ -55,7 +56,7 @@ index fb98936bb8a5488db75d676c5bcb4060597fbbf8..904bf48288e0865db9bbe8d2ca183b83
|
||||
standardInput = System.`in`
|
||||
workingDir = rootProject.layout.projectDirectory
|
||||
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
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -593,7 +593,7 @@ public class Metrics {
|
||||
@ -72,7 +73,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d0
|
||||
if (implVersion != null) {
|
||||
final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
||||
- 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 {
|
||||
paperVersion = "unknown";
|
||||
}
|
||||
@ -95,10 +96,10 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..21ded7c14c56a40feaa7741131be5166
|
||||
.completer(new ConsoleCommandCompleter(this.server))
|
||||
.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
|
||||
index 67ee3a4ca8a6cdeb275653d492a1fea8037c51fb..318f6534cfb11f7fd05b2dcd6da4e0ca9f69f731 100644
|
||||
index 3d5d79e428a7b0f1aa7d0d3911e6d61b9537e8a0..97231b3a80c248efca4a7ef644272801644386d5 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1692,7 +1692,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1712,7 +1712,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
@ -108,10 +109,10 @@ index 67ee3a4ca8a6cdeb275653d492a1fea8037c51fb..318f6534cfb11f7fd05b2dcd6da4e0ca
|
||||
|
||||
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 ec4b73321205b472f19fa5bd4ad95893020d1340..45f43dc72647f2f3fa91dad767b949d851f7dd46 100644
|
||||
index 9c08303de2891de92e06de8a939a618b7a6f7321..43e331f2946faaf3e7e66e4a81a6b34604647c3b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -269,7 +269,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
@ -5,13 +5,13 @@ 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
|
||||
index b65dcff9812dbc3256c080ac264c4aafd83ce276..82b53a7bfb37bfa1752a016a8a454c0b994b9108 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 {
|
||||
}
|
||||
@@ -74,7 +74,11 @@ public final class NbtUtils {
|
||||
UUID uUID = nbt.hasUUID("Id") ? nbt.getUUID("Id") : Util.NIL_UUID;
|
||||
// Paper start - support string UUID's
|
||||
if (nbt.contains("Id", 8)) {
|
||||
if (nbt.contains("Id", Tag.TAG_STRING)) {
|
||||
- uUID = UUID.fromString(nbt.getString("Id"));
|
||||
+ // Scissors start - Validate String UUIDs in game profiles
|
||||
+ try {
|
||||
@ -20,7 +20,7 @@ index 6dac24354192bea79a4b9eb721543110826790b2..a9c3c55eb622b18c74d8a9bd472e4e87
|
||||
+ // Scissors end
|
||||
}
|
||||
// Paper end
|
||||
|
||||
String string = nbt.getString("Name");
|
||||
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
|
@ -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 47c8148e6413c51ffdd30082bfb37a7fb8a73a71..48fce864be2a92c9665b9eeb85e3193eaed4133d 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;
|
||||
@@ -74,7 +75,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
try { // Paper - Ignore invalid game profiles
|
||||
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)));
|
||||
}
|
||||
} catch (Exception ignored) {} // Paper
|
@ -31,10 +31,10 @@ index 2ee4ee14ab3345486dad6b24fd9a4fcc6c746b99..c5ac6cda91a81d3075f5c763e30dc009
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||
index 8e4cb2fa787feca47dd4ba2fbb44e6193bac2431..000aa76e3f4dce8129dbd1868cfc244515997c0c 100644
|
||||
index 1f55185814125c691288294d18bf1580461c8066..259d65f8e21f9cf99585d416eafdc967dddccf57 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||
@@ -408,7 +408,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
||||
@@ -409,7 +409,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
||||
try {
|
||||
this.setParticle(ParticleArgument.readParticle(new StringReader(nbt.getString("Particle")), (HolderLookup) BuiltInRegistries.PARTICLE_TYPE.asLookup()));
|
||||
} catch (CommandSyntaxException commandsyntaxexception) {
|
||||
@ -44,10 +44,10 @@ index 8e4cb2fa787feca47dd4ba2fbb44e6193bac2431..000aa76e3f4dce8129dbd1868cfc2445
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..7b0aed8ed3a150b7c10fa246bb0b519232424737 100644
|
||||
index 73871f456a85bda1e51f54986d0e61fb629822e8..df16049a70061c7c38d72b188d054339f5434e03 100644
|
||||
--- a/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
|
||||
@@ -589,7 +589,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
}), (entity) -> {
|
||||
entity.load(nbt);
|
||||
}, () -> {
|
||||
@ -56,7 +56,7 @@ index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..7b0aed8ed3a150b7c10fa246bb0b5192
|
||||
});
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
@@ -608,7 +608,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
}
|
||||
|
||||
public static Optional<EntityType<?>> by(CompoundTag nbt) {
|
||||
@ -66,10 +66,10 @@ index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..7b0aed8ed3a150b7c10fa246bb0b5192
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index e2a25c29ec74147b3e66aa0b3deb85a8f6ee53a5..0bb87ca2556ca41e0b14503d3ae62e0fc133a209 100644
|
||||
index d28c477171c1b6888a45175075017d960464b5cd..cc46185c05a735d4443b266423215f1f7a0c7741 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -618,7 +618,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -619,7 +619,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
|
||||
if (nbt.contains("DeathLootTable", 8)) {
|
||||
@ -79,7 +79,7 @@ index e2a25c29ec74147b3e66aa0b3deb85a8f6ee53a5..0bb87ca2556ca41e0b14503d3ae62e0f
|
||||
}
|
||||
|
||||
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 448fa4f4f200430d6ce3051763c7ceb697696146..40e59b8db83aec1143e3c394427e916beea7c01f 100644
|
||||
index a18aadbf7ae83713e1f2b21553185d8000bc7699..f5ad7ddf13cbb6452c2927aef9b54eae3335b4c6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
@@ -289,7 +289,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@ -109,19 +109,6 @@ index 0425151e688966442340ea1cf892aff34ffe0791..244b04e0020b1bd1e7be34a1b6266a8a
|
||||
this.lootTableSeed = nbt.getLong("LootTableSeed");
|
||||
return true;
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
|
||||
index 6f9286db4e5786464fb0b49dc125e1228ab7ae93..8d91accb0d5e8afa3957d816bd71681b4198ee6e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
|
||||
@@ -90,7 +90,7 @@ public class DecoratedPotBlockEntity extends BlockEntity {
|
||||
return Items.BRICK;
|
||||
} else {
|
||||
Tag tag = list.get(index);
|
||||
- return BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getAsString()));
|
||||
+ return BuiltInRegistries.ITEM.get(ResourceLocation.tryParse(tag.getAsString())); // Scissors
|
||||
}
|
||||
}
|
||||
}
|
||||
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 081691f9710ff1115e4308f79ed49fbc38941193..c29dfd15e147d5c4d9c9584ff7803c2a52009f0d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||
@ -136,18 +123,18 @@ index 081691f9710ff1115e4308f79ed49fbc38941193..c29dfd15e147d5c4d9c9584ff7803c2a
|
||||
this.lootTableSeed = nbt.getLong("LootTableSeed");
|
||||
return false; // Paper - always load the items, table may still remain
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
||||
index e49eece9bff3a53469673d03a7bbf8f9cf8776b8..a49f32e9649155b6af4b1f236e4e8142d730e7e8 100644
|
||||
index f6942cb3ef1f9ef03708d4bc932ea9aeb1c13894..8b32864bafb3c1948993688be8f639dd6492057e 100644
|
||||
--- a/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;
|
||||
}
|
||||
|
||||
- ResourceLocation key = getSnapshot().lootTable;
|
||||
- ResourceLocation key = this.getSnapshot().lootTable;
|
||||
- return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
||||
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
||||
+ try {
|
||||
+ ResourceLocation key = getSnapshot().lootTable;
|
||||
+ ResourceLocation key = this.getSnapshot().lootTable;
|
||||
+ return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
||||
+ } catch (Exception ex) {
|
||||
+ return null;
|
||||
@ -157,7 +144,7 @@ index e49eece9bff3a53469673d03a7bbf8f9cf8776b8..a49f32e9649155b6af4b1f236e4e8142
|
||||
|
||||
@Override
|
||||
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..aa7fa17b9fb8519d8b57e27a5b422249b9b875d8 100644
|
||||
--- a/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
|
||||
@ -178,7 +165,7 @@ index 0dd0ce9a9b3253e87eda12354249ec2fd2a33cf2..b6920f9432ca1736afbe775186fbbcf1
|
||||
|
||||
@Override
|
||||
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 b4e45d8e9851552f30c9c29d3d9671e1e9094c38..4e8e1a6b718d9ec8720efb648ab023e9e39f67e3 100644
|
||||
--- a/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 {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Removes useless spammy error logging
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 3df1822b55358a9bdf41bcacd5b7fecfd8f05dfa..f9741039dada19391e80d9623f2d8cabc1089506 100644
|
||||
index aeca803cc0434d9de9434987d6e43b70353e305b..5bd581c1a82236359c810037333590d0d9741587 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -1813,8 +1813,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1814,8 +1814,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
resource = CraftNamespacedKey.fromMinecraft(key);
|
||||
}
|
||||
} catch (IllegalArgumentException ex) {
|
||||
|
@ -5,7 +5,7 @@ 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
|
||||
index 52196431a6538872755344859a0454a0e50c3b6e..2312881cdd925ec538fff3df7cdc7e04770453eb 100644
|
||||
index eb0351aa12eebcefab1d1d14641fc3c60cbbcab8..cf944848cdebbb6f04f5211e00c876329e86d9cc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -425,11 +425,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
|
@ -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
|
||||
index b79f4ce38a42e4dba8ebdfc97dadc531b7245c7a..9c49be7c53a1f2a8c203341b8ded9cd222d0c178 100644
|
||||
index 37f37be56bab171df442b980ff46ff325daae283..deade19d16a7d6870171b9a60806a8cadb437db4 100644
|
||||
--- a/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 {
|
||||
|
||||
for(int i = 0; i < listTag.size(); ++i) {
|
||||
String string = listTag.getString(i);
|
||||
- Optional<? extends Recipe<?>> optional = recipeManager.byKey(new ResourceLocation(string));
|
||||
+ Optional<? extends Recipe<?>> optional = recipeManager.byKey(ResourceLocation.tryParse(string)); // Scissors - Validate resource locations
|
||||
- Optional<RecipeHolder<?>> optional = recipeManager.byKey(new ResourceLocation(string));
|
||||
+ Optional<RecipeHolder<?>> optional = recipeManager.byKey(ResourceLocation.tryParse(string)); // Scissors - Validate resource locations
|
||||
if (!optional.isPresent()) {
|
||||
- LOGGER.error("Invalid recipe: {}", (Object)string);
|
||||
+ // Scissors - Don't log errors caused by invalid recipes being provided
|
||||
|
@ -5,10 +5,10 @@ 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
|
||||
index efa800402413202d190926610d8264dfbf5019e7..1b3229128771adb85a7d007989891ef073a80278 100644
|
||||
index 82b53a7bfb37bfa1752a016a8a454c0b994b9108..b8720020f98ea26da7d3225ddfbb1d9e80be4eb1 100644
|
||||
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
@@ -234,7 +234,7 @@ public final class NbtUtils {
|
||||
@@ -231,7 +231,7 @@ public final class NbtUtils {
|
||||
if (!nbt.contains("Name", 8)) {
|
||||
return Blocks.AIR.defaultBlockState();
|
||||
} else {
|
||||
@ -18,7 +18,7 @@ index efa800402413202d190926610d8264dfbf5019e7..1b3229128771adb85a7d007989891ef0
|
||||
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 fa885337085348308604e50049ecc5bb52023884..366f70bfe6559e4d43844473a2c080c3ec52a4fc 100644
|
||||
index 8affdd74769aed9aa92a76ba539cd9d27208827c..23e480535bfb4071cde84fc400c2e6acb129e1ae 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 {
|
||||
|
@ -77,10 +77,10 @@ index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..bc5ed619e05f24f3ad50a6a81306d120
|
||||
switch (distance) {
|
||||
case -1:
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 7c29d92362a82330440dff151bcf421f15c68f71..d1c8671ba5ca95c425e4c679445d55c4bbba217e 100644
|
||||
index c737c5d62407337d3db2899cfc01713a058a6467..54891c5d7ca19a4fdab74a8729814a6fecee3fda 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -300,7 +300,7 @@ public class Main {
|
||||
@@ -301,7 +301,7 @@ public class Main {
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
// Paper start - This is some stupid bullshit
|
||||
System.err.println("*** Warning, you've not updated in a while! ***");
|
||||
|
@ -5,26 +5,25 @@ 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
|
||||
index c69088a2ec374b2d236fec61e267f42afa2967b1..7ca1ece926b0ef4598d4fa913b96d1e7a0e5bba4 100644
|
||||
index 8240bb085b619f257f8c0a25775e0b15068e440f..c80d58dc9cb9171d51ff0a0596bb27bf161c3c83 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
@@ -559,13 +559,7 @@ public final class MCUtil {
|
||||
@@ -659,12 +659,6 @@ public final class MCUtil {
|
||||
return null;
|
||||
}
|
||||
String string = compound.getString(key);
|
||||
- try {
|
||||
- return Component.Serializer.fromJson(string);
|
||||
- return net.minecraft.network.chat.Component.Serializer.fromJson(string);
|
||||
- } catch (com.google.gson.JsonParseException e) {
|
||||
- org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage());
|
||||
- }
|
||||
-
|
||||
- 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
|
||||
index 37fc353c3e59dd5af2fd6c58ac084fb0e6e155d7..2873ed7c443ed8c8c57a8b1d3e444d229f10f07b 100644
|
||||
index b540ce21c65ad52ad7e94d2ca2b3926c0875bee1..9cb6fa8e35c89f73e7c95dbe219a4bf6d00b60a9 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;
|
||||
@ -128,10 +127,10 @@ index 97a2657bc98d41c3c1e376b266d2c85f685acc88..9d20f3f1af8e663a8c13714c8928d4a9
|
||||
}
|
||||
}).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
|
||||
index e8485fb900b25e911a858678a833852731cb2ace..842f8af14b2bd694a48ee6573d98e6cfcf910e16 100644
|
||||
index 1e05fca2a2ba6e2c0b641b6e27585520889cd8a6..3bf0c06f5042e9ff5572714dfc6a641a01a65978 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2487,12 +2487,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2503,12 +2503,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.setRot(this.getYRot(), this.getXRot());
|
||||
if (nbt.contains("CustomName", 8)) {
|
||||
String s = nbt.getString("CustomName");
|
||||
@ -146,10 +145,10 @@ index e8485fb900b25e911a858678a833852731cb2ace..842f8af14b2bd694a48ee6573d98e6cf
|
||||
|
||||
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
|
||||
index 2be7a697f08045b974579e6942b38571e744efac..84ec21c38bb44db1e9ff26c01d5c8af1a2417616 100644
|
||||
index 4def212655cea0fd998b52e924f8b671d6aeb559..4359fb5997f8a207c52a09aa61a9431fa3ff550e 100644
|
||||
--- a/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 {
|
||||
@@ -38,7 +38,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||
CompoundTag compoundTag = nbt.getCompound(i);
|
||||
String string = compoundTag.getString("Name");
|
||||
PlayerTeam playerTeam = this.scoreboard.addPlayerTeam(string);
|
||||
@ -158,7 +157,7 @@ index 2be7a697f08045b974579e6942b38571e744efac..84ec21c38bb44db1e9ff26c01d5c8af1
|
||||
if (component != null) {
|
||||
playerTeam.setDisplayName(component);
|
||||
}
|
||||
@@ -53,14 +53,14 @@ public class ScoreboardSaveData extends SavedData {
|
||||
@@ -56,14 +56,14 @@ public class ScoreboardSaveData extends SavedData {
|
||||
}
|
||||
|
||||
if (compoundTag.contains("MemberNamePrefix", 8)) {
|
||||
@ -175,12 +174,12 @@ index 2be7a697f08045b974579e6942b38571e744efac..84ec21c38bb44db1e9ff26c01d5c8af1
|
||||
if (component3 != null) {
|
||||
playerTeam.setPlayerSuffix(component3);
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||
CompoundTag compoundTag = nbt.getCompound(i);
|
||||
ObjectiveCriteria.byName(compoundTag.getString("CriteriaName")).ifPresent((criterion) -> {
|
||||
String string = compoundTag.getString("Name");
|
||||
@@ -123,7 +123,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||
return ObjectiveCriteria.DUMMY;
|
||||
});
|
||||
String string2 = compoundTag.getString("Name");
|
||||
- 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
|
||||
ObjectiveCriteria.RenderType renderType = ObjectiveCriteria.RenderType.byId(compoundTag.getString("RenderType"));
|
||||
this.scoreboard.addObjective(string, criterion, component, renderType);
|
||||
});
|
||||
this.scoreboard.addObjective(string2, objectiveCriteria, component, renderType);
|
||||
}
|
||||
|
@ -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
|
||||
index fbfadeb83719b81f42724e79c59e92ed88fdece7..7de21c9bcc1f3c556790da62f96cc44995e877b2 100644
|
||||
index d364bd57b1675c8b21d781c2bc16c3e65800455c..f2e7585630ff724f966c7bcedc17e502d786870d 100644
|
||||
--- a/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;
|
||||
import io.netty.handler.codec.MessageToByteEncoder;
|
||||
import io.papermc.paper.adventure.PaperAdventure; // Paper
|
||||
@@ -7,8 +7,16 @@ import io.netty.handler.codec.MessageToByteEncoder;
|
||||
import io.netty.util.Attribute;
|
||||
import io.netty.util.AttributeKey;
|
||||
import java.io.IOException;
|
||||
+import java.util.Collections; // Scissors
|
||||
+import net.minecraft.ChatFormatting; // Scissors
|
||||
@ -19,7 +19,6 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..7de21c9bcc1f3c556790da62f96cc449
|
||||
+import net.minecraft.network.chat.Component; // Scissors
|
||||
+import net.minecraft.network.chat.SignedMessageBody; // Scissors
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.PacketFlow;
|
||||
+import net.minecraft.network.protocol.game.*; // Scissors
|
||||
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
||||
+import net.minecraft.world.item.ItemStack; // Scissors
|
||||
@ -27,20 +26,20 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..7de21c9bcc1f3c556790da62f96cc449
|
||||
|
||||
public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||
@@ -19,6 +27,23 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||
this.flow = side;
|
||||
this.codecKey = protocolKey;
|
||||
}
|
||||
|
||||
+ // 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.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();
|
||||
+ packet.write(friendlyByteBuf);
|
||||
+ int k = friendlyByteBuf.writerIndex() - j;
|
||||
+ int packetLength = friendlyByteBuf.readableBytes();
|
||||
+ if (k > 8388608 || packetLength > MAX_PACKET_SIZE) {
|
||||
+ throw new SkipPacketException(new IllegalArgumentException("Packet too big (is " + k + "): " + packet));
|
||||
+ if (packetLength > MAX_PACKET_SIZE) {
|
||||
+ throw new PacketTooLargeException(packet, this.codecKey, packetLength);
|
||||
+ }
|
||||
+
|
||||
+ return k;
|
||||
@ -48,14 +47,14 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..7de21c9bcc1f3c556790da62f96cc449
|
||||
+ // Scissors end
|
||||
+
|
||||
protected void encode(ChannelHandlerContext channelHandlerContext, Packet<?> packet, ByteBuf byteBuf) throws Exception {
|
||||
ConnectionProtocol connectionProtocol = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get();
|
||||
if (connectionProtocol == null) {
|
||||
@@ -33,38 +58,59 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||
Attribute<ConnectionProtocol.CodecData<?>> attribute = channelHandlerContext.channel().attr(this.codecKey);
|
||||
ConnectionProtocol.CodecData<?> codecData = attribute.get();
|
||||
@@ -34,46 +59,59 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||
throw new IOException("Can't serialize unregistered packet");
|
||||
} else {
|
||||
FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(byteBuf);
|
||||
- friendlyByteBuf.writeVarInt(i);
|
||||
- friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
||||
- friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(io.papermc.paper.adventure.PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
||||
|
||||
+ // Scissors start
|
||||
+ int k;
|
||||
@ -65,33 +64,41 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..7de21c9bcc1f3c556790da62f96cc449
|
||||
- int k = friendlyByteBuf.writerIndex() - j;
|
||||
- if (false && k > 8388608) { // Paper - disable
|
||||
- throw new IllegalArgumentException("Packet too big (is " + k + ", should be less than 8388608): " + packet);
|
||||
- } 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) {
|
||||
- LOGGER.error("Packet encoding of packet ID {} threw (skippable? {})", i, packet.isSkippable(), var10); // Paper - Give proper error message
|
||||
-
|
||||
- JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k);
|
||||
+ k = this.tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
||||
} catch (Throwable var13) {
|
||||
- // Paper start - Give proper error message
|
||||
- String packetName = io.papermc.paper.util.ObfHelper.INSTANCE.deobfClassName(packet.getClass().getName());
|
||||
- if (packetName.contains(".")) {
|
||||
- packetName = packetName.substring(packetName.lastIndexOf(".") + 1);
|
||||
- }
|
||||
-
|
||||
- LOGGER.error("Packet encoding of packet {} (ID: {}) threw (skippable? {})", packetName, i, packet.isSkippable(), var13);
|
||||
- // Paper end
|
||||
- if (packet.isSkippable()) {
|
||||
- throw new SkipPacketException(var10);
|
||||
- } else {
|
||||
- throw var10;
|
||||
- throw new SkipPacketException(var13);
|
||||
- }
|
||||
-
|
||||
- throw var13;
|
||||
- } finally {
|
||||
- // Paper start
|
||||
- int packetLength = friendlyByteBuf.readableBytes();
|
||||
- if (packetLength > MAX_PACKET_SIZE) {
|
||||
- throw new PacketTooLargeException(packet, this.codecKey, packetLength);
|
||||
+ packet = capPacket(packet, i);
|
||||
+ if (packet == null) {
|
||||
+ throw new SkipPacketException(new IllegalArgumentException("Packet too big: " + packet));
|
||||
}
|
||||
- // Paper end
|
||||
- ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet);
|
||||
+ friendlyByteBuf.clear();
|
||||
+ k = tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
||||
+ k = this.tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
||||
}
|
||||
|
||||
- // Paper start
|
||||
- int packetLength = friendlyByteBuf.readableBytes();
|
||||
- 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);
|
||||
+ JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k);
|
||||
+ ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet);
|
||||
+ // Scissors end
|
||||
}
|
||||
}
|
||||
@ -146,7 +153,7 @@ index 3944852921335c78a04a9dc301882ab5b152b1ed..96ee53c7cc862e059328c5cdf5e07f30
|
||||
this.type = blockEntityType;
|
||||
this.tag = nbt.isEmpty() ? null : nbt;
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||
index 39b879f21f958dbd91ab0f74e5d4f3c74928fc33..688287c637a0d4b28d630b7304a3c2cf339bdf54 100644
|
||||
index 51e24105facfe71ce9f2757c6c881a21b58dacfd..5692fbae221fb01d32d92edc7bea0f6312e24e1c 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||
@@ -33,6 +33,13 @@ public class ClientboundLevelChunkPacketData {
|
||||
|
@ -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
|
||||
index 584a58659fae6ba3d8b53858890bc6ec509ffb0e..54a7dae26854d320d9e53f63eb411a85a2d78159 100644
|
||||
index 7daca712816a79cc4a30b084afbd3d07b5d3755f..a7e04eb4284e7d5148e1c7b991620d666785ec70 100644
|
||||
--- a/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 {
|
||||
@ -19,7 +19,7 @@ index 584a58659fae6ba3d8b53858890bc6ec509ffb0e..54a7dae26854d320d9e53f63eb411a85
|
||||
} else {
|
||||
// Paper start
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -414,10 +414,10 @@ index 0000000000000000000000000000000000000000..8cd2848aa6b06c5efbe797ed2d75ff4b
|
||||
+}
|
||||
+
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index a7ebf851a65231074c89a24f30de4ac2fb5b63e4..641fe69cb2131413654c39a32a73c62e2bc092f6 100644
|
||||
index ec268189b19b6fa5c4521f96ce211a531db35ec5..343cb72710ef100cf7e4de1e081cfdc2744aab46 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -147,6 +147,7 @@ public class Main {
|
||||
@@ -144,6 +144,7 @@ public class Main {
|
||||
// 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 spigotConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("spigot-settings"));
|
||||
@ -426,7 +426,7 @@ index a7ebf851a65231074c89a24f30de4ac2fb5b63e4..641fe69cb2131413654c39a32a73c62e
|
||||
|
||||
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
|
||||
index c49802c936ae8e3f4dc1badd98414d96714ecd60..c9725f2df7a66eba3d5994a2b4b16b07ff0f696d 100644
|
||||
index 1c9742ad81f04052d2c3bc18c7636f45b2fc5160..e2cb86f0323d91fa10ecf6cdf1db2e28405798a8 100644
|
||||
--- a/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
|
||||
@ -447,18 +447,18 @@ index c49802c936ae8e3f4dc1badd98414d96714ecd60..c9725f2df7a66eba3d5994a2b4b16b07
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
this.setMotd(dedicatedserverproperties.motd);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 26937b8dd0411b0c96e461c57eeee6ae8595211e..bf8ade78a771b0295811f48cba96aeb05a39524e 100644
|
||||
index 903df63725faeaa160609edddf9f5c54144945e6..058780b420c9207119f4bb889f602bd94199d7fb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1036,6 +1036,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1040,6 +1040,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
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
@@ -1067,6 +1068,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1071,6 +1072,7 @@ public final class CraftServer implements Server {
|
||||
this.reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
@ -466,7 +466,7 @@ index 26937b8dd0411b0c96e461c57eeee6ae8595211e..bf8ade78a771b0295811f48cba96aeb0
|
||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -2912,6 +2914,14 @@ public final class CraftServer implements Server {
|
||||
@@ -2978,6 +2980,14 @@ public final class CraftServer implements Server {
|
||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||
}
|
||||
|
||||
@ -482,10 +482,10 @@ index 26937b8dd0411b0c96e461c57eeee6ae8595211e..bf8ade78a771b0295811f48cba96aeb0
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index d1c8671ba5ca95c425e4c679445d55c4bbba217e..3be40632c70f5a7994ada3e61616dca632cef2da 100644
|
||||
index 54891c5d7ca19a4fdab74a8729814a6fecee3fda..05db4799fddfbd8045c967520db99a75ba807697 100644
|
||||
--- a/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")
|
||||
.describedAs("Name");
|
||||
// Paper end
|
||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Prevent attributes with invalid namespaces from being applied
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index f9741039dada19391e80d9623f2d8cabc1089506..38238d9e6d464990caf10557997c6ca88ee100c0 100644
|
||||
index ed6e5060901c348c4f56a573c23e2000d8f2fb72..5cdf1e6fcdc9e2bd821f40ec9bf95cf03f03179a 100644
|
||||
--- a/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;
|
||||
@ -17,10 +17,10 @@ index f9741039dada19391e80d9623f2d8cabc1089506..38238d9e6d464990caf10557997c6ca8
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.apache.commons.lang3.EnumUtils;
|
||||
@@ -486,7 +487,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -487,7 +488,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
|
||||
|
||||
String attributeName = CraftAttributeMap.convertIfNeeded(entry.getString(ATTRIBUTES_IDENTIFIER.NBT)); // Paper
|
||||
String attributeName = CraftAttributeMap.convertIfNeeded(entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT)); // Paper
|
||||
- if (attributeName == null || attributeName.isEmpty()) {
|
||||
+ if (attributeName == null || attributeName.isEmpty() || attributeName.length() > 256 || !ResourceLocation.isValidResourceLocation(attributeName)) { // Scissors
|
||||
continue;
|
||||
|
@ -5,49 +5,30 @@ Subject: [PATCH] Fixes creative-killing potion effects and certain potion
|
||||
effect overflows
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/effect/MobEffect.java b/src/main/java/net/minecraft/world/effect/MobEffect.java
|
||||
index 53cc6befb752affcfec65e18365f6d369448d407..181f5aa262689617ff3ad766dae485c36b88c9aa 100644
|
||||
--- a/src/main/java/net/minecraft/world/effect/MobEffect.java
|
||||
+++ b/src/main/java/net/minecraft/world/effect/MobEffect.java
|
||||
@@ -57,6 +57,7 @@ public class MobEffect {
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java b/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java
|
||||
index 1c7794de5f0a7238b944c9473e2cc9d011ef2306..9c594c504611b9da5fcd119284b2dcb4b59d3bf4 100644
|
||||
--- a/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java
|
||||
+++ b/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java
|
||||
@@ -16,6 +16,11 @@ class HealOrHarmMobEffect extends InstantenousMobEffect {
|
||||
@Override
|
||||
public void applyEffectTick(LivingEntity entity, int amplifier) {
|
||||
+ boolean god = entity instanceof Player player && (player.isCreative() || player.isInvulnerable()); // Scissors
|
||||
if (this == MobEffects.REGENERATION) {
|
||||
if (entity.getHealth() < entity.getMaxHealth()) {
|
||||
entity.heal(1.0F, RegainReason.MAGIC_REGEN); // CraftBukkit
|
||||
@@ -83,17 +84,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
|
||||
super.applyEffectTick(entity, amplifier);
|
||||
+ // Scissors start - Don't apply any healing/harming effects for Creative/Invulnerable players and cap the amplifier for those who aren't.
|
||||
+ if (entity instanceof net.minecraft.world.entity.player.Player player && (player.isCreative() || player.isInvulnerable())) return;
|
||||
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
||||
+ if (!god && (this == MobEffects.HARM && !entity.isInvertedHealAndHarm() || this == MobEffects.HEAL && entity.isInvertedHealAndHarm())) {
|
||||
+ // 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 {
|
||||
- entity.heal((float) Math.max(4 << amplifier, 0), RegainReason.MAGIC); // CraftBukkit
|
||||
+ // Scissors start
|
||||
+ if (!god) {
|
||||
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
||||
+ entity.heal((float) Math.max(4 << amplifier, 0), RegainReason.MAGIC); // CraftBukkit
|
||||
+ }
|
||||
+ // Scissors end
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +32,10 @@ class HealOrHarmMobEffect extends InstantenousMobEffect {
|
||||
@Override
|
||||
public void applyInstantenousEffect(@Nullable Entity source, @Nullable Entity attacker, LivingEntity target, int amplifier, double proximity) {
|
||||
int j;
|
||||
+ // 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())) {
|
||||
+ return;
|
||||
+ }
|
||||
+ if (target instanceof net.minecraft.world.entity.player.Player player && (player.isCreative() || player.isInvulnerable())) return;
|
||||
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
||||
+ // Scissors end
|
||||
|
||||
if ((this != MobEffects.HEAL || target.isInvertedHealAndHarm()) && (this != MobEffects.HARM || !target.isInvertedHealAndHarm())) {
|
||||
if ((this != MobEffects.HARM || target.isInvertedHealAndHarm()) && (this != MobEffects.HEAL || !target.isInvertedHealAndHarm())) {
|
||||
if (this.isHarm == target.isInvertedHealAndHarm()) {
|
||||
j = (int) (proximity * (double) (4 << amplifier) + 0.5D);
|
||||
|
@ -5,7 +5,7 @@ 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
|
||||
index e11d7283662834047b2ff81a2fd25a4263792deb..4bd7eea49a0720063db2a8ed10f53bd19e9499ad 100644
|
||||
index b95f88d5e5b4785ee063695fd81935636a0588d1..168b002377e258f84a3bb86dd8e4a5f42060e3e0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -629,7 +629,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
@ -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
|
||||
index 9948a28dae4edba877c13ef0156be5ff58df3fa2..9e25d4a3384d0157b99f7bd4d5f7edce032ece6b 100644
|
||||
index 44a6118d3bd67a95180f750c17967561946e2e87..8aece67eba8d6b558bc2441b8b8e599f86e12e4f 100644
|
||||
--- a/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;
|
||||
@ -17,7 +17,7 @@ index 9948a28dae4edba877c13ef0156be5ff58df3fa2..9e25d4a3384d0157b99f7bd4d5f7edce
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.BlockUtil;
|
||||
import net.minecraft.Util;
|
||||
@@ -107,6 +108,7 @@ public abstract class AbstractMinecart extends Entity {
|
||||
@@ -111,6 +112,7 @@ public abstract class AbstractMinecart extends Entity {
|
||||
private double flyingX = 0.949999988079071D; // Paper - restore vanilla precision
|
||||
private double flyingY = 0.949999988079071D; // Paper - restore vanilla precision
|
||||
private double flyingZ = 0.949999988079071D; // Paper - restore vanilla precision
|
||||
@ -25,20 +25,18 @@ index 9948a28dae4edba877c13ef0156be5ff58df3fa2..9e25d4a3384d0157b99f7bd4d5f7edce
|
||||
public double maxSpeed = 0.4D;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -434,8 +436,10 @@ public abstract class AbstractMinecart extends Entity {
|
||||
@@ -432,8 +434,8 @@ public abstract class AbstractMinecart extends Entity {
|
||||
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));
|
||||
|
||||
- if (!list.isEmpty()) {
|
||||
- for (int l = 0; l < list.size(); ++l) {
|
||||
+ // Scissors start
|
||||
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Using TimeUnit for better code readability
|
||||
+ for (int l = 0; l < Math.min(3, list.size()); ++l) {
|
||||
+ // Scissors end
|
||||
Entity entity = (Entity) list.get(l);
|
||||
- Iterator iterator = list.iterator();
|
||||
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Scissors - add collision debounce, using TimeUnit for better code readability
|
||||
+ Iterator iterator = list.size() <= 15 ? list.iterator() : list.subList(0, 15).iterator(); // Scissors
|
||||
|
||||
if (!(entity instanceof Player) && !(entity instanceof IronGolem) && !(entity instanceof AbstractMinecart) && !this.isVehicle() && !entity.isPassenger()) {
|
||||
@@ -462,6 +466,14 @@ public abstract class AbstractMinecart extends Entity {
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
@@ -462,6 +464,14 @@ public abstract class AbstractMinecart extends Entity {
|
||||
entity.push(this);
|
||||
}
|
||||
}
|
||||
@ -52,9 +50,9 @@ index 9948a28dae4edba877c13ef0156be5ff58df3fa2..9e25d4a3384d0157b99f7bd4d5f7edce
|
||||
+ // Scissors end
|
||||
}
|
||||
} 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
|
||||
index 35aeba4e8430e6419caa9db4a0b931a994228618..289eb39b15a283b0d9dbc33823f3a73f87202907 100644
|
||||
index 5c07da62c82bc70138f6cb5007629d6974be69ac..301a72dffd4ac58333d987e85d22136498d2d82a 100644
|
||||
--- a/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;
|
||||
@ -65,7 +63,7 @@ index 35aeba4e8430e6419caa9db4a0b931a994228618..289eb39b15a283b0d9dbc33823f3a73f
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.BlockUtil;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@@ -109,6 +110,7 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
||||
@@ -112,6 +113,7 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
||||
public double unoccupiedDeceleration = -1;
|
||||
public boolean landBoats = false;
|
||||
// CraftBukkit end
|
||||
@ -73,20 +71,19 @@ index 35aeba4e8430e6419caa9db4a0b931a994228618..289eb39b15a283b0d9dbc33823f3a73f
|
||||
|
||||
public Boat(EntityType<? extends Boat> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -421,10 +423,10 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
||||
@@ -465,9 +467,9 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
||||
this.checkInsideBlocks();
|
||||
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() && (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);
|
||||
- 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) {
|
||||
+ for (int j = 0; j < Math.min(3, list.size()); ++j) { // Scissors - Limit amount of vehicle collision checks to 3 maximum
|
||||
Entity entity = (Entity) list.get(j);
|
||||
|
||||
if (!entity.hasPassenger((Entity) this)) {
|
||||
@@ -435,6 +437,14 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
@@ -480,6 +482,14 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ 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
|
||||
index d138660e459b2d09ba9dd7ae2bf3da499d9ae25c..8c5fe0166a5442a2fa4f212d7c53343c937f53f1 100644
|
||||
index d0f7baa80cb7d0883304abe2ed990c258a0d92b6..bedd53797391005d70dcdd61c5ed6d56a32fee5c 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -21,6 +21,7 @@ import java.util.function.Predicate;
|
||||
@ -70,7 +70,7 @@ index d138660e459b2d09ba9dd7ae2bf3da499d9ae25c..8c5fe0166a5442a2fa4f212d7c53343c
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
@@ -253,6 +254,12 @@ public final class ItemStack {
|
||||
@@ -254,6 +255,12 @@ public final class ItemStack {
|
||||
|
||||
// CraftBukkit - break into own method
|
||||
private void load(CompoundTag nbttagcompound) {
|
||||
@ -83,7 +83,7 @@ index d138660e459b2d09ba9dd7ae2bf3da499d9ae25c..8c5fe0166a5442a2fa4f212d7c53343c
|
||||
this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id")));
|
||||
this.count = nbttagcompound.getByte("Count");
|
||||
if (nbttagcompound.contains("tag", 10)) {
|
||||
@@ -556,7 +563,11 @@ public final class ItemStack {
|
||||
@@ -563,7 +570,11 @@ public final class ItemStack {
|
||||
nbt.putString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
|
||||
nbt.putByte("Count", (byte) this.count);
|
||||
if (this.tag != null) {
|
||||
@ -96,7 +96,7 @@ index d138660e459b2d09ba9dd7ae2bf3da499d9ae25c..8c5fe0166a5442a2fa4f212d7c53343c
|
||||
}
|
||||
|
||||
return nbt;
|
||||
@@ -886,6 +897,7 @@ public final class ItemStack {
|
||||
@@ -893,6 +904,7 @@ public final class ItemStack {
|
||||
// Paper end
|
||||
|
||||
public void setTag(@Nullable CompoundTag nbt) {
|
||||
@ -105,7 +105,7 @@ index d138660e459b2d09ba9dd7ae2bf3da499d9ae25c..8c5fe0166a5442a2fa4f212d7c53343c
|
||||
this.processEnchantOrder(this.tag); // Paper
|
||||
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
|
||||
index 40e59b8db83aec1143e3c394427e916beea7c01f..f292aa0016e6f741b36ddc1417f6f63d248f987f 100644
|
||||
index f5ad7ddf13cbb6452c2927aef9b54eae3335b4c6..041e3c8fb7c9ca69a7c7c1c952ed9915a75d7752 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
@@ -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
|
||||
index b11f51762ca289d99eaa49e66e31e58595bcea4e..06adfdc61f1064c1ec0db34632a8740fc09a1782 100644
|
||||
index d4dcf7fe26474ae07374e7761d823bc5c8b54f97..7352183f7eaa1ddcd028e53f4b66a1c34e32b988 100644
|
||||
--- a/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;
|
||||
@ -282,10 +282,10 @@ index b11f51762ca289d99eaa49e66e31e58595bcea4e..06adfdc61f1064c1ec0db34632a8740f
|
||||
}
|
||||
|
||||
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
|
||||
+++ 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.stream.IntStream;
|
||||
import javax.annotation.Nullable;
|
||||
@ -293,7 +293,7 @@ index b7686fd63b7c5d88c3a12ec4ee9bc01a17f997e0..db3a4a8cd19da9775bb0884c33494f1e
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
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 List<ItemStack> getContents() {
|
||||
|
@ -5,7 +5,7 @@ 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
|
||||
index 4bd7eea49a0720063db2a8ed10f53bd19e9499ad..953c2702880b358c0da4b8117c77b76bae849271 100644
|
||||
index 168b002377e258f84a3bb86dd8e4a5f42060e3e0..065d2c1543832190bd8bdcd4b553542115c07e64 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -861,7 +861,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
@ -77,7 +77,7 @@ index 182e16c1d968707a11329150d71b7d01df6c6e52..8582a9369cffe0eebeb82a81fc413d0b
|
||||
Registry<StructureTemplatePool> registry = world.registryAccess().registryOrThrow(Registries.TEMPLATE_POOL);
|
||||
// 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
|
||||
index 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616fd3f73eb 100644
|
||||
index e8ecced687261861953899a3bea162dbc03977b4..30720203173b23ccdbb0789f7e2adbbe180c7c69 100644
|
||||
--- a/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;
|
||||
@ -107,7 +107,7 @@ index 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616
|
||||
Stream<BlockPos> stream = this.getRelatedCorners(blockPos2, blockPos3);
|
||||
@@ -321,6 +323,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
|
||||
public boolean saveStructure(boolean bl) {
|
||||
public boolean saveStructure(boolean interactive) {
|
||||
if (this.mode == StructureMode.SAVE && !this.level.isClientSide && this.structureName != null) {
|
||||
+ // Scissors start - Add master block fire event
|
||||
+ final BlockPos pos = this.getBlockPos();
|
||||
@ -124,7 +124,7 @@ index 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616
|
||||
StructureTemplateManager structureTemplateManager = serverLevel.getStructureManager();
|
||||
@@ -358,6 +370,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
|
||||
public boolean loadStructure(ServerLevel world, boolean bl) {
|
||||
public boolean loadStructure(ServerLevel world, boolean interactive) {
|
||||
if (this.mode == StructureMode.LOAD && this.structureName != null) {
|
||||
+ // Scissors start - Add master block fire event
|
||||
+ final BlockPos blockPos = this.getBlockPos();
|
||||
|
@ -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
|
||||
index 3c0651fa5a5db880202c9a3805a6455269c5f16d..d7ddd44fb9b571850515edc6ee2e6801092f6446 100644
|
||||
index 65bb221993147a558995b36fb835f7b82e0eb4bd..4ea2c551d924f976a8de9e2ae521544f323fbec4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -14,19 +14,17 @@ index 3c0651fa5a5db880202c9a3805a6455269c5f16d..d7ddd44fb9b571850515edc6ee2e6801
|
||||
+import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.primitives.Floats;
|
||||
import com.mojang.brigadier.ParseResults;
|
||||
@@ -2113,6 +2114,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
import com.mojang.authlib.GameProfile;
|
||||
@@ -2006,6 +2007,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
Entity entity = packet.getEntity(worldserver);
|
||||
|
||||
if (entity != null) {
|
||||
+ // Scissors start - Add spectator teleport event
|
||||
+ final SpectatorTeleportEvent event = new SpectatorTeleportEvent(this.player.getBukkitEntity(), entity.getBukkitEntity());
|
||||
+
|
||||
+ if(!event.callEvent()) {
|
||||
+ if (!event.callEvent()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
this.player.teleportTo(worldserver, entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot(), org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.SPECTATE); // CraftBukkit
|
||||
return;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent invalid container events
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index bf7cf2108c0273552a41a9734dfd66b6a68a24d4..1c102fa91711ed595626633e127c89a83ed6b6c5 100644
|
||||
index 4ea2c551d924f976a8de9e2ae521544f323fbec4..83ae366b4f52261e2e2b65a4183d7ca823edd315 100644
|
||||
--- a/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;
|
||||
@ -14,9 +14,9 @@ index bf7cf2108c0273552a41a9734dfd66b6a68a24d4..1c102fa91711ed595626633e127c89a8
|
||||
import javax.annotation.Nullable;
|
||||
+import net.kyori.adventure.text.format.NamedTextColor; // Scissors
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
@@ -3037,6 +3038,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.Util;
|
||||
@@ -2900,6 +2901,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Validate block entity/entity tag query positions
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 3c4825e295eefc7fcd628ba804fcc7dd5f160f28..280ebeee9bfae3059b6681873fa5633a9e929161 100644
|
||||
index 83ae366b4f52261e2e2b65a4183d7ca823edd315..67b5447ffcf54c54b2087df456690a9bed98fbd3 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1376,7 +1376,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -1262,7 +1262,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
if (this.player.hasPermissions(2)) {
|
||||
Entity entity = this.player.level().getEntity(packet.getEntityId());
|
||||
|
||||
@ -17,7 +17,7 @@ index 3c4825e295eefc7fcd628ba804fcc7dd5f160f28..280ebeee9bfae3059b6681873fa5633a
|
||||
CompoundTag nbttagcompound = entity.saveWithoutId(new CompoundTag());
|
||||
|
||||
this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound));
|
||||
@@ -1388,7 +1388,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -1274,7 +1274,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@Override
|
||||
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
|
@ -5,7 +5,7 @@ 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
|
||||
index f356196aaeb498a6d2c9ad2112329cef5a3103d6..a8d8445be1cfb67de1adcaf64847d0bfaf8c503d 100644
|
||||
index 38cde466714e5663cd416b6afd5d2558e139ec09..ed48eaae75e709361a260421934b6b925ae9b427 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
@@ -8,8 +8,10 @@ import java.util.Objects;
|
||||
|
@ -60,7 +60,7 @@ 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
|
||||
index 562289bbe08b8d8e75436ad94cfc02e7c0e95d2e..a98134b3b59e194c03bb8110652a9208263c420d 100644
|
||||
index 67b5447ffcf54c54b2087df456690a9bed98fbd3..94cc122aad0e48687ea9f25cd810f07dc893acc6 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -70,7 +70,7 @@ index 562289bbe08b8d8e75436ad94cfc02e7c0e95d2e..a98134b3b59e194c03bb8110652a9208
|
||||
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.primitives.Floats;
|
||||
@@ -2368,7 +2369,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2220,7 +2221,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
|
||||
@ -79,7 +79,7 @@ index 562289bbe08b8d8e75436ad94cfc02e7c0e95d2e..a98134b3b59e194c03bb8110652a9208
|
||||
this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes
|
||||
} else {
|
||||
this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED));
|
||||
@@ -2424,6 +2425,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2276,6 +2277,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment);
|
||||
|
||||
if (optional.isEmpty()) {
|
||||
@ -87,7 +87,7 @@ index 562289bbe08b8d8e75436ad94cfc02e7c0e95d2e..a98134b3b59e194c03bb8110652a9208
|
||||
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
|
||||
}
|
||||
@@ -2632,6 +2634,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2484,6 +2486,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
synchronized (this.lastSeenMessages) {
|
||||
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
|
||||
@ -95,7 +95,7 @@ index 562289bbe08b8d8e75436ad94cfc02e7c0e95d2e..a98134b3b59e194c03bb8110652a9208
|
||||
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
|
||||
}
|
||||
@@ -3673,6 +3676,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3462,6 +3465,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@Override
|
||||
public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
|
@ -0,0 +1,78 @@
|
||||
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 8897496323378080135127f53db004d576476c21..5f957d3241c1931f8166bc9e4960cef15679e932 100644
|
||||
--- a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
||||
+++ b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
||||
@@ -129,9 +129,9 @@ 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> optional, Optional<Double> optional2) {
|
||||
+ public Doubles(Optional<Double> optional, Optional<Double> optional2) { // Scissors - private -> public
|
||||
this(optional, optional2, squareOpt(optional), squareOpt(optional2));
|
||||
}
|
||||
|
||||
@@ -202,7 +202,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> optional, Optional<Integer> optional2) {
|
||||
this(optional, optional2, optional.map((integer) -> {
|
||||
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..6cb3e86f2d661a55536b782729f768ef72163223 100644
|
||||
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
@@ -5,11 +5,13 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
+import java.util.Optional; // Scissors
|
||||
import java.util.UUID;
|
||||
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 +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,10 +5,10 @@ Subject: [PATCH] Patch invalid entity rotation log spam
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 842f8af14b2bd694a48ee6573d98e6cfcf910e16..e9e98f09e13d7f21333450d892cdc80b0667c915 100644
|
||||
index e8845d6ec1bcba6df2eb8e1af0d658b10299831a..015d5e9b6de5f1fb466e1801bdf5fb430ba91f35 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4617,7 +4617,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4696,7 +4696,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
|
||||
public void setXRot(float 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;
|
@ -4,35 +4,25 @@ Date: Fri, 28 Apr 2023 16:29:23 -0300
|
||||
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
|
||||
index 347d2914f9560a3ee8cea59444bc0dfbb7cf3456..b6a38b1458957bd444fea439fa81d2976ffb86e0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java
|
||||
@@ -2,6 +2,7 @@ package net.minecraft.world.level.saveddata.maps;
|
||||
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Nullable;
|
||||
+import net.minecraft.ChatFormatting; // Scissors
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.util.Mth;
|
||||
|
||||
@@ -14,6 +15,11 @@ public class MapDecoration {
|
||||
private final Component name;
|
||||
|
||||
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/network/protocol/game/ClientboundMapItemDataPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||
index 81f3e64d94fa17e45411e5c1641d9c5a2fe3d2e2..bcf6e2ce9f00d1688a5fa00ec055a57389346922 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||
@@ -65,7 +65,8 @@ public class ClientboundMapItemDataPacket implements Packet<ClientGamePacketList
|
||||
b.writeByte(icon.x());
|
||||
b.writeByte(icon.y());
|
||||
b.writeByte(icon.rot() & 15);
|
||||
- b.writeNullable(icon.name(), FriendlyByteBuf::writeComponent);
|
||||
+ final boolean passedNameCap = icon.name() == null || icon.name().getString().length() <= 32; // Scissors
|
||||
+ b.writeNullable(passedNameCap ? icon.name() : null, FriendlyByteBuf::writeComponent); // Scissors
|
||||
});
|
||||
});
|
||||
if (this.colorPatch != null) {
|
||||
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 3b12030b49b1c539684d75ca3896eb498400ef99..0d55d73bd31747ad9579aebbb77f315aa3dc2bc8 100644
|
||||
index e4c4948e076cd64686dfd16ae0568fafc1437140..eff53c21b18574750b691b784fb1688885d4ace7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
@@ -354,6 +354,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) {
|
||||
|
@ -5,12 +5,12 @@ 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
|
||||
index 18aac3da3c88f33b1a71a5920a8daa27e9723913..b1bfb12f10d6fec9ca905498b4a6768997867311 100644
|
||||
index 3f26fdcc5cbf0a684ad724ab8c042d0053cc187e..c6f36a6b967aeb6ffdf5b099b2692e038401dc79 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1610,7 +1610,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1664,7 +1664,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
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();
|
||||
- this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED);
|
||||
+ // Scissors start - Prevent player banning using duplicate UUIDs
|
||||
|
@ -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
|
||||
index 41791c7331c80d496cde4e3d1846a178bef0bbe3..d04181bda85dbaa77d3b55b04b25519496bec4ff 100644
|
||||
index 15ee41452992714108efe53b708b5a4e1da7c1ff..5054dce35127cb0132431021578c345fcbb1f92a 100644
|
||||
--- a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||
@@ -372,7 +372,7 @@ public final class EntityLookup implements LevelEntityGetter<Entity> {
|
||||
@@ -415,7 +415,7 @@ public final class EntityLookup implements LevelEntityGetter<Entity> {
|
||||
return false;
|
||||
}
|
||||
if (this.entityByUUID.containsKey(entity.getUUID())) {
|
||||
|
@ -5,7 +5,7 @@ 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
|
||||
index 9cb6fa8e35c89f73e7c95dbe219a4bf6d00b60a9..fa6151a2361684426bdd3bf3b433fe4dbd0cf47b 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> {
|
||||
|
@ -5,7 +5,7 @@ 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
|
||||
index fa6151a2361684426bdd3bf3b433fe4dbd0cf47b..4dd93e02f2b18e5c75be14ff8f052220ca69f427 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;
|
||||
|
@ -18,7 +18,7 @@ index c99fc118013cb3d4043638e2001a8297e79ddf9c..cdaa81e1f2167b29ec01cc25e51a8400
|
||||
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
|
||||
index 08390409bbaf9f3ae8260ab36ea5e0580e93b3e3..e2f7cef0edf2775083eb87b1cb5984ec8b25c76f 100644
|
||||
index 94cc122aad0e48687ea9f25cd810f07dc893acc6..bcb195b1e40f562d0cd5ecca236ebba87150d236 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1,6 +1,8 @@
|
||||
@ -30,7 +30,7 @@ index 08390409bbaf9f3ae8260ab36ea5e0580e93b3e3..e2f7cef0edf2775083eb87b1cb5984ec
|
||||
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.primitives.Floats;
|
||||
@@ -159,6 +161,7 @@ import net.minecraft.world.entity.player.Inventory;
|
||||
@@ -154,6 +156,7 @@ import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.ProfilePublicKey;
|
||||
import net.minecraft.world.entity.projectile.AbstractArrow;
|
||||
import net.minecraft.world.entity.vehicle.Boat;
|
||||
@ -38,7 +38,7 @@ index 08390409bbaf9f3ae8260ab36ea5e0580e93b3e3..e2f7cef0edf2775083eb87b1cb5984ec
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.BucketItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
@@ -187,6 +190,8 @@ import net.minecraft.world.phys.Vec3;
|
||||
@@ -181,6 +184,8 @@ import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.BooleanOp;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
@ -47,7 +47,7 @@ index 08390409bbaf9f3ae8260ab36ea5e0580e93b3e3..e2f7cef0edf2775083eb87b1cb5984ec
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1007,6 +1012,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -893,6 +898,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity);
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ index 08390409bbaf9f3ae8260ab36ea5e0580e93b3e3..e2f7cef0edf2775083eb87b1cb5984ec
|
||||
commandblocklistenerabstract.setCommand(s);
|
||||
commandblocklistenerabstract.setTrackOutput(flag);
|
||||
if (!flag) {
|
||||
@@ -1038,7 +1053,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -924,7 +939,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level());
|
||||
|
||||
if (commandblocklistenerabstract != null) {
|
||||
|
@ -5,10 +5,10 @@ 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
|
||||
index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..b70bafe2766efcbcce00287e6511a588560564a6 100644
|
||||
index ee012f1ef1ff7f2adf76d1690dbd5611af7deb4d..d79723047317c24c53fb85c423de8dd9f84891ac 100644
|
||||
--- a/src/main/java/net/minecraft/nbt/TagParser.java
|
||||
+++ b/src/main/java/net/minecraft/nbt/TagParser.java
|
||||
@@ -169,9 +169,56 @@ public class TagParser {
|
||||
@@ -179,9 +179,56 @@ public class TagParser {
|
||||
}
|
||||
|
||||
this.expect('}');
|
||||
@ -66,7 +66,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..b70bafe2766efcbcce00287e6511a588
|
||||
private Tag readListTag() throws CommandSyntaxException {
|
||||
this.expect('[');
|
||||
this.reader.skipWhitespace();
|
||||
@@ -203,7 +250,7 @@ public class TagParser {
|
||||
@@ -213,7 +260,7 @@ public class TagParser {
|
||||
}
|
||||
|
||||
this.expect(']');
|
||||
@ -75,7 +75,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..b70bafe2766efcbcce00287e6511a588
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +275,7 @@ public class TagParser {
|
||||
@@ -238,7 +285,7 @@ public class TagParser {
|
||||
}
|
||||
|
||||
private <T extends Number> List<T> readArray(TagType<?> arrayTypeReader, TagType<?> typeReader) throws CommandSyntaxException {
|
||||
@ -84,7 +84,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..b70bafe2766efcbcce00287e6511a588
|
||||
|
||||
while(true) {
|
||||
if (this.reader.peek() != ']') {
|
||||
@@ -241,11 +288,11 @@ public class TagParser {
|
||||
@@ -251,11 +298,11 @@ public class TagParser {
|
||||
}
|
||||
|
||||
if (typeReader == ByteTag.TYPE) {
|
||||
@ -99,7 +99,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..b70bafe2766efcbcce00287e6511a588
|
||||
}
|
||||
|
||||
if (this.hasElementSeparator()) {
|
||||
@@ -257,7 +304,7 @@ public class TagParser {
|
||||
@@ -267,7 +314,7 @@ public class TagParser {
|
||||
}
|
||||
|
||||
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
|
||||
index 5c951ef93fe4cf4f085df86b0cefc02bc2610ab9..1d08e3a9493154e075a289d2eb9a8772289534af 100644
|
||||
index f13943db6f2fb923c52dcf9e8bf7000041d0a362..2fdcc47dd6a813d5f7a32dc58ca67b6b965c8749 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
@@ -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;
|
||||
|
||||
public double getEffectRange() {
|
||||
@ -17,7 +17,7 @@ index 5c951ef93fe4cf4f085df86b0cefc02bc2610ab9..1d08e3a9493154e075a289d2eb9a8772
|
||||
return this.levels * 10 + 10;
|
||||
} else {
|
||||
return effectRange;
|
||||
@@ -428,6 +428,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.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
|
||||
index ec81be70cd6f92bbf9011395cb361f0ce54c5ad0..97da1db83dca24759b52fc2d0a360187dbef86f1 100644
|
||||
index 598dc0d3a2b9387e76d7e4e19e54c4573a24bc54..9eed28bf8bc7e2fa528729cde01a535bc7040815 100644
|
||||
--- a/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 {
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix packet-related lag exploits
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index e2f7cef0edf2775083eb87b1cb5984ec8b25c76f..c645e05ec6c309448460c7e983931b9dc79a7f7e 100644
|
||||
index bcb195b1e40f562d0cd5ecca236ebba87150d236..fee0a88c6ccecd71ebf63651655dec2d5097f894 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -972,7 +972,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -858,7 +858,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
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
|
||||
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
|
||||
@ -17,7 +17,7 @@ index e2f7cef0edf2775083eb87b1cb5984ec8b25c76f..c645e05ec6c309448460c7e983931b9d
|
||||
BaseCommandBlock commandblocklistenerabstract = null;
|
||||
CommandBlockEntity tileentitycommand = null;
|
||||
BlockPos blockposition = packet.getPos();
|
||||
@@ -1139,7 +1139,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -1025,7 +1025,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@Override
|
||||
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@ -26,7 +26,7 @@ index e2f7cef0edf2775083eb87b1cb5984ec8b25c76f..c645e05ec6c309448460c7e983931b9d
|
||||
BlockPos blockposition = packet.getPos();
|
||||
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
||||
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
||||
@@ -1197,7 +1197,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -1083,7 +1083,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@Override
|
||||
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@ -35,7 +35,7 @@ index e2f7cef0edf2775083eb87b1cb5984ec8b25c76f..c645e05ec6c309448460c7e983931b9d
|
||||
BlockPos blockposition = packet.getPos();
|
||||
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
||||
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
||||
@@ -1220,7 +1220,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -1106,7 +1106,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@Override
|
||||
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Limit save data for Bees and Vexes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
index 55026e1731e41b4e3e4c6a8fef5d96a32051a556..4a8383d48da4fcf39ec528a00cd09417f8d08c57 100644
|
||||
index 9a7956befc346e1b58f064213800fd099a052fc6..2ebedd806bafc6ff7c4bf5a962ead50ce2ad1a8a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -227,8 +227,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@ -24,7 +24,7 @@ index 55026e1731e41b4e3e4c6a8fef5d96a32051a556..4a8383d48da4fcf39ec528a00cd09417
|
||||
|
||||
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
|
||||
index 65cb385ab294e362d666a6d03c4496cdc3b64890..42c3e946e51f6dcb100078969a4fb46c77f42b2d 100644
|
||||
index 90e577b1a89b02c38daff2845a63dafe5ed929e1..1a2b6ee032ab6952634c9f596820db3e7374fb50 100644
|
||||
--- a/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 {
|
||||
|
@ -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
|
||||
index dd1102d5291ef6f18e82400a6d8a0a376cc071e9..d304612325d6c70a4100582d6c0fbfeecd8716d1 100644
|
||||
index 7204b973c3ad9239e82355513f6d538107102e48..2463444778f19f937b18173798c04d9d9788a824 100644
|
||||
--- a/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
|
||||
index 8de09eea46c27db9d8c472e84f768976769d1b0b..c8d05d35368e0cf593bcc3589b6c108a901bdc22 100644
|
||||
index a7380ce6dcbf64ad8a51dd047d178ae887518041..cb015941e5ea4618bd0964f4aa66a9f0fceb27a1 100644
|
||||
--- a/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 {
|
||||
@@ -92,7 +92,7 @@ public class AttributeModifier {
|
||||
AttributeModifier.Operation operation = AttributeModifier.Operation.fromValue(nbt.getInt("Operation"));
|
||||
return new AttributeModifier(uUID, nbt.getString("Name"), nbt.getDouble("Amount"), operation);
|
||||
} catch (Exception var3) {
|
||||
|
@ -6,23 +6,11 @@ Subject: [PATCH] Don't return null Components in the Component codec
|
||||
Found by Sk8kman
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/util/ExtraCodecs.java b/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||
index 066d423dc908080157586555ba01053a2477d570..aa6e5de37ce69c9bc6b8e1e0b5ab0ee918fc27e2 100644
|
||||
index 607f32b856c6c1fb81d3f1604f3bf3fb240d713f..5afdc9d93e696568cc8a263ab0142fbac258e874 100644
|
||||
--- a/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||
+++ b/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||
@@ -62,7 +62,10 @@ public class ExtraCodecs {
|
||||
});
|
||||
public static final Codec<Component> COMPONENT = JSON.flatXmap((element) -> {
|
||||
try {
|
||||
- return DataResult.success(Component.Serializer.fromJson(element));
|
||||
+ // Scissors start
|
||||
+ final Component component = Component.Serializer.fromJson(element);
|
||||
+ return DataResult.success(component != null ? component : Component.empty());
|
||||
+ // Scissors end
|
||||
} catch (JsonParseException var2) {
|
||||
return DataResult.error(var2::getMessage);
|
||||
}
|
||||
@@ -75,7 +78,10 @@ public class ExtraCodecs {
|
||||
});
|
||||
@@ -70,7 +70,10 @@ public class ExtraCodecs {
|
||||
public static final Codec<Component> COMPONENT = adaptJsonSerializer(Component.Serializer::fromJson, Component.Serializer::toJsonTree);
|
||||
public static final Codec<Component> FLAT_COMPONENT = Codec.STRING.flatXmap((json) -> {
|
||||
try {
|
||||
- return DataResult.success(Component.Serializer.fromJson(json));
|
||||
@ -33,7 +21,19 @@ index 066d423dc908080157586555ba01053a2477d570..aa6e5de37ce69c9bc6b8e1e0b5ab0ee9
|
||||
} catch (JsonParseException var2) {
|
||||
return DataResult.error(var2::getMessage);
|
||||
}
|
||||
@@ -246,7 +252,7 @@ public class ExtraCodecs {
|
||||
@@ -233,7 +236,10 @@ public class ExtraCodecs {
|
||||
public static <T> Codec<T> adaptJsonSerializer(Function<JsonElement, T> deserializer, Function<T, JsonElement> serializer) {
|
||||
return JSON.flatXmap((json) -> {
|
||||
try {
|
||||
- return DataResult.success(deserializer.apply(json));
|
||||
+ // Scissors start
|
||||
+ final T value = deserializer.apply(json);
|
||||
+ return DataResult.success(value != null ? value : (T)Component.empty());
|
||||
+ // Scissors end
|
||||
} catch (JsonParseException var3) {
|
||||
return DataResult.error(var3::getMessage);
|
||||
}
|
||||
@@ -260,7 +266,7 @@ public class ExtraCodecs {
|
||||
}, (pair) -> {
|
||||
return ImmutableList.of(leftFunction.apply(pair), rightFunction.apply(pair));
|
||||
});
|
||||
@ -42,7 +42,7 @@ index 066d423dc908080157586555ba01053a2477d570..aa6e5de37ce69c9bc6b8e1e0b5ab0ee9
|
||||
return instance.group(codec.fieldOf(leftFieldName).forGetter(Pair::getFirst), codec.fieldOf(rightFieldName).forGetter(Pair::getSecond)).apply(instance, Pair::of);
|
||||
}).comapFlatMap((pair) -> {
|
||||
return combineFunction.apply((P)pair.getFirst(), (P)pair.getSecond());
|
||||
@@ -278,7 +284,7 @@ public class ExtraCodecs {
|
||||
@@ -286,7 +292,7 @@ public class ExtraCodecs {
|
||||
Optional<Pair<A, T>> optional = dataResult.resultOrPartial(mutableObject::setValue);
|
||||
return optional.isPresent() ? dataResult : DataResult.error(() -> {
|
||||
return "(" + (String)mutableObject.getValue() + " -> using default)";
|
||||
@ -51,12 +51,3 @@ index 066d423dc908080157586555ba01053a2477d570..aa6e5de37ce69c9bc6b8e1e0b5ab0ee9
|
||||
}
|
||||
|
||||
public <T> DataResult<T> coApply(DynamicOps<T> dynamicOps, A objectx, DataResult<T> dataResult) {
|
||||
@@ -565,7 +571,7 @@ public class ExtraCodecs {
|
||||
|
||||
static record LazyInitializedCodec<A>(Supplier<Codec<A>> delegate) implements Codec<A> {
|
||||
LazyInitializedCodec {
|
||||
- supplier = Suppliers.memoize(supplier::get);
|
||||
+ delegate = Suppliers.memoize(delegate::get); // Scissors - Decompile error
|
||||
}
|
||||
|
||||
public <T> DataResult<Pair<A, T>> decode(DynamicOps<T> dynamicOps, T object) {
|
||||
|
@ -5,10 +5,10 @@ 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 a2fc2c0437999dd09f080eafe8ea466b16cdf57b..0dcf1d7e041477fe31dce4b4ee707399520d30f2 100644
|
||||
index 238b6cd88cb24ca63770db607f2241fcd7210574..ec02597810a4022112ddf31928eb6976e6ac5371 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
|
||||
@@ -80,7 +80,7 @@ public class SkullBlockEntity extends BlockEntity {
|
||||
@@ -92,7 +92,7 @@ public class SkullBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
if (nbt.contains("note_block_sound", 8)) {
|
||||
|
@ -7,4 +7,4 @@ pluginManagement {
|
||||
|
||||
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 0ecbd018a0
Reference in New Issue
Block a user