mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2025-07-15 10:08:35 +00:00
Compare commits
97 Commits
archive/1.
...
archive/1.
Author | SHA1 | Date | |
---|---|---|---|
cedb59e831 | |||
3000da112b | |||
ebdedbed25 | |||
2733597c72 | |||
72fa0ce340 | |||
b90b32ca54 | |||
8274f52923 | |||
f3b3ef9f03 | |||
a7dbe8a38e | |||
63e980e13b | |||
8c0deddbe1 | |||
ade230ed68 | |||
f940a6bb8f | |||
f403924ca0 | |||
ba694be2bc | |||
d382eb52e7 | |||
3ea91b9dbc | |||
b30b7223e5 | |||
2b687d9eda | |||
ad72d5928e | |||
907c5f4ed1 | |||
ff6ceb1094 | |||
acb9c23149 | |||
3330671737 | |||
0abae227cb | |||
6b64fc6c2c | |||
310c7a953b | |||
c09d7fa208 | |||
219e834ffd | |||
3eb4c190e4 | |||
6be48a491b | |||
e34e6c62e6 | |||
fe1c388702 | |||
46668157cb | |||
3c39f1892b | |||
59d76f7bea | |||
aa10085c27 | |||
506b716f7b | |||
c054fc5086 | |||
6e849f20cd | |||
d3ac39a78f | |||
5722923db1 | |||
8fb90b1264 | |||
2c65ed7440 | |||
b36df60ff1 | |||
3f1d9c9ac8 | |||
420496e2e0 | |||
77839d1184 | |||
4df9a3cb36 | |||
7d85029867 | |||
54af1d2b70 | |||
b2fa32800c | |||
8befd612e7 | |||
6ee56d0f13 | |||
2b1cf2200e | |||
0d072fc182 | |||
04a1068b17 | |||
1fa3f6a734 | |||
6931ebe3f3 | |||
107075987e | |||
73b78dc339 | |||
261416de49 | |||
ce0f198467 | |||
4930040ef9 | |||
1bd8ad23ab | |||
da8e9e0497 | |||
d495d26d78 | |||
e3c53a1f8e | |||
67d8415fb3 | |||
cd9edca0e9 | |||
823057089b | |||
7081efe798 | |||
042c4d854f | |||
c32bbf0728 | |||
14d33a5998 | |||
6884a59cf4 | |||
d13728a72f | |||
6cf04f68f9 | |||
3780ab8142 | |||
3c9f6d0e01 | |||
54c0013982 | |||
fba2ddfedc | |||
7b1a66a44e | |||
53755af975 | |||
41be2256f0 | |||
aedd5067fd | |||
ef929a72a2 | |||
81609b1d4b | |||
65407daeae | |||
719cce7443 | |||
1546e4ae5f | |||
2671eeee6b | |||
a988bca4a6 | |||
b76c7d1ccd | |||
856ff4c719 | |||
4c0a4b8804 | |||
243ebd8d3b |
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@ -14,12 +14,12 @@ pipeline {
|
||||
stage('paperclipJar') {
|
||||
steps {
|
||||
withGradle {
|
||||
sh './gradlew paperclipJar --no-daemon --refresh-dependencies'
|
||||
sh './gradlew createReobfPaperclipJar --no-daemon --refresh-dependencies'
|
||||
}
|
||||
sh """
|
||||
#!/bin/sh
|
||||
BRANCH=\$(echo "\${BRANCH_NAME}" | sed 's/\\//_/g')
|
||||
mv \${WORKSPACE}/build/libs/Scissors-*.jar \${WORKSPACE}/build/libs/scissors-\${BRANCH}-\${BUILD_NUMBER}.jar
|
||||
mv \${WORKSPACE}/build/libs/Scissors-paperclip-*.jar \${WORKSPACE}/build/libs/scissors-\${BRANCH_NAME}-\${BUILD_NUMBER}.jar
|
||||
rm \${WORKSPACE}/build/libs/Scissors-bundler-*.jar
|
||||
"""
|
||||
}
|
||||
}
|
||||
@ -33,7 +33,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: 'build/libs/*.jar', fingerprint: true
|
||||
archiveArtifacts artifacts: 'build/libs/scissors-*.jar', fingerprint: true
|
||||
junit 'Scissors-Server/build/test-results/test/*.xml'
|
||||
junit 'Scissors-API/build/test-results/test/*.xml'
|
||||
cleanWs()
|
||||
|
30
README.md
30
README.md
@ -1,8 +1,32 @@
|
||||
# Scissors [](https://ci.scissors.gg/job/Scissors/job/1.17.1/)
|
||||
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.
|
||||
# Scissors [](https://ci.scissors.gg/job/Scissors/job/1.18.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.
|
||||
|
||||
## Links
|
||||
### [Scissors Download](https://ci.plex.us.org/job/Scissors)
|
||||
### [Scissors Javadoc](https://javadoc.scissors.gg/1.17.1)
|
||||
### [Scissors Javadoc](https://javadoc.scissors.gg/1.18.2)
|
||||
### [Scissors Announcements](https://totalfreedom.me/forum/board/139)
|
||||
### [Scissors General Discussion](https://totalfreedom.me/forum/board/140)
|
||||
|
||||
## Tasks
|
||||
```
|
||||
Paperweight tasks
|
||||
-----------------
|
||||
applyApiPatches
|
||||
applyPatches
|
||||
applyServerPatches
|
||||
cleanCache - Delete the project setup cache and task outputs.
|
||||
createMojmapBundlerJar - Build a runnable bundler jar
|
||||
createMojmapPaperclipJar - Build a runnable paperclip jar
|
||||
createReobfBundlerJar - Build a runnable bundler jar
|
||||
createReobfPaperclipJar - Build a runnable paperclip jar
|
||||
generateDevelopmentBundle
|
||||
rebuildApiPatches
|
||||
rebuildPatches
|
||||
rebuildServerPatches
|
||||
reobfJar - Re-obfuscate the built jar to obf mappings
|
||||
runDev - Spin up a non-relocated Mojang-mapped test server
|
||||
runReobf - Spin up a test server from the reobfJar output jar
|
||||
runShadow - Spin up a test server from the shadowJar archiveFile
|
||||
```
|
||||
|
@ -8,4 +8,3 @@
|
||||
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
||||
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||
minecraft net/minecraft/nbt/TagParser.java
|
@ -1,31 +1,23 @@
|
||||
import io.papermc.paperweight.util.constants.*
|
||||
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
|
||||
id("io.papermc.paperweight.patcher") version "1.2.0"
|
||||
id("io.papermc.paperweight.patcher") version "1.3.6"
|
||||
}
|
||||
|
||||
val spigotDecompiler: Configuration by configurations.creating
|
||||
val paperMavenPublicUrl = "https://papermc.io/repo/repository/maven-public/"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://repo.papermc.io/repository/maven-public/") {
|
||||
content {
|
||||
onlyForConfigurations(
|
||||
configurations.paperclip.name,
|
||||
spigotDecompiler.name,
|
||||
)
|
||||
}
|
||||
maven(paperMavenPublicUrl) {
|
||||
content { onlyForConfigurations(configurations.paperclip.name) }
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.1:fat")
|
||||
decompiler("net.minecraftforge:forgeflower:1.5.498.22")
|
||||
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.4")
|
||||
paperclip("io.papermc:paperclip:2.0.1")
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.2:fat")
|
||||
decompiler("net.minecraftforge:forgeflower:1.5.498.29")
|
||||
paperclip("io.papermc:paperclip:3.0.2")
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@ -53,15 +45,15 @@ subprojects {
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
maven(paperMavenPublicUrl)
|
||||
}
|
||||
}
|
||||
|
||||
paperweight {
|
||||
serverProject.set(project(":Scissors-Server"))
|
||||
|
||||
remapRepo.set("https://maven.fabricmc.net/")
|
||||
decompileRepo.set("https://files.minecraftforge.net/maven/")
|
||||
remapRepo.set(paperMavenPublicUrl)
|
||||
decompileRepo.set(paperMavenPublicUrl)
|
||||
|
||||
usePaperUpstream(providers.gradleProperty("paperRef")) {
|
||||
withPaperPatcher {
|
||||
@ -80,7 +72,7 @@ tasks.generateDevelopmentBundle {
|
||||
libraryRepositories.set(
|
||||
listOf(
|
||||
"https://repo.maven.apache.org/maven2/",
|
||||
"https://repo.papermc.io/repository/maven-public/",
|
||||
paperMavenPublicUrl,
|
||||
"https://repo.scissors.gg/repository/scissors-snapshot/",
|
||||
)
|
||||
)
|
||||
|
@ -1,8 +1,8 @@
|
||||
group=me.totalfreedom.scissors
|
||||
version=1.17.1-R0.1-SNAPSHOT
|
||||
version=1.18.2-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion=1.17.1
|
||||
paperRef=6625db387ea9fe5296a6c6f984975b387c3089f0
|
||||
mcVersion=1.18.2
|
||||
paperRef=fc9ee65a32622d03a91db39364b6f106cf88335b
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
@ -4,13 +4,13 @@ Date: Mon, 4 Jul 2022 16:44:35 +0100
|
||||
Subject: [PATCH] Add MasterBlockFireEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/event/block/MasterBlockFireEvent.java b/src/main/java/com/github/atlasmediagroup/scissors/event/block/MasterBlockFireEvent.java
|
||||
diff --git a/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a24cb52a5af62012c5d5acc29e4c3558e92ae572
|
||||
index 0000000000000000000000000000000000000000..812e6ae9f1c8eb9558e5109c522d3ce3a7deb35c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/event/block/MasterBlockFireEvent.java
|
||||
+++ b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
||||
@@ -0,0 +1,51 @@
|
||||
+package com.github.atlasmediagroup.scissors.event.block;
|
||||
+package me.totalfreedom.scissors.event.block;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
|
@ -1,16 +1,16 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Tue, 5 Jul 2022 03:28:49 +0100
|
||||
Date: Tue, 5 Jul 2022 03:59:18 +0100
|
||||
Subject: [PATCH] Add spectator teleport event
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/event/player/SpectatorTeleportEvent.java b/src/main/java/com/github/atlasmediagroup/scissors/event/player/SpectatorTeleportEvent.java
|
||||
diff --git a/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..504f02ac89ea0ed3569cbc4ff67292041c9f408e
|
||||
index 0000000000000000000000000000000000000000..e4c9256c78f8b395aea86e9ea1a112f8e7426c1f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/event/player/SpectatorTeleportEvent.java
|
||||
+++ b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
||||
@@ -0,0 +1,60 @@
|
||||
+package com.github.atlasmediagroup.scissors.event.player;
|
||||
+package me.totalfreedom.scissors.event.player;
|
||||
+
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.entity.Player;
|
||||
|
@ -1,14 +1,14 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Sun, 10 Jul 2022 07:27:37 +0100
|
||||
Date: Sun, 10 Jul 2022 09:56:34 +0100
|
||||
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 c34cfba8f9ed7e9dbd0b6b8ffef9fba46abff046..416bdfccc6cae51a584f29949a32172fb10f78a6 100644
|
||||
index 79b26045a68ebb9b01e5bd06abbccaaef5489777..eb66a2cf4785c9f8ef4bdebee59f29777bf9fa50 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1715,6 +1715,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -1897,6 +1897,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
}
|
||||
// Paper end
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Fri, 2 Jun 2023 23:40:13 +0100
|
||||
Date: Fri, 2 Jun 2023 20:42:02 +0100
|
||||
Subject: [PATCH] Add command block player edit event
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/event/block/CommandBlockPlayerEditEvent.java b/src/main/java/com/github/atlasmediagroup/scissors/event/block/CommandBlockPlayerEditEvent.java
|
||||
diff --git a/src/main/java/me/totalfreedom/scissors/event/block/CommandBlockPlayerEditEvent.java b/src/main/java/me/totalfreedom/scissors/event/block/CommandBlockPlayerEditEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..983dd3b25800d5f1fcc61415051bf7c28d0147bd
|
||||
index 0000000000000000000000000000000000000000..722f5839600954998cbbf799e68477d499d104c4
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/event/block/CommandBlockPlayerEditEvent.java
|
||||
+++ b/src/main/java/me/totalfreedom/scissors/event/block/CommandBlockPlayerEditEvent.java
|
||||
@@ -0,0 +1,77 @@
|
||||
+package com.github.atlasmediagroup.scissors.event.block;
|
||||
+package me.totalfreedom.scissors.event.block;
|
||||
+
|
||||
+import org.bukkit.block.CommandBlock;
|
||||
+import org.bukkit.entity.Player;
|
||||
@ -87,15 +87,14 @@ index 0000000000000000000000000000000000000000..983dd3b25800d5f1fcc61415051bf7c2
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/event/block/CommandMinecartPlayerEditEvent.java b/src/main/java/com/github/atlasmediagroup/scissors/event/block/CommandMinecartPlayerEditEvent.java
|
||||
diff --git a/src/main/java/me/totalfreedom/scissors/event/block/CommandMinecartPlayerEditEvent.java b/src/main/java/me/totalfreedom/scissors/event/block/CommandMinecartPlayerEditEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..2ecaad3d67d3a028a50e998d791de3a829197117
|
||||
index 0000000000000000000000000000000000000000..4248563a590c76dc0d211fec99f6c98becf42b57
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/event/block/CommandMinecartPlayerEditEvent.java
|
||||
@@ -0,0 +1,78 @@
|
||||
+package com.github.atlasmediagroup.scissors.event.block;
|
||||
+++ b/src/main/java/me/totalfreedom/scissors/event/block/CommandMinecartPlayerEditEvent.java
|
||||
@@ -0,0 +1,77 @@
|
||||
+package me.totalfreedom.scissors.event.block;
|
||||
+
|
||||
+import org.bukkit.block.CommandBlock;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.entity.minecart.CommandMinecart;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
|
@ -1,25 +1,25 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Sat, 12 Mar 2022 22:22:22 -0300
|
||||
From: Telesphoreo <me@telesphoreo.me>
|
||||
Date: Tue, 19 Apr 2022 18:17:43 -0500
|
||||
Subject: [PATCH] Build changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index c236fe5dc388f8bc0a929f1de04af94c63514208..722e2aefa279e02bfef23cda8d98210072b0ed3d 100644
|
||||
index 0282e3b75470e1a68ea1fc228082483514ba432e..9e78384fdd5727143d3be5f189478ed701fbd0bd 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -13,8 +13,8 @@ plugins {
|
||||
@@ -9,8 +9,8 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":Paper-API"))
|
||||
- implementation(project(":Paper-MojangAPI"))
|
||||
+ implementation(project(":Scissors-API")) // Scissors
|
||||
+ implementation("io.papermc.paper:paper-mojangapi:1.17.1-R0.1-SNAPSHOT") // Scissors
|
||||
- implementation(project(":paper-api"))
|
||||
- implementation(project(":paper-mojangapi"))
|
||||
+ implementation(project(":Scissors-API"))
|
||||
+ implementation("io.papermc.paper:paper-mojangapi:1.18.2-R0.1-SNAPSHOT") // Scissors
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
@@ -62,11 +62,17 @@ tasks.jar {
|
||||
@@ -56,11 +56,17 @@ 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
|
||||
@ -35,19 +35,19 @@ index c236fe5dc388f8bc0a929f1de04af94c63514208..722e2aefa279e02bfef23cda8d982100
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
"Implementation-Title" to "CraftBukkit",
|
||||
- "Implementation-Version" to "git-Paper-$implementationVersion",
|
||||
+ "Implementation-Version" to "git-Scissors-$implementationVersion", // Scissors
|
||||
+ "Implementation-Version" to "git-Scissors-$implementationVersion",
|
||||
"Implementation-Vendor" to date, // Paper
|
||||
"Specification-Title" to "Bukkit",
|
||||
"Specification-Version" to project.version,
|
||||
@@ -193,7 +199,7 @@ tasks.test {
|
||||
fun TaskContainer.registerRunTask(
|
||||
name: String, block: JavaExec.() -> Unit
|
||||
@@ -148,7 +154,7 @@ fun TaskContainer.registerRunTask(
|
||||
name: String,
|
||||
block: JavaExec.() -> Unit
|
||||
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||
- group = "paper"
|
||||
+ group = "paperweight"
|
||||
mainClass.set("org.bukkit.craftbukkit.Main")
|
||||
standardInput = System.`in`
|
||||
workingDir = rootProject.layout.projectDirectory.dir(
|
||||
providers.gradleProperty("runWorkDir").forUseAtConfigurationTime().orElse("run")
|
||||
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 218f5bafeed8551b55b91c7fccaf6935c8b631ca..1434060d64bca5931749278d72c3eca6b0cd5189 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@ -70,24 +70,11 @@ index 218f5bafeed8551b55b91c7fccaf6935c8b631ca..1434060d64bca5931749278d72c3eca6
|
||||
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
index e0b1f0671d16ddddcb6725acd25a1d1d69e42701..3a3d1d22e105ec2c68a06512434540a81c889685 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
|
||||
@Override
|
||||
protected LineReader buildReader(LineReaderBuilder builder) {
|
||||
builder
|
||||
- .appName("Paper")
|
||||
+ .appName("Scissors")
|
||||
.variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history"))
|
||||
.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 8091a901106a1085da9dfd8627dadcbe50f00872..e6da0f7e755e6b0225afbced2c7a14e9df83b09d 100644
|
||||
index da15a224b8b974e78b9d8d5f514229b3b2a5a63e..8ca2e2e3d2564ec0cc081ff52334484dd5561e5c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1729,7 +1729,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1696,7 +1696,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
@ -97,10 +84,10 @@ index 8091a901106a1085da9dfd8627dadcbe50f00872..e6da0f7e755e6b0225afbced2c7a14e9
|
||||
|
||||
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 99a94898316b0601f55b333c15a9926eae24f8a2..cc797b45674163b5913e20031d110796d78b928b 100644
|
||||
index 8a248e34fce1e04de4460f98b7627df495c66af1..ebd5aeceb4ac1a6300bbfa70218421f0d91b7614 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -251,7 +251,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -249,7 +249,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
@ -110,7 +97,7 @@ index 99a94898316b0601f55b333c15a9926eae24f8a2..cc797b45674163b5913e20031d110796
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
private final Logger logger = Logger.getLogger("Minecraft");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
index 774556a62eb240da42e84db4502e2ed43495be17..becf61c0adde1c27f3e462a1b8248544ab181797 100644
|
||||
index 774556a62eb240da42e84db4502e2ed43495be17..5e6cce78e7987b4aa1c0052262ab8c4563905372 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
@@ -11,7 +11,7 @@ public final class Versioning {
|
||||
@ -118,7 +105,7 @@ index 774556a62eb240da42e84db4502e2ed43495be17..becf61c0adde1c27f3e462a1b8248544
|
||||
String result = "Unknown-Version";
|
||||
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/io.papermc.paper/paper-api/pom.properties");
|
||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/me.totalfreedom.scissors/scissors-api/pom.properties");
|
||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/me.totalfreedom.scissors/Scissors-API/pom.properties");
|
||||
Properties properties = new Properties();
|
||||
|
||||
if (stream != null) {
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Return null when a show_entity hover event's UUID isn't valid
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||
index fda8aad4a394cf331f3421ec07ffe0d605c8da4e..c5711b3d120699ec78f81e9b6ee80d0764552e94 100644
|
||||
index b31ff9d237f593e58b42b453632aa2c2af74f986..67feb4e688d049e9f74f0deabb1ec583336a29be 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||
@@ -175,7 +175,14 @@ public class HoverEvent {
|
||||
@@ -174,7 +174,14 @@ public class HoverEvent {
|
||||
} else {
|
||||
JsonObject jsonObject = json.getAsJsonObject();
|
||||
EntityType<?> entityType = Registry.ENTITY_TYPE.get(new ResourceLocation(GsonHelper.getAsString(jsonObject, "type")));
|
||||
@ -24,7 +24,7 @@ index fda8aad4a394cf331f3421ec07ffe0d605c8da4e..c5711b3d120699ec78f81e9b6ee80d07
|
||||
Component component = Component.Serializer.fromJson(jsonObject.get("name"));
|
||||
return new HoverEvent.EntityTooltipInfo(entityType, uUID, component);
|
||||
}
|
||||
@@ -187,7 +194,14 @@ public class HoverEvent {
|
||||
@@ -186,7 +193,14 @@ public class HoverEvent {
|
||||
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
||||
Component component = Component.Serializer.fromJson(compoundTag.getString("name"));
|
||||
EntityType<?> entityType = Registry.ENTITY_TYPE.get(new ResourceLocation(compoundTag.getString("type")));
|
||||
@ -38,5 +38,5 @@ index fda8aad4a394cf331f3421ec07ffe0d605c8da4e..c5711b3d120699ec78f81e9b6ee80d07
|
||||
+ }
|
||||
+ // Scissors end
|
||||
return new HoverEvent.EntityTooltipInfo(entityType, uUID, component);
|
||||
} catch (CommandSyntaxException | JsonSyntaxException var5) {
|
||||
} catch (Exception var5) {
|
||||
return null;
|
||||
|
@ -32,7 +32,7 @@ index 94dc68182ec5f6dc1294ad15523427836228086a..07075cea760562c901d4469a7f88271c
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
index f57864ce919ef4721cfb5913c636fe8903ce4cc1..d80c7be5b153db4046d0b11c0116c6aa860ea48c 100644
|
||||
index 8a07d5d25086d7544757bb86181fbe2b5e743d29..ef50d9747f2a027e356b05ad8d94ffb2fd4a423e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
@@ -219,7 +219,7 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fixes log spam caused by invalid entities in beehives
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
index 8484e80a70129fb0358d56efab6fd54798b54e6e..90fce5d2178672608f3ae97277cafe740a9ebead 100644
|
||||
index 483dc52c793d9f90a35b1d091dd8ce71115e4640..61097643950b1182e3751c6a4629cf5661dcf3b8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||
@ -16,7 +16,7 @@ index 8484e80a70129fb0358d56efab6fd54798b54e6e..90fce5d2178672608f3ae97277cafe74
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
@@ -351,6 +352,13 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
@@ -367,6 +368,13 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
|
||||
for (int i = 0; i < nbttaglist.size(); ++i) {
|
||||
CompoundTag nbttagcompound1 = nbttaglist.getCompound(i);
|
||||
|
@ -1,24 +1,24 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Video <videogamesm12@gmail.com>
|
||||
Date: Sun, 13 Mar 2022 03:01:29 -0600
|
||||
Date: Fri, 22 Apr 2022 00:59:00 -0500
|
||||
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 7cacc61fed0c610845c67894d1cc68e44f5e46fe..4186b9558cbf6799e8491443b9ed5a2c9063ab7c 100644
|
||||
index 292ae4a68093b7d939a755e1062cee57da186ab1..4ae030580131252b849fd356717d0323c29cf773 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
@@ -6,6 +6,9 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import com.destroystokyo.paper.profile.CraftPlayerProfile;
|
||||
import com.destroystokyo.paper.profile.PlayerProfile;
|
||||
@@ -7,6 +7,9 @@ import java.util.UUID;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.world.level.block.entity.SkullBlockEntity;
|
||||
+// Scissors start
|
||||
+import org.apache.commons.lang3.StringUtils;
|
||||
+// Scissors end
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
@@ -47,7 +50,9 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@@ -45,7 +48,9 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
|
||||
if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) {
|
||||
this.setProfile(NbtUtils.readGameProfile(tag.getCompound(SKULL_OWNER.NBT)));
|
@ -5,19 +5,18 @@ 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 c88ab49f60857d5687facc8523f9edc4d652c81b..2e3220cbbea5f6cb9acb7f8fbaf2ff8f91b09234 100644
|
||||
index 5607dc10dc1c9d2dbf4e3007890e5e89a175605e..bc30df2009cf0d8edf0040f6fe16587d109cebdb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -1758,7 +1758,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1769,6 +1769,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
try {
|
||||
blockParser = blockParser.parse(false);
|
||||
} catch (com.mojang.brigadier.exceptions.CommandSyntaxException e) {
|
||||
- e.printStackTrace();
|
||||
+ // Scissors - Don't log errors thrown by Brigadier when an error is thrown
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1782,8 +1782,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1794,8 +1795,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
resource = CraftNamespacedKey.fromMinecraft(key);
|
||||
}
|
||||
} catch (IllegalArgumentException ex) {
|
@ -6,17 +6,17 @@ Subject: [PATCH] Ignore errors thrown when trying to remove minecart entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
index d80c7be5b153db4046d0b11c0116c6aa860ea48c..dfbae9ca58722c0aeb6cb9888643016d4cb36f63 100644
|
||||
index ef50d9747f2a027e356b05ad8d94ffb2fd4a423e..cd8ede69be1f728663a670085113d842ec0209af 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
@@ -192,7 +192,12 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
|
||||
@Override
|
||||
public void remove(Entity.RemovalReason reason) {
|
||||
if (!this.level.isClientSide && reason.shouldDestroy()) {
|
||||
- Containers.dropContents(this.level, this, this);
|
||||
- Containers.dropContents(this.level, (Entity) this, (Container) this);
|
||||
+ // Scissors start - Ignore errors thrown when trying to remove minecart entities with content in them
|
||||
+ try {
|
||||
+ Containers.dropContents(this.level, this, this);
|
||||
+ Containers.dropContents(this.level, (Entity) this, (Container) this);
|
||||
+ } catch (Exception ignored) {
|
||||
+ }
|
||||
+ // Scissors end
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] ItemEntity - Check if items are air before calling setItem
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 063f3e4c67e6716c9a03dbe4b72eafd32e4f0d53..03b8cc0ae12f17cf3a1c57958cf10ca23750b92a 100644
|
||||
index 9ca37cbf829ff4240ae79fc283bcf9e7f2c728d2..bc71ca6e082a137d17ee0bf43de72095bd19ab3d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -377,11 +377,14 @@ public class ItemEntity extends Entity {
|
||||
@@ -379,11 +379,14 @@ public class ItemEntity extends Entity {
|
||||
|
||||
CompoundTag nbttagcompound1 = nbt.getCompound("Item");
|
||||
|
||||
|
@ -6,7 +6,7 @@ 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 bb5319afd112f1013445e29e9fcad137d4c581f9..1cd62752e675b91fdcc21733509c95d5bd97625a 100644
|
||||
index b79f4ce38a42e4dba8ebdfc97dadc531b7245c7a..9c49be7c53a1f2a8c203341b8ded9cd222d0c178 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 {
|
||||
|
@ -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 dca8853944832e8fc5a291aa6b46d84b24181ea7..24f009fa3b84323b4c43e0ed15c224d16a7ede81 100644
|
||||
index 050ee055b9a2a0767f58d6677ad7f2d927fbaa54..9ec5bc2c29fc98ac2fbf9ff6231e8c3215ff11a1 100644
|
||||
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
@@ -230,7 +230,7 @@ public final class NbtUtils {
|
||||
@@ -229,7 +229,7 @@ public final class NbtUtils {
|
||||
if (!compound.contains("Name", 8)) {
|
||||
return Blocks.AIR.defaultBlockState();
|
||||
} else {
|
||||
@ -18,10 +18,10 @@ index dca8853944832e8fc5a291aa6b46d84b24181ea7..24f009fa3b84323b4c43e0ed15c224d1
|
||||
if (compound.contains("Properties", 10)) {
|
||||
CompoundTag compoundTag = compound.getCompound("Properties");
|
||||
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 52e4948fd1657fa1776ac6b0142e8c21e7567976..a811b97021e2eed6efc592bc33602a270feb75a0 100644
|
||||
index 53d0024daf6963ac4dab575666b0d6a74a39a958..ce13ba13c30428558391defbb09a49429dd10422 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -536,7 +536,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
@@ -549,7 +549,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
this.setCritArrow(nbt.getBoolean("crit"));
|
||||
this.setPierceLevel(nbt.getByte("PierceLevel"));
|
||||
if (nbt.contains("SoundEvent", 8)) {
|
||||
|
@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Video <videogamesm12@gmail.com>
|
||||
Date: Sun, 20 Mar 2022 03:04:33 -0600
|
||||
Date: Mon, 9 May 2022 23:40:59 -0500
|
||||
Subject: [PATCH] Even more ResourceLocation validation and log spam fixes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||
index 02172fdcf587904258387d309938fb379a300524..3c60094119a2b51d5fbab6c559c43293913f6204 100644
|
||||
index 7e1885d9cc568a544e934cede32bff05c20b567a..2481c50d8eb58a003e30e2d957b877bce5123a3a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||
@@ -420,7 +420,7 @@ public class AreaEffectCloud extends Entity {
|
||||
@ -60,18 +60,22 @@ 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 5a43e420f14fa52d71d41ff3694a179e7a1a5be3..488ccdeb867dcd3aaae4bce77da8b7a11d07eddc 100644
|
||||
index d775e19402188e35f79affb4ed636b6533f90ab5..29f5ab80ffbc421da911046678427755c6156894 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
@@ -67,8 +67,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||
this.getHandle().lootTable = this.getHandle().getDefaultLootTable();
|
||||
}
|
||||
@@ -63,8 +63,18 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||
|
||||
- NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().lootTable);
|
||||
@Override
|
||||
public LootTable getLootTable() {
|
||||
- NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().getLootTable());
|
||||
- return Bukkit.getLootTable(key);
|
||||
+ if (this.getHandle().lootTable == null) {
|
||||
+ this.getHandle().lootTable = this.getHandle().getDefaultLootTable();
|
||||
+ }
|
||||
+
|
||||
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
||||
+ try {
|
||||
+ NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().lootTable);
|
||||
+ NamespacedKey key = CraftNamespacedKey.fromMinecraft(this.getHandle().getLootTable());
|
||||
+ return Bukkit.getLootTable(key);
|
||||
+ } catch (Exception ex) {
|
||||
+ return null;
|
@ -5,10 +5,10 @@ Subject: [PATCH] Do not log invalid items in HoverEvent and ItemFrame
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||
index c5711b3d120699ec78f81e9b6ee80d0764552e94..9c1341803cf892f7f3af11381bd56bc95f31fad0 100644
|
||||
index 67feb4e688d049e9f74f0deabb1ec583336a29be..63dbbc0f027ab66d183f81d6a8e0f9e0b85ea562 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||
@@ -315,7 +315,7 @@ public class HoverEvent {
|
||||
@@ -314,7 +314,7 @@ public class HoverEvent {
|
||||
CompoundTag compoundTag = TagParser.parseTag(string);
|
||||
return new HoverEvent.ItemStackInfo(item, i, compoundTag);
|
||||
} catch (CommandSyntaxException var6) {
|
||||
@ -17,7 +17,7 @@ index c5711b3d120699ec78f81e9b6ee80d0764552e94..9c1341803cf892f7f3af11381bd56bc9
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ public class HoverEvent {
|
||||
@@ -328,7 +328,7 @@ public class HoverEvent {
|
||||
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
||||
return new HoverEvent.ItemStackInfo(ItemStack.of(compoundTag));
|
||||
} catch (CommandSyntaxException var2) {
|
||||
@ -27,10 +27,10 @@ index c5711b3d120699ec78f81e9b6ee80d0764552e94..9c1341803cf892f7f3af11381bd56bc9
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
index b829efdb40051a41b3bf1cabb8bf7d7c952797b5..a0f20bd54f713afe17c9b5fea9fdee6c59b6e219 100644
|
||||
index f134a2e68d50fba021b19fac4c75fb35d0e252c6..5e79ce09bf8ba48eb7f5dfdcf1511a2964c3281d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
@@ -388,7 +388,7 @@ public class ItemFrame extends HangingEntity {
|
||||
@@ -396,7 +396,7 @@ public class ItemFrame extends HangingEntity {
|
||||
ItemStack itemstack = ItemStack.of(nbttagcompound1);
|
||||
|
||||
if (itemstack.isEmpty()) {
|
@ -1,27 +1,27 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Video <videogamesm12@gmail.com>
|
||||
Date: Mon, 14 Mar 2022 00:49:35 -0600
|
||||
Date: Fri, 22 Apr 2022 01:19:49 -0500
|
||||
Subject: [PATCH] Even more resource location validation
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||
index 4733f74ff028c03a60b73280caf9e4d1e2f0ca30..02172fdcf587904258387d309938fb379a300524 100644
|
||||
index 2481c50d8eb58a003e30e2d957b877bce5123a3a..6b284666eae8b7e0ef8f54dfe9311a0979b420fe 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||
@@ -143,7 +143,7 @@ public class AreaEffectCloud extends Entity {
|
||||
}
|
||||
|
||||
public void setType(String string) {
|
||||
public void setPotionType(String string) {
|
||||
- this.setPotion(Registry.POTION.get(new ResourceLocation(string)));
|
||||
+ this.setPotion(Registry.POTION.get(ResourceLocation.tryParse(string))); // Scissors - Validate resource locations
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index 1c446dba5de89698397041ee38a2e1a00bec8a56..93799eda06c7b699580251f80b641c47643f3615 100644
|
||||
index 79abd84696ef099f6b12ddeaa6e398f18c53316a..7070b64c0c66b5c9d09bf7764ce506f4461dbac5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -513,7 +513,7 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
@@ -514,7 +514,7 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
}), (entity) -> {
|
||||
entity.load(nbt);
|
||||
}, () -> {
|
||||
@ -30,7 +30,7 @@ index 1c446dba5de89698397041ee38a2e1a00bec8a56..93799eda06c7b699580251f80b641c47
|
||||
});
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
@@ -538,7 +538,7 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
}
|
||||
|
||||
public static Optional<EntityType<?>> by(CompoundTag nbt) {
|
||||
@ -40,10 +40,10 @@ index 1c446dba5de89698397041ee38a2e1a00bec8a56..93799eda06c7b699580251f80b641c47
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 8837fc04a67a656d0e780965ac113d3b28e2369f..11427668a0af28cf638df3574357f696f49af13d 100644
|
||||
index e3227a806d9e19923783122ea94ae19e7dbe71da..473dba5213f6aed7573e970119f4b6ad0e4f6367 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -570,7 +570,7 @@ public abstract class Mob extends LivingEntity {
|
||||
@@ -572,7 +572,7 @@ public abstract class Mob extends LivingEntity {
|
||||
|
||||
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
|
||||
if (nbt.contains("DeathLootTable", 8)) {
|
@ -1,28 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Video <videogamesm12@gmail.com>
|
||||
Date: Sun, 20 Mar 2022 04:39:09 -0600
|
||||
Subject: [PATCH] Fixes crash exploit related to out of bounds Axolotl variants
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
index 2b8725087fd3bfeca7162bda2783fdacd13a8390..802c9c87df190dce09f9e703cedcb06874c58389 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
@@ -118,7 +118,7 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||
super.readAdditionalSaveData(nbt);
|
||||
- this.setVariant(Axolotl.Variant.BY_ID[nbt.getInt("Variant")]);
|
||||
+ this.setVariant(Axolotl.Variant.BY_ID[Math.min(Math.abs(nbt.getInt("Variant")), 4)]); // Scissors - Fixes out of bounds Axolotl variant exploit
|
||||
this.setFromBucket(nbt.getBoolean("FromBucket"));
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
|
||||
@Override
|
||||
public void loadFromBucketTag(CompoundTag nbt) {
|
||||
Bucketable.loadDefaultDataFromBucketTag(this, nbt);
|
||||
- this.setVariant(Axolotl.Variant.BY_ID[nbt.getInt("Variant")]);
|
||||
+ this.setVariant(Axolotl.Variant.BY_ID[Math.min(Math.abs(nbt.getInt("Variant")), 4)]); // Scissors - Fix out-of-bounds Axolotl variant exploit
|
||||
if (nbt.contains("Age")) {
|
||||
this.setAge(nbt.getInt("Age"));
|
||||
}
|
@ -5,7 +5,7 @@ Subject: [PATCH] Change version fetcher to AMG
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
index ece77f5ea4b14bbed7c070131b3251ea86764538..74e5c5194580c6b65f3b4e657237fef7ef005ec2 100644
|
||||
index bf42969859545a8a520923ef1836ffa4a5cc24a0..2ee707e109f146c83cdea162c119ea96c0ff4f8f 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
@@ -4,6 +4,8 @@ import com.destroystokyo.paper.util.VersionFetcher;
|
||||
@ -72,10 +72,10 @@ index ece77f5ea4b14bbed7c070131b3251ea86764538..74e5c5194580c6b65f3b4e657237fef7
|
||||
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 22e9dd17f62103c5061435099ce96a3d70d54808..d033caf5dabbd2a240286c5623b3d287ae5cbdd9 100644
|
||||
index fbe68bd4739d9a0e7d9bc4c3d5ba8ecfd2d13954..40313b014b4ed5f7e9505bde2827383c19d4377a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -269,7 +269,7 @@ public class Main {
|
||||
@@ -265,7 +265,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! ***");
|
@ -6,17 +6,17 @@ 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 2e3220cbbea5f6cb9acb7f8fbaf2ff8f91b09234..3ea83a093f698a055566f45a7927c289ff9a6955 100644
|
||||
index 65844bb02bd3d9ef566d4779106a1f9ef2a2b7bc..f856ac2dfe55a1f1f63725ec20e7b8dd3d394acf 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -45,6 +45,7 @@ import net.minecraft.nbt.NbtIo;
|
||||
@@ -46,6 +46,7 @@ import net.minecraft.nbt.NbtIo;
|
||||
import net.minecraft.nbt.StringTag;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
+import net.minecraft.resources.ResourceLocation; // Scissors
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.apache.commons.lang3.EnumUtils;
|
||||
@@ -481,7 +482,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
|
||||
|
@ -6,11 +6,11 @@ Subject: [PATCH] Validate String UUIDs during the CompoundTag -> GameProfile
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
index 24f009fa3b84323b4c43e0ed15c224d16a7ede81..1d1876c78f82ce36d45320e4575c79fdc284ce0e 100644
|
||||
index 9ec5bc2c29fc98ac2fbf9ff6231e8c3215ff11a1..9ef6b0a861a2b0f6e6d54775c6b0496689d12d66 100644
|
||||
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
@@ -78,7 +78,12 @@ public final class NbtUtils {
|
||||
|
||||
@@ -76,7 +76,12 @@ public final class NbtUtils {
|
||||
}
|
||||
// Paper start - support string UUID's
|
||||
if (compound.contains("Id", 8)) {
|
||||
- uUID = UUID.fromString(compound.getString("Id"));
|
||||
@ -22,4 +22,4 @@ index 24f009fa3b84323b4c43e0ed15c224d16a7ede81..1d1876c78f82ce36d45320e4575c79fd
|
||||
+ // Scissors end
|
||||
}
|
||||
// Paper end
|
||||
if (compound.hasUUID("Id")) {
|
||||
|
@ -5,18 +5,18 @@ Subject: [PATCH] Don't query player data in the `nbt` component
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/NbtComponent.java b/src/main/java/net/minecraft/network/chat/NbtComponent.java
|
||||
index f5f2ec1192303bc55a64dce3e0457e4531a35ba7..62613d9fccd74fe16512fe1fe703dc6db0166b28 100644
|
||||
index 8e658eeb4edc83db72c187baa52b7ada7b848af8..e3dc56de3f91e03b1543257f72448a734d914ed7 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/NbtComponent.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/NbtComponent.java
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.nbt.Tag;
|
||||
@@ -23,6 +23,7 @@ import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
+import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -218,7 +219,7 @@ public abstract class NbtComponent extends BaseComponent implements ContextAware
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -217,7 +218,7 @@ public abstract class NbtComponent extends BaseComponent implements ContextAware
|
||||
protected Stream<CompoundTag> getData(CommandSourceStack source) throws CommandSyntaxException {
|
||||
if (this.compiledSelector != null) {
|
||||
List<? extends Entity> list = this.compiledSelector.findEntities(source);
|
@ -1,165 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: ayunami2000 <spwilliamsiam@gmail.com>
|
||||
Date: Mon, 28 Mar 2022 17:02:21 -0400
|
||||
Subject: [PATCH] Block server-side chunkbans
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||
index b039a32b805fc02033fa862a1c40c4a51639e69a..b2227f01bc90351a4a3f73fa835dd89bde15632e 100644
|
||||
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||
@@ -5,8 +5,22 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.MessageToByteEncoder;
|
||||
import io.papermc.paper.adventure.PaperAdventure; // Paper
|
||||
import java.io.IOException;
|
||||
+import java.util.Collections;
|
||||
+import net.minecraft.ChatFormatting;
|
||||
+import net.minecraft.core.NonNullList;
|
||||
+import net.minecraft.nbt.CompoundTag;
|
||||
+import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.PacketFlow;
|
||||
+import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundChatPacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundContainerSetContentPacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundLevelChunkPacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundMapItemDataPacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket;
|
||||
+import net.minecraft.world.item.ItemStack;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.Marker;
|
||||
@@ -21,6 +35,23 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||
this.flow = side;
|
||||
}
|
||||
|
||||
+ // Scissors start
|
||||
+ private static int tryWrite(Packet packet, FriendlyByteBuf friendlyByteBuf, ChannelHandlerContext channelHandlerContext, int i) {
|
||||
+ friendlyByteBuf.writeVarInt(i);
|
||||
+ friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(PaperAdventure.LOCALE_ATTRIBUTE).get();
|
||||
+
|
||||
+ 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));
|
||||
+ }
|
||||
+
|
||||
+ return k;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
@Override
|
||||
protected void encode(ChannelHandlerContext channelHandlerContext, Packet<?> packet, ByteBuf byteBuf) throws Exception {
|
||||
ConnectionProtocol connectionProtocol = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get();
|
||||
@@ -36,35 +67,68 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||
throw new IOException("Can't serialize unregistered packet");
|
||||
} else {
|
||||
FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(byteBuf);
|
||||
- friendlyByteBuf.writeVarInt(integer);
|
||||
- friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
||||
-
|
||||
+ // Scissors start
|
||||
+ int k;
|
||||
try {
|
||||
- int i = friendlyByteBuf.writerIndex();
|
||||
- packet.write(friendlyByteBuf);
|
||||
- int j = friendlyByteBuf.writerIndex() - i;
|
||||
- if (j > 8388608) {
|
||||
- throw new IllegalArgumentException("Packet too big (is " + j + ", should be less than 8388608): " + packet);
|
||||
- }
|
||||
+ k = tryWrite(packet, friendlyByteBuf, channelHandlerContext, integer);
|
||||
} catch (Throwable var9) {
|
||||
- LOGGER.error("Packet encoding of packet ID {} threw (skippable? {})", integer, packet.isSkippable(), var9); // Paper - WHAT WAS IT? WHO DID THIS TO YOU? WHAT DID YOU SEE?
|
||||
- if (packet.isSkippable()) {
|
||||
- throw new SkipPacketException(var9);
|
||||
- } else {
|
||||
- throw var9;
|
||||
+ packet = capPacket(packet, integer);
|
||||
+ if (packet == null) {
|
||||
+ throw new SkipPacketException(new IllegalArgumentException("Packet too big: " + packet));
|
||||
}
|
||||
+ friendlyByteBuf.clear();
|
||||
+ k = tryWrite(packet, friendlyByteBuf, channelHandlerContext, integer);
|
||||
}
|
||||
-
|
||||
- // Paper start
|
||||
- int packetLength = friendlyByteBuf.readableBytes();
|
||||
- if (packetLength > MAX_PACKET_SIZE) {
|
||||
- throw new PacketTooLargeException(packet, packetLength);
|
||||
- }
|
||||
- // Paper end
|
||||
+ // Scissors end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ // Scissors start
|
||||
+ private static Packet capPacket(Packet packet, int i)
|
||||
+ {
|
||||
+ if (packet instanceof ClientboundBlockEntityDataPacket blockEntityDataPacket)
|
||||
+ {
|
||||
+ packet = new ClientboundBlockEntityDataPacket(blockEntityDataPacket.getPos(), blockEntityDataPacket.getType(), new CompoundTag());
|
||||
+ }
|
||||
+ else if (packet instanceof ClientboundLevelChunkPacket chunkPacket)
|
||||
+ {
|
||||
+ chunkPacket.clearNBT();
|
||||
+ }
|
||||
+ else if (packet instanceof ClientboundSetEntityDataPacket)
|
||||
+ {
|
||||
+ return null; // Skip
|
||||
+ }
|
||||
+ else if (packet instanceof ClientboundContainerSetContentPacket containerSetContentPacket)
|
||||
+ {
|
||||
+ packet = new ClientboundContainerSetContentPacket(containerSetContentPacket.getContainerId(), containerSetContentPacket.getStateId(), NonNullList.create(), ItemStack.EMPTY);
|
||||
+ }
|
||||
+ else if (packet instanceof ClientboundSetEquipmentPacket setEquipmentPacket)
|
||||
+ {
|
||||
+ packet = new ClientboundSetEquipmentPacket(setEquipmentPacket.getEntity(), Collections.emptyList());
|
||||
+ }
|
||||
+ else if (packet instanceof ClientboundContainerSetSlotPacket containerSetSlotPacket)
|
||||
+ {
|
||||
+ packet = new ClientboundContainerSetSlotPacket(containerSetSlotPacket.getContainerId(), containerSetSlotPacket.getStateId(), containerSetSlotPacket.getSlot(), ItemStack.EMPTY);
|
||||
+ }
|
||||
+ else if (packet instanceof ClientboundMapItemDataPacket mapItemDataPacket)
|
||||
+ {
|
||||
+ packet = new ClientboundMapItemDataPacket(mapItemDataPacket.getMapId(), mapItemDataPacket.getScale(), mapItemDataPacket.isLocked(), null, null);
|
||||
+ }
|
||||
+ else if (packet instanceof ClientboundChatPacket chatPacket)
|
||||
+ {
|
||||
+ return null;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ LOGGER.error("Packet with ID {} was too large and was not caught. Please report this to the Scissors developers.", i);
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ return packet;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
// Paper start
|
||||
private static int MAX_PACKET_SIZE = 2097152;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacket.java
|
||||
index 60d72e488bc77cd913328be400ca374a873b4561..1af2260e7bab81fca24784172dd31e06e9adb1e1 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacket.java
|
||||
@@ -50,6 +50,13 @@ public class ClientboundLevelChunkPacket implements Packet<ClientGamePacketListe
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Scissors start
|
||||
+ public void clearNBT() {
|
||||
+ this.blockEntitiesTags.clear();
|
||||
+ this.extraPackets.clear();
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
// Paper start - Anti-Xray - Add chunk packet info
|
||||
@Deprecated public ClientboundLevelChunkPacket(LevelChunk chunk) { this(chunk, true); } // Notice for updates: Please make sure this constructor isn't used anywhere
|
||||
public ClientboundLevelChunkPacket(LevelChunk chunk, boolean modifyBlocks) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Limit ListTags to 1024 elements
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
|
||||
index 88bac72edf19c578902f49d20353989ed4d96f8f..6963f2720fcc9888f62f5a1382dd96d82f598ac8 100644
|
||||
index ea68b26e506e48d8238b7ee4266e61b211d52bd2..10d3a1b31233f884823ee9a4bb27d70eac3914df 100644
|
||||
--- a/src/main/java/net/minecraft/nbt/ListTag.java
|
||||
+++ b/src/main/java/net/minecraft/nbt/ListTag.java
|
||||
@@ -34,6 +34,7 @@ public class ListTag extends CollectionTag<Tag> {
|
||||
@@ -33,6 +33,7 @@ public class ListTag extends CollectionTag<Tag> {
|
||||
list.add(tagType.load(dataInput, i + 1, nbtAccounter));
|
||||
}
|
||||
|
@ -1,41 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Video <videogamesm12@gmail.com>
|
||||
Date: Sun, 20 Mar 2022 07:46:37 -0600
|
||||
Date: Fri, 22 Apr 2022 01:24:05 -0500
|
||||
Subject: [PATCH] Validate coordinates before attempting to get block entities
|
||||
when handling Creative Inventory packets
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 621ec8e8a197323da6b423fee57c816ac9d7c875..83333ae9c8e8c1edc6e7f02468bd8dc7e44bb66e 100644
|
||||
index 901fa17d0f0a3f66923f68f13f183bc4c17f7748..dc9199c0b1fa9b8779afc51d7af4c516d217ddb3 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2933,20 +2933,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -2991,20 +2991,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
if (this.player.gameMode.isCreative()) {
|
||||
boolean flag = packet.getSlotNum() < 0;
|
||||
ItemStack itemstack = packet.getItem();
|
||||
- CompoundTag nbttagcompound = itemstack.getTagElement("BlockEntityTag");
|
||||
- CompoundTag nbttagcompound = BlockItem.getBlockEntityData(itemstack);
|
||||
|
||||
+ CompoundTag nbttagcompound = itemstack.getTagElement("BlockEntityTag");
|
||||
+ CompoundTag nbttagcompound = BlockItem.getBlockEntityData(itemstack);
|
||||
if (!itemstack.isEmpty() && nbttagcompound != null && nbttagcompound.contains("x") && nbttagcompound.contains("y") && nbttagcompound.contains("z") && this.player.getBukkitEntity().hasPermission("minecraft.nbt.copy")) { // Spigot
|
||||
BlockPos blockposition = new BlockPos(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z"));
|
||||
- BlockEntity tileentity = this.player.level.getBlockEntity(blockposition);
|
||||
BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound);
|
||||
// Paper start
|
||||
- BlockEntity tileentity = null;
|
||||
+ // Scissors start - Validate coordinates and whether or not the player can reach them
|
||||
+ if (Level.isInSpawnableBounds(blockposition) && !isOutsideOfReach(blockposition.getX(), blockposition.getY(), blockposition.getZ())) {
|
||||
+ BlockEntity tileentity = this.player.level.getBlockEntity(blockposition);
|
||||
+ BlockEntity tileentity = null;
|
||||
if (this.player.distanceToSqr(blockposition.getX(), blockposition.getY(), blockposition.getZ()) < 32 * 32 && this.player.getLevel().isLoadedAndInBounds(blockposition)) {
|
||||
tileentity = this.player.level.getBlockEntity(blockposition);
|
||||
}
|
||||
// Paper end
|
||||
|
||||
- if (tileentity != null) {
|
||||
- CompoundTag nbttagcompound1 = tileentity.save(new CompoundTag());
|
||||
- tileentity.saveToItem(itemstack);
|
||||
+ if (tileentity != null) {
|
||||
+ CompoundTag nbttagcompound1 = tileentity.save(new CompoundTag());
|
||||
|
||||
- nbttagcompound1.remove("x");
|
||||
- nbttagcompound1.remove("y");
|
||||
- nbttagcompound1.remove("z");
|
||||
- itemstack.addTagElement("BlockEntityTag", (Tag) nbttagcompound1);
|
||||
+ nbttagcompound1.remove("x");
|
||||
+ nbttagcompound1.remove("y");
|
||||
+ nbttagcompound1.remove("z");
|
||||
+ itemstack.addTagElement("BlockEntityTag", (Tag) nbttagcompound1);
|
||||
+ tileentity.saveToItem(
|
||||
+ itemstack);
|
||||
+ }
|
||||
}
|
||||
+ // Scissors end
|
@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Video <videogamesm12@gmail.com>
|
||||
Date: Mon, 28 Mar 2022 13:19:43 -0600
|
||||
Date: Fri, 22 Apr 2022 01:26:55 -0500
|
||||
Subject: [PATCH] Better handling of invalid JSON components
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
||||
index 5ba1636bbb938373e43c1f3ac561368fc9cffd43..6978d14c6bd90ffb640e39e8666430d95d5ef45c 100644
|
||||
index 984105c226f16746b43bb2d2932e0b87f3a6a70c..faa41d102c06b52bc758ebe3484820376c482093 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
||||
@@ -24,6 +24,8 @@ import java.util.List;
|
||||
@ -45,10 +45,10 @@ index 5ba1636bbb938373e43c1f3ac561368fc9cffd43..6978d14c6bd90ffb640e39e8666430d9
|
||||
public static MutableComponent fromJson(String json) {
|
||||
return (MutableComponent) GsonHelper.fromJson(Component.Serializer.GSON, json, MutableComponent.class, false);
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||
index 9c1341803cf892f7f3af11381bd56bc95f31fad0..c4394812326bccd70d64b4bd45eb1bb7b53b0905 100644
|
||||
index 63dbbc0f027ab66d183f81d6a8e0f9e0b85ea562..21ee39172b3efb6414d1cf8fbf36cd463194abab 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||
@@ -80,7 +80,7 @@ public class HoverEvent {
|
||||
@@ -79,7 +79,7 @@ public class HoverEvent {
|
||||
if (jsonElement != null) {
|
||||
return action.deserialize(jsonElement);
|
||||
} else {
|
||||
@ -57,7 +57,7 @@ index 9c1341803cf892f7f3af11381bd56bc95f31fad0..c4394812326bccd70d64b4bd45eb1bb7
|
||||
return component != null ? action.deserializeFromLegacy(component) : null;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class HoverEvent {
|
||||
@@ -94,7 +94,7 @@ public class HoverEvent {
|
||||
}
|
||||
|
||||
public static class Action<T> {
|
||||
@ -66,7 +66,7 @@ index 9c1341803cf892f7f3af11381bd56bc95f31fad0..c4394812326bccd70d64b4bd45eb1bb7
|
||||
public static final HoverEvent.Action<HoverEvent.ItemStackInfo> SHOW_ITEM = new HoverEvent.Action<>("show_item", true, HoverEvent.ItemStackInfo::create, HoverEvent.ItemStackInfo::serialize, HoverEvent.ItemStackInfo::create);
|
||||
public static final HoverEvent.Action<HoverEvent.EntityTooltipInfo> SHOW_ENTITY = new HoverEvent.Action<>("show_entity", true, HoverEvent.EntityTooltipInfo::create, HoverEvent.EntityTooltipInfo::serialize, HoverEvent.EntityTooltipInfo::create);
|
||||
private static final Map<String, HoverEvent.Action<?>> LOOKUP = Stream.of(SHOW_TEXT, SHOW_ITEM, SHOW_ENTITY).collect(ImmutableMap.toImmutableMap(HoverEvent.Action::getName, (action) -> {
|
||||
@@ -183,7 +183,7 @@ public class HoverEvent {
|
||||
@@ -182,7 +182,7 @@ public class HoverEvent {
|
||||
return null;
|
||||
}
|
||||
// Scissors end
|
||||
@ -75,7 +75,7 @@ index 9c1341803cf892f7f3af11381bd56bc95f31fad0..c4394812326bccd70d64b4bd45eb1bb7
|
||||
return new HoverEvent.EntityTooltipInfo(entityType, uUID, component);
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ public class HoverEvent {
|
||||
@@ -191,7 +191,7 @@ public class HoverEvent {
|
||||
public static HoverEvent.EntityTooltipInfo create(Component text) {
|
||||
try {
|
||||
CompoundTag compoundTag = TagParser.parseTag(text.getString());
|
||||
@ -85,10 +85,10 @@ index 9c1341803cf892f7f3af11381bd56bc95f31fad0..c4394812326bccd70d64b4bd45eb1bb7
|
||||
// Scissors start
|
||||
UUID uUID;
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/NbtComponent.java b/src/main/java/net/minecraft/network/chat/NbtComponent.java
|
||||
index ae9fef071388bc6b10d34a0126c9dd1ac77eb9e7..f5f2ec1192303bc55a64dce3e0457e4531a35ba7 100644
|
||||
index e3dc56de3f91e03b1543257f72448a734d914ed7..f518e47818a47be0dfd7cccc4845ba9736c6cd8b 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/NbtComponent.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/NbtComponent.java
|
||||
@@ -77,13 +77,14 @@ public abstract class NbtComponent extends BaseComponent implements ContextAware
|
||||
@@ -78,13 +78,14 @@ public abstract class NbtComponent extends BaseComponent implements ContextAware
|
||||
if (this.interpreting) {
|
||||
Component component = DataFixUtils.orElse(ComponentUtils.updateForEntity(source, this.separator, sender, depth), ComponentUtils.DEFAULT_NO_STYLE_SEPARATOR);
|
||||
return stream.flatMap((text) -> {
|
||||
@ -105,7 +105,7 @@ index ae9fef071388bc6b10d34a0126c9dd1ac77eb9e7..f5f2ec1192303bc55a64dce3e0457e45
|
||||
}).reduce((accumulator, current) -> {
|
||||
return accumulator.append(component).append(current);
|
||||
}).orElseGet(() -> {
|
||||
@@ -94,7 +95,7 @@ public abstract class NbtComponent extends BaseComponent implements ContextAware
|
||||
@@ -95,7 +96,7 @@ public abstract class NbtComponent extends BaseComponent implements ContextAware
|
||||
return stream.map((string) -> {
|
||||
return new TextComponent(string);
|
||||
}).reduce((accumulator, current) -> {
|
||||
@ -115,10 +115,10 @@ index ae9fef071388bc6b10d34a0126c9dd1ac77eb9e7..f5f2ec1192303bc55a64dce3e0457e45
|
||||
return new TextComponent("");
|
||||
});
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index b7c4700fd5db14c77e7ee78311dd77a754d9d41c..07f04c1708b118ace3ed73ae2bf88c29b1c80ad2 100644
|
||||
index dfd1f37757af1bd808cc2e2d8bf97123adf638bb..876e8f83fab4e255959948e59cabf05478446e4d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2202,12 +2202,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
@@ -2215,12 +2215,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");
|
||||
@ -133,45 +133,45 @@ index b7c4700fd5db14c77e7ee78311dd77a754d9d41c..07f04c1708b118ace3ed73ae2bf88c29
|
||||
|
||||
this.setCustomNameVisible(nbt.getBoolean("CustomNameVisible"));
|
||||
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 3281448bf37da8a1b4b7b44f10f4b2438b4a4f29..8038e3a10b563321df1e8cedd26b256078ce745a 100644
|
||||
index 8d5c9813010a0256bd2712a1eabbc91f0f473a41..6ec48f834f5fef8678c690fd5d1ea530ebd2720f 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
|
||||
@@ -405,7 +405,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
|
||||
@@ -402,7 +402,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
|
||||
this.levels = nbt.getInt("Levels"); // SPIGOT-5053, use where available
|
||||
// CraftBukkit end
|
||||
if (nbt.contains("CustomName", 8)) {
|
||||
- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"));
|
||||
- this.name = net.minecraft.server.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException
|
||||
+ this.name = Component.Serializer.fromJsonSafe(nbt.getString("CustomName")); // Scissors - Use safer method for getting Components from JSON
|
||||
}
|
||||
|
||||
this.lockKey = LockCode.fromTag(nbt);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
||||
index 40ac65501a0213b43964fd68eb155d4358fb7fd4..9cfc44472e841e1a2cd7de2a1284afdde05a7989 100644
|
||||
index 1eccf9424bd8a4bcbeed4ebb1795fd113fe5af18..fcc3d2fbc679fdb70da27d20d19380fa238ba7ea 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
||||
@@ -44,7 +44,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
|
||||
@@ -43,7 +43,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
|
||||
public void load(CompoundTag nbt) {
|
||||
super.load(nbt);
|
||||
if (nbt.contains("CustomName", 8)) {
|
||||
- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"));
|
||||
- this.name = net.minecraft.server.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException
|
||||
+ this.name = Component.Serializer.fromJsonSafe(nbt.getString("CustomName")); // Scissors - Use safer method for getting Components from JSON
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
||||
index 2153e7035535990b5307b85d8bc3dab50c0a3ae8..5f11f9b77684bd91b4cfe77cd415ed42bd9bc21a 100644
|
||||
index 0efb63d1a4cefede25712daf9cea0f5c3256980f..07fe4043184eda6fa11e0680930100eb914f64c1 100644
|
||||
--- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
||||
+++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
||||
@@ -39,7 +39,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||
CompoundTag compoundTag = nbt.getCompound(i);
|
||||
String string = compoundTag.getString("Name");
|
||||
PlayerTeam playerTeam = this.scoreboard.addPlayerTeam(string);
|
||||
- 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
|
||||
if (component != null) {
|
||||
playerTeam.setDisplayName(component);
|
||||
}
|
||||
@@ -57,14 +57,14 @@ public class ScoreboardSaveData extends SavedData {
|
||||
@@ -53,14 +53,14 @@ public class ScoreboardSaveData extends SavedData {
|
||||
}
|
||||
|
||||
if (compoundTag.contains("MemberNamePrefix", 8)) {
|
||||
@ -188,12 +188,12 @@ index 2153e7035535990b5307b85d8bc3dab50c0a3ae8..5f11f9b77684bd91b4cfe77cd415ed42
|
||||
if (component3 != null) {
|
||||
playerTeam.setPlayerSuffix(component3);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||
string = string.substring(0, 16);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
- 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, objectiveCriteria, component, renderType);
|
||||
this.scoreboard.addObjective(string, criterion, component, renderType);
|
||||
});
|
@ -1,95 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Business Goose <arclicious@vivaldi.net>
|
||||
Date: Mon, 4 Apr 2022 00:16:54 +0100
|
||||
Subject: [PATCH] Prevent abusable entities from being spawned by spawners
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
index 569cef8fcb1e3e1e8b66dad4fa9b956b44542bf1..f844e0b1e44f0b45b1febadf02d7b37d3099fbdb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -19,7 +19,9 @@ import net.minecraft.util.StringUtil;
|
||||
import net.minecraft.util.random.WeightedRandomList;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
+import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
+import net.minecraft.world.entity.MobCategory;
|
||||
import net.minecraft.world.entity.MobSpawnType;
|
||||
import net.minecraft.world.entity.SpawnGroupData;
|
||||
import net.minecraft.world.entity.SpawnPlacements;
|
||||
@@ -31,6 +33,7 @@ public abstract class BaseSpawner {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final int EVENT_SPAWN = 1;
|
||||
+ public static List<MobCategory> whitelistedCategories = List.of(MobCategory.CREATURE, MobCategory.MONSTER, MobCategory.WATER_CREATURE, MobCategory.UNDERGROUND_WATER_CREATURE, MobCategory.AMBIENT); // Scissors
|
||||
public static WeightedRandomList<SpawnData> EMPTY_POTENTIALS = WeightedRandomList.create(); // Paper - private->public
|
||||
public int spawnDelay = 20;
|
||||
public WeightedRandomList<SpawnData> spawnPotentials;
|
||||
@@ -64,6 +67,13 @@ public abstract class BaseSpawner {
|
||||
public ResourceLocation getEntityId(@Nullable Level world, BlockPos pos) {
|
||||
String s = this.nextSpawnData.getTag().getString("id");
|
||||
|
||||
+ // Scissors start
|
||||
+ Optional<EntityType<?>> entityType = EntityType.byString(s);
|
||||
+ if (entityType.isPresent() && !whitelistedCategories.contains(entityType.get().getCategory())) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
try {
|
||||
return StringUtil.isNullOrEmpty(s) ? null : new ResourceLocation(s);
|
||||
} catch (ResourceLocationException resourcekeyinvalidexception) {
|
||||
@@ -73,6 +83,12 @@ public abstract class BaseSpawner {
|
||||
}
|
||||
|
||||
public void setEntityId(EntityType<?> type) {
|
||||
+ // Scissors start - Don't allow unnatural entities to be added to spawners
|
||||
+ if (!whitelistedCategories.contains(type.getCategory())) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
this.nextSpawnData.getTag().putString("id", Registry.ENTITY_TYPE.getKey(type).toString());
|
||||
this.spawnPotentials = BaseSpawner.EMPTY_POTENTIALS; // CraftBukkit - SPIGOT-3496, MC-92282
|
||||
}
|
||||
@@ -121,7 +137,7 @@ public abstract class BaseSpawner {
|
||||
CompoundTag nbttagcompound = this.nextSpawnData.getTag();
|
||||
Optional<EntityType<?>> optional = EntityType.by(nbttagcompound);
|
||||
|
||||
- if (!optional.isPresent()) {
|
||||
+ if (!(optional.isPresent() && whitelistedCategories.contains(optional.get().getCategory()))) { // Scissors - Don't try spawning in entites that aren't whitelisted
|
||||
this.delay(world, pos);
|
||||
return;
|
||||
}
|
||||
@@ -254,12 +270,16 @@ public abstract class BaseSpawner {
|
||||
ListTag nbttaglist = nbt.getList("SpawnPotentials", 10);
|
||||
|
||||
for (int i = 0; i < nbttaglist.size(); ++i) {
|
||||
- list.add(new SpawnData(nbttaglist.getCompound(i)));
|
||||
+ // Scissors start - Filter unnatural entity types from being added
|
||||
+ if (isValid(nbttaglist.getCompound(i))) {
|
||||
+ list.add(new SpawnData(nbttaglist.getCompound(i)));
|
||||
+ }
|
||||
+ // Scissors end
|
||||
}
|
||||
}
|
||||
|
||||
this.spawnPotentials = WeightedRandomList.create((List) list);
|
||||
- if (nbt.contains("SpawnData", 10)) {
|
||||
+ if (nbt.contains("SpawnData", 10) && isValid(nbt.getCompound("SpawnData"))) { // Scissors - Filter unnatural entity types from being added
|
||||
this.setNextSpawnData(world, pos, new SpawnData(1, nbt.getCompound("SpawnData")));
|
||||
} else if (!list.isEmpty()) {
|
||||
this.spawnPotentials.getRandom(this.random).ifPresent((mobspawnerdata) -> {
|
||||
@@ -371,4 +391,11 @@ public abstract class BaseSpawner {
|
||||
public double getoSpin() {
|
||||
return this.oSpin;
|
||||
}
|
||||
+
|
||||
+ // Scissors start
|
||||
+ public boolean isValid(CompoundTag tag) {
|
||||
+ Optional<EntityType<?>> type = EntityType.by(tag);
|
||||
+ return type.isPresent() && whitelistedCategories.contains(type.get().getCategory());
|
||||
+ }
|
||||
+ // Scissors end
|
||||
}
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fixes creative-killing potion effects and certain potion
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/effect/MobEffect.java b/src/main/java/net/minecraft/world/effect/MobEffect.java
|
||||
index 79e036d79dec2ec4404baf02c23ba5ccad20cdce..506be74453c6ecc52f05a48b1d95f82175fa6159 100644
|
||||
index 8bbb9bdcf95989f1737714655f6f6a269d46d7f2..3f5df0a365ddafe4277988767f8366536b928dab 100644
|
||||
--- a/src/main/java/net/minecraft/world/effect/MobEffect.java
|
||||
+++ b/src/main/java/net/minecraft/world/effect/MobEffect.java
|
||||
@@ -47,6 +47,7 @@ public class MobEffect {
|
@ -1,19 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Business Goose <arclicious@vivaldi.net>
|
||||
Date: Mon, 18 Apr 2022 16:55:19 +0100
|
||||
Date: Fri, 3 Jun 2022 19:30:14 -0500
|
||||
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 99a5074adbe2a254ae6115b3548f1fcd30ba2489..68ae4dfe3f4a77605b19607b5f04a2a6d07d6fc8 100644
|
||||
index d6ef140bcc35b10f78f2ec2f10c8a153395fc9df..d8393887cc98930815864eca28b07ef89b26f39e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -623,7 +623,7 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -620,7 +620,7 @@ public abstract class LivingEntity extends Entity {
|
||||
|
||||
protected void tickDeath() {
|
||||
++this.deathTime;
|
||||
- if (this.deathTime >= 20 && !this.isRemoved() && !this.level.isClientSide()) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead)
|
||||
+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.isRemoved() && !this.level.isClientSide()) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead)
|
||||
- if (this.deathTime == 20 && !this.level.isClientSide()) {
|
||||
+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level.isClientSide()) {
|
||||
this.level.broadcastEntityEvent(this, (byte) 60);
|
||||
this.remove(Entity.RemovalReason.KILLED);
|
||||
}
|
53
patches/server/0026-Update-for-1.18.2.patch
Normal file
53
patches/server/0026-Update-for-1.18.2.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Telesphoreo <me@telesphoreo.me>
|
||||
Date: Fri, 22 Apr 2022 01:27:54 -0500
|
||||
Subject: [PATCH] Update for 1.18.2
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
index f92610edcfb724374c69e66443eab60919ee955a..69cc277e4b737ff5a7424cd9afc5573e6eaec3d3 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
@@ -18,6 +18,7 @@ import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.stream.StreamSupport;
|
||||
+import org.bukkit.Bukkit;
|
||||
|
||||
public class PaperVersionFetcher implements VersionFetcher {
|
||||
private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end
|
||||
@@ -56,15 +57,14 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
return mcVer;
|
||||
}
|
||||
|
||||
- // Scissors start - Allow getting git information
|
||||
- public static String getCommit() {
|
||||
- Map<String, String> attributes = JarManifests.MANIFEST_MAP;
|
||||
- return attributes.get("Git-Commit");
|
||||
+ // Scissors start - Allow getting Git information
|
||||
+ private static String getCommit() {
|
||||
+ final var manifest = JarManifests.manifest(Bukkit.getServer().getClass());
|
||||
+ return manifest == null ? null : manifest.getMainAttributes().getValue("Git-Commit");
|
||||
}
|
||||
-
|
||||
- public static String getBranch() {
|
||||
- Map<String, String> attributes = JarManifests.MANIFEST_MAP;
|
||||
- return attributes.get("Git-Branch");
|
||||
+ private static String getBranch() {
|
||||
+ final var manifest = JarManifests.manifest(Bukkit.getServer().getClass());
|
||||
+ return manifest == null ? null : manifest.getMainAttributes().getValue("Git-Branch");
|
||||
}
|
||||
// Scissors end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/NbtComponent.java b/src/main/java/net/minecraft/network/chat/NbtComponent.java
|
||||
index f518e47818a47be0dfd7cccc4845ba9736c6cd8b..218525ba1742d68cde10f6caf09ee30eb2d01d50 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/NbtComponent.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/NbtComponent.java
|
||||
@@ -96,6 +96,7 @@ public abstract class NbtComponent extends BaseComponent implements ContextAware
|
||||
return stream.map((string) -> {
|
||||
return new TextComponent(string);
|
||||
}).reduce((accumulator, current) -> {
|
||||
+ // Scissors - untested, likely needs fixing
|
||||
return (TextComponent) accumulator.append(text).append(current);
|
||||
}).orElseGet(() -> {
|
||||
return new TextComponent("");
|
@ -1,6 +1,6 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Business Goose <arclicious@vivaldi.net>
|
||||
Date: Mon, 18 Apr 2022 03:56:09 +0100
|
||||
Date: Fri, 22 Apr 2022 01:56:03 -0500
|
||||
Subject: [PATCH] Reset large tags
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ index 0000000000000000000000000000000000000000..058203440fd071ce5edbe18391ea60f0
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index d02339a07e1da56fd5dc171a5e32b00d63fa555c..fe6cb52573ee50a2c02d7add38b5e8411d7177f4 100644
|
||||
index 6837c965592d4584cfc958a1008b98791a0fc780..0f7d7248be0aa99dd759d12ed956a98822a2749b 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -49,52 +49,22 @@ index d02339a07e1da56fd5dc171a5e32b00d63fa555c..fe6cb52573ee50a2c02d7add38b5e841
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Multimap;
|
||||
@@ -7,23 +8,28 @@ import com.google.gson.JsonParseException;
|
||||
import com.mojang.brigadier.StringReader;
|
||||
@@ -8,13 +9,13 @@ import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.logging.LogUtils;
|
||||
import com.mojang.serialization.Codec;
|
||||
+import com.mojang.serialization.Dynamic;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
-import java.text.DecimalFormat;
|
||||
-import java.text.DecimalFormatSymbols;
|
||||
-import java.util.Collection;
|
||||
-import java.util.Iterator;
|
||||
-import java.util.List;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
-import java.util.Collections;
|
||||
-import java.util.Comparator;
|
||||
-import java.util.Locale;
|
||||
-import java.util.Map.Entry;
|
||||
-import java.util.Objects;
|
||||
-import java.util.Optional;
|
||||
-import java.util.Random;
|
||||
-import java.util.function.Consumer;
|
||||
-import java.util.function.Predicate;
|
||||
-import java.util.stream.Collectors;
|
||||
-import javax.annotation.Nullable;
|
||||
+import net.minecraft.ChatFormatting;
|
||||
+import net.minecraft.Util;
|
||||
+import net.minecraft.advancements.CriteriaTriggers;
|
||||
+import net.minecraft.commands.arguments.blocks.BlockPredicateArgument;
|
||||
+import net.minecraft.commands.arguments.blocks.BlockStateParser;
|
||||
+import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.core.Direction;
|
||||
+import net.minecraft.core.Registry;
|
||||
+import net.minecraft.nbt.CompoundTag;
|
||||
+import net.minecraft.nbt.ListTag;
|
||||
+import net.minecraft.nbt.NbtOps;
|
||||
+import net.minecraft.network.chat.*;
|
||||
+import net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.server.level.ServerLevel;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
+import net.minecraft.sounds.SoundEvent;
|
||||
+import net.minecraft.sounds.SoundSource;
|
||||
+import net.minecraft.stats.Stats;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.tags.TagContainer;
|
||||
@@ -31,11 +37,7 @@ import net.minecraft.util.datafix.fixes.References;
|
||||
import java.util.Comparator;
|
||||
import java.util.Locale;
|
||||
import java.util.Map.Entry;
|
||||
@@ -50,11 +51,7 @@ import net.minecraft.util.datafix.fixes.References;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.InteractionResultHolder;
|
||||
@ -107,77 +77,16 @@ index d02339a07e1da56fd5dc171a5e32b00d63fa555c..fe6cb52573ee50a2c02d7add38b5e841
|
||||
import net.minecraft.world.entity.ai.attributes.Attribute;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
@@ -51,50 +53,13 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.level.Level;
|
||||
-import net.minecraft.world.level.block.BaseEntityBlock;
|
||||
-import net.minecraft.world.level.block.Block;
|
||||
-import org.apache.logging.log4j.LogManager;
|
||||
-import org.apache.logging.log4j.Logger;
|
||||
-
|
||||
-// CraftBukkit start
|
||||
@@ -75,8 +72,6 @@ import net.minecraft.world.level.block.Block;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
-import com.mojang.serialization.Dynamic;
|
||||
-import java.util.List;
|
||||
-import java.util.Map;
|
||||
-import net.minecraft.ChatFormatting;
|
||||
-import net.minecraft.Util;
|
||||
-import net.minecraft.advancements.CriteriaTriggers;
|
||||
-import net.minecraft.commands.arguments.blocks.BlockPredicateArgument;
|
||||
-import net.minecraft.commands.arguments.blocks.BlockStateParser;
|
||||
-import net.minecraft.core.BlockPos;
|
||||
-import net.minecraft.core.Direction;
|
||||
-import net.minecraft.core.Registry;
|
||||
-import net.minecraft.nbt.CompoundTag;
|
||||
-import net.minecraft.nbt.ListTag;
|
||||
-import net.minecraft.nbt.NbtOps;
|
||||
-import net.minecraft.network.chat.Component;
|
||||
-import net.minecraft.network.chat.ComponentUtils;
|
||||
-import net.minecraft.network.chat.HoverEvent;
|
||||
-import net.minecraft.network.chat.MutableComponent;
|
||||
-import net.minecraft.network.chat.Style;
|
||||
-import net.minecraft.network.chat.TextComponent;
|
||||
-import net.minecraft.network.chat.TranslatableComponent;
|
||||
-import net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket;
|
||||
-import net.minecraft.resources.ResourceLocation;
|
||||
-import net.minecraft.server.MinecraftServer;
|
||||
-import net.minecraft.server.level.ServerLevel;
|
||||
-import net.minecraft.server.level.ServerPlayer;
|
||||
-import net.minecraft.sounds.SoundEvent;
|
||||
-import net.minecraft.sounds.SoundSource;
|
||||
-import net.minecraft.stats.Stats;
|
||||
-import net.minecraft.world.level.block.Blocks;
|
||||
-import net.minecraft.world.level.block.JukeboxBlock;
|
||||
-import net.minecraft.world.level.block.SaplingBlock;
|
||||
-import net.minecraft.world.level.block.SoundType;
|
||||
-import net.minecraft.world.level.block.WitherSkullBlock;
|
||||
+import net.minecraft.world.level.block.*;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.SignBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.SkullBlockEntity;
|
||||
import net.minecraft.world.level.block.state.pattern.BlockInWorld;
|
||||
+import org.apache.logging.log4j.LogManager;
|
||||
+import org.apache.logging.log4j.Logger;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.TreeType;
|
||||
import org.bukkit.block.BlockState;
|
||||
@@ -106,6 +71,15 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockFertilizeEvent;
|
||||
import org.bukkit.event.player.PlayerItemDamageEvent;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
+
|
||||
+import javax.annotation.Nullable;
|
||||
+import java.text.DecimalFormat;
|
||||
+import java.text.DecimalFormatSymbols;
|
||||
+import java.util.*;
|
||||
+import java.util.Map.Entry;
|
||||
+import java.util.function.Consumer;
|
||||
+import java.util.function.Predicate;
|
||||
+import java.util.stream.Collectors;
|
||||
// CraftBukkit end
|
||||
|
||||
public final class ItemStack {
|
||||
@@ -245,6 +219,13 @@ public final class ItemStack {
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -251,6 +246,13 @@ public final class ItemStack {
|
||||
|
||||
// CraftBukkit - break into own method
|
||||
private void load(CompoundTag nbttagcompound) {
|
||||
@ -191,7 +100,7 @@ index d02339a07e1da56fd5dc171a5e32b00d63fa555c..fe6cb52573ee50a2c02d7add38b5e841
|
||||
this.item = (Item) Registry.ITEM.get(new ResourceLocation(nbttagcompound.getString("id")));
|
||||
this.count = nbttagcompound.getByte("Count");
|
||||
if (nbttagcompound.contains("tag", 10)) {
|
||||
@@ -485,7 +466,11 @@ public final class ItemStack {
|
||||
@@ -495,7 +497,11 @@ public final class ItemStack {
|
||||
nbt.putString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
|
||||
nbt.putByte("Count", (byte) this.count);
|
||||
if (this.tag != null) {
|
||||
@ -204,18 +113,18 @@ index d02339a07e1da56fd5dc171a5e32b00d63fa555c..fe6cb52573ee50a2c02d7add38b5e841
|
||||
}
|
||||
|
||||
return nbt;
|
||||
@@ -815,6 +800,9 @@ public final class ItemStack {
|
||||
}
|
||||
@@ -827,6 +833,9 @@ public final class ItemStack {
|
||||
// Paper end
|
||||
|
||||
public void setTag(@Nullable CompoundTag nbt) {
|
||||
+ // Scissors start - Ignore large tags
|
||||
+ if (NbtUtility.isTooLarge(nbt)) return;
|
||||
+ // Scissors end
|
||||
this.tag = nbt;
|
||||
processEnchantOrder(this.tag); // Paper
|
||||
this.processEnchantOrder(this.tag); // Paper
|
||||
if (this.getItem().canBeDepleted()) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index 14da2997b5fff4434b1fe8d5a1b3109dde143740..a4385cea2d472611cfc7ef43662367bb1d780333 100644
|
||||
index 226d9ac01c601fc8954a88bea93a521cdce79eda..9bfa2deca1258dd9c294422a0ea032142cd11789 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -1,16 +1,12 @@
|
@ -59,7 +59,7 @@ index 4092c7a8c2b0d9d26e6f4d97386735236300d132..ad3af6d90b68bc55c29243da88145165
|
||||
}
|
||||
}
|
||||
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 1bb79768fe3be8a44a00e1f8686f95eed0dc2cf2..73e95e631ac622de897775399d205de66c4d8ff8 100644
|
||||
index 888e1f2bc6ea4ddbbcc5466f177233f25b290459..0f19ef250a2f82e49730cb58ea43ee6bf407455a 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
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -69,7 +69,7 @@ index 1bb79768fe3be8a44a00e1f8686f95eed0dc2cf2..73e95e631ac622de897775399d205de6
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry;
|
||||
@@ -209,6 +210,17 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -211,6 +212,17 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||
|
||||
public List<ItemStack> getContents() {
|
||||
@ -88,7 +88,7 @@ index 1bb79768fe3be8a44a00e1f8686f95eed0dc2cf2..73e95e631ac622de897775399d205de6
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
index f494063ead9c6303fb3ca880aba2a877ae8d83ab..7ec2f7f9ea8e75d5a04c700fce783a21a9b560f8 100644
|
||||
index 5a47d58071b83ea911e4cb5e1cc5468801ad0d55..c6f25cb62335fda65596ba3f4a55734a88b75bd4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -117,7 +117,7 @@ index f494063ead9c6303fb3ca880aba2a877ae8d83ab..7ec2f7f9ea8e75d5a04c700fce783a21
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
index 3e71a16ae77601f589f4283a72ef8b68aae60db3..27fb605dbaefbb3a8eed25a519af4062e67aee26 100644
|
||||
index 5c0f1488c8a8100cd39a03adeccded9984722249..d1e1b29298e1e074df1966498d7f3c94b20c77f4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -146,7 +146,7 @@ index 3e71a16ae77601f589f4283a72ef8b68aae60db3..27fb605dbaefbb3a8eed25a519af4062
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||
index 52de9852f87d346714a950b60a0004d386ac10f0..14854956a81c5f6da4d3f3ff2e910f37f32c21f7 100644
|
||||
index e56f7d76b501dab7d549efd2fafd514a9625c24e..153c70defdd6c25203764035c97ed3d20bc9c17e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -175,7 +175,7 @@ index 52de9852f87d346714a950b60a0004d386ac10f0..14854956a81c5f6da4d3f3ff2e910f37
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||
index cfec89db4300bdb96a220540ee87892d22215e9d..ea14263bc11a80657b099342c1d6bb239ea1c80e 100644
|
||||
index f74c5bb8e1ba42c77c59d481b871fd992483b128..10393d499fa6a5e36750ed9305d22454ef98e6cf 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -185,7 +185,7 @@ index cfec89db4300bdb96a220540ee87892d22215e9d..ea14263bc11a80657b099342c1d6bb23
|
||||
import java.util.Random;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.NonNullList;
|
||||
@@ -31,6 +32,17 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity {
|
||||
@@ -30,6 +31,17 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity {
|
||||
private int maxStack = MAX_STACK;
|
||||
|
||||
public List<ItemStack> getContents() {
|
||||
@ -204,7 +204,7 @@ index cfec89db4300bdb96a220540ee87892d22215e9d..ea14263bc11a80657b099342c1d6bb23
|
||||
}
|
||||
|
||||
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 06ffdf7301c8c9a02b4aa3693c69984064c8e085..ed28d8a30f9238a94ff6aff00740b77d12bfb8d6 100644
|
||||
index d241b25acc223982109495542fd17e0fbdf53437..ab952ef090ca5183340b014e0aae3aef553a4803 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
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -235,7 +235,7 @@ index 06ffdf7301c8c9a02b4aa3693c69984064c8e085..ed28d8a30f9238a94ff6aff00740b77d
|
||||
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
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 01d77f800a1497418f08b8d52b0b7995bfbb5f4e..281d5f875de4bfaca1efc281e595cfa0dc492ede 100644
|
||||
index b4d38a9aa8792e979c99bedc20906679ba7991c6..5bdff2d3b13b3dbd0f3f83d9ece5a42173fb7e6c 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
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -245,7 +245,7 @@ index 01d77f800a1497418f08b8d52b0b7995bfbb5f4e..281d5f875de4bfaca1efc281e595cfa0
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -257,7 +258,19 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||
@@ -252,7 +253,19 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||
|
||||
@Override
|
||||
protected NonNullList<ItemStack> getItems() {
|
@ -1,12 +1,12 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Business Goose <arclicious@vivaldi.net>
|
||||
Date: Thu, 21 Apr 2022 13:52:32 +0100
|
||||
Date: Sun, 1 May 2022 14:23:35 -0500
|
||||
Subject: [PATCH] Limit amount of vehicle collision checks to 3 and discard
|
||||
vehicles if they collide with more than 15 other entities
|
||||
|
||||
|
||||
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 309bafd257d4932cfd69c2c212b32306938cd234..17c6aef70089730d9ca3d20d242f6755851b9494 100644
|
||||
index 96a7bfd921e59f298f0ee502d356cc3552c30ce8..6c1a489f03ecd7dfef161822cf6910f6119c082b 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 309bafd257d4932cfd69c2c212b32306938cd234..17c6aef70089730d9ca3d20d242f6755
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.BlockUtil;
|
||||
import net.minecraft.Util;
|
||||
@@ -109,6 +110,7 @@ public abstract class AbstractMinecart extends Entity {
|
||||
@@ -106,6 +107,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,9 +25,9 @@ index 309bafd257d4932cfd69c2c212b32306938cd234..17c6aef70089730d9ca3d20d242f6755
|
||||
public double maxSpeed = 0.4D;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -425,8 +427,10 @@ public abstract class AbstractMinecart extends Entity {
|
||||
@@ -422,8 +424,10 @@ public abstract class AbstractMinecart extends Entity {
|
||||
if (this.getMinecartType() == AbstractMinecart.Type.RIDEABLE && this.getDeltaMovement().horizontalDistanceSqr() > 0.01D) {
|
||||
List<Entity> list = this.level.getEntities(this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
||||
List<Entity> list = this.level.getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
||||
|
||||
- if (!list.isEmpty()) {
|
||||
- for (int l = 0; l < list.size(); ++l) {
|
||||
@ -38,7 +38,7 @@ index 309bafd257d4932cfd69c2c212b32306938cd234..17c6aef70089730d9ca3d20d242f6755
|
||||
Entity entity = (Entity) list.get(l);
|
||||
|
||||
if (!(entity instanceof Player) && !(entity instanceof IronGolem) && !(entity instanceof AbstractMinecart) && !this.isVehicle() && !entity.isPassenger()) {
|
||||
@@ -453,6 +457,16 @@ public abstract class AbstractMinecart extends Entity {
|
||||
@@ -450,6 +454,16 @@ public abstract class AbstractMinecart extends Entity {
|
||||
entity.push(this);
|
||||
}
|
||||
}
|
||||
@ -56,7 +56,7 @@ index 309bafd257d4932cfd69c2c212b32306938cd234..17c6aef70089730d9ca3d20d242f6755
|
||||
} else {
|
||||
Iterator iterator = 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 391454a58d18d7373b974e094fd62514ca0d0b6b..52b75015c89be054ef2bfe1f4780a69540b0f032 100644
|
||||
index 0dbc85c450797d7384e641f80e1b1f8c56fd14fc..99e9867dfc0b3ba8b11dd95c264794f2f0079994 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
|
||||
@ -67,7 +67,7 @@ index 391454a58d18d7373b974e094fd62514ca0d0b6b..52b75015c89be054ef2bfe1f4780a695
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.BlockUtil;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@@ -108,6 +109,7 @@ public class Boat extends Entity {
|
||||
@@ -106,6 +107,7 @@ public class Boat extends Entity {
|
||||
public double unoccupiedDeceleration = -1;
|
||||
public boolean landBoats = false;
|
||||
// CraftBukkit end
|
||||
@ -75,9 +75,9 @@ index 391454a58d18d7373b974e094fd62514ca0d0b6b..52b75015c89be054ef2bfe1f4780a695
|
||||
|
||||
public Boat(EntityType<? extends Boat> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -400,10 +402,12 @@ public class Boat extends Entity {
|
||||
@@ -398,10 +400,12 @@ public class Boat extends Entity {
|
||||
this.checkInsideBlocks();
|
||||
List<Entity> list = this.level.getEntities(this, this.getBoundingBox().inflate(0.20000000298023224D, -0.009999999776482582D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
||||
List<Entity> list = this.level.getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, -0.009999999776482582D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
||||
|
||||
- if (!list.isEmpty()) {
|
||||
+ // Scissors - Add collision debounce
|
||||
@ -89,8 +89,8 @@ index 391454a58d18d7373b974e094fd62514ca0d0b6b..52b75015c89be054ef2bfe1f4780a695
|
||||
+ for (int j = 0; j < Math.min(3, list.size()); ++j) {
|
||||
Entity entity = (Entity) list.get(j);
|
||||
|
||||
if (!entity.hasPassenger(this)) {
|
||||
@@ -414,6 +418,16 @@ public class Boat extends Entity {
|
||||
if (!entity.hasPassenger((Entity) this)) {
|
||||
@@ -412,6 +416,16 @@ public class Boat extends Entity {
|
||||
}
|
||||
}
|
||||
}
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't log invalid teams to console
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 68ae4dfe3f4a77605b19607b5f04a2a6d07d6fc8..b7efb87767570992e9bb14510e510f2b37ec2226 100644
|
||||
index d8393887cc98930815864eca28b07ef89b26f39e..3b5c48bfb7e7bcd0be9ad6d0357213c7adde08ad 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -816,7 +816,9 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -813,7 +813,9 @@ public abstract class LivingEntity extends Entity {
|
||||
boolean flag = scoreboardteam != null && this.level.getScoreboard().addPlayerToTeam(this.getStringUUID(), scoreboardteam);
|
||||
|
||||
if (!flag) {
|
@ -1,34 +1,36 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Mon, 4 Jul 2022 17:02:52 +0100
|
||||
Date: Mon, 4 Jul 2022 21:43:40 +0100
|
||||
Subject: [PATCH] Add MasterBlockFireEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CommandBlock.java b/src/main/java/net/minecraft/world/level/block/CommandBlock.java
|
||||
index fd73e9100feac8c7bf9a5fee21a0ab2d502dc3e0..4912d24683f5094b0b93798c3ad378516eed4746 100644
|
||||
index 1a48c5ea1f2f755abfa85469e26f37ea5f02d6da..d6ed6b04792c4766ed5111fb83d52b76967d6856 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CommandBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CommandBlock.java
|
||||
@@ -1,6 +1,6 @@
|
||||
@@ -1,7 +1,7 @@
|
||||
package net.minecraft.world.level.block;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
-import java.util.Random;
|
||||
+import com.github.atlasmediagroup.scissors.event.block.MasterBlockFireEvent;
|
||||
+import me.totalfreedom.scissors.event.block.MasterBlockFireEvent;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@@ -25,8 +25,10 @@ import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
||||
@@ -25,9 +25,11 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.event.block.BlockRedstoneEvent;
|
||||
+import org.bukkit.Location;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
||||
+import java.util.Random;
|
||||
|
||||
public class CommandBlock extends BaseEntityBlock implements GameMasterBlock {
|
||||
|
||||
@@ -116,6 +118,15 @@ public class CommandBlock extends BaseEntityBlock implements GameMasterBlock {
|
||||
@@ -117,6 +119,15 @@ public class CommandBlock extends BaseEntityBlock implements GameMasterBlock {
|
||||
}
|
||||
|
||||
private void execute(BlockState state, Level world, BlockPos pos, BaseCommandBlock executor, boolean hasCommand) {
|
||||
@ -44,39 +46,26 @@ index fd73e9100feac8c7bf9a5fee21a0ab2d502dc3e0..4912d24683f5094b0b93798c3ad37851
|
||||
if (hasCommand) {
|
||||
executor.performCommand(world);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/StructureBlock.java b/src/main/java/net/minecraft/world/level/block/StructureBlock.java
|
||||
index 4142687c6bb08ac8a156fcaee39ce26308924615..fd9b338117f5cb4575b60bb5bc5664c548132265 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/StructureBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/StructureBlock.java
|
||||
@@ -1,6 +1,8 @@
|
||||
package net.minecraft.world.level.block;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
+
|
||||
+import com.github.atlasmediagroup.scissors.event.block.MasterBlockFireEvent;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
||||
index c391db3b6cbe3140a92aec44fb52e90455209217..c93d21142c5f7b2799eeac7a8314ffdb7360162e 100644
|
||||
index 4bed3a1f353ada478c93e3e6f94aa7ea9d228730..02a9c902a2ec8994ebc8c639864aa0d231aab61a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.world.level.block.entity;
|
||||
|
||||
+import com.github.atlasmediagroup.scissors.event.block.MasterBlockFireEvent;
|
||||
+import me.totalfreedom.scissors.event.block.MasterBlockFireEvent;
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -28,6 +29,7 @@ import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece;
|
||||
@@ -27,6 +28,7 @@ import net.minecraft.world.level.levelgen.structure.pools.SinglePoolElement;
|
||||
import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElement;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
|
||||
+import org.bukkit.Location;
|
||||
|
||||
public class JigsawBlockEntity extends BlockEntity {
|
||||
public static final String TARGET = "target";
|
||||
@@ -120,11 +122,21 @@ public class JigsawBlockEntity extends BlockEntity {
|
||||
@@ -117,11 +119,21 @@ public class JigsawBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) {
|
||||
@ -100,7 +89,7 @@ index c391db3b6cbe3140a92aec44fb52e90455209217..c93d21142c5f7b2799eeac7a8314ffdb
|
||||
StructureTemplate structureTemplate = new StructureTemplate();
|
||||
structureTemplate.fillFromWorld(world, blockPos, new Vec3i(1, 1, 1), false, (Block)null);
|
||||
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 a9b186e5a60838443d2ad2ee82ed3f4803a4899a..9134c8fc0b9363eadf6da288029b7a33c6d5d405 100644
|
||||
index 9a65ed7e5ed76a320c8602b0a4edeff6615d9e0b..e46727ee13550d4ab5473dc5ac28abddf822c9ee 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
|
||||
@@ -6,6 +6,8 @@ import java.util.Optional;
|
||||
@ -108,7 +97,7 @@ index a9b186e5a60838443d2ad2ee82ed3f4803a4899a..9134c8fc0b9363eadf6da288029b7a33
|
||||
import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
+
|
||||
+import com.github.atlasmediagroup.scissors.event.block.MasterBlockFireEvent;
|
||||
+import me.totalfreedom.scissors.event.block.MasterBlockFireEvent;
|
||||
import net.minecraft.ResourceLocationException;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@ -120,7 +109,7 @@ index a9b186e5a60838443d2ad2ee82ed3f4803a4899a..9134c8fc0b9363eadf6da288029b7a33
|
||||
|
||||
public class StructureBlockEntity extends BlockEntity {
|
||||
private static final int SCAN_CORNER_BLOCKS_RANGE = 5;
|
||||
@@ -266,7 +269,6 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
@@ -264,7 +267,6 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
return false;
|
||||
} else {
|
||||
BlockPos blockPos = this.getBlockPos();
|
||||
@ -128,7 +117,7 @@ index a9b186e5a60838443d2ad2ee82ed3f4803a4899a..9134c8fc0b9363eadf6da288029b7a33
|
||||
BlockPos blockPos2 = new BlockPos(blockPos.getX() - 80, this.level.getMinBuildHeight(), blockPos.getZ() - 80);
|
||||
BlockPos blockPos3 = new BlockPos(blockPos.getX() + 80, this.level.getMaxBuildHeight() - 1, blockPos.getZ() + 80);
|
||||
Stream<BlockPos> stream = this.getRelatedCorners(blockPos2, blockPos3);
|
||||
@@ -323,6 +325,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
@@ -321,6 +323,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
|
||||
public boolean saveStructure(boolean bl) {
|
||||
if (this.mode == StructureMode.SAVE && !this.level.isClientSide && this.structureName != null) {
|
||||
@ -145,7 +134,7 @@ index a9b186e5a60838443d2ad2ee82ed3f4803a4899a..9134c8fc0b9363eadf6da288029b7a33
|
||||
BlockPos blockPos = this.getBlockPos().offset(this.structurePos);
|
||||
ServerLevel serverLevel = (ServerLevel)this.level;
|
||||
StructureManager structureManager = serverLevel.getStructureManager();
|
||||
@@ -360,6 +372,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
@@ -358,6 +370,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
|
||||
public boolean loadStructure(ServerLevel world, boolean bl) {
|
||||
if (this.mode == StructureMode.LOAD && this.structureName != null) {
|
||||
@ -162,25 +151,7 @@ index a9b186e5a60838443d2ad2ee82ed3f4803a4899a..9134c8fc0b9363eadf6da288029b7a33
|
||||
StructureManager structureManager = world.getStructureManager();
|
||||
|
||||
Optional<StructureTemplate> optional;
|
||||
@@ -376,7 +398,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public boolean loadStructure(ServerLevel world, boolean bl, StructureTemplate structureTemplate) {
|
||||
- BlockPos blockPos = this.getBlockPos();
|
||||
+ // Scissors - Add master block fire event
|
||||
+ final BlockPos blockPos = this.getBlockPos();
|
||||
+ final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(this.getLevel().getWorld(), blockPos.getX(), blockPos.getY(), blockPos.getZ()));
|
||||
+
|
||||
+ if (!event.callEvent())
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
if (!StringUtil.isNullOrEmpty(structureTemplate.getAuthor())) {
|
||||
this.author = structureTemplate.getAuthor();
|
||||
}
|
||||
@@ -405,6 +436,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
@@ -403,6 +425,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public void unloadStructure() {
|
@ -1,21 +1,21 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Tue, 5 Jul 2022 03:34:36 +0100
|
||||
Date: Tue, 5 Jul 2022 04:00:42 +0100
|
||||
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 83333ae9c8e8c1edc6e7f02468bd8dc7e44bb66e..ca595abe940463a62da033c7082c868c4c4b28d8 100644
|
||||
index 64c438459f150af1cabdd3cea29c2951d42d69a0..b0bd0412010320cc624535d6abffe417a135a4dc 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 @@
|
||||
package net.minecraft.server.network;
|
||||
|
||||
+import com.github.atlasmediagroup.scissors.event.player.SpectatorTeleportEvent;
|
||||
+import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.primitives.Floats;
|
||||
import com.mojang.brigadier.ParseResults;
|
||||
@@ -1905,6 +1906,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -1948,6 +1949,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
Entity entity = packet.getEntity(worldserver);
|
||||
|
||||
if (entity != null) {
|
@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Video <videogamesm12@gmail.com>
|
||||
Date: Fri, 19 Aug 2022 00:49:38 -0600
|
||||
Subject: [PATCH] Fixes out of bounds HangingEntity crash exploit
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
index ca9decf85dd1af0baf0d34a48aa67cbb9f4eb586..50cbd324b87300d6b872581571fa97ad9fa54396 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
@@ -265,7 +265,11 @@ public abstract class HangingEntity extends Entity {
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||
- this.pos = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ"));
|
||||
+ // Scissors start - Fixes exploit where bad TileX, TileY, and TileZ coordinates can crash servers
|
||||
+ BlockPos pos = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ"));
|
||||
+ if (level.isLoadedAndInBounds(pos))
|
||||
+ this.pos = pos;
|
||||
+ // Scissors end
|
||||
}
|
||||
|
||||
public abstract int getWidth();
|
@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Sun, 10 Jul 2022 02:20:16 +0100
|
||||
Date: Sun, 10 Jul 2022 02:44:05 +0100
|
||||
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 ca595abe940463a62da033c7082c868c4c4b28d8..a102586b42ac408a3f655f7c0d069ab0990ec7fc 100644
|
||||
index b0bd0412010320cc624535d6abffe417a135a4dc..65e9791d7e613d039f93184cde717bff8e97000c 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -24,6 +24,8 @@ import java.util.function.UnaryOperator;
|
||||
@ -17,7 +17,7 @@ index ca595abe940463a62da033c7082c868c4c4b28d8..a102586b42ac408a3f655f7c0d069ab0
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
@@ -2593,6 +2595,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -2642,6 +2644,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
public void handleContainerClick(ServerboundContainerClickPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
if (this.player.isImmobile()) return; // CraftBukkit
|
||||
@ -25,28 +25,22 @@ index ca595abe940463a62da033c7082c868c4c4b28d8..a102586b42ac408a3f655f7c0d069ab0
|
||||
this.player.resetLastActionTime();
|
||||
if (this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu.stillValid(this.player)) { // CraftBukkit
|
||||
boolean cancelled = this.player.isSpectator(); // CraftBukkit - see below if
|
||||
@@ -2602,11 +2605,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
boolean flag = packet.getStateId() != this.player.containerMenu.getStateId();
|
||||
@@ -2661,6 +2664,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
return;
|
||||
}
|
||||
|
||||
this.player.containerMenu.suppressRemoteUpdates();
|
||||
+
|
||||
// CraftBukkit start - Call InventoryClickEvent
|
||||
if (packet.getSlotNum() < -1 && packet.getSlotNum() != -999) {
|
||||
return;
|
||||
}
|
||||
|
||||
+ // Scissors start - Do not call events when the slot/button number is invalid
|
||||
+ final int sentSlotNum = packet.getSlotNum();
|
||||
+ if((Mth.clamp(sentSlotNum, -1, this.player.containerMenu.slots.size() - 1) != sentSlotNum) && sentSlotNum != -999)
|
||||
+ {
|
||||
+ this.getCraftPlayer().kick(
|
||||
+ // Scissors start - Do not call events when the slot/button number is invalid
|
||||
+ final int sentSlotNum = packet.getSlotNum();
|
||||
+ if((Mth.clamp(sentSlotNum, -1, this.player.containerMenu.slots.size() - 1) != sentSlotNum) && sentSlotNum != -999)
|
||||
+ {
|
||||
+ this.getCraftPlayer().kick(
|
||||
+ net.kyori.adventure.text.Component.text("Invalid container click slot (Hacking?)")
|
||||
+ .color(NamedTextColor.RED)
|
||||
+ );
|
||||
+ return;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+ .color(NamedTextColor.RED)
|
||||
+ );
|
||||
+ return;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
InventoryView inventory = this.player.containerMenu.getBukkitView();
|
||||
SlotType type = inventory.getSlotType(packet.getSlotNum());
|
||||
InventoryView inventory = this.player.containerMenu.getBukkitView();
|
||||
SlotType type = inventory.getSlotType(packet.getSlotNum());
|
||||
|
@ -1,14 +1,14 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Sun, 10 Jul 2022 02:25:28 +0100
|
||||
Date: Sun, 10 Jul 2022 02:45:15 +0100
|
||||
Subject: [PATCH] Do not attempt to cast items to recipes
|
||||
|
||||
|
||||
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 73e95e631ac622de897775399d205de66c4d8ff8..c3fd536cebb2f8664f9bf86d322f88094677d2b5 100644
|
||||
index 0f19ef250a2f82e49730cb58ea43ee6bf407455a..764b56c2d5cdf5a57fced106d196ef866f70e885 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
|
||||
@@ -629,6 +629,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -634,6 +634,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
Entry<ResourceLocation> entry = (Entry) objectiterator.next();
|
||||
|
||||
worldserver.getRecipeManager().byKey((ResourceLocation) entry.getKey()).ifPresent((irecipe) -> {
|
@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Sun, 10 Jul 2022 07:53:59 +0100
|
||||
Subject: [PATCH] Add Scissors config & command
|
||||
Date: Sun, 10 Jul 2022 09:57:10 +0100
|
||||
Subject: [PATCH] Add Scissors configuration file & command
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index e29b0a90019b12bd6586ad0f7b5314f307e527ba..c6f19e178f8c5a03f9fb8b011f329ef81e4e35d8 100644
|
||||
index 06bff37e4c1fddd3be6343049a66787c63fb420c..c7f93f7b8531c0783eba0c77e319d9a08588c184 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -23,6 +23,7 @@
|
||||
@ -14,9 +14,9 @@ index e29b0a90019b12bd6586ad0f7b5314f307e527ba..c6f19e178f8c5a03f9fb8b011f329ef8
|
||||
|
||||
+import com.github.atlasmediagroup.scissors.ScissorsConfig;
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -228,7 +229,8 @@ public class TimingsExport extends Thread {
|
||||
import io.papermc.paper.adventure.PaperAdventure;
|
||||
import net.kyori.adventure.text.event.ClickEvent;
|
||||
@@ -241,7 +242,8 @@ public class TimingsExport extends Thread {
|
||||
parent.put("config", createObject(
|
||||
pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
||||
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||
@ -28,10 +28,10 @@ index e29b0a90019b12bd6586ad0f7b5314f307e527ba..c6f19e178f8c5a03f9fb8b011f329ef8
|
||||
new TimingsExport(listeners, parent, history).start();
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsCommand.java b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f5202deac5b3a715a22d0d482f1302b6074b26ac
|
||||
index 0000000000000000000000000000000000000000..2085c48fa4dda81bf275aee0b92c9e8206dba8e2
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsCommand.java
|
||||
@@ -0,0 +1,150 @@
|
||||
@@ -0,0 +1,156 @@
|
||||
+package com.github.atlasmediagroup.scissors;
|
||||
+
|
||||
+import com.google.common.base.Functions;
|
||||
@ -39,6 +39,15 @@ index 0000000000000000000000000000000000000000..f5202deac5b3a715a22d0d482f1302b6
|
||||
+import com.google.common.collect.ImmutableSet;
|
||||
+import com.google.common.collect.Iterables;
|
||||
+import com.google.common.collect.Lists;
|
||||
+import java.io.File;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Arrays;
|
||||
+import java.util.Collection;
|
||||
+import java.util.Collections;
|
||||
+import java.util.Iterator;
|
||||
+import java.util.List;
|
||||
+import java.util.Locale;
|
||||
+import java.util.stream.Collectors;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.Bukkit;
|
||||
@ -47,10 +56,6 @@ index 0000000000000000000000000000000000000000..f5202deac5b3a715a22d0d482f1302b6
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.util.*;
|
||||
+import java.util.stream.Collectors;
|
||||
+
|
||||
+public class ScissorsCommand extends Command
|
||||
+{
|
||||
+
|
||||
@ -62,7 +67,8 @@ index 0000000000000000000000000000000000000000..f5202deac5b3a715a22d0d482f1302b6
|
||||
+ super(name);
|
||||
+ this.description = "Scissors related commands";
|
||||
+ this.usageMessage = "/scissors [" + Joiner.on(" | ").join(SUBCOMMANDS) + "]";
|
||||
+ this.setPermission("bukkit.command.scissors;" + Joiner.on(';').join(SUBCOMMANDS.stream().map(s -> BASE_PERM + s).collect(Collectors.toSet())));
|
||||
+ this.setPermission("bukkit.command.scissors;" + Joiner.on(';').join(SUBCOMMANDS.stream().map(s -> BASE_PERM + s).collect(
|
||||
+ Collectors.toSet())));
|
||||
+ }
|
||||
+
|
||||
+ private static boolean testPermission(CommandSender commandSender, String permission)
|
||||
@ -184,19 +190,13 @@ index 0000000000000000000000000000000000000000..f5202deac5b3a715a22d0d482f1302b6
|
||||
+}
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..076379a0e61d74ecaf651b341821e1e30999b3b8
|
||||
index 0000000000000000000000000000000000000000..9612d02814d6ae45d7087c34e0c8549e6c9aecf9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
@@ -0,0 +1,170 @@
|
||||
@@ -0,0 +1,175 @@
|
||||
+package com.github.atlasmediagroup.scissors;
|
||||
+
|
||||
+import com.google.common.base.Throwables;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.configuration.InvalidConfigurationException;
|
||||
+import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.io.IOException;
|
||||
+import java.lang.reflect.InvocationTargetException;
|
||||
@ -207,6 +207,11 @@ index 0000000000000000000000000000000000000000..076379a0e61d74ecaf651b341821e1e3
|
||||
+import java.util.Map;
|
||||
+import java.util.logging.Level;
|
||||
+import java.util.regex.Pattern;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.configuration.InvalidConfigurationException;
|
||||
+import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+
|
||||
+public class ScissorsConfig
|
||||
+{
|
||||
@ -221,7 +226,7 @@ index 0000000000000000000000000000000000000000..076379a0e61d74ecaf651b341821e1e3
|
||||
+
|
||||
+ Discord: https://discord.com/invite/mtVQcHn58h
|
||||
+ Website: https://scissors.gg/\s
|
||||
+ Docs: https://javadoc.scissors.gg/1.17.1/\s
|
||||
+ Docs: https://scissors.gg/javadoc/1.18.2/\s
|
||||
+ """;
|
||||
+ private static final Pattern SPACE = Pattern.compile(" ");
|
||||
+ private static final Pattern NOT_NUMERIC = Pattern.compile("[^-\\d.]");
|
||||
@ -317,6 +322,12 @@ index 0000000000000000000000000000000000000000..076379a0e61d74ecaf651b341821e1e3
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static boolean runCommandsInBooks = false;
|
||||
+
|
||||
+ private static void runCommandsInBooks() {
|
||||
+ runCommandsInBooks = getBoolean("runCommandsInBooks", false);
|
||||
+ }
|
||||
+
|
||||
+ private static void set(String path, Object val)
|
||||
+ {
|
||||
+ config.set(path, val);
|
||||
@ -359,10 +370,10 @@ index 0000000000000000000000000000000000000000..076379a0e61d74ecaf651b341821e1e3
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 6a00ee7f69bf44c5a9a329df26ac5640b368283b..3fed82a0b271234065767ec37c9ddd0a9f39da27 100644
|
||||
index 1e0d261439255091a6f61485c0747231fbd5b1db..63861ff0c0e942dfafad7ceedfa17864c100b301 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -106,6 +106,7 @@ public class Main {
|
||||
@@ -114,6 +114,7 @@ public class Main {
|
||||
org.bukkit.configuration.file.YamlConfiguration bukkitConfiguration = loadConfigFile((File) optionset.valueOf("bukkit-settings"));
|
||||
org.bukkit.configuration.file.YamlConfiguration spigotConfiguration = loadConfigFile((File) optionset.valueOf("spigot-settings"));
|
||||
org.bukkit.configuration.file.YamlConfiguration paperConfiguration = loadConfigFile((File) optionset.valueOf("paper-settings"));
|
||||
@ -371,10 +382,10 @@ index 6a00ee7f69bf44c5a9a329df26ac5640b368283b..3fed82a0b271234065767ec37c9ddd0a
|
||||
|
||||
Path path1 = Paths.get("eula.txt");
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index b6ee0e709b0f0529b99567bc9b8fb6bfd99bcd8e..4cd18a681dedea26b98002902a3c3b1f47966887 100644
|
||||
index 257c94f7c1cb00c9a91ab82e311dfd8eca29c538..605602ca03bd0d974b559881ab0ad4da66640002 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -234,7 +234,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -235,7 +235,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // load mappings for stacktrace deobf and etc.
|
||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
|
||||
// Paper end
|
||||
@ -392,10 +403,10 @@ index b6ee0e709b0f0529b99567bc9b8fb6bfd99bcd8e..4cd18a681dedea26b98002902a3c3b1f
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
this.setResourcePack(dedicatedserverproperties.resourcePack, this.getPackHash());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index cc797b45674163b5913e20031d110796d78b928b..bb5d6e5405c1781404bfd3d2af9c93026f9c86f0 100644
|
||||
index ebd5aeceb4ac1a6300bbfa70218421f0d91b7614..b17f788c982a5c46e493edd447c07bedfcefd2fd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -924,6 +924,7 @@ public final class CraftServer implements Server {
|
||||
@@ -956,6 +956,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||
com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper
|
||||
@ -403,7 +414,7 @@ index cc797b45674163b5913e20031d110796d78b928b..bb5d6e5405c1781404bfd3d2af9c9302
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -979,6 +980,7 @@ public final class CraftServer implements Server {
|
||||
@@ -987,6 +988,7 @@ public final class CraftServer implements Server {
|
||||
this.reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
com.destroystokyo.paper.PaperConfig.registerCommands(); // Paper
|
||||
@ -411,7 +422,7 @@ index cc797b45674163b5913e20031d110796d78b928b..bb5d6e5405c1781404bfd3d2af9c9302
|
||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -2566,6 +2568,12 @@ public final class CraftServer implements Server {
|
||||
@@ -2714,6 +2716,12 @@ public final class CraftServer implements Server {
|
||||
return com.destroystokyo.paper.PaperConfig.config;
|
||||
}
|
||||
|
||||
@ -425,12 +436,12 @@ index cc797b45674163b5913e20031d110796d78b928b..bb5d6e5405c1781404bfd3d2af9c9302
|
||||
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 d033caf5dabbd2a240286c5623b3d287ae5cbdd9..facfcc3f478a21240fa2938c94de7dc599eeafd3 100644
|
||||
index 40313b014b4ed5f7e9505bde2827383c19d4377a..d88a755e18c1da5e5a64ff88d96be33e3dd3dcc3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -160,6 +160,14 @@ public class Main {
|
||||
.defaultsTo(new File[] {})
|
||||
.describedAs("Jar file");
|
||||
.defaultsTo("Unknown Server")
|
||||
.describedAs("Name");
|
||||
// Paper end
|
||||
+
|
||||
+ // Scissors start
|
@ -1,28 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Sun, 10 Jul 2022 09:46:20 +0100
|
||||
Date: Sun, 10 Jul 2022 10:06:58 +0100
|
||||
Subject: [PATCH] Disable running commands in books by default
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
index d0e2bcf4671d723d5893e0a9bc8c6e30a9b83be6..6fcbd02c02d70617e4533b450747c918ec3339d5 100644
|
||||
--- a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
@@ -127,6 +127,12 @@ public class ScissorsConfig
|
||||
}
|
||||
}
|
||||
|
||||
+ public static boolean runCommandsInBooks = false;
|
||||
+
|
||||
+ private static void runCommandsInBooks() {
|
||||
+ runCommandsInBooks = getBoolean("runCommandsInBooks", false);
|
||||
+ }
|
||||
+
|
||||
private static void set(String path, Object val)
|
||||
{
|
||||
config.set(path, val);
|
||||
diff --git a/src/main/java/net/minecraft/world/item/WrittenBookItem.java b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
||||
index de11f8b4a783e7aa6029693f6812c950649fe88c..526206f11bdfc2aa7cb88649c47d707678753007 100644
|
||||
index 26a9a15cc630113cd8d2c8287c6b0f1067ce53f0..15419727d37fc75bc18177cf3ea2daa54f97ec47 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
||||
@@ -1,7 +1,10 @@
|
||||
@ -52,14 +35,14 @@ index de11f8b4a783e7aa6029693f6812c950649fe88c..526206f11bdfc2aa7cb88649c47d7076
|
||||
|
||||
public static boolean resolveBookComponents(ItemStack book, @Nullable CommandSourceStack commandSource, @Nullable Player player) {
|
||||
CompoundTag compoundTag = book.getTag();
|
||||
- if (compoundTag != null && !compoundTag.getBoolean("resolved")) {
|
||||
- if (com.destroystokyo.paper.PaperConfig.resolveSelectorsInBooks && compoundTag != null && !compoundTag.getBoolean("resolved")) { // Paper
|
||||
- compoundTag.putBoolean("resolved", true);
|
||||
+ if (compoundTag != null) {
|
||||
+ if (compoundTag != null) { // Paper
|
||||
if (!makeSureTagIsValid(compoundTag)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -148,8 +147,41 @@ public class WrittenBookItem extends Item {
|
||||
component2 = new TextComponent(string);
|
||||
@@ -165,8 +164,41 @@ public class WrittenBookItem extends Item {
|
||||
component2 = new TextComponent(text);
|
||||
}
|
||||
|
||||
- return Component.Serializer.toJson(component2);
|
@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Mon, 11 Jul 2022 17:21:37 -0300
|
||||
Subject: [PATCH] Validate block 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 65e9791d7e613d039f93184cde717bff8e97000c..2e6e1af5244202e0bc77b443f089b4f3016be8ac 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1273,7 +1273,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@Override
|
||||
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
- if (this.player.hasPermissions(2)) {
|
||||
+ if (this.player.hasPermissions(2) && Level.isInSpawnableBounds(packet.getPos())) { // Scissors - Validate block entity tag query positions
|
||||
BlockEntity tileentity = this.player.getLevel().getBlockEntity(packet.getPos());
|
||||
CompoundTag nbttagcompound = tileentity != null ? tileentity.saveWithoutMetadata() : null;
|
||||
|
@ -1,14 +1,14 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Wed, 13 Jul 2022 10:16:57 +0100
|
||||
Date: Wed, 13 Jul 2022 11:31:04 +0100
|
||||
Subject: [PATCH] Fix ClickEvents on Signs bypassing permissions
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
index 6fcbd02c02d70617e4533b450747c918ec3339d5..52b0161711634f9ad8cecf58668737a726278f72 100644
|
||||
index 9612d02814d6ae45d7087c34e0c8549e6c9aecf9..ad222b622979716efdb0ea14cbf2cbcb4acf2e74 100644
|
||||
--- a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
@@ -65,8 +65,8 @@ public class ScissorsConfig
|
||||
@@ -64,8 +64,8 @@ public class ScissorsConfig
|
||||
config.options().header(HEADER);
|
||||
config.options().copyDefaults(true);
|
||||
|
||||
@ -19,7 +19,7 @@ index 6fcbd02c02d70617e4533b450747c918ec3339d5..52b0161711634f9ad8cecf58668737a7
|
||||
readConfig(ScissorsConfig.class, null);
|
||||
}
|
||||
|
||||
@@ -133,6 +133,13 @@ public class ScissorsConfig
|
||||
@@ -132,6 +132,13 @@ public class ScissorsConfig
|
||||
runCommandsInBooks = getBoolean("runCommandsInBooks", false);
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ index 6fcbd02c02d70617e4533b450747c918ec3339d5..52b0161711634f9ad8cecf58668737a7
|
||||
{
|
||||
config.set(path, val);
|
||||
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 344d3a8c1162f1a4ab5fc2b7676680ddace46649..5e526ba120b9e4ba77fa4474730aa180dba5eb56 100644
|
||||
index d5bcc81a809e3c733c6fc11309bcf0913860edf6..19e04b0b47c0e185b5e02e8a7c00bab551a0d45e 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
|
||||
@@ -1,11 +1,13 @@
|
||||
@ -49,9 +49,9 @@ index 344d3a8c1162f1a4ab5fc2b7676680ddace46649..5e526ba120b9e4ba77fa4474730aa180
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
+import net.minecraft.commands.Commands;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Vec3i;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
@@ -16,6 +18,7 @@ import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.network.chat.ClickEvent;
|
||||
@@ -15,6 +17,7 @@ import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.network.chat.Style;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
||||
@ -59,7 +59,7 @@ index 344d3a8c1162f1a4ab5fc2b7676680ddace46649..5e526ba120b9e4ba77fa4474730aa180
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.util.FormattedCharSequence;
|
||||
@@ -24,6 +27,8 @@ import net.minecraft.world.item.DyeColor;
|
||||
@@ -23,6 +26,8 @@ import net.minecraft.world.item.DyeColor;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.Vec2;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
@ -68,7 +68,7 @@ index 344d3a8c1162f1a4ab5fc2b7676680ddace46649..5e526ba120b9e4ba77fa4474730aa180
|
||||
|
||||
public class SignBlockEntity extends BlockEntity implements CommandSource { // CraftBukkit - implements
|
||||
private static final boolean CONVERT_LEGACY_SIGNS = Boolean.getBoolean("convertLegacySigns"); // Paper
|
||||
@@ -237,7 +242,21 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
||||
@@ -236,7 +241,21 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
||||
if (!event.callEvent()) {
|
||||
return false;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Tue, 16 Aug 2022 18:14:16 +0100
|
||||
Date: Tue, 16 Aug 2022 17:25:37 +0100
|
||||
Subject: [PATCH] Refuse to convert legacy messages over 1k characters
|
||||
|
||||
|
@ -0,0 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Sat, 20 Aug 2022 03:01:56 +0100
|
||||
Subject: [PATCH] Fix exploit where paintings are able to spawn out of bounds
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
index ad222b622979716efdb0ea14cbf2cbcb4acf2e74..33b97f0738fbc4a54a174e9419275770e4513ca0 100644
|
||||
--- a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
@@ -30,7 +30,7 @@ public class ScissorsConfig
|
||||
|
||||
Discord: https://discord.com/invite/mtVQcHn58h
|
||||
Website: https://scissors.gg/\s
|
||||
- Docs: https://scissors.gg/javadoc/1.18.2/\s
|
||||
+ Docs: https://javadoc.scissors.gg/1.18.2/\s
|
||||
""";
|
||||
private static final Pattern SPACE = Pattern.compile(" ");
|
||||
private static final Pattern NOT_NUMERIC = Pattern.compile("[^-\\d.]");
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
index 2805ebfe4ffe769bcde778a1225b3101c91538d8..3c4bfad55e438c5e723ef58c9cc24908af9e0846 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
@@ -265,7 +265,13 @@ public abstract class HangingEntity extends Entity {
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||
- this.pos = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ"));
|
||||
+ // Scissors start - Fix exploit where paintings are able to spawn out of bounds
|
||||
+ final BlockPos pos = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ"));
|
||||
+ if (this.level.isLoadedAndInBounds(pos))
|
||||
+ {
|
||||
+ this.pos = pos;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
}
|
||||
|
||||
public abstract int getWidth();
|
@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Sun, 27 Nov 2022 04:04:14 +0000
|
||||
Date: Sun, 27 Nov 2022 04:56:24 +0000
|
||||
Subject: [PATCH] Prevent velocity freeze
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||
index 3a088afd8269606543ebc9fb2074eb70431fcd39..561e68806b50c417f08a20bcf87c44d117b9f41c 100644
|
||||
index fa4e930388baa2ee0a752873b2ec1a67cc020de6..8ba2433de1e079e2227b97a5a7b5f06a6f34984f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||
@@ -41,9 +41,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||
@ -42,9 +42,9 @@ index 3a088afd8269606543ebc9fb2074eb70431fcd39..561e68806b50c417f08a20bcf87c44d1
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ this.xPower = Math.min(Math.max(xPower, -1024), 1024);
|
||||
+ this.yPower = Math.min(Math.max(yPower, -1024), 1024);
|
||||
+ this.zPower = Math.min(Math.max(zPower, -1024), 1024);
|
||||
+ this.xPower = xPower;
|
||||
+ this.yPower = yPower;
|
||||
+ this.zPower = zPower;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
@ -68,20 +68,19 @@ index 3a088afd8269606543ebc9fb2074eb70431fcd39..561e68806b50c417f08a20bcf87c44d1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,9 +219,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||
Vec3 vec3d = entity.getLookAngle();
|
||||
@@ -193,9 +220,12 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||
Vec3 vec3d = entity.getLookAngle();
|
||||
|
||||
this.setDeltaMovement(vec3d);
|
||||
- this.xPower = vec3d.x * 0.1D;
|
||||
- this.yPower = vec3d.y * 0.1D;
|
||||
- this.zPower = vec3d.z * 0.1D;
|
||||
+ // Scissors start - Prevent projectile velocity freeze
|
||||
+ //this.xPower = vec3d.x * 0.1D;
|
||||
+ //this.yPower = vec3d.y * 0.1D;
|
||||
+ //this.zPower = vec3d.z * 0.1D;
|
||||
+ setPower(vec3d.x * 0.1D, vec3d.y * 0.1D, vec3d.z * 0.1D);
|
||||
+ // Scissors end
|
||||
this.setOwner(entity);
|
||||
}
|
||||
|
||||
this.setDeltaMovement(vec3d);
|
||||
- this.xPower = vec3d.x * 0.1D;
|
||||
- this.yPower = vec3d.y * 0.1D;
|
||||
- this.zPower = vec3d.z * 0.1D;
|
||||
+ // Scissors start - Prevent projectile velocity freeze
|
||||
+ //this.xPower = vec3d.x * 0.1D;
|
||||
+ //this.yPower = vec3d.y * 0.1D;
|
||||
+ //this.zPower = vec3d.z * 0.1D;
|
||||
+
|
||||
+ setPower(vec3d.x * 0.1D, vec3d.y * 0.1D, vec3d.z * 0.1D);
|
||||
+ // Scissors end
|
||||
this.setOwner(entity);
|
||||
return true;
|
||||
} else {
|
@ -1,33 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Mon, 11 Jul 2022 17:10:17 -0300
|
||||
Subject: [PATCH] Validate block 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 a102586b42ac408a3f655f7c0d069ab0990ec7fc..1c56ca1f7ed3064bfd3352cf46741fc64bbee4eb 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1240,7 +1240,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
if (this.player.hasPermissions(2)) {
|
||||
Entity entity = this.player.getLevel().getEntity(packet.getEntityId());
|
||||
|
||||
- if (entity != null) {
|
||||
+ if (entity != null && !isOutsideOfReach(entity.position().x, entity.position().y, entity.position().z)) { // Scissors - Prevent querying of entities out of reach
|
||||
CompoundTag nbttagcompound = entity.saveWithoutId(new CompoundTag());
|
||||
|
||||
this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound));
|
||||
@@ -1252,8 +1252,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@Override
|
||||
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
- if (this.player.hasPermissions(2)) {
|
||||
- BlockEntity tileentity = this.player.getLevel().getBlockEntity(packet.getPos());
|
||||
+ // Scissors start - Validate block entity tag query positions, prevent querying block entities out of reach
|
||||
+ final BlockPos pos = packet.getPos();
|
||||
+ if (this.player.hasPermissions(2) && Level.isInSpawnableBounds(pos) && !isOutsideOfReach(pos.getX(), pos.getY(), pos.getZ())) {
|
||||
+ BlockEntity tileentity = this.player.getLevel().isLoaded(pos) ? this.player.getLevel().getBlockEntity(pos) : null;
|
||||
+ // Scissors end
|
||||
CompoundTag nbttagcompound = tileentity != null ? tileentity.save(new CompoundTag()) : null;
|
||||
|
||||
this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound));
|
@ -1,22 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Mon, 25 Jul 2022 09:43:20 +0100
|
||||
Subject: [PATCH] Fix out of bound chunks crashing server
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
index cf1cb0996bb06ae7cf56e0ecf0c01f03da7fdd83..57154a7dd88f00ac7cd78f51ead718853e0d2101 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
@@ -157,7 +157,10 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
if (ichunkaccess != null) {
|
||||
throw (RuntimeException) Util.pauseInIde((Throwable) (new RuntimeException(String.format("Chunk is not of correct status. Expecting %s, got %s | %s %s", leastStatus, ichunkaccess.getStatus(), chunkX, chunkZ))));
|
||||
} else {
|
||||
- throw (RuntimeException) Util.pauseInIde((Throwable) (new RuntimeException(String.format("We are asking a region for a chunk out of bound | %s %s", chunkX, chunkZ))));
|
||||
+ // Scissors start - Fix out of bound chunks crashing server
|
||||
+ // throw (RuntimeException) Util.pauseInIde((Throwable) (new RuntimeException(String.format("We are asking a region for a chunk out of bound | %s %s", chunkX, chunkZ))));
|
||||
+ return null;
|
||||
+ // Scissors end
|
||||
}
|
||||
}
|
||||
}
|
@ -1,45 +1,36 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Fri, 2 Jun 2023 23:42:46 +0100
|
||||
From: Telesphoreo <me@telesphoreo.me>
|
||||
Date: Sun, 11 Jun 2023 00:00:20 -0500
|
||||
Subject: [PATCH] Implement command block events
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 8ec188a09dd1d5150a25fdf18f49deac1593fb4d..0eb54b2b36df7870724e33d75d1d3f6d5492ffab 100644
|
||||
index 2e6e1af5244202e0bc77b443f089b4f3016be8ac..f1f17e33cddf23fffae96d60bfd92934b6ab3c5a 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 @@
|
||||
package net.minecraft.server.network;
|
||||
@@ -25,6 +25,8 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.github.atlasmediagroup.scissors.ScissorsConfig;
|
||||
+import com.github.atlasmediagroup.scissors.event.block.CommandBlockPlayerEditEvent;
|
||||
+import com.github.atlasmediagroup.scissors.event.block.CommandMinecartPlayerEditEvent;
|
||||
import com.github.atlasmediagroup.scissors.event.player.SpectatorTeleportEvent;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.primitives.Floats;
|
||||
@@ -134,6 +136,7 @@ import net.minecraft.world.entity.player.ChatVisiblity;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.projectile.AbstractArrow;
|
||||
import net.minecraft.world.entity.vehicle.Boat;
|
||||
+import net.minecraft.world.entity.vehicle.MinecartCommandBlock;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.BucketItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
@@ -186,6 +189,7 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
import org.bukkit.craftbukkit.util.LazyPlayerSet;
|
||||
import org.bukkit.craftbukkit.util.Waitable;
|
||||
import org.bukkit.entity.Player;
|
||||
+import me.totalfreedom.scissors.event.block.CommandBlockPlayerEditEvent;
|
||||
+import me.totalfreedom.scissors.event.block.CommandMinecartPlayerEditEvent;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.CrashReport;
|
||||
@@ -156,6 +158,7 @@ import net.minecraft.world.phys.shapes.BooleanOp;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
+import org.bukkit.entity.minecart.CommandMinecart;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
@@ -902,6 +906,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -916,6 +919,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
this.player.level.getChunkAt(blockposition).setBlockEntity(tileentity);
|
||||
}
|
||||
|
||||
+ // Scissors start - Implement command block events
|
||||
+ if (commandblocklistenerabstract instanceof org.bukkit.block.CommandBlock commandBlock)
|
||||
+ {
|
||||
+ if (commandblocklistenerabstract instanceof org.bukkit.block.CommandBlock commandBlock) {
|
||||
+ CommandBlockPlayerEditEvent event = new CommandBlockPlayerEditEvent(this.getCraftPlayer(), Objects.requireNonNullElse(commandblocklistenerabstract.getCommand(), ""), s, commandBlock);
|
||||
+ event.callEvent();
|
||||
+
|
||||
@ -49,13 +40,12 @@ index 8ec188a09dd1d5150a25fdf18f49deac1593fb4d..0eb54b2b36df7870724e33d75d1d3f6d
|
||||
+
|
||||
+ s = event.getNewCommand();
|
||||
+ }
|
||||
+
|
||||
+ // Scissors end
|
||||
+
|
||||
commandblocklistenerabstract.setCommand(s);
|
||||
commandblocklistenerabstract.setTrackOutput(flag);
|
||||
if (!flag) {
|
||||
@@ -933,7 +952,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -947,7 +963,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level);
|
||||
|
||||
if (commandblocklistenerabstract != null) {
|
||||
@ -63,8 +53,7 @@ index 8ec188a09dd1d5150a25fdf18f49deac1593fb4d..0eb54b2b36df7870724e33d75d1d3f6d
|
||||
+ // Scissors start - Implement command block events
|
||||
+ String command = packet.getCommand();
|
||||
+
|
||||
+ if (commandblocklistenerabstract instanceof CommandMinecart commandMinecart)
|
||||
+ {
|
||||
+ if (commandblocklistenerabstract instanceof CommandMinecart commandMinecart) {
|
||||
+ CommandMinecartPlayerEditEvent event = new CommandMinecartPlayerEditEvent(this.getCraftPlayer(), Objects.requireNonNullElse(commandblocklistenerabstract.getCommand(), ""), command, commandMinecart);
|
||||
+ event.callEvent();
|
||||
+
|
||||
@ -80,7 +69,6 @@ index 8ec188a09dd1d5150a25fdf18f49deac1593fb4d..0eb54b2b36df7870724e33d75d1d3f6d
|
||||
+ // commandblocklistenerabstract.setCommand(packet.getCommand());
|
||||
+
|
||||
+ // Scissors end
|
||||
+
|
||||
commandblocklistenerabstract.setTrackOutput(packet.isTrackOutput());
|
||||
if (!packet.isTrackOutput()) {
|
||||
commandblocklistenerabstract.setLastOutput((Component) null);
|
@ -1,227 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: VideoGameSmash12 <videogamesm12@gmail.com>
|
||||
Date: Sun, 2 Oct 2022 19:43:40 -0600
|
||||
Subject: [PATCH] Adds configuration option to outright disable Game Master
|
||||
Blocks and fixes some configuration bugs
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
index 52b0161711634f9ad8cecf58668737a726278f72..bb58d90e9d676761a43a12cbc1c3b687d00654b1 100644
|
||||
--- a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
@@ -65,8 +65,8 @@ public class ScissorsConfig
|
||||
config.options().header(HEADER);
|
||||
config.options().copyDefaults(true);
|
||||
|
||||
- version = getInt("config-version", 2);
|
||||
- set("config-version", 2);
|
||||
+ version = getInt("config-version", 3);
|
||||
+ set("config-version", 3);
|
||||
readConfig(ScissorsConfig.class, null);
|
||||
}
|
||||
|
||||
@@ -135,11 +135,17 @@ public class ScissorsConfig
|
||||
|
||||
// people still may want them to bypass permissions for warps
|
||||
public static boolean commandSignsBypassPermissions = false;
|
||||
- public static void commandSignsBypassPermissions()
|
||||
+ private static void commandSignsBypassPermissions()
|
||||
{
|
||||
commandSignsBypassPermissions = getBoolean("commandSignsBypassPermissions", false);
|
||||
}
|
||||
|
||||
+ public static boolean disableGameMasterBlocks = false;
|
||||
+ private static void disableGameMasterBlocks()
|
||||
+ {
|
||||
+ disableGameMasterBlocks = getBoolean("disableGameMasterBlocks", false);
|
||||
+ }
|
||||
+
|
||||
private static void set(String path, Object val)
|
||||
{
|
||||
config.set(path, val);
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index dbf982c85ff361184a34b462bec331ac5b1a472c..8ec188a09dd1d5150a25fdf18f49deac1593fb4d 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 @@
|
||||
package net.minecraft.server.network;
|
||||
|
||||
+import com.github.atlasmediagroup.scissors.ScissorsConfig;
|
||||
import com.github.atlasmediagroup.scissors.event.player.SpectatorTeleportEvent;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.primitives.Floats;
|
||||
@@ -987,7 +988,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@Override
|
||||
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
- if (this.player.canUseGameMasterBlocks()) {
|
||||
+ if (!ScissorsConfig.disableGameMasterBlocks && this.player.canUseGameMasterBlocks()) { // Scissors - Add configuration option to completely disable game master blocks
|
||||
BlockPos blockposition = packet.getPos();
|
||||
BlockState iblockdata = this.player.level.getBlockState(blockposition);
|
||||
BlockEntity tileentity = this.player.level.getBlockEntity(blockposition);
|
||||
@@ -1045,7 +1046,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@Override
|
||||
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
- if (this.player.canUseGameMasterBlocks()) {
|
||||
+ if (!ScissorsConfig.disableGameMasterBlocks && this.player.canUseGameMasterBlocks()) { // Scissors - Add configuration option to completely disable game master blocks
|
||||
BlockPos blockposition = packet.getPos();
|
||||
BlockState iblockdata = this.player.level.getBlockState(blockposition);
|
||||
BlockEntity tileentity = this.player.level.getBlockEntity(blockposition);
|
||||
@@ -1068,7 +1069,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@Override
|
||||
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
- if (this.player.canUseGameMasterBlocks()) {
|
||||
+ if (!ScissorsConfig.disableGameMasterBlocks && this.player.canUseGameMasterBlocks()) { // Scissors - Add configuration option to completely disable game master blocks
|
||||
BlockPos blockposition = packet.getPos();
|
||||
BlockEntity tileentity = this.player.level.getBlockEntity(blockposition);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
||||
index c93d21142c5f7b2799eeac7a8314ffdb7360162e..2279b7958c837a9616e8de2c2de53950d2f19a59 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.world.level.block.entity;
|
||||
|
||||
+import com.github.atlasmediagroup.scissors.ScissorsConfig; // Scissors
|
||||
import com.github.atlasmediagroup.scissors.event.block.MasterBlockFireEvent;
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.Arrays;
|
||||
@@ -122,6 +123,12 @@ public class JigsawBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) {
|
||||
+ // Scissors start - Add configuration option to completely disable jigsaw and structure blocks
|
||||
+ if (ScissorsConfig.disableGameMasterBlocks) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
// Scissors - Add master block fire event
|
||||
final BlockPos blockPos = this.getBlockPos();
|
||||
final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(this.getLevel().getWorld(), blockPos.getX(), blockPos.getY(), blockPos.getZ()));
|
||||
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 ed297126ebc05c1eb81e32b7644552d5627b3697..896afd5ce022a4f4d83f2985112bcf0e3fc5f37d 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
|
||||
@@ -7,6 +7,7 @@ import java.util.Random;
|
||||
import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+import com.github.atlasmediagroup.scissors.ScissorsConfig;
|
||||
import com.github.atlasmediagroup.scissors.event.block.MasterBlockFireEvent;
|
||||
import net.minecraft.ResourceLocationException;
|
||||
import net.minecraft.Util;
|
||||
@@ -130,6 +131,12 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
private void updateBlockState() {
|
||||
+ // Scissors start - Add configuration option to completely disable jigsaw and structure blocks
|
||||
+ if (ScissorsConfig.disableGameMasterBlocks) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
if (this.level != null) {
|
||||
BlockPos blockPos = this.getBlockPos();
|
||||
BlockState blockState = this.level.getBlockState(blockPos);
|
||||
@@ -152,6 +159,12 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public boolean usedBy(Player player) {
|
||||
+ // Scissors start - Add configuration option to completely disable jigsaw and structure blocks
|
||||
+ if (ScissorsConfig.disableGameMasterBlocks) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
if (!player.canUseGameMasterBlocks()) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -265,6 +278,12 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public boolean detectSize() {
|
||||
+ // Scissors start - Add configuration option to completely disable jigsaw and structure blocks
|
||||
+ if (ScissorsConfig.disableGameMasterBlocks) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
if (this.mode != StructureMode.SAVE) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -324,13 +343,18 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public boolean saveStructure(boolean bl) {
|
||||
+ // Scissors - Add option to completely disable structure and jigsaw blocks
|
||||
+ if (ScissorsConfig.disableGameMasterBlocks) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
if (this.mode == StructureMode.SAVE && !this.level.isClientSide && this.structureName != null) {
|
||||
// Scissors - Add master block fire event
|
||||
final BlockPos pos = this.getBlockPos();
|
||||
final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(this.getLevel().getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
||||
|
||||
- if (!event.callEvent())
|
||||
- {
|
||||
+ if (!event.callEvent()) {
|
||||
return false;
|
||||
}
|
||||
// Scissors end
|
||||
@@ -371,6 +395,12 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public boolean loadStructure(ServerLevel world, boolean bl) {
|
||||
+ // Scissors start - Add configuration option to completely disable jigsaw and structure blocks
|
||||
+ if (ScissorsConfig.disableGameMasterBlocks) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
if (this.mode == StructureMode.LOAD && this.structureName != null) {
|
||||
// Scissors - Add master block fire event
|
||||
final BlockPos blockPos = this.getBlockPos();
|
||||
@@ -398,6 +428,12 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public boolean loadStructure(ServerLevel world, boolean bl, StructureTemplate structureTemplate) {
|
||||
+ // Scissors start - Add configuration option to completely disable jigsaw and structure blocks
|
||||
+ if (ScissorsConfig.disableGameMasterBlocks) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
// Scissors - Add master block fire event
|
||||
final BlockPos blockPos = this.getBlockPos();
|
||||
final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(this.getLevel().getWorld(), blockPos.getX(), blockPos.getY(), blockPos.getZ()));
|
||||
@@ -436,6 +472,12 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public void unloadStructure() {
|
||||
+ // Scissors start - Add configuration option to completely disable jigsaw and structure blocks
|
||||
+ if (ScissorsConfig.disableGameMasterBlocks) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
// Scissors - Add master block fire event
|
||||
final BlockPos blockPos = this.getBlockPos();
|
||||
final MasterBlockFireEvent event = new MasterBlockFireEvent(new Location(this.getLevel().getWorld(), blockPos.getX(), blockPos.getY(), blockPos.getZ()));
|
||||
@@ -454,6 +496,12 @@ public class StructureBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
public boolean isStructureLoadable() {
|
||||
+ // Scissors start - Add configuration option to completely disable jigsaw and structure blocks
|
||||
+ if (ScissorsConfig.disableGameMasterBlocks) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
if (this.mode == StructureMode.LOAD && !this.level.isClientSide && this.structureName != null) {
|
||||
ServerLevel serverLevel = (ServerLevel)this.level;
|
||||
StructureManager structureManager = serverLevel.getStructureManager();
|
@ -1,53 +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 a890f52e2214242f6e31353bb912813d00e41045..bc0e1938d6e1faca64bb041442bad9e501708fe4 100644
|
||||
--- a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
||||
+++ b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
||||
@@ -173,7 +173,7 @@ public abstract class MinMaxBounds<T extends Number> {
|
||||
return double_ == null ? null : double_ * double_;
|
||||
}
|
||||
|
||||
- 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 0fb8f32427843f4bfd90ab88ecb3ab3e4a4fda31..c9b5f7715d4a866d477c65adb39f11cc46e5623a 100644
|
||||
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
@@ -58,9 +58,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(
|
||||
+ Math.min(Math.max(box.minX, -1024), 1025),
|
||||
+ Math.min(Math.max(box.minY, -1024), 1025),
|
||||
+ Math.min(Math.max(box.minZ, -1024), 1025),
|
||||
+ Math.min(Math.max(box.maxX, -1024), 1025),
|
||||
+ Math.min(Math.max(box.maxY, -1024), 1025),
|
||||
+ Math.min(Math.max(box.maxZ, -1024), 1025),
|
||||
+ false
|
||||
+ );
|
||||
+ } else {
|
||||
+ this.aabb = null;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
this.order = sorter;
|
||||
this.currentEntity = senderOnly;
|
||||
this.playerName = playerName;
|
@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Fri, 28 Apr 2023 18:24:09 -0300
|
||||
Subject: [PATCH] Limit map decoration text length
|
||||
|
||||
|
||||
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 3d9c3e3ec56bc1bf5719e31d169015eaf598bde3..1233c8904f6a4f91931b42a08c514d783267a4c8 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
|
||||
@@ -14,6 +14,12 @@ 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;
|
@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Fri, 28 Apr 2023 18:24:55 -0300
|
||||
Subject: [PATCH] Limit map decoration count
|
||||
|
||||
|
||||
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 6f64d1ce0f5b20e1579f8af64c08ef8fc4e4444b..d78036b62bb36539d3d3e1a8299af2fa60ebd379 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
|
||||
@@ -357,6 +357,12 @@ 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) {
|
||||
+ // Scissors start - Limit decoration count
|
||||
+ if (this.decorations.size() > 32) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
int i = 1 << this.scale;
|
||||
float f = (float) (x - (double) this.x) / (float) i;
|
||||
float f1 = (float) (z - (double) this.z) / (float) i;
|
@ -1,26 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Fri, 28 Apr 2023 18:25:56 -0300
|
||||
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 a002713686e66faf0d18662586a7a236c27ca7d2..795d72084ff196c5f4a0ff4bafd3ac88257fc379 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1354,7 +1354,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
if (entity != null) {
|
||||
ServerLevel.LOGGER.warn("Force-added player with duplicate UUID {}", player.getUUID().toString());
|
||||
entity.unRide();
|
||||
- this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED);
|
||||
+
|
||||
+ // Scissors start - Prevent player banning using duplicate UUIDs
|
||||
+ if (entity instanceof ServerPlayer serverPlayer) {
|
||||
+ this.removePlayerImmediately(serverPlayer, Entity.RemovalReason.DISCARDED);
|
||||
+ } else {
|
||||
+ entity.discard();
|
||||
+ }
|
||||
+ // Scissors end
|
||||
}
|
||||
|
||||
this.entityManager.addNewEntity(player); // CraftBukkit - decompile error
|
@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Fri, 28 Apr 2023 18:32:03 -0300
|
||||
Subject: [PATCH] Don't warn on duplicate entity UUIDs
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
index 8cb246863e06c5b95ba1442e2ec47095026c4f39..48990a8192465e11b27c072fc7d4351a6c5fb7a0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
@@ -147,7 +147,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
return true;
|
||||
}
|
||||
// Paper end
|
||||
- PersistentEntitySectionManager.LOGGER.warn("UUID of added entity already exists: {}", entity);
|
||||
+ // Scissors - Don't warn on duplicate entity UUIDs
|
||||
// Paper start
|
||||
if (net.minecraft.world.level.Level.DEBUG_ENTITIES && ((Entity) entity).level.paperConfig.duplicateUUIDMode != com.destroystokyo.paper.PaperWorldConfig.DuplicateUUIDMode.NOTHING) {
|
||||
if (((Entity) entity).addedToWorldStack != null) {
|
@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Mon, 29 May 2023 19:47:48 -0300
|
||||
Subject: [PATCH] Fix component extra empty array exploit
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
||||
index 6978d14c6bd90ffb640e39e8666430d95d5ef45c..474ed00c09d58a7796cd543c9bcf8752e2f9f742 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
||||
@@ -201,6 +201,12 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
} else if (!jsonelement.isJsonObject()) {
|
||||
if (jsonelement.isJsonArray()) {
|
||||
JsonArray jsonarray = jsonelement.getAsJsonArray();
|
||||
+ // Scissors start
|
||||
+ if (jsonarray.size() <= 0) {
|
||||
+ throw new JsonParseException("Unexpected empty array of components");
|
||||
+ }
|
||||
+ // Scissors end
|
||||
+
|
||||
MutableComponent ichatmutablecomponent = null;
|
||||
Iterator iterator = jsonarray.iterator();
|
||||
|
@ -1,151 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Wed, 31 May 2023 20:44:20 -0300
|
||||
Subject: [PATCH] Add depth limit to Component deserializer
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
index bb58d90e9d676761a43a12cbc1c3b687d00654b1..74f33cba7d713eddca5a58a2b33cad357792145e 100644
|
||||
--- a/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
+++ b/src/main/java/com/github/atlasmediagroup/scissors/ScissorsConfig.java
|
||||
@@ -65,8 +65,8 @@ public class ScissorsConfig
|
||||
config.options().header(HEADER);
|
||||
config.options().copyDefaults(true);
|
||||
|
||||
- version = getInt("config-version", 3);
|
||||
- set("config-version", 3);
|
||||
+ version = getInt("config-version", 4);
|
||||
+ set("config-version", 4);
|
||||
readConfig(ScissorsConfig.class, null);
|
||||
}
|
||||
|
||||
@@ -146,6 +146,12 @@ public class ScissorsConfig
|
||||
disableGameMasterBlocks = getBoolean("disableGameMasterBlocks", false);
|
||||
}
|
||||
|
||||
+ public static int componentDepthLimit = 128;
|
||||
+ private static void componentDepthLimit()
|
||||
+ {
|
||||
+ componentDepthLimit = getInt("componentDepthLimit", 128);
|
||||
+ }
|
||||
+
|
||||
private static void set(String path, Object val)
|
||||
{
|
||||
config.set(path, val);
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
||||
index 474ed00c09d58a7796cd543c9bcf8752e2f9f742..68e99223b0b084bdfdb9990780150bbc7d8ad8ea 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.network.chat;
|
||||
|
||||
+import com.github.atlasmediagroup.scissors.ScissorsConfig; // Scissors
|
||||
import com.google.common.collect.Lists;
|
||||
import io.papermc.paper.adventure.AdventureComponent; // Paper
|
||||
import com.google.gson.Gson;
|
||||
@@ -33,6 +34,7 @@ import net.minecraft.util.GsonHelper;
|
||||
import net.minecraft.util.LowerCaseEnumTypeAdapterFactory;
|
||||
// CraftBukkit start
|
||||
import com.google.common.collect.Streams;
|
||||
+import java.util.regex.Pattern; // Scissors
|
||||
import java.util.stream.Stream;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -192,27 +194,31 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
throw new IllegalStateException("Couldn't get field 'lineStart' for JsonReader", nosuchfieldexception);
|
||||
}
|
||||
});
|
||||
+ private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("%[0-9]+\\$s"); // Scissors
|
||||
|
||||
public Serializer() {}
|
||||
|
||||
- public MutableComponent deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
|
||||
+ // Scissors start
|
||||
+ private MutableComponent deserialize(JsonElement jsonelement, JsonDeserializationContext jsondeserializationcontext, int depth) throws JsonParseException {
|
||||
+ if (depth > ScissorsConfig.componentDepthLimit) {
|
||||
+ throw new JsonParseException("Depth limit exceeded");
|
||||
+ }
|
||||
+
|
||||
if (jsonelement.isJsonPrimitive()) {
|
||||
return new TextComponent(jsonelement.getAsString());
|
||||
} else if (!jsonelement.isJsonObject()) {
|
||||
if (jsonelement.isJsonArray()) {
|
||||
JsonArray jsonarray = jsonelement.getAsJsonArray();
|
||||
- // Scissors start
|
||||
if (jsonarray.size() <= 0) {
|
||||
throw new JsonParseException("Unexpected empty array of components");
|
||||
}
|
||||
- // Scissors end
|
||||
|
||||
MutableComponent ichatmutablecomponent = null;
|
||||
Iterator iterator = jsonarray.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
JsonElement jsonelement1 = (JsonElement) iterator.next();
|
||||
- MutableComponent ichatmutablecomponent1 = this.deserialize(jsonelement1, jsonelement1.getClass(), jsondeserializationcontext);
|
||||
+ MutableComponent ichatmutablecomponent1 = this.deserialize(jsonelement1, jsondeserializationcontext, depth + 1);
|
||||
|
||||
if (ichatmutablecomponent == null) {
|
||||
ichatmutablecomponent = ichatmutablecomponent1;
|
||||
@@ -236,12 +242,17 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
|
||||
if (jsonobject.has("translate")) {
|
||||
s = GsonHelper.getAsString(jsonobject, "translate");
|
||||
+
|
||||
+ // Penalize depth for placeholders in translate & fallback
|
||||
+ long translate_placeholders = PLACEHOLDER_PATTERN.matcher(s).results().count();
|
||||
+ int penalty = (int)translate_placeholders * 12;
|
||||
+
|
||||
if (jsonobject.has("with")) {
|
||||
JsonArray jsonarray1 = GsonHelper.getAsJsonArray(jsonobject, "with");
|
||||
Object[] aobject = new Object[jsonarray1.size()];
|
||||
|
||||
for (int i = 0; i < aobject.length; ++i) {
|
||||
- aobject[i] = this.deserialize(jsonarray1.get(i), type, jsondeserializationcontext);
|
||||
+ aobject[i] = this.deserialize(jsonarray1.get(i), jsondeserializationcontext, depth + 1 + penalty);
|
||||
if (aobject[i] instanceof TextComponent) {
|
||||
TextComponent chatcomponenttext = (TextComponent) aobject[i];
|
||||
|
||||
@@ -264,7 +275,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
|
||||
object = new ScoreComponent(GsonHelper.getAsString(jsonobject1, "name"), GsonHelper.getAsString(jsonobject1, "objective"));
|
||||
} else if (jsonobject.has("selector")) {
|
||||
- Optional<Component> optional = this.parseSeparator(type, jsondeserializationcontext, jsonobject);
|
||||
+ Optional<Component> optional = this.parseSeparator(jsondeserializationcontext, jsonobject, depth + 1);
|
||||
|
||||
object = new SelectorComponent(GsonHelper.getAsString(jsonobject, "selector"), optional);
|
||||
} else if (jsonobject.has("keybind")) {
|
||||
@@ -275,7 +286,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
}
|
||||
|
||||
s = GsonHelper.getAsString(jsonobject, "nbt");
|
||||
- Optional<Component> optional1 = this.parseSeparator(type, jsondeserializationcontext, jsonobject);
|
||||
+ Optional<Component> optional1 = this.parseSeparator(jsondeserializationcontext, jsonobject, depth + 1);
|
||||
boolean flag = GsonHelper.getAsBoolean(jsonobject, "interpret", false);
|
||||
|
||||
if (jsonobject.has("block")) {
|
||||
@@ -300,7 +311,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
}
|
||||
|
||||
for (int j = 0; j < jsonarray2.size(); ++j) {
|
||||
- ((MutableComponent) object).append(this.deserialize(jsonarray2.get(j), type, jsondeserializationcontext));
|
||||
+ ((MutableComponent) object).append(this.deserialize(jsonarray2.get(j), jsondeserializationcontext, depth + 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,8 +320,13 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
}
|
||||
}
|
||||
|
||||
- private Optional<Component> parseSeparator(Type type, JsonDeserializationContext context, JsonObject json) {
|
||||
- return json.has("separator") ? Optional.of(this.deserialize(json.get("separator"), type, context)) : Optional.empty();
|
||||
+ public MutableComponent deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
|
||||
+ return this.deserialize(jsonelement, jsondeserializationcontext, 1);
|
||||
+ }
|
||||
+
|
||||
+ private Optional<Component> parseSeparator(JsonDeserializationContext context, JsonObject json, int depth) {
|
||||
+ return json.has("separator") ? Optional.of(this.deserialize(json.get("separator"), context, depth + 1)) : Optional.empty();
|
||||
+ // Scissors end
|
||||
}
|
||||
|
||||
private void serializeStyle(Style style, JsonObject json, JsonSerializationContext context) {
|
@ -1,116 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Fri, 2 Jun 2023 23:30:40 +0100
|
||||
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 28a13331ac7713cde725bf7c7ce6be959227d506..4f5573d1cc5630519122010d44f0a82e2948e767 100644
|
||||
--- a/src/main/java/net/minecraft/nbt/TagParser.java
|
||||
+++ b/src/main/java/net/minecraft/nbt/TagParser.java
|
||||
@@ -169,8 +169,58 @@ public class TagParser {
|
||||
}
|
||||
|
||||
this.expect('}');
|
||||
- return compoundTag;
|
||||
+
|
||||
+ // Scissors start - Add depth limit to SNBT
|
||||
+ return exceedsDepthLimit(compoundTag) ? new CompoundTag() : compoundTag;
|
||||
+ // Scissors end
|
||||
+ }
|
||||
+
|
||||
+ // Scissors start - Add depth limit to SNBT
|
||||
+ private boolean exceedsDepthLimit(Tag tag) {
|
||||
+ return this.exceedsDepthLimit(0, tag);
|
||||
+ }
|
||||
+
|
||||
+ private boolean exceedsDepthLimit(long depth, Tag tag)
|
||||
+ {
|
||||
+ if (depth > 256)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ if (tag instanceof ListTag listTag)
|
||||
+ {
|
||||
+ for (Tag childTag : listTag)
|
||||
+ {
|
||||
+ boolean returnValue = this.exceedsDepthLimit(depth + 1, childTag);
|
||||
+
|
||||
+ if (returnValue)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ } else if (tag instanceof CompoundTag compoundTag)
|
||||
+ {
|
||||
+ for (String key: compoundTag.getAllKeys())
|
||||
+ {
|
||||
+ Tag childTag = compoundTag.get(key);
|
||||
+
|
||||
+ if (childTag == null)
|
||||
+ {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ boolean returnValue = this.exceedsDepthLimit(depth + 1, childTag);
|
||||
+
|
||||
+ if (returnValue)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
}
|
||||
+ // Scissors end
|
||||
|
||||
private Tag readListTag() throws CommandSyntaxException {
|
||||
this.expect('[');
|
||||
@@ -203,7 +253,11 @@ public class TagParser {
|
||||
}
|
||||
|
||||
this.expect(']');
|
||||
- return listTag;
|
||||
+
|
||||
+ // Scissors start - Add depth limit to SNBT
|
||||
+ return exceedsDepthLimit(listTag) ? new ListTag() : listTag;
|
||||
+ // return listTag;
|
||||
+ // Scissors end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +282,7 @@ public class TagParser {
|
||||
}
|
||||
|
||||
private <T extends Number> List<T> readArray(TagType<?> arrayTypeReader, TagType<?> typeReader) throws CommandSyntaxException {
|
||||
- List<T> list = Lists.newArrayList();
|
||||
+ List<Number> list = Lists.newArrayList(); // Scissors - List<T> -> List<Number>
|
||||
|
||||
while(true) {
|
||||
if (this.reader.peek() != ']') {
|
||||
@@ -241,11 +295,11 @@ public class TagParser {
|
||||
}
|
||||
|
||||
if (typeReader == ByteTag.TYPE) {
|
||||
- list.add((T)((NumericTag)tag).getAsByte());
|
||||
+ list.add(((NumericTag)tag).getAsByte()); // Scissors - Remove (T) cast
|
||||
} else if (typeReader == LongTag.TYPE) {
|
||||
- list.add((T)((NumericTag)tag).getAsLong());
|
||||
+ list.add(((NumericTag)tag).getAsLong()); // Scissors - Remove (T) cast
|
||||
} else {
|
||||
- list.add((T)((NumericTag)tag).getAsInt());
|
||||
+ list.add(((NumericTag)tag).getAsInt()); // Scissors - Remove (T) cast
|
||||
}
|
||||
|
||||
if (this.hasElementSeparator()) {
|
||||
@@ -257,7 +311,7 @@ public class TagParser {
|
||||
}
|
||||
|
||||
this.expect(']');
|
||||
- return list;
|
||||
+ return (List<T>) list; // Scissors - Cast to List<T>
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Wed, 7 Jun 2023 17:02:00 -0300
|
||||
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 8038e3a10b563321df1e8cedd26b256078ce745a..7fb177779fa2bf30e4d190a277691eeab375120e 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
|
||||
@@ -84,7 +84,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
|
||||
private double effectRange = -1;
|
||||
|
||||
public double getEffectRange() {
|
||||
- if (this.effectRange < 0) {
|
||||
+ if (this.effectRange < 0 || this.effectRange > 256) { // Scissors
|
||||
return this.levels * 10 + 10;
|
||||
} else {
|
||||
return effectRange;
|
||||
@@ -410,6 +410,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
|
||||
|
||||
this.lockKey = LockCode.fromTag(nbt);
|
||||
this.effectRange = nbt.contains(PAPER_RANGE_TAG, 6) ? nbt.getDouble(PAPER_RANGE_TAG) : -1; // Paper
|
||||
+ if (this.effectRange > 256) this.effectRange = 256; // Scissors
|
||||
}
|
||||
|
||||
@Override
|
@ -1,46 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Tue, 4 Jul 2023 18:49:34 -0300
|
||||
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 d3fd35a33da5ce40667781f7ee35e89531b4ea96..f92385c4f72fce6ceec40e21ea081eeb1bd8fc25 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -866,7 +866,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
this.player.sendMessage(new TranslatableComponent("advMode.notEnabled"), Util.NIL_UUID);
|
||||
} else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission
|
||||
this.player.sendMessage(new TranslatableComponent("advMode.notAllowed"), Util.NIL_UUID);
|
||||
- } else {
|
||||
+ } else if (this.player.level.isLoadedAndInBounds(packet.getPos())) { // Scissors
|
||||
BaseCommandBlock commandblocklistenerabstract = null;
|
||||
CommandBlockEntity tileentitycommand = null;
|
||||
BlockPos blockposition = packet.getPos();
|
||||
@@ -1027,7 +1027,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@Override
|
||||
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
- if (!ScissorsConfig.disableGameMasterBlocks && this.player.canUseGameMasterBlocks()) { // Scissors - Add configuration option to completely disable game master blocks
|
||||
+ if (!ScissorsConfig.disableGameMasterBlocks && this.player.canUseGameMasterBlocks() && this.player.level.isLoadedAndInBounds(packet.getPos())) { // Scissors
|
||||
BlockPos blockposition = packet.getPos();
|
||||
BlockState iblockdata = this.player.level.getBlockState(blockposition);
|
||||
BlockEntity tileentity = this.player.level.getBlockEntity(blockposition);
|
||||
@@ -1085,7 +1085,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@Override
|
||||
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
- if (!ScissorsConfig.disableGameMasterBlocks && this.player.canUseGameMasterBlocks()) { // Scissors - Add configuration option to completely disable game master blocks
|
||||
+ if (!ScissorsConfig.disableGameMasterBlocks && this.player.canUseGameMasterBlocks() && this.player.level.isLoadedAndInBounds(packet.getPos())) { // Scissors
|
||||
BlockPos blockposition = packet.getPos();
|
||||
BlockState iblockdata = this.player.level.getBlockState(blockposition);
|
||||
BlockEntity tileentity = this.player.level.getBlockEntity(blockposition);
|
||||
@@ -1108,7 +1108,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@Override
|
||||
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
- if (!ScissorsConfig.disableGameMasterBlocks && this.player.canUseGameMasterBlocks()) { // Scissors - Add configuration option to completely disable game master blocks
|
||||
+ if (!ScissorsConfig.disableGameMasterBlocks && this.player.canUseGameMasterBlocks() && this.player.level.isLoadedAndInBounds(packet.getPos())) { // Scissors
|
||||
BlockPos blockposition = packet.getPos();
|
||||
BlockEntity tileentity = this.player.level.getBlockEntity(blockposition);
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Wed, 5 Jul 2023 22:58:24 +0100
|
||||
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 083640b7e4aee75db9b884aebd640c9410e669ca..76a2d683c7a32a8af2683cb2d7a3e33111064b27 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -223,8 +223,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||
this.hivePos = null;
|
||||
- if (nbt.contains("HivePos")) {
|
||||
- this.hivePos = NbtUtils.readBlockPos(nbt.getCompound("HivePos"));
|
||||
+ if (nbt.contains("HivePos"))
|
||||
+ {
|
||||
+ // Scissors start - Limit HivePos
|
||||
+ final BlockPos savedHivePos = NbtUtils.readBlockPos(nbt.getCompound("HivePos"));
|
||||
+ this.hivePos = this.level.isLoadedAndInBounds(savedHivePos) ? savedHivePos : null;
|
||||
+ // Scissors end - Limit HivePos
|
||||
}
|
||||
|
||||
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 f78f3f2d740f7b4800e17d9bc64b7b4fedda49b9..a4c4c7cd5a4325916836728f11d2164ad211143b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||
@@ -107,8 +107,12 @@ public class Vex extends Monster {
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||
super.readAdditionalSaveData(nbt);
|
||||
- if (nbt.contains("BoundX")) {
|
||||
- this.boundOrigin = new BlockPos(nbt.getInt("BoundX"), nbt.getInt("BoundY"), nbt.getInt("BoundZ"));
|
||||
+ if (nbt.contains("BoundX"))
|
||||
+ {
|
||||
+ // Scissors start - Limit Vex bound origin
|
||||
+ final BlockPos savedBoundOrigin = new BlockPos(nbt.getInt("BoundX"), nbt.getInt("BoundY"), nbt.getInt("BoundZ"));
|
||||
+ this.boundOrigin = this.level.isLoadedAndInBounds(savedBoundOrigin) ? savedBoundOrigin : null;
|
||||
+ // Scissors end - Limit Vex bound origin
|
||||
}
|
||||
|
||||
if (nbt.contains("LifeTicks")) {
|
@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Thu, 6 Jul 2023 23:01:12 +0100
|
||||
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 9cbfda029782385d1a7987f5be46d450bd8a758e..2421573bbc738ce5c2ac0e5a3013a4813d807dc5 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
|
||||
@@ -127,7 +127,7 @@ public class AttributeMap {
|
||||
}
|
||||
|
||||
}, () -> {
|
||||
- LOGGER.warn("Ignoring unknown attribute '{}'", (Object)string);
|
||||
+ // LOGGER.warn("Ignoring unknown attribute '{}'", (Object)string); // Scissors - Mute invalid attributes
|
||||
});
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
||||
index 5f94be8e8793f0b5b99e630882f53199d688eadf..7da1c212ff15940c849ac27061d47c5d9ffb1a30 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 {
|
||||
AttributeModifier.Operation operation = AttributeModifier.Operation.fromValue(nbt.getInt("Operation"));
|
||||
return new AttributeModifier(uUID, nbt.getString("Name"), nbt.getDouble("Amount"), operation);
|
||||
} catch (Exception var3) {
|
||||
- LOGGER.warn("Unable to create attribute: {}", (Object)var3.getMessage());
|
||||
+ // LOGGER.warn("Unable to create attribute: {}", (Object)var3.getMessage()); // Scissors - Mute invalid attributes
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Allink <arclicious@vivaldi.net>
|
||||
Date: Thu, 6 Jul 2023 23:34:46 +0100
|
||||
Subject: [PATCH] Mute invalid Enderdragon phases
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java
|
||||
index 235b1548ccd1ff6a7ff05fc6a903d8b053aea5ce..92b4bd06c53e1f2c5c4c05ec7dd10e15889f4ebb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonChargePlayerPhase.java
|
||||
@@ -19,7 +19,7 @@ public class DragonChargePlayerPhase extends AbstractDragonPhaseInstance {
|
||||
@Override
|
||||
public void doServerTick() {
|
||||
if (this.targetLocation == null) {
|
||||
- LOGGER.warn("Aborting charge player as no target was set.");
|
||||
+ // LOGGER.warn("Aborting charge player as no target was set."); // Scissors - Mute invalid Enderdragon phases
|
||||
this.dragon.getPhaseManager().setPhase(EnderDragonPhase.HOLDING_PATTERN);
|
||||
} else if (this.timeSinceCharge > 0 && this.timeSinceCharge++ >= 10) {
|
||||
this.dragon.getPhaseManager().setPhase(EnderDragonPhase.HOLDING_PATTERN);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
||||
index 318a288a9170254b682955d96a150e99ca89b345..bcdd44cc2927791eae8492d316f26b52b58a2a06 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
|
||||
@@ -29,7 +29,7 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance {
|
||||
@Override
|
||||
public void doServerTick() {
|
||||
if (this.attackTarget == null) {
|
||||
- LOGGER.warn("Skipping player strafe phase because no player was found");
|
||||
+ // LOGGER.warn("Skipping player strafe phase because no player was found"); // Scissors - Mute invalid Enderdragon phases
|
||||
this.dragon.getPhaseManager().setPhase(EnderDragonPhase.HOLDING_PATTERN);
|
||||
} else {
|
||||
if (this.currentPath != null && this.currentPath.isDone()) {
|
Reference in New Issue
Block a user