mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2025-07-15 21:04:04 +00:00
Compare commits
43 Commits
folia/1.20
...
1.20.2
Author | SHA1 | Date | |
---|---|---|---|
df68e51d87 | |||
0e240d3c00 | |||
031de7abb1 | |||
e57b14d8c7 | |||
8c424d257e | |||
86c36bd01d | |||
8a3fc4f053 | |||
b17300cb6b | |||
c454da9e1a | |||
5e8dbab98c | |||
cbd4b8c045 | |||
27e30f29d6 | |||
ba578b3eec | |||
7d9b628fac | |||
66f40c0905 | |||
343f0b78b2 | |||
f7e1e35ffc | |||
367d03e949 | |||
c5f38c235c | |||
f15dbbc6d3 | |||
8fc04a818b | |||
1050894e5a | |||
c268904a94 | |||
d3cf82a23f | |||
3a1a4b68b9 | |||
f3bd200608 | |||
227341fc66 | |||
0e2564c3fa | |||
ccc2be8000 | |||
cc6f512333 | |||
37e93142a5 | |||
5a93f07bd7 | |||
cd87d4fc61 | |||
5cbac48e6f | |||
9bb6c35edd | |||
35fd7b6fc0 | |||
ddd6e20790 | |||
71a75afe98 | |||
378d710612 | |||
a07a38484b | |||
4d3359cb97 | |||
|
e82a295608 | ||
5a7aef059d |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -50,3 +50,5 @@ Scissors-Server
|
|||||||
Scissors-API
|
Scissors-API
|
||||||
|
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
paper-api-generator
|
@@ -1,13 +1,13 @@
|
|||||||
# Scissors [](https://ci.scissors.gg/job/Scissors/job/1.20.1/)
|
# Scissors [](https://ci.scissors.gg/job/Scissors/job/1.20.2/)
|
||||||
|
|
||||||
Scissors is a fork of Paper that aims to fix exploits possible in Creative Mode. Many of these exploits are ones that
|
Scissors is a fork of Paper that aims to fix exploits possible in Creative Mode. Many of these exploits are ones that
|
||||||
Paper's own team has either refused to fix or would have.
|
Paper's own team has either refused to fix or would have.
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
### [Scissors Download](https://ci.plex.us.org/job/Scissors)
|
### [Scissors Download](https://ci.plex.us.org/job/Scissors)
|
||||||
### [Scissors Javadoc](https://javadoc.scissors.gg/1.20.1)
|
### [Scissors Javadoc](https://javadoc.scissors.gg/1.20.2)
|
||||||
### [Scissors Announcements](https://totalfreedom.me/forum/board/139)
|
### [Scissors Announcements](https://totalfreedom.tf/forums/scissors-announcements.55)
|
||||||
### [Scissors General Discussion](https://totalfreedom.me/forum/board/140)
|
### [Scissors General Discussion](https://totalfreedom.tf/forums/scissors-discussion.56/)
|
||||||
|
|
||||||
## Tasks
|
## Tasks
|
||||||
```
|
```
|
||||||
|
@@ -8,9 +8,3 @@
|
|||||||
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
||||||
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
||||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||||
|
|
||||||
## Used in Scissors 1.19
|
|
||||||
#minecraft net/minecraft/world/ContainerHelper
|
|
||||||
#minecraft net/minecraft/network/chat/contents/NbtContents
|
|
||||||
#minecraft net/minecraft/network/chat/ComponentUtils
|
|
||||||
#minecraft net/minecraft/network/chat/contents/EntityDataSource
|
|
@@ -2,7 +2,7 @@ plugins {
|
|||||||
java
|
java
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||||
id("io.papermc.paperweight.patcher") version "1.5.5"
|
id("io.papermc.paperweight.patcher") version "1.5.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||||
@@ -15,9 +15,9 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
|
remapper("net.fabricmc:tiny-remapper:0.8.11:fat")
|
||||||
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
|
decompiler("net.minecraftforge:forgeflower:2.0.629.1")
|
||||||
paperclip("io.papermc:paperclip:3.0.3")
|
paperclip("io.papermc:paperclip:3.0.4-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
@@ -58,18 +58,22 @@ paperweight {
|
|||||||
remapRepo.set(paperMavenPublicUrl)
|
remapRepo.set(paperMavenPublicUrl)
|
||||||
decompileRepo.set(paperMavenPublicUrl)
|
decompileRepo.set(paperMavenPublicUrl)
|
||||||
|
|
||||||
useStandardUpstream("Folia") {
|
usePaperUpstream(providers.gradleProperty("paperRef")) {
|
||||||
url.set(github("PaperMC", "Folia"))
|
withPaperPatcher {
|
||||||
ref.set(providers.gradleProperty("foliaRef"))
|
|
||||||
|
|
||||||
withStandardPatcher {
|
|
||||||
baseName("Folia")
|
|
||||||
|
|
||||||
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
|
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
|
||||||
apiOutputDir.set(layout.projectDirectory.dir("Scissors-API"))
|
apiOutputDir.set(layout.projectDirectory.dir("Scissors-API"))
|
||||||
|
|
||||||
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
||||||
serverOutputDir.set(layout.projectDirectory.dir("Scissors-Server"))
|
serverOutputDir.set(layout.projectDirectory.dir("Scissors-Server"))
|
||||||
|
|
||||||
|
patchTasks {
|
||||||
|
register("generatedApi") {
|
||||||
|
isBareDirectory.set(true)
|
||||||
|
upstreamDirPath.set("paper-api-generator/generated")
|
||||||
|
patchDir.set(layout.projectDirectory.dir("patches/generatedApi"))
|
||||||
|
outputDir.set(layout.projectDirectory.dir("paper-api-generator/generated"))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
group=me.totalfreedom.scissors
|
group=me.totalfreedom.scissors
|
||||||
version=1.20.1-R0.1-SNAPSHOT
|
version=1.20.2-R0.1-SNAPSHOT
|
||||||
|
|
||||||
mcVersion=1.20.1
|
mcVersion=1.20.2
|
||||||
foliaRef=edafbcef6884cffe493e62cd71f4957708fba7ff
|
paperRef=931781c220b98dde0159c9a3c8dce06c3b2b1e13
|
||||||
|
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
15
gradlew
vendored
15
gradlew
vendored
@@ -83,10 +83,8 @@ done
|
|||||||
# This is normally unused
|
# This is normally unused
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -133,11 +131,14 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
@@ -197,6 +198,10 @@ if "$cygwin" || "$msys" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command;
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
@@ -6,7 +6,7 @@ Subject: [PATCH] Add MasterBlockFireEvent
|
|||||||
|
|
||||||
diff --git a/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
diff --git a/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..a24cb52a5af62012c5d5acc29e4c3558e92ae572
|
index 0000000000000000000000000000000000000000..812e6ae9f1c8eb9558e5109c522d3ce3a7deb35c
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
+++ b/src/main/java/me/totalfreedom/scissors/event/block/MasterBlockFireEvent.java
|
||||||
@@ -0,0 +1,51 @@
|
@@ -0,0 +1,51 @@
|
||||||
|
@@ -6,7 +6,7 @@ Subject: [PATCH] Add spectator teleport event
|
|||||||
|
|
||||||
diff --git a/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
diff --git a/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..d7efa63c316ed99c3eccfeadc1b0873b2ccb5d8a
|
index 0000000000000000000000000000000000000000..e4c9256c78f8b395aea86e9ea1a112f8e7426c1f
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
+++ b/src/main/java/me/totalfreedom/scissors/event/player/SpectatorTeleportEvent.java
|
||||||
@@ -0,0 +1,60 @@
|
@@ -0,0 +1,60 @@
|
||||||
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Scissors configuration file
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
index b6a8217b97842cd07af24fadb21e0e44226e5bb9..d4e33e4c94f5c81d14a138c8be46939b758dd21b 100644
|
index d0c634629aa0b6bac0da93655dd86ad3aea0ce30..5729362a327f6cc67e86d4ebf5328fc60ed710f7 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
@@ -2121,6 +2121,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2190,6 +2190,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
|
@@ -5,27 +5,25 @@ Subject: [PATCH] Build changes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 9ee90bc753e65f9dd532f28ec75cc16bf16486c8..9ca282a17c94d1314c625ca4ad15bb899cd6e02f 100644
|
index 79beac737c17412913983614bd478d33e3c6ed58..6c396296c3ff8b5559b7bf69af76459117de4e85 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -13,12 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||||
val alsoShade: Configuration by configurations.creating
|
val alsoShade: Configuration by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
- // Folia start
|
- implementation(project(":paper-api"))
|
||||||
- implementation(project(":folia-api"))
|
- implementation(project(":paper-mojangapi"))
|
||||||
- implementation("io.papermc.paper:paper-mojangapi:1.19.3-R0.1-SNAPSHOT") {
|
|
||||||
+ // Scissors start
|
+ // Scissors start
|
||||||
+ implementation(project(":Scissors-API"))
|
+ implementation(project(":Scissors-API"))
|
||||||
+ implementation("io.papermc.paper:paper-mojangapi:1.20.1-R0.1-SNAPSHOT") {
|
+ implementation("io.papermc.paper:paper-mojangapi:1.20.2-R0.1-SNAPSHOT") {
|
||||||
exclude("io.papermc.paper", "paper-api")
|
+ exclude("io.papermc.paper", "paper-api")
|
||||||
}
|
+ }
|
||||||
- // Folia end
|
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
// Paper start
|
// Paper start
|
||||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||||
@@ -72,11 +72,19 @@ tasks.jar {
|
@@ -66,11 +70,19 @@ tasks.jar {
|
||||||
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
||||||
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
||||||
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
||||||
@@ -42,21 +40,30 @@ index 9ee90bc753e65f9dd532f28ec75cc16bf16486c8..9ca282a17c94d1314c625ca4ad15bb89
|
|||||||
attributes(
|
attributes(
|
||||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
"Implementation-Title" to "CraftBukkit",
|
"Implementation-Title" to "CraftBukkit",
|
||||||
- "Implementation-Version" to "git-Folia-$implementationVersion", // Folia
|
- "Implementation-Version" to "git-Paper-$implementationVersion",
|
||||||
+ "Implementation-Version" to "git-Scissors-$implementationVersion", // Scissors // Folia
|
+ "Implementation-Version" to "git-Scissors-$implementationVersion", // Scissors
|
||||||
"Implementation-Vendor" to date, // Paper
|
"Implementation-Vendor" to date, // Paper
|
||||||
"Specification-Title" to "Bukkit",
|
"Specification-Title" to "Bukkit",
|
||||||
"Specification-Version" to project.version,
|
"Specification-Version" to project.version,
|
||||||
|
@@ -154,7 +166,7 @@ fun TaskContainer.registerRunTask(
|
||||||
|
name: String,
|
||||||
|
block: JavaExec.() -> Unit
|
||||||
|
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||||
|
- group = "paper"
|
||||||
|
+ group = "paperweight" // Scissors
|
||||||
|
mainClass.set("org.bukkit.craftbukkit.Main")
|
||||||
|
standardInput = System.`in`
|
||||||
|
workingDir = rootProject.layout.projectDirectory
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
index cb60d58d4a7556dd896f31d0cd249f860bb3ef84..f7038ee0d3475ee9c187da8feb12ff4553130e1d 100644
|
index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d07175ca09 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||||
@@ -593,7 +593,7 @@ public class Metrics {
|
@@ -593,7 +593,7 @@ public class Metrics {
|
||||||
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
|
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
|
||||||
// Only start Metrics, if it's enabled in the config
|
// Only start Metrics, if it's enabled in the config
|
||||||
if (config.getBoolean("enabled", true)) {
|
if (config.getBoolean("enabled", true)) {
|
||||||
- Metrics metrics = new Metrics("Folia", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page
|
- Metrics metrics = new Metrics("Paper", serverUUID, logFailedRequests, Bukkit.getLogger());
|
||||||
+ Metrics metrics = new Metrics("Scissors", serverUUID, logFailedRequests, Bukkit.getLogger()); // Scissors // Folia - we have our own bstats page
|
+ Metrics metrics = new Metrics("Scissors", serverUUID, logFailedRequests, Bukkit.getLogger()); // Scissors
|
||||||
|
|
||||||
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
||||||
String minecraftVersion = Bukkit.getVersion();
|
String minecraftVersion = Bukkit.getVersion();
|
||||||
@@ -64,13 +71,13 @@ index cb60d58d4a7556dd896f31d0cd249f860bb3ef84..f7038ee0d3475ee9c187da8feb12ff45
|
|||||||
final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
|
final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
|
||||||
if (implVersion != null) {
|
if (implVersion != null) {
|
||||||
final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
||||||
- paperVersion = "git-Folia-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Folia - we have our own bstats page
|
- paperVersion = "git-Paper-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash);
|
||||||
+ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors // Folia - we have our own bstats page
|
+ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors
|
||||||
} else {
|
} else {
|
||||||
paperVersion = "unknown";
|
paperVersion = "unknown";
|
||||||
}
|
}
|
||||||
- metrics.addCustomChart(new Metrics.SimplePie("folia_version", () -> paperVersion)); // Folia - we have our own bstats page
|
- metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> paperVersion));
|
||||||
+ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion)); // Scissors // Folia - we have our own bstats page
|
+ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion)); // Scissors
|
||||||
|
|
||||||
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
||||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||||
@@ -88,41 +95,41 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..21ded7c14c56a40feaa7741131be5166
|
|||||||
.completer(new ConsoleCommandCompleter(this.server))
|
.completer(new ConsoleCommandCompleter(this.server))
|
||||||
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 75eb95c330d6ab7ac1e4a69da13695bbd40f894e..1d2918a9f1307bc6b36ea3973dc0fff9fd073647 100644
|
index 8f31413c939cc2b0454ad3d9a1b618dbae449d00..96c2044c66db2b2aef644e19ecd289cf870ab62a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1811,7 +1811,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1697,7 +1697,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
- return "Folia"; // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
- return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||||
+ return "Scissors"; // Scissors - Scissors > // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
+ return "Scissors"; // Scissors - Scissors > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||||
}
|
}
|
||||||
|
|
||||||
public SystemReport fillSystemReport(SystemReport details) {
|
public SystemReport fillSystemReport(SystemReport details) {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index a8bf1f542ab20eb7c40c80b5e42b55982677373d..f9a2190b74121e510c8a234905ee5eb24e5ea7f7 100644
|
index 9c08303de2891de92e06de8a939a618b7a6f7321..43e331f2946faaf3e7e66e4a81a6b34604647c3b 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
|
@@ -269,7 +269,7 @@ import javax.annotation.Nullable; // Paper
|
||||||
import javax.annotation.Nonnull; // Paper
|
import javax.annotation.Nonnull; // Paper
|
||||||
|
|
||||||
public final class CraftServer implements Server {
|
public final class CraftServer implements Server {
|
||||||
- private final String serverName = "Folia"; // Folia // Paper
|
- private final String serverName = "Paper"; // Paper
|
||||||
+ private final String serverName = "Scissors"; // Scissors // Folia // Paper
|
+ private final String serverName = "Scissors"; // Scissors // Paper
|
||||||
private final String serverVersion;
|
private final String serverVersion;
|
||||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||||
private final Logger logger = Logger.getLogger("Minecraft");
|
private final Logger logger = Logger.getLogger("Minecraft");
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||||
index e9b6ca3aa25e140467ae866d572483050ea3fa0e..bb37db7715b7c5eb497f4d5f5a32668ad947943b 100644
|
index 774556a62eb240da42e84db4502e2ed43495be17..741c76c4dfa0bb34cc23bd795c194bdea10418cc 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||||
+++ b/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 {
|
@@ -11,7 +11,7 @@ public final class Versioning {
|
||||||
public static String getBukkitVersion() {
|
public static String getBukkitVersion() {
|
||||||
String result = "Unknown-Version";
|
String result = "Unknown-Version";
|
||||||
|
|
||||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/dev.folia/folia-api/pom.properties"); // Folia
|
- 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"); // Folia // Scissors
|
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/me.totalfreedom.scissors/Scissors-API/pom.properties"); // Scissors
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
|
|
||||||
if (stream != null) {
|
if (stream != null) {
|
||||||
|
@@ -5,13 +5,13 @@ Subject: [PATCH] UUID validation
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||||
index 6dac24354192bea79a4b9eb721543110826790b2..a9c3c55eb622b18c74d8a9bd472e4e871d11b2aa 100644
|
index b65dcff9812dbc3256c080ac264c4aafd83ce276..82b53a7bfb37bfa1752a016a8a454c0b994b9108 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||||
@@ -78,7 +78,11 @@ public final class NbtUtils {
|
@@ -74,7 +74,11 @@ public final class NbtUtils {
|
||||||
}
|
UUID uUID = nbt.hasUUID("Id") ? nbt.getUUID("Id") : Util.NIL_UUID;
|
||||||
// Paper start - support string UUID's
|
// Paper start - support string UUID's
|
||||||
if (nbt.contains("Id", 8)) {
|
if (nbt.contains("Id", Tag.TAG_STRING)) {
|
||||||
- uUID = UUID.fromString(nbt.getString("Id"));
|
- uUID = UUID.fromString(nbt.getString("Id"));
|
||||||
+ // Scissors start - Validate String UUIDs in game profiles
|
+ // Scissors start - Validate String UUIDs in game profiles
|
||||||
+ try {
|
+ try {
|
||||||
@@ -20,7 +20,7 @@ index 6dac24354192bea79a4b9eb721543110826790b2..a9c3c55eb622b18c74d8a9bd472e4e87
|
|||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
|
String string = nbt.getString("Name");
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
index 3ad05bbab726c59e7b67d9614af4b208d4520cb3..c0633f9553fb5aa52e8ffc863159521d09cb3bd5 100644
|
index 3ad05bbab726c59e7b67d9614af4b208d4520cb3..c0633f9553fb5aa52e8ffc863159521d09cb3bd5 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
|
||||||
|
@@ -31,10 +31,10 @@ index 2ee4ee14ab3345486dad6b24fd9a4fcc6c746b99..c5ac6cda91a81d3075f5c763e30dc009
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||||
index a178f00744ad2e27c0f35d69803574e5a16ec294..a971a7efc8e2a318d596f668e35a933de90b0525 100644
|
index 1f55185814125c691288294d18bf1580461c8066..259d65f8e21f9cf99585d416eafdc967dddccf57 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
--- a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
+++ b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
|
||||||
@@ -408,7 +408,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
@@ -409,7 +409,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
||||||
try {
|
try {
|
||||||
this.setParticle(ParticleArgument.readParticle(new StringReader(nbt.getString("Particle")), (HolderLookup) BuiltInRegistries.PARTICLE_TYPE.asLookup()));
|
this.setParticle(ParticleArgument.readParticle(new StringReader(nbt.getString("Particle")), (HolderLookup) BuiltInRegistries.PARTICLE_TYPE.asLookup()));
|
||||||
} catch (CommandSyntaxException commandsyntaxexception) {
|
} catch (CommandSyntaxException commandsyntaxexception) {
|
||||||
@@ -44,10 +44,10 @@ index a178f00744ad2e27c0f35d69803574e5a16ec294..a971a7efc8e2a318d596f668e35a933d
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..7b0aed8ed3a150b7c10fa246bb0b519232424737 100644
|
index 73871f456a85bda1e51f54986d0e61fb629822e8..df16049a70061c7c38d72b188d054339f5434e03 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
@@ -588,7 +588,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
@@ -589,7 +589,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||||
}), (entity) -> {
|
}), (entity) -> {
|
||||||
entity.load(nbt);
|
entity.load(nbt);
|
||||||
}, () -> {
|
}, () -> {
|
||||||
@@ -56,7 +56,7 @@ index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..7b0aed8ed3a150b7c10fa246bb0b5192
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -607,7 +607,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
@@ -608,7 +608,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<EntityType<?>> by(CompoundTag nbt) {
|
public static Optional<EntityType<?>> by(CompoundTag nbt) {
|
||||||
@@ -66,10 +66,10 @@ index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..7b0aed8ed3a150b7c10fa246bb0b5192
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
index a21edc7df32a59a6cb1af3865d2ce35f72cf8afc..0b272b0cf56dcb1c509fa63ff0f6e526c5536748 100644
|
index d28c477171c1b6888a45175075017d960464b5cd..cc46185c05a735d4443b266423215f1f7a0c7741 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
@@ -638,7 +638,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
@@ -619,7 +619,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||||
|
|
||||||
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
|
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
|
||||||
if (nbt.contains("DeathLootTable", 8)) {
|
if (nbt.contains("DeathLootTable", 8)) {
|
||||||
@@ -79,7 +79,7 @@ index a21edc7df32a59a6cb1af3865d2ce35f72cf8afc..0b272b0cf56dcb1c509fa63ff0f6e526
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
index 448fa4f4f200430d6ce3051763c7ceb697696146..40e59b8db83aec1143e3c394427e916beea7c01f 100644
|
index a18aadbf7ae83713e1f2b21553185d8000bc7699..f5ad7ddf13cbb6452c2927aef9b54eae3335b4c6 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
@@ -289,7 +289,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
@@ -289,7 +289,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||||
@@ -109,19 +109,6 @@ index 0425151e688966442340ea1cf892aff34ffe0791..244b04e0020b1bd1e7be34a1b6266a8a
|
|||||||
this.lootTableSeed = nbt.getLong("LootTableSeed");
|
this.lootTableSeed = nbt.getLong("LootTableSeed");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
|
|
||||||
index 6f9286db4e5786464fb0b49dc125e1228ab7ae93..8d91accb0d5e8afa3957d816bd71681b4198ee6e 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
|
|
||||||
@@ -90,7 +90,7 @@ public class DecoratedPotBlockEntity extends BlockEntity {
|
|
||||||
return Items.BRICK;
|
|
||||||
} else {
|
|
||||||
Tag tag = list.get(index);
|
|
||||||
- return BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getAsString()));
|
|
||||||
+ return BuiltInRegistries.ITEM.get(ResourceLocation.tryParse(tag.getAsString())); // Scissors
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||||
index 081691f9710ff1115e4308f79ed49fbc38941193..c29dfd15e147d5c4d9c9584ff7803c2a52009f0d 100644
|
index 081691f9710ff1115e4308f79ed49fbc38941193..c29dfd15e147d5c4d9c9584ff7803c2a52009f0d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
|
||||||
@@ -136,18 +123,18 @@ index 081691f9710ff1115e4308f79ed49fbc38941193..c29dfd15e147d5c4d9c9584ff7803c2a
|
|||||||
this.lootTableSeed = nbt.getLong("LootTableSeed");
|
this.lootTableSeed = nbt.getLong("LootTableSeed");
|
||||||
return false; // Paper - always load the items, table may still remain
|
return false; // Paper - always load the items, table may still remain
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
||||||
index e49eece9bff3a53469673d03a7bbf8f9cf8776b8..a49f32e9649155b6af4b1f236e4e8142d730e7e8 100644
|
index f6942cb3ef1f9ef03708d4bc932ea9aeb1c13894..8b32864bafb3c1948993688be8f639dd6492057e 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
|
||||||
@@ -30,8 +30,14 @@ public abstract class CraftLootable<T extends RandomizableContainerBlockEntity>
|
@@ -34,8 +34,14 @@ public abstract class CraftLootable<T extends RandomizableContainerBlockEntity>
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
- ResourceLocation key = getSnapshot().lootTable;
|
- ResourceLocation key = this.getSnapshot().lootTable;
|
||||||
- return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
- return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
||||||
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
+ // Scissors start - Return a null loot table if the specified loot table is not valid
|
||||||
+ try {
|
+ try {
|
||||||
+ ResourceLocation key = getSnapshot().lootTable;
|
+ ResourceLocation key = this.getSnapshot().lootTable;
|
||||||
+ return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
+ return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
||||||
+ } catch (Exception ex) {
|
+ } catch (Exception ex) {
|
||||||
+ return null;
|
+ return null;
|
||||||
@@ -157,10 +144,10 @@ index e49eece9bff3a53469673d03a7bbf8f9cf8776b8..a49f32e9649155b6af4b1f236e4e8142
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
||||||
index b7d0892953f357e58665e87fbcf794a75f1c0980..e65232cb1abd59b896650e249a2b2ad8b0828712 100644
|
index 313ee5c8737b2e57f9b5db6512c1871766b2ccd4..aa7fa17b9fb8519d8b57e27a5b422249b9b875d8 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java
|
||||||
@@ -41,8 +41,14 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo
|
@@ -33,8 +33,14 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo
|
||||||
return null; // return empty loot table?
|
return null; // return empty loot table?
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,10 +165,10 @@ index b7d0892953f357e58665e87fbcf794a75f1c0980..e65232cb1abd59b896650e249a2b2ad8
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
index 148d0393b093a326f76fc34c035768f4758f3f1b..43034806bf8dcd940e1ec47edd3875adb9cefe0f 100644
|
index b4e45d8e9851552f30c9c29d3d9671e1e9094c38..4e8e1a6b718d9ec8720efb648ab023e9e39f67e3 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||||
@@ -88,8 +88,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
@@ -80,8 +80,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LootTable getLootTable() {
|
public LootTable getLootTable() {
|
||||||
|
@@ -1,27 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Video <videogamesm12@gmail.com>
|
|
||||||
Date: Sun, 13 Mar 2022 03:01:29 -0600
|
|
||||||
Subject: [PATCH] Fixes the Blank SkullOwner exploit
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
|
||||||
index 47c8148e6413c51ffdd30082bfb37a7fb8a73a71..48fce864be2a92c9665b9eeb85e3193eaed4133d 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
|
||||||
@@ -11,6 +11,7 @@ import net.minecraft.nbt.CompoundTag;
|
|
||||||
import net.minecraft.nbt.NbtUtils;
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
|
||||||
import net.minecraft.world.level.block.entity.SkullBlockEntity;
|
|
||||||
+import org.apache.commons.lang3.StringUtils; // Scissors
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.NamespacedKey;
|
|
||||||
@@ -74,7 +75,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
|
||||||
try { // Paper - Ignore invalid game profiles
|
|
||||||
if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) {
|
|
||||||
this.setProfile(NbtUtils.readGameProfile(tag.getCompound(SKULL_OWNER.NBT)));
|
|
||||||
- } else if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_STRING) && !tag.getString(SKULL_OWNER.NBT).isEmpty()) {
|
|
||||||
+ } else if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_STRING) && !StringUtils.isBlank(tag.getString(SKULL_OWNER.NBT))) { // Scissors
|
|
||||||
this.setProfile(new GameProfile(null, tag.getString(SKULL_OWNER.NBT)));
|
|
||||||
}
|
|
||||||
} catch (Exception ignored) {} // Paper
|
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Removes useless spammy error logging
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
index 3df1822b55358a9bdf41bcacd5b7fecfd8f05dfa..f9741039dada19391e80d9623f2d8cabc1089506 100644
|
index aeca803cc0434d9de9434987d6e43b70353e305b..5bd581c1a82236359c810037333590d0d9741587 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
@@ -1813,8 +1813,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
@@ -1814,8 +1814,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||||
resource = CraftNamespacedKey.fromMinecraft(key);
|
resource = CraftNamespacedKey.fromMinecraft(key);
|
||||||
}
|
}
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
@@ -5,10 +5,10 @@ Subject: [PATCH] ItemEntity - Check if items are air before calling setItem
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
index 76e010769786132d8af3889051b3f52e9f683509..c8ac6e7dd19dfe38a99364f586c8d8d5e2539fb4 100644
|
index eb0351aa12eebcefab1d1d14641fc3c60cbbcab8..cf944848cdebbb6f04f5211e00c876329e86d9cc 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
@@ -424,11 +424,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
@@ -425,11 +425,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||||
|
|
||||||
CompoundTag nbttagcompound1 = nbt.getCompound("Item");
|
CompoundTag nbttagcompound1 = nbt.getCompound("Item");
|
||||||
|
|
@@ -6,15 +6,15 @@ Subject: [PATCH] Fixes Knowledge Books causing log spam when invalid data is
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
diff --git a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
||||||
index b79f4ce38a42e4dba8ebdfc97dadc531b7245c7a..9c49be7c53a1f2a8c203341b8ded9cd222d0c178 100644
|
index 37f37be56bab171df442b980ff46ff325daae283..deade19d16a7d6870171b9a60806a8cadb437db4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
--- a/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
+++ b/src/main/java/net/minecraft/world/item/KnowledgeBookItem.java
|
||||||
@@ -40,9 +40,9 @@ public class KnowledgeBookItem extends Item {
|
@@ -40,9 +40,9 @@ public class KnowledgeBookItem extends Item {
|
||||||
|
|
||||||
for(int i = 0; i < listTag.size(); ++i) {
|
for(int i = 0; i < listTag.size(); ++i) {
|
||||||
String string = listTag.getString(i);
|
String string = listTag.getString(i);
|
||||||
- Optional<? extends Recipe<?>> optional = recipeManager.byKey(new ResourceLocation(string));
|
- Optional<RecipeHolder<?>> optional = recipeManager.byKey(new ResourceLocation(string));
|
||||||
+ Optional<? extends Recipe<?>> optional = recipeManager.byKey(ResourceLocation.tryParse(string)); // Scissors - Validate resource locations
|
+ Optional<RecipeHolder<?>> optional = recipeManager.byKey(ResourceLocation.tryParse(string)); // Scissors - Validate resource locations
|
||||||
if (!optional.isPresent()) {
|
if (!optional.isPresent()) {
|
||||||
- LOGGER.error("Invalid recipe: {}", (Object)string);
|
- LOGGER.error("Invalid recipe: {}", (Object)string);
|
||||||
+ // Scissors - Don't log errors caused by invalid recipes being provided
|
+ // Scissors - Don't log errors caused by invalid recipes being provided
|
@@ -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
|
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||||
index efa800402413202d190926610d8264dfbf5019e7..1b3229128771adb85a7d007989891ef073a80278 100644
|
index 82b53a7bfb37bfa1752a016a8a454c0b994b9108..b8720020f98ea26da7d3225ddfbb1d9e80be4eb1 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||||
@@ -234,7 +234,7 @@ public final class NbtUtils {
|
@@ -231,7 +231,7 @@ public final class NbtUtils {
|
||||||
if (!nbt.contains("Name", 8)) {
|
if (!nbt.contains("Name", 8)) {
|
||||||
return Blocks.AIR.defaultBlockState();
|
return Blocks.AIR.defaultBlockState();
|
||||||
} else {
|
} else {
|
||||||
@@ -18,10 +18,10 @@ index efa800402413202d190926610d8264dfbf5019e7..1b3229128771adb85a7d007989891ef0
|
|||||||
if (optional.isEmpty()) {
|
if (optional.isEmpty()) {
|
||||||
return Blocks.AIR.defaultBlockState();
|
return Blocks.AIR.defaultBlockState();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
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 270b37a34de47bc9846442d58827e8ff5e35178c..dbac57c9f6048779330f404d96ad213af5810707 100644
|
index 8affdd74769aed9aa92a76ba539cd9d27208827c..23e480535bfb4071cde84fc400c2e6acb129e1ae 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||||
@@ -546,7 +546,7 @@ public abstract class AbstractArrow extends Projectile {
|
@@ -541,7 +541,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||||
this.setCritArrow(nbt.getBoolean("crit"));
|
this.setCritArrow(nbt.getBoolean("crit"));
|
||||||
this.setPierceLevel(nbt.getByte("PierceLevel"));
|
this.setPierceLevel(nbt.getByte("PierceLevel"));
|
||||||
if (nbt.contains("SoundEvent", 8)) {
|
if (nbt.contains("SoundEvent", 8)) {
|
@@ -27,10 +27,10 @@ index c0633f9553fb5aa52e8ffc863159521d09cb3bd5..7449a024265c42f28a6c9a1ed8d8f4b9
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||||
index 0344b1f77f23274c2932b5dce01b0ea6887078cf..d3d716e349df0edd28a4dabe528a332ea218b37f 100644
|
index 759ecd79534a7706f7d4a63eb9dacbefcfe54674..9afda54ad70d446672749506822c6abd729b8f1b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||||
@@ -443,7 +443,7 @@ public class ItemFrame extends HangingEntity {
|
@@ -441,7 +441,7 @@ public class ItemFrame extends HangingEntity {
|
||||||
ItemStack itemstack = ItemStack.of(nbttagcompound1);
|
ItemStack itemstack = ItemStack.of(nbttagcompound1);
|
||||||
|
|
||||||
if (itemstack.isEmpty()) {
|
if (itemstack.isEmpty()) {
|
@@ -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
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
index e2f704c115fd6e00960bb56bb0779f1100c89c17..0a821ba42f850b95412c89eba8f66dbf0d6b5c66 100644
|
index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..bc5ed619e05f24f3ad50a6a81306d120869f57a1 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
@@ -4,11 +4,13 @@ import com.destroystokyo.paper.util.VersionFetcher;
|
@@ -4,11 +4,13 @@ import com.destroystokyo.paper.util.VersionFetcher;
|
||||||
@@ -37,10 +37,10 @@ index e2f704c115fd6e00960bb56bb0779f1100c89c17..0a821ba42f850b95412c89eba8f66dbf
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Component getVersionMessage(@Nonnull String serverVersion) {
|
public Component getVersionMessage(@Nonnull String serverVersion) {
|
||||||
- String[] parts = serverVersion.substring("git-Folia-".length()).split("[-\\s]"); // Folia
|
- String[] parts = serverVersion.substring("git-Paper-".length()).split("[-\\s]");
|
||||||
- final Component updateMessage = getUpdateStatusMessage("PaperMC/Folia", GITHUB_BRANCH_NAME, parts[0]); // Folia
|
- final Component updateMessage = getUpdateStatusMessage("PaperMC/Paper", GITHUB_BRANCH_NAME, parts[0]);
|
||||||
+ String[] parts = serverVersion.substring("git-Scissors-".length()).split("[-\\s]"); // Scissors // Folia
|
+ String[] parts = serverVersion.substring("git-Scissors-".length()).split("[-\\s]"); // Scissors
|
||||||
+ final Component updateMessage = getUpdateStatusMessage("AtlasMediaGroup/Scissors", GITHUB_BRANCH_NAME, parts[0]); // Scissors // Folia
|
+ final Component updateMessage = getUpdateStatusMessage("AtlasMediaGroup/Scissors", GITHUB_BRANCH_NAME, parts[0]); // Scissors
|
||||||
final Component history = getHistory();
|
final Component history = getHistory();
|
||||||
|
|
||||||
return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
|
return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
|
||||||
@@ -77,10 +77,10 @@ index e2f704c115fd6e00960bb56bb0779f1100c89c17..0a821ba42f850b95412c89eba8f66dbf
|
|||||||
switch (distance) {
|
switch (distance) {
|
||||||
case -1:
|
case -1:
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
index 776b7fc26fe96b69be260bbd36efae147d988640..344bef62aa1551a6a09c10492cbc26acb63fa105 100644
|
index c737c5d62407337d3db2899cfc01713a058a6467..54891c5d7ca19a4fdab74a8729814a6fecee3fda 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
@@ -292,7 +292,7 @@ public class Main {
|
@@ -301,7 +301,7 @@ public class Main {
|
||||||
if (buildDate.before(deadline.getTime())) {
|
if (buildDate.before(deadline.getTime())) {
|
||||||
// Paper start - This is some stupid bullshit
|
// Paper start - This is some stupid bullshit
|
||||||
System.err.println("*** Warning, you've not updated in a while! ***");
|
System.err.println("*** Warning, you've not updated in a while! ***");
|
@@ -5,26 +5,25 @@ Subject: [PATCH] Better handling of invalid JSON components
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||||
index cadb91c7f5ef80aac8513f246fdf481947fa0a17..7c64d20f551c120f37b278cc2f09b002920cab62 100644
|
index 8240bb085b619f257f8c0a25775e0b15068e440f..c80d58dc9cb9171d51ff0a0596bb27bf161c3c83 100644
|
||||||
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||||
@@ -584,13 +584,7 @@ public final class MCUtil {
|
@@ -659,12 +659,6 @@ public final class MCUtil {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String string = compound.getString(key);
|
String string = compound.getString(key);
|
||||||
- try {
|
- try {
|
||||||
- return Component.Serializer.fromJson(string);
|
- return net.minecraft.network.chat.Component.Serializer.fromJson(string);
|
||||||
- } catch (com.google.gson.JsonParseException e) {
|
- } catch (com.google.gson.JsonParseException e) {
|
||||||
- org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage());
|
- org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage());
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- return null;
|
- return null;
|
||||||
+ return Component.Serializer.fromJsonSafe(string);
|
+ return net.minecraft.network.chat.Component.Serializer.fromJsonSafe(string);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChunkStatus getChunkStatus(ChunkHolder chunk) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
index 37fc353c3e59dd5af2fd6c58ac084fb0e6e155d7..2873ed7c443ed8c8c57a8b1d3e444d229f10f07b 100644
|
index b540ce21c65ad52ad7e94d2ca2b3926c0875bee1..9cb6fa8e35c89f73e7c95dbe219a4bf6d00b60a9 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
@@ -26,6 +26,7 @@ import java.util.List;
|
@@ -26,6 +26,7 @@ import java.util.List;
|
||||||
@@ -128,10 +127,10 @@ index 97a2657bc98d41c3c1e376b266d2c85f685acc88..9d20f3f1af8e663a8c13714c8928d4a9
|
|||||||
}
|
}
|
||||||
}).reduce((accumulator, current) -> {
|
}).reduce((accumulator, current) -> {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index fa35d2c1c8de225acd68e08f15976c92f7ab82aa..c3e587abaf61772f2a6872ece6ea65b18cf7cdee 100644
|
index 1e05fca2a2ba6e2c0b641b6e27585520889cd8a6..3bf0c06f5042e9ff5572714dfc6a641a01a65978 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -2491,12 +2491,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
@@ -2503,12 +2503,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||||
this.setRot(this.getYRot(), this.getXRot());
|
this.setRot(this.getYRot(), this.getXRot());
|
||||||
if (nbt.contains("CustomName", 8)) {
|
if (nbt.contains("CustomName", 8)) {
|
||||||
String s = nbt.getString("CustomName");
|
String s = nbt.getString("CustomName");
|
||||||
@@ -146,10 +145,10 @@ index fa35d2c1c8de225acd68e08f15976c92f7ab82aa..c3e587abaf61772f2a6872ece6ea65b1
|
|||||||
|
|
||||||
this.setCustomNameVisible(nbt.getBoolean("CustomNameVisible"));
|
this.setCustomNameVisible(nbt.getBoolean("CustomNameVisible"));
|
||||||
diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
||||||
index 2be7a697f08045b974579e6942b38571e744efac..84ec21c38bb44db1e9ff26c01d5c8af1a2417616 100644
|
index 4def212655cea0fd998b52e924f8b671d6aeb559..4359fb5997f8a207c52a09aa61a9431fa3ff550e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
--- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
||||||
+++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
+++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
|
||||||
@@ -35,7 +35,7 @@ public class ScoreboardSaveData extends SavedData {
|
@@ -38,7 +38,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||||
CompoundTag compoundTag = nbt.getCompound(i);
|
CompoundTag compoundTag = nbt.getCompound(i);
|
||||||
String string = compoundTag.getString("Name");
|
String string = compoundTag.getString("Name");
|
||||||
PlayerTeam playerTeam = this.scoreboard.addPlayerTeam(string);
|
PlayerTeam playerTeam = this.scoreboard.addPlayerTeam(string);
|
||||||
@@ -158,7 +157,7 @@ index 2be7a697f08045b974579e6942b38571e744efac..84ec21c38bb44db1e9ff26c01d5c8af1
|
|||||||
if (component != null) {
|
if (component != null) {
|
||||||
playerTeam.setDisplayName(component);
|
playerTeam.setDisplayName(component);
|
||||||
}
|
}
|
||||||
@@ -53,14 +53,14 @@ public class ScoreboardSaveData extends SavedData {
|
@@ -56,14 +56,14 @@ public class ScoreboardSaveData extends SavedData {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compoundTag.contains("MemberNamePrefix", 8)) {
|
if (compoundTag.contains("MemberNamePrefix", 8)) {
|
||||||
@@ -175,12 +174,12 @@ index 2be7a697f08045b974579e6942b38571e744efac..84ec21c38bb44db1e9ff26c01d5c8af1
|
|||||||
if (component3 != null) {
|
if (component3 != null) {
|
||||||
playerTeam.setPlayerSuffix(component3);
|
playerTeam.setPlayerSuffix(component3);
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ public class ScoreboardSaveData extends SavedData {
|
@@ -123,7 +123,7 @@ public class ScoreboardSaveData extends SavedData {
|
||||||
CompoundTag compoundTag = nbt.getCompound(i);
|
return ObjectiveCriteria.DUMMY;
|
||||||
ObjectiveCriteria.byName(compoundTag.getString("CriteriaName")).ifPresent((criterion) -> {
|
});
|
||||||
String string = compoundTag.getString("Name");
|
String string2 = compoundTag.getString("Name");
|
||||||
- Component component = Component.Serializer.fromJson(compoundTag.getString("DisplayName"));
|
- Component component = Component.Serializer.fromJson(compoundTag.getString("DisplayName"));
|
||||||
+ Component component = Component.Serializer.fromJsonSafe(compoundTag.getString("DisplayName")); // Scissors - Use safer method for getting Components from JSON
|
+ Component component = Component.Serializer.fromJsonSafe(compoundTag.getString("DisplayName")); // Scissors - Use safer method for getting Components from JSON
|
||||||
ObjectiveCriteria.RenderType renderType = ObjectiveCriteria.RenderType.byId(compoundTag.getString("RenderType"));
|
ObjectiveCriteria.RenderType renderType = ObjectiveCriteria.RenderType.byId(compoundTag.getString("RenderType"));
|
||||||
this.scoreboard.addObjective(string, criterion, component, renderType);
|
this.scoreboard.addObjective(string2, objectiveCriteria, component, renderType);
|
||||||
});
|
}
|
@@ -5,12 +5,12 @@ Subject: [PATCH] Block server-side chunkbans
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
|
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||||
index fbfadeb83719b81f42724e79c59e92ed88fdece7..7de21c9bcc1f3c556790da62f96cc44995e877b2 100644
|
index d364bd57b1675c8b21d781c2bc16c3e65800455c..f2e7585630ff724f966c7bcedc17e502d786870d 100644
|
||||||
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
|
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||||
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
|
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
|
||||||
@@ -6,9 +6,17 @@ import io.netty.channel.ChannelHandlerContext;
|
@@ -7,8 +7,16 @@ import io.netty.handler.codec.MessageToByteEncoder;
|
||||||
import io.netty.handler.codec.MessageToByteEncoder;
|
import io.netty.util.Attribute;
|
||||||
import io.papermc.paper.adventure.PaperAdventure; // Paper
|
import io.netty.util.AttributeKey;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
+import java.util.Collections; // Scissors
|
+import java.util.Collections; // Scissors
|
||||||
+import net.minecraft.ChatFormatting; // Scissors
|
+import net.minecraft.ChatFormatting; // Scissors
|
||||||
@@ -19,7 +19,6 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..7de21c9bcc1f3c556790da62f96cc449
|
|||||||
+import net.minecraft.network.chat.Component; // Scissors
|
+import net.minecraft.network.chat.Component; // Scissors
|
||||||
+import net.minecraft.network.chat.SignedMessageBody; // Scissors
|
+import net.minecraft.network.chat.SignedMessageBody; // Scissors
|
||||||
import net.minecraft.network.protocol.Packet;
|
import net.minecraft.network.protocol.Packet;
|
||||||
import net.minecraft.network.protocol.PacketFlow;
|
|
||||||
+import net.minecraft.network.protocol.game.*; // Scissors
|
+import net.minecraft.network.protocol.game.*; // Scissors
|
||||||
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
||||||
+import net.minecraft.world.item.ItemStack; // Scissors
|
+import net.minecraft.world.item.ItemStack; // Scissors
|
||||||
@@ -27,20 +26,20 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..7de21c9bcc1f3c556790da62f96cc449
|
|||||||
|
|
||||||
public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||||
@@ -19,6 +27,23 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
@@ -19,6 +27,23 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||||
this.flow = side;
|
this.codecKey = protocolKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Scissors start
|
+ // Scissors start
|
||||||
+ private static int tryWrite(Packet packet, FriendlyByteBuf friendlyByteBuf, ChannelHandlerContext channelHandlerContext, int i) {
|
+ private int tryWrite(Packet packet, FriendlyByteBuf friendlyByteBuf, ChannelHandlerContext channelHandlerContext, int i) {
|
||||||
+ friendlyByteBuf.writeVarInt(i);
|
+ friendlyByteBuf.writeVarInt(i);
|
||||||
+ friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(PaperAdventure.LOCALE_ATTRIBUTE).get();
|
+ friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(io.papermc.paper.adventure.PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
||||||
+
|
+
|
||||||
+ int j = friendlyByteBuf.writerIndex();
|
+ int j = friendlyByteBuf.writerIndex();
|
||||||
+ packet.write(friendlyByteBuf);
|
+ packet.write(friendlyByteBuf);
|
||||||
+ int k = friendlyByteBuf.writerIndex() - j;
|
+ int k = friendlyByteBuf.writerIndex() - j;
|
||||||
+ int packetLength = friendlyByteBuf.readableBytes();
|
+ int packetLength = friendlyByteBuf.readableBytes();
|
||||||
+ if (k > 8388608 || packetLength > MAX_PACKET_SIZE) {
|
+ if (packetLength > MAX_PACKET_SIZE) {
|
||||||
+ throw new SkipPacketException(new IllegalArgumentException("Packet too big (is " + k + "): " + packet));
|
+ throw new PacketTooLargeException(packet, this.codecKey, packetLength);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return k;
|
+ return k;
|
||||||
@@ -48,14 +47,14 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..7de21c9bcc1f3c556790da62f96cc449
|
|||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
+
|
+
|
||||||
protected void encode(ChannelHandlerContext channelHandlerContext, Packet<?> packet, ByteBuf byteBuf) throws Exception {
|
protected void encode(ChannelHandlerContext channelHandlerContext, Packet<?> packet, ByteBuf byteBuf) throws Exception {
|
||||||
ConnectionProtocol connectionProtocol = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get();
|
Attribute<ConnectionProtocol.CodecData<?>> attribute = channelHandlerContext.channel().attr(this.codecKey);
|
||||||
if (connectionProtocol == null) {
|
ConnectionProtocol.CodecData<?> codecData = attribute.get();
|
||||||
@@ -33,38 +58,59 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
@@ -34,46 +59,59 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||||
throw new IOException("Can't serialize unregistered packet");
|
throw new IOException("Can't serialize unregistered packet");
|
||||||
} else {
|
} else {
|
||||||
FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(byteBuf);
|
FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(byteBuf);
|
||||||
- friendlyByteBuf.writeVarInt(i);
|
- friendlyByteBuf.writeVarInt(i);
|
||||||
- friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
- friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(io.papermc.paper.adventure.PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
|
||||||
|
|
||||||
+ // Scissors start
|
+ // Scissors start
|
||||||
+ int k;
|
+ int k;
|
||||||
@@ -65,33 +64,41 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..7de21c9bcc1f3c556790da62f96cc449
|
|||||||
- int k = friendlyByteBuf.writerIndex() - j;
|
- int k = friendlyByteBuf.writerIndex() - j;
|
||||||
- if (false && k > 8388608) { // Paper - disable
|
- if (false && k > 8388608) { // Paper - disable
|
||||||
- throw new IllegalArgumentException("Packet too big (is " + k + ", should be less than 8388608): " + packet);
|
- throw new IllegalArgumentException("Packet too big (is " + k + ", should be less than 8388608): " + packet);
|
||||||
- } else {
|
|
||||||
- int l = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get().getId();
|
|
||||||
- JvmProfiler.INSTANCE.onPacketSent(l, i, channelHandlerContext.channel().remoteAddress(), k);
|
|
||||||
- }
|
- }
|
||||||
+ k = tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
-
|
||||||
} catch (Throwable var10) {
|
- JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k);
|
||||||
- LOGGER.error("Packet encoding of packet ID {} threw (skippable? {})", i, packet.isSkippable(), var10); // Paper - Give proper error message
|
+ k = this.tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
||||||
|
} catch (Throwable var13) {
|
||||||
|
- // Paper start - Give proper error message
|
||||||
|
- String packetName = io.papermc.paper.util.ObfHelper.INSTANCE.deobfClassName(packet.getClass().getName());
|
||||||
|
- if (packetName.contains(".")) {
|
||||||
|
- packetName = packetName.substring(packetName.lastIndexOf(".") + 1);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- LOGGER.error("Packet encoding of packet {} (ID: {}) threw (skippable? {})", packetName, i, packet.isSkippable(), var13);
|
||||||
|
- // Paper end
|
||||||
- if (packet.isSkippable()) {
|
- if (packet.isSkippable()) {
|
||||||
- throw new SkipPacketException(var10);
|
- throw new SkipPacketException(var13);
|
||||||
- } else {
|
- }
|
||||||
- throw var10;
|
-
|
||||||
|
- throw var13;
|
||||||
|
- } finally {
|
||||||
|
- // Paper start
|
||||||
|
- int packetLength = friendlyByteBuf.readableBytes();
|
||||||
|
- if (packetLength > MAX_PACKET_SIZE) {
|
||||||
|
- throw new PacketTooLargeException(packet, this.codecKey, packetLength);
|
||||||
+ packet = capPacket(packet, i);
|
+ packet = capPacket(packet, i);
|
||||||
+ if (packet == null) {
|
+ if (packet == null) {
|
||||||
+ throw new SkipPacketException(new IllegalArgumentException("Packet too big: " + packet));
|
+ throw new SkipPacketException(new IllegalArgumentException("Packet too big: " + packet));
|
||||||
}
|
}
|
||||||
|
- // Paper end
|
||||||
|
- ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet);
|
||||||
+ friendlyByteBuf.clear();
|
+ friendlyByteBuf.clear();
|
||||||
+ k = tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
+ k = this.tryWrite(packet, friendlyByteBuf, channelHandlerContext, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
- // Paper start
|
+ JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k);
|
||||||
- int packetLength = friendlyByteBuf.readableBytes();
|
+ ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet);
|
||||||
- if (packetLength > MAX_PACKET_SIZE) {
|
|
||||||
- throw new PacketTooLargeException(packet, packetLength);
|
|
||||||
- }
|
|
||||||
- // Paper end
|
|
||||||
+ int l = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get().getId();
|
|
||||||
+ JvmProfiler.INSTANCE.onPacketSent(l, i, channelHandlerContext.channel().remoteAddress(), k);
|
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,7 +153,7 @@ index 3944852921335c78a04a9dc301882ab5b152b1ed..96ee53c7cc862e059328c5cdf5e07f30
|
|||||||
this.type = blockEntityType;
|
this.type = blockEntityType;
|
||||||
this.tag = nbt.isEmpty() ? null : nbt;
|
this.tag = nbt.isEmpty() ? null : nbt;
|
||||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||||
index 39b879f21f958dbd91ab0f74e5d4f3c74928fc33..688287c637a0d4b28d630b7304a3c2cf339bdf54 100644
|
index 51e24105facfe71ce9f2757c6c881a21b58dacfd..5692fbae221fb01d32d92edc7bea0f6312e24e1c 100644
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||||
@@ -33,6 +33,13 @@ public class ClientboundLevelChunkPacketData {
|
@@ -33,6 +33,13 @@ public class ClientboundLevelChunkPacketData {
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Reject oversized components from updating
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/ComponentUtils.java b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
diff --git a/src/main/java/net/minecraft/network/chat/ComponentUtils.java b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
||||||
index 584a58659fae6ba3d8b53858890bc6ec509ffb0e..54a7dae26854d320d9e53f63eb411a85a2d78159 100644
|
index 7daca712816a79cc4a30b084afbd3d07b5d3755f..a7e04eb4284e7d5148e1c7b991620d666785ec70 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
--- a/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
+++ b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
||||||
@@ -39,8 +39,9 @@ public class ComponentUtils {
|
@@ -38,8 +38,9 @@ public class ComponentUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MutableComponent updateForEntity(@Nullable CommandSourceStack source, Component text, @Nullable Entity sender, int depth) throws CommandSyntaxException {
|
public static MutableComponent updateForEntity(@Nullable CommandSourceStack source, Component text, @Nullable Entity sender, int depth) throws CommandSyntaxException {
|
||||||
@@ -19,7 +19,7 @@ index 584a58659fae6ba3d8b53858890bc6ec509ffb0e..54a7dae26854d320d9e53f63eb411a85
|
|||||||
} else {
|
} else {
|
||||||
// Paper start
|
// Paper start
|
||||||
if (text instanceof io.papermc.paper.adventure.AdventureComponent adventureComponent) {
|
if (text instanceof io.papermc.paper.adventure.AdventureComponent adventureComponent) {
|
||||||
@@ -53,8 +54,9 @@ public class ComponentUtils {
|
@@ -52,8 +53,9 @@ public class ComponentUtils {
|
||||||
mutableComponent.append(updateForEntity(source, component, sender, depth + 1));
|
mutableComponent.append(updateForEntity(source, component, sender, depth + 1));
|
||||||
}
|
}
|
||||||
|
|
@@ -414,10 +414,10 @@ index 0000000000000000000000000000000000000000..8cd2848aa6b06c5efbe797ed2d75ff4b
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||||
index dae36c6452ccd57a436dd918547b64d59957ab0a..d450cf3cf8ab5cbb5d32a28ee2e4a6717941adef 100644
|
index ec268189b19b6fa5c4521f96ce211a531db35ec5..343cb72710ef100cf7e4de1e081cfdc2744aab46 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Main.java
|
--- a/src/main/java/net/minecraft/server/Main.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||||
@@ -136,6 +136,7 @@ public class Main {
|
@@ -144,6 +144,7 @@ public class Main {
|
||||||
// Paper start - load config files for access below if needed
|
// Paper start - load config files for access below if needed
|
||||||
org.bukkit.configuration.file.YamlConfiguration bukkitConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("bukkit-settings"));
|
org.bukkit.configuration.file.YamlConfiguration bukkitConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("bukkit-settings"));
|
||||||
org.bukkit.configuration.file.YamlConfiguration spigotConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("spigot-settings"));
|
org.bukkit.configuration.file.YamlConfiguration spigotConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("spigot-settings"));
|
||||||
@@ -426,7 +426,7 @@ index dae36c6452ccd57a436dd918547b64d59957ab0a..d450cf3cf8ab5cbb5d32a28ee2e4a671
|
|||||||
|
|
||||||
if (optionset.has("initSettings")) { // CraftBukkit
|
if (optionset.has("initSettings")) { // CraftBukkit
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index c5dfd99a38a79fd19a2bf85fa297a28e40612b51..a2aee0bbd0ffcd3d86d33a4cea7b0d683736726b 100644
|
index 1c9742ad81f04052d2c3bc18c7636f45b2fc5160..e2cb86f0323d91fa10ecf6cdf1db2e28405798a8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -222,6 +222,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -222,6 +222,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
@@ -447,18 +447,18 @@ index c5dfd99a38a79fd19a2bf85fa297a28e40612b51..a2aee0bbd0ffcd3d86d33a4cea7b0d68
|
|||||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||||
this.setMotd(dedicatedserverproperties.motd);
|
this.setMotd(dedicatedserverproperties.motd);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index f9a2190b74121e510c8a234905ee5eb24e5ea7f7..d6eef122c2ee170d5c305524166e18b7315fe9f3 100644
|
index 903df63725faeaa160609edddf9f5c54144945e6..058780b420c9207119f4bb889f602bd94199d7fb 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -1097,6 +1097,7 @@ public final class CraftServer implements Server {
|
@@ -1040,6 +1040,7 @@ public final class CraftServer implements Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||||
+ me.totalfreedom.scissors.ScissorsConfig.init(((File) console.options.valueOf("scissors-settings"))); // Scissors
|
+ me.totalfreedom.scissors.ScissorsConfig.init(((File) console.options.valueOf("scissors-settings"))); // Scissors
|
||||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||||
for (ServerLevel world : this.console.getAllLevels()) {
|
for (ServerLevel world : this.console.getAllLevels()) {
|
||||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||||
@@ -1128,6 +1129,7 @@ public final class CraftServer implements Server {
|
@@ -1071,6 +1072,7 @@ public final class CraftServer implements Server {
|
||||||
this.reloadData();
|
this.reloadData();
|
||||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||||
@@ -466,7 +466,7 @@ index f9a2190b74121e510c8a234905ee5eb24e5ea7f7..d6eef122c2ee170d5c305524166e18b7
|
|||||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||||
|
|
||||||
@@ -2975,6 +2977,14 @@ public final class CraftServer implements Server {
|
@@ -2978,6 +2980,14 @@ public final class CraftServer implements Server {
|
||||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,10 +482,10 @@ index f9a2190b74121e510c8a234905ee5eb24e5ea7f7..d6eef122c2ee170d5c305524166e18b7
|
|||||||
public void restart() {
|
public void restart() {
|
||||||
org.spigotmc.RestartCommand.restart();
|
org.spigotmc.RestartCommand.restart();
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
index 344bef62aa1551a6a09c10492cbc26acb63fa105..0e3127f3fffb832571aef3b14085e66289ad76b1 100644
|
index 54891c5d7ca19a4fdab74a8729814a6fecee3fda..05db4799fddfbd8045c967520db99a75ba807697 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
@@ -180,6 +180,20 @@ public class Main {
|
@@ -181,6 +181,20 @@ public class Main {
|
||||||
.defaultsTo("Unknown Server")
|
.defaultsTo("Unknown Server")
|
||||||
.describedAs("Name");
|
.describedAs("Name");
|
||||||
// Paper end
|
// Paper end
|
@@ -6,7 +6,7 @@ Subject: [PATCH] Prevent attributes with invalid namespaces from being applied
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
index f9741039dada19391e80d9623f2d8cabc1089506..38238d9e6d464990caf10557997c6ca88ee100c0 100644
|
index ed6e5060901c348c4f56a573c23e2000d8f2fb72..5cdf1e6fcdc9e2bd821f40ec9bf95cf03f03179a 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
@@ -46,6 +46,7 @@ import net.minecraft.nbt.NbtIo;
|
@@ -46,6 +46,7 @@ import net.minecraft.nbt.NbtIo;
|
||||||
@@ -17,10 +17,10 @@ index f9741039dada19391e80d9623f2d8cabc1089506..38238d9e6d464990caf10557997c6ca8
|
|||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import org.apache.commons.lang3.EnumUtils;
|
import org.apache.commons.lang3.EnumUtils;
|
||||||
@@ -486,7 +487,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
@@ -487,7 +488,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||||
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
|
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
|
||||||
|
|
||||||
String attributeName = CraftAttributeMap.convertIfNeeded(entry.getString(ATTRIBUTES_IDENTIFIER.NBT)); // Paper
|
String attributeName = CraftAttributeMap.convertIfNeeded(entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT)); // Paper
|
||||||
- if (attributeName == null || attributeName.isEmpty()) {
|
- if (attributeName == null || attributeName.isEmpty()) {
|
||||||
+ if (attributeName == null || attributeName.isEmpty() || attributeName.length() > 256 || !ResourceLocation.isValidResourceLocation(attributeName)) { // Scissors
|
+ if (attributeName == null || attributeName.isEmpty() || attributeName.length() > 256 || !ResourceLocation.isValidResourceLocation(attributeName)) { // Scissors
|
||||||
continue;
|
continue;
|
@@ -0,0 +1,34 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Video <videogamesm12@gmail.com>
|
||||||
|
Date: Mon, 11 Apr 2022 13:33:52 -0600
|
||||||
|
Subject: [PATCH] Fixes creative-killing potion effects and certain potion
|
||||||
|
effect overflows
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java b/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java
|
||||||
|
index 1c7794de5f0a7238b944c9473e2cc9d011ef2306..9c594c504611b9da5fcd119284b2dcb4b59d3bf4 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/effect/HealOrHarmMobEffect.java
|
||||||
|
@@ -16,6 +16,11 @@ class HealOrHarmMobEffect extends InstantenousMobEffect {
|
||||||
|
@Override
|
||||||
|
public void applyEffectTick(LivingEntity entity, int amplifier) {
|
||||||
|
super.applyEffectTick(entity, amplifier);
|
||||||
|
+ // Scissors start - Don't apply any healing/harming effects for Creative/Invulnerable players and cap the amplifier for those who aren't.
|
||||||
|
+ if (entity instanceof net.minecraft.world.entity.player.Player player && (player.isCreative() || player.isInvulnerable())) return;
|
||||||
|
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
||||||
|
+ // Scissors end
|
||||||
|
+
|
||||||
|
if (this.isHarm == entity.isInvertedHealAndHarm()) {
|
||||||
|
entity.heal((float) Math.max(4 << amplifier, 0), org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.MAGIC); // CraftBukkit
|
||||||
|
} else {
|
||||||
|
@@ -27,6 +32,10 @@ class HealOrHarmMobEffect extends InstantenousMobEffect {
|
||||||
|
@Override
|
||||||
|
public void applyInstantenousEffect(@Nullable Entity source, @Nullable Entity attacker, LivingEntity target, int amplifier, double proximity) {
|
||||||
|
int j;
|
||||||
|
+ // Scissors start - Don't apply any healing/harming effects for Creative/Invulnerable players and cap the amplifier for those who aren't.
|
||||||
|
+ if (target instanceof net.minecraft.world.entity.player.Player player && (player.isCreative() || player.isInvulnerable())) return;
|
||||||
|
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
||||||
|
+ // Scissors end
|
||||||
|
|
||||||
|
if (this.isHarm == target.isInvertedHealAndHarm()) {
|
||||||
|
j = (int) (proximity * (double) (4 << amplifier) + 0.5D);
|
@@ -5,15 +5,15 @@ Subject: [PATCH] Fix negative death times
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index f636bdf1075fa784ce7ee25478d4d94bacb05677..77275e948b3636d21cca8f59c35834e8fdb339c7 100644
|
index b95f88d5e5b4785ee063695fd81935636a0588d1..168b002377e258f84a3bb86dd8e4a5f42060e3e0 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -637,7 +637,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -629,7 +629,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
public boolean broadcastedDeath = false; // Folia - region threading
|
|
||||||
protected void tickDeath() {
|
protected void tickDeath() {
|
||||||
++this.deathTime;
|
++this.deathTime;
|
||||||
- if (this.deathTime >= 20 && !this.level().isClientSide() && !this.isRemoved() && !this.broadcastedDeath) { // Folia - region threading
|
- if (this.deathTime >= 20 && !this.level().isClientSide() && !this.isRemoved()) {
|
||||||
+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level().isClientSide() && !this.isRemoved() && !this.broadcastedDeath) { // Scissors // Folia - region threading
|
+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level().isClientSide() && !this.isRemoved()) { // Scissors
|
||||||
this.level().broadcastEntityEvent(this, (byte) 60);
|
this.level().broadcastEntityEvent(this, (byte) 60);
|
||||||
this.broadcastedDeath = true; // Folia - region threading - death has been broadcasted
|
this.remove(Entity.RemovalReason.KILLED);
|
||||||
if (!(this instanceof ServerPlayer)) this.remove(Entity.RemovalReason.KILLED); // Folia - region threading - don't remove, we want the tick scheduler to be running
|
}
|
@@ -1,53 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Video <videogamesm12@gmail.com>
|
|
||||||
Date: Mon, 11 Apr 2022 13:33:52 -0600
|
|
||||||
Subject: [PATCH] Fixes creative-killing potion effects and certain potion
|
|
||||||
effect overflows
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/effect/MobEffect.java b/src/main/java/net/minecraft/world/effect/MobEffect.java
|
|
||||||
index 53cc6befb752affcfec65e18365f6d369448d407..181f5aa262689617ff3ad766dae485c36b88c9aa 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/effect/MobEffect.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/effect/MobEffect.java
|
|
||||||
@@ -57,6 +57,7 @@ public class MobEffect {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void applyEffectTick(LivingEntity entity, int amplifier) {
|
|
||||||
+ boolean god = entity instanceof Player player && (player.isCreative() || player.isInvulnerable()); // Scissors
|
|
||||||
if (this == MobEffects.REGENERATION) {
|
|
||||||
if (entity.getHealth() < entity.getMaxHealth()) {
|
|
||||||
entity.heal(1.0F, RegainReason.MAGIC_REGEN); // CraftBukkit
|
|
||||||
@@ -83,17 +84,31 @@ public class MobEffect {
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
} else if ((this != MobEffects.HEAL || entity.isInvertedHealAndHarm()) && (this != MobEffects.HARM || !entity.isInvertedHealAndHarm())) {
|
|
||||||
- if (this == MobEffects.HARM && !entity.isInvertedHealAndHarm() || this == MobEffects.HEAL && entity.isInvertedHealAndHarm()) {
|
|
||||||
+ // Scissors start
|
|
||||||
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
|
||||||
+ if (!god && (this == MobEffects.HARM && !entity.isInvertedHealAndHarm() || this == MobEffects.HEAL && entity.isInvertedHealAndHarm())) {
|
|
||||||
+ // Scissors end
|
|
||||||
entity.hurt(entity.damageSources().magic(), (float) (6 << amplifier));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
- entity.heal((float) Math.max(4 << amplifier, 0), RegainReason.MAGIC); // CraftBukkit
|
|
||||||
+ // Scissors start
|
|
||||||
+ if (!god) {
|
|
||||||
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
|
||||||
+ entity.heal((float) Math.max(4 << amplifier, 0), RegainReason.MAGIC); // CraftBukkit
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void applyInstantenousEffect(@Nullable Entity source, @Nullable Entity attacker, LivingEntity target, int amplifier, double proximity) {
|
|
||||||
int j;
|
|
||||||
+ // Scissors start - Don't apply any healing/harming effects for Creative/Invulnerable players and cap the amplifier for those who aren't.
|
|
||||||
+ if (target instanceof Player player && (player.isCreative() || player.isInvulnerable())) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ amplifier = Math.min(Math.abs(amplifier), 124);
|
|
||||||
+ // Scissors end
|
|
||||||
|
|
||||||
if ((this != MobEffects.HEAL || target.isInvertedHealAndHarm()) && (this != MobEffects.HARM || !target.isInvertedHealAndHarm())) {
|
|
||||||
if ((this != MobEffects.HARM || target.isInvertedHealAndHarm()) && (this != MobEffects.HEAL || !target.isInvertedHealAndHarm())) {
|
|
@@ -6,7 +6,7 @@ Subject: [PATCH] Limit amount of vehicle collision checks to 3 and discard
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||||
index 9948a28dae4edba877c13ef0156be5ff58df3fa2..9e25d4a3384d0157b99f7bd4d5f7edce032ece6b 100644
|
index 44a6118d3bd67a95180f750c17967561946e2e87..8aece67eba8d6b558bc2441b8b8e599f86e12e4f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||||
@@ -8,6 +8,7 @@ import com.mojang.datafixers.util.Pair;
|
@@ -8,6 +8,7 @@ import com.mojang.datafixers.util.Pair;
|
||||||
@@ -17,7 +17,7 @@ index 9948a28dae4edba877c13ef0156be5ff58df3fa2..9e25d4a3384d0157b99f7bd4d5f7edce
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import net.minecraft.BlockUtil;
|
import net.minecraft.BlockUtil;
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
@@ -107,6 +108,7 @@ public abstract class AbstractMinecart extends Entity {
|
@@ -111,6 +112,7 @@ public abstract class AbstractMinecart extends Entity {
|
||||||
private double flyingX = 0.949999988079071D; // Paper - restore vanilla precision
|
private double flyingX = 0.949999988079071D; // Paper - restore vanilla precision
|
||||||
private double flyingY = 0.949999988079071D; // Paper - restore vanilla precision
|
private double flyingY = 0.949999988079071D; // Paper - restore vanilla precision
|
||||||
private double flyingZ = 0.949999988079071D; // Paper - restore vanilla precision
|
private double flyingZ = 0.949999988079071D; // Paper - restore vanilla precision
|
||||||
@@ -25,20 +25,18 @@ index 9948a28dae4edba877c13ef0156be5ff58df3fa2..9e25d4a3384d0157b99f7bd4d5f7edce
|
|||||||
public double maxSpeed = 0.4D;
|
public double maxSpeed = 0.4D;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@@ -434,8 +436,10 @@ public abstract class AbstractMinecart extends Entity {
|
@@ -432,8 +434,8 @@ public abstract class AbstractMinecart extends Entity {
|
||||||
if (this.getMinecartType() == AbstractMinecart.Type.RIDEABLE && this.getDeltaMovement().horizontalDistanceSqr() > 0.01D) {
|
if (this.getMinecartType() == AbstractMinecart.Type.RIDEABLE && this.getDeltaMovement().horizontalDistanceSqr() > 0.01D) {
|
||||||
List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
||||||
|
|
||||||
- if (!list.isEmpty()) {
|
- if (!list.isEmpty()) {
|
||||||
- for (int l = 0; l < list.size(); ++l) {
|
- Iterator iterator = list.iterator();
|
||||||
+ // Scissors start
|
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Scissors - add collision debounce, using TimeUnit for better code readability
|
||||||
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Using TimeUnit for better code readability
|
+ Iterator iterator = list.size() <= 15 ? list.iterator() : list.subList(0, 15).iterator(); // Scissors
|
||||||
+ for (int l = 0; l < Math.min(3, list.size()); ++l) {
|
|
||||||
+ // Scissors end
|
|
||||||
Entity entity = (Entity) list.get(l);
|
|
||||||
|
|
||||||
if (!(entity instanceof Player) && !(entity instanceof IronGolem) && !(entity instanceof AbstractMinecart) && !this.isVehicle() && !entity.isPassenger()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -462,6 +466,14 @@ public abstract class AbstractMinecart extends Entity {
|
Entity entity = (Entity) iterator.next();
|
||||||
|
@@ -462,6 +464,14 @@ public abstract class AbstractMinecart extends Entity {
|
||||||
entity.push(this);
|
entity.push(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,9 +50,9 @@ index 9948a28dae4edba877c13ef0156be5ff58df3fa2..9e25d4a3384d0157b99f7bd4d5f7edce
|
|||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Iterator iterator = this.level().getEntities(this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D)).iterator();
|
Iterator iterator1 = this.level().getEntities(this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D)).iterator();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||||
index 35aeba4e8430e6419caa9db4a0b931a994228618..289eb39b15a283b0d9dbc33823f3a73f87202907 100644
|
index 5c07da62c82bc70138f6cb5007629d6974be69ac..301a72dffd4ac58333d987e85d22136498d2d82a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||||
@@ -5,6 +5,7 @@ import com.google.common.collect.UnmodifiableIterator;
|
@@ -5,6 +5,7 @@ import com.google.common.collect.UnmodifiableIterator;
|
||||||
@@ -65,7 +63,7 @@ index 35aeba4e8430e6419caa9db4a0b931a994228618..289eb39b15a283b0d9dbc33823f3a73f
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import net.minecraft.BlockUtil;
|
import net.minecraft.BlockUtil;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
@@ -109,6 +110,7 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
@@ -112,6 +113,7 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
||||||
public double unoccupiedDeceleration = -1;
|
public double unoccupiedDeceleration = -1;
|
||||||
public boolean landBoats = false;
|
public boolean landBoats = false;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -73,20 +71,19 @@ index 35aeba4e8430e6419caa9db4a0b931a994228618..289eb39b15a283b0d9dbc33823f3a73f
|
|||||||
|
|
||||||
public Boat(EntityType<? extends Boat> type, Level world) {
|
public Boat(EntityType<? extends Boat> type, Level world) {
|
||||||
super(type, world);
|
super(type, world);
|
||||||
@@ -421,10 +423,10 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
@@ -465,9 +467,9 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
||||||
this.checkInsideBlocks();
|
this.checkInsideBlocks();
|
||||||
List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, -0.009999999776482582D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, -0.009999999776482582D, 0.20000000298023224D), EntitySelector.pushableBy(this));
|
||||||
|
|
||||||
- if (!list.isEmpty()) {
|
- if (!list.isEmpty()) {
|
||||||
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Scissors - add collision debounce, using TimeUnit for better code readability
|
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Scissors - add collision debounce, using TimeUnit for better code readability
|
||||||
boolean flag = !this.level().isClientSide && !(this.getControllingPassenger() instanceof Player);
|
boolean flag = !this.level().isClientSide && !(this.getControllingPassenger() instanceof Player);
|
||||||
|
- Iterator iterator = list.iterator();
|
||||||
|
+ Iterator iterator = list.size() <= 15 ? list.iterator() : list.subList(0, 15).iterator(); // Scissors
|
||||||
|
|
||||||
- for (int j = 0; j < list.size(); ++j) {
|
while (iterator.hasNext()) {
|
||||||
+ for (int j = 0; j < Math.min(3, list.size()); ++j) { // Scissors - Limit amount of vehicle collision checks to 3 maximum
|
Entity entity = (Entity) iterator.next();
|
||||||
Entity entity = (Entity) list.get(j);
|
@@ -480,6 +482,14 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
||||||
|
|
||||||
if (!entity.hasPassenger((Entity) this)) {
|
|
||||||
@@ -435,6 +437,14 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -59,7 +59,7 @@ index 4092c7a8c2b0d9d26e6f4d97386735236300d132..04c47cf1a920ae6c356449df801227ee
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
index d30156d5cb888b8cf2af9aee9b94e242a6510192..7fb7337256a0c3cdde587fb5a9222bb8faa322ec 100644
|
index d0f7baa80cb7d0883304abe2ed990c258a0d92b6..bedd53797391005d70dcdd61c5ed6d56a32fee5c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
@@ -21,6 +21,7 @@ import java.util.function.Predicate;
|
@@ -21,6 +21,7 @@ import java.util.function.Predicate;
|
||||||
@@ -70,7 +70,7 @@ index d30156d5cb888b8cf2af9aee9b94e242a6510192..7fb7337256a0c3cdde587fb5a9222bb8
|
|||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
import net.minecraft.advancements.CriteriaTriggers;
|
import net.minecraft.advancements.CriteriaTriggers;
|
||||||
@@ -253,6 +254,12 @@ public final class ItemStack {
|
@@ -254,6 +255,12 @@ public final class ItemStack {
|
||||||
|
|
||||||
// CraftBukkit - break into own method
|
// CraftBukkit - break into own method
|
||||||
private void load(CompoundTag nbttagcompound) {
|
private void load(CompoundTag nbttagcompound) {
|
||||||
@@ -83,7 +83,7 @@ index d30156d5cb888b8cf2af9aee9b94e242a6510192..7fb7337256a0c3cdde587fb5a9222bb8
|
|||||||
this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id")));
|
this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id")));
|
||||||
this.count = nbttagcompound.getByte("Count");
|
this.count = nbttagcompound.getByte("Count");
|
||||||
if (nbttagcompound.contains("tag", 10)) {
|
if (nbttagcompound.contains("tag", 10)) {
|
||||||
@@ -556,7 +563,11 @@ public final class ItemStack {
|
@@ -563,7 +570,11 @@ public final class ItemStack {
|
||||||
nbt.putString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
|
nbt.putString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
|
||||||
nbt.putByte("Count", (byte) this.count);
|
nbt.putByte("Count", (byte) this.count);
|
||||||
if (this.tag != null) {
|
if (this.tag != null) {
|
||||||
@@ -96,7 +96,7 @@ index d30156d5cb888b8cf2af9aee9b94e242a6510192..7fb7337256a0c3cdde587fb5a9222bb8
|
|||||||
}
|
}
|
||||||
|
|
||||||
return nbt;
|
return nbt;
|
||||||
@@ -886,6 +897,7 @@ public final class ItemStack {
|
@@ -893,6 +904,7 @@ public final class ItemStack {
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
public void setTag(@Nullable CompoundTag nbt) {
|
public void setTag(@Nullable CompoundTag nbt) {
|
||||||
@@ -105,7 +105,7 @@ index d30156d5cb888b8cf2af9aee9b94e242a6510192..7fb7337256a0c3cdde587fb5a9222bb8
|
|||||||
this.processEnchantOrder(this.tag); // Paper
|
this.processEnchantOrder(this.tag); // Paper
|
||||||
if (this.getItem().canBeDepleted()) {
|
if (this.getItem().canBeDepleted()) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
index 40e59b8db83aec1143e3c394427e916beea7c01f..f292aa0016e6f741b36ddc1417f6f63d248f987f 100644
|
index f5ad7ddf13cbb6452c2927aef9b54eae3335b4c6..041e3c8fb7c9ca69a7c7c1c952ed9915a75d7752 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
@@ -9,6 +9,7 @@ import java.util.Iterator;
|
@@ -9,6 +9,7 @@ import java.util.Iterator;
|
||||||
@@ -164,7 +164,7 @@ index 416aa989ebb18a8741cc9d605a1180ab830f6643..a9a8c9e68e5b767dec2c26495685da88
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||||
index 526d1bfd5ad0de7bcfd0c2da902515f3dec94c54..2cf0e645aeae983ec6db9b1a25401120fd968f06 100644
|
index c57efcb9a79337ec791e4e8f6671612f0a82b441..2cbb8170953cb555411db8c171a3d1d91eb799bb 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||||
@@ -3,6 +3,7 @@ package net.minecraft.world.level.block.entity;
|
@@ -3,6 +3,7 @@ package net.minecraft.world.level.block.entity;
|
||||||
@@ -252,7 +252,7 @@ index 881379681c39230a00b3a1f11cd87498984396c7..d0513b72cdaec3b67b9341d251367b19
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
index 1eebd3969735bff3e5559ed01ab4a2ec1c3c2de6..a7d8a6beb45bcc8be3e4a444ab1020783fba1635 100644
|
index d4dcf7fe26474ae07374e7761d823bc5c8b54f97..7352183f7eaa1ddcd028e53f4b66a1c34e32b988 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
@@ -6,6 +6,7 @@ import java.util.function.BooleanSupplier;
|
@@ -6,6 +6,7 @@ import java.util.function.BooleanSupplier;
|
||||||
@@ -282,10 +282,10 @@ index 1eebd3969735bff3e5559ed01ab4a2ec1c3c2de6..a7d8a6beb45bcc8be3e4a444ab102078
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
index b7686fd63b7c5d88c3a12ec4ee9bc01a17f997e0..db3a4a8cd19da9775bb0884c33494f1e8591b1fa 100644
|
index 1fa22445a4ecc8c08dbcf0cc6bd39dc5003604c4..9f12fbcd8d0c75de1d8c06bed2c64a0acdc877c9 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
@@ -3,6 +3,7 @@ package net.minecraft.world.level.block.entity;
|
@@ -4,6 +4,7 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@@ -293,7 +293,7 @@ index b7686fd63b7c5d88c3a12ec4ee9bc01a17f997e0..db3a4a8cd19da9775bb0884c33494f1e
|
|||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
@@ -60,6 +61,17 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
@@ -61,6 +62,17 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||||
public boolean opened;
|
public boolean opened;
|
||||||
|
|
||||||
public List<ItemStack> getContents() {
|
public List<ItemStack> getContents() {
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't log invalid teams to console
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 77275e948b3636d21cca8f59c35834e8fdb339c7..4bc677c5ab2cdcb1a235ecfab9468e7f1d7a96f3 100644
|
index 168b002377e258f84a3bb86dd8e4a5f42060e3e0..065d2c1543832190bd8bdcd4b553542115c07e64 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -871,7 +871,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -861,7 +861,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
boolean flag = scoreboardteam != null && this.level().getScoreboard().addPlayerToTeam(this.getStringUUID(), scoreboardteam);
|
boolean flag = scoreboardteam != null && this.level().getScoreboard().addPlayerToTeam(this.getStringUUID(), scoreboardteam);
|
||||||
|
|
||||||
if (!flag) {
|
if (!flag) {
|
@@ -77,7 +77,7 @@ index 182e16c1d968707a11329150d71b7d01df6c6e52..8582a9369cffe0eebeb82a81fc413d0b
|
|||||||
Registry<StructureTemplatePool> registry = world.registryAccess().registryOrThrow(Registries.TEMPLATE_POOL);
|
Registry<StructureTemplatePool> registry = world.registryAccess().registryOrThrow(Registries.TEMPLATE_POOL);
|
||||||
// Paper start - Replace getHolderOrThrow with a null check
|
// Paper start - Replace getHolderOrThrow with a null check
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
||||||
index 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616fd3f73eb 100644
|
index e8ecced687261861953899a3bea162dbc03977b4..30720203173b23ccdbb0789f7e2adbbe180c7c69 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
||||||
@@ -5,6 +5,7 @@ import java.util.Objects;
|
@@ -5,6 +5,7 @@ import java.util.Objects;
|
||||||
@@ -107,7 +107,7 @@ index 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616
|
|||||||
Stream<BlockPos> stream = this.getRelatedCorners(blockPos2, blockPos3);
|
Stream<BlockPos> stream = this.getRelatedCorners(blockPos2, blockPos3);
|
||||||
@@ -321,6 +323,16 @@ public class StructureBlockEntity extends BlockEntity {
|
@@ -321,6 +323,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||||
|
|
||||||
public boolean saveStructure(boolean bl) {
|
public boolean saveStructure(boolean interactive) {
|
||||||
if (this.mode == StructureMode.SAVE && !this.level.isClientSide && this.structureName != null) {
|
if (this.mode == StructureMode.SAVE && !this.level.isClientSide && this.structureName != null) {
|
||||||
+ // Scissors start - Add master block fire event
|
+ // Scissors start - Add master block fire event
|
||||||
+ final BlockPos pos = this.getBlockPos();
|
+ final BlockPos pos = this.getBlockPos();
|
||||||
@@ -124,7 +124,7 @@ index 9792bf3ee083f571f1f4089d30beb586839f5f6b..fa6592cdc916d3578fccc6c0075eb616
|
|||||||
StructureTemplateManager structureTemplateManager = serverLevel.getStructureManager();
|
StructureTemplateManager structureTemplateManager = serverLevel.getStructureManager();
|
||||||
@@ -358,6 +370,16 @@ public class StructureBlockEntity extends BlockEntity {
|
@@ -358,6 +370,16 @@ public class StructureBlockEntity extends BlockEntity {
|
||||||
|
|
||||||
public boolean loadStructure(ServerLevel world, boolean bl) {
|
public boolean loadStructure(ServerLevel world, boolean interactive) {
|
||||||
if (this.mode == StructureMode.LOAD && this.structureName != null) {
|
if (this.mode == StructureMode.LOAD && this.structureName != null) {
|
||||||
+ // Scissors start - Add master block fire event
|
+ // Scissors start - Add master block fire event
|
||||||
+ final BlockPos blockPos = this.getBlockPos();
|
+ final BlockPos blockPos = this.getBlockPos();
|
@@ -5,7 +5,7 @@ Subject: [PATCH] Add spectator teleport event
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 678bba9d636a0eb34270a2d26b5b3d0d6d900115..30339009c126fca8393ceed3c780c097b6c06ffd 100644
|
index 65bb221993147a558995b36fb835f7b82e0eb4bd..4ea2c551d924f976a8de9e2ae521544f323fbec4 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
@@ -14,19 +14,17 @@ index 678bba9d636a0eb34270a2d26b5b3d0d6d900115..30339009c126fca8393ceed3c780c097
|
|||||||
+import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
+import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.primitives.Floats;
|
import com.google.common.primitives.Floats;
|
||||||
import com.mojang.brigadier.ParseResults;
|
import com.mojang.authlib.GameProfile;
|
||||||
@@ -2148,6 +2149,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -2006,6 +2007,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
Entity entity = packet.getEntity(worldserver);
|
Entity entity = packet.getEntity(worldserver);
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
+ // Scissors start - Add spectator teleport event
|
+ // Scissors start - Add spectator teleport event
|
||||||
+ final SpectatorTeleportEvent event = new SpectatorTeleportEvent(this.player.getBukkitEntity(), entity.getBukkitEntity());
|
+ final SpectatorTeleportEvent event = new SpectatorTeleportEvent(this.player.getBukkitEntity(), entity.getBukkitEntity());
|
||||||
+
|
|
||||||
+ if (!event.callEvent()) {
|
+ if (!event.callEvent()) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ // Scissors end
|
+ // Scissors end
|
||||||
+
|
this.player.teleportTo(worldserver, entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot(), org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.SPECTATE); // CraftBukkit
|
||||||
io.papermc.paper.threadedregions.TeleportUtils.teleport(this.player, false, entity, null, null, Entity.TELEPORT_FLAG_LOAD_CHUNK, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.SPECTATE, null); // Folia - region threading
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
@@ -5,7 +5,7 @@ Subject: [PATCH] Prevent invalid container events
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 30339009c126fca8393ceed3c780c097b6c06ffd..bb5120b65e7394c134b69fbde8e880298397076b 100644
|
index 4ea2c551d924f976a8de9e2ae521544f323fbec4..83ae366b4f52261e2e2b65a4183d7ca823edd315 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -30,6 +30,7 @@ import java.util.function.UnaryOperator;
|
@@ -30,6 +30,7 @@ import java.util.function.UnaryOperator;
|
||||||
@@ -14,9 +14,9 @@ index 30339009c126fca8393ceed3c780c097b6c06ffd..bb5120b65e7394c134b69fbde8e88029
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
+import net.kyori.adventure.text.format.NamedTextColor; // Scissors
|
+import net.kyori.adventure.text.format.NamedTextColor; // Scissors
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.CrashReport;
|
import net.minecraft.SharedConstants;
|
||||||
import net.minecraft.CrashReportCategory;
|
import net.minecraft.Util;
|
||||||
@@ -3114,6 +3115,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -2900,6 +2901,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Validate block entity/entity tag query positions
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index bb5120b65e7394c134b69fbde8e880298397076b..dc28a954a9ac0fa0615c7cf4797db5fca2e48989 100644
|
index 83ae366b4f52261e2e2b65a4183d7ca823edd315..67b5447ffcf54c54b2087df456690a9bed98fbd3 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -1410,7 +1410,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1262,7 +1262,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
if (this.player.hasPermissions(2)) {
|
if (this.player.hasPermissions(2)) {
|
||||||
Entity entity = this.player.level().getEntity(packet.getEntityId());
|
Entity entity = this.player.level().getEntity(packet.getEntityId());
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ index bb5120b65e7394c134b69fbde8e880298397076b..dc28a954a9ac0fa0615c7cf4797db5fc
|
|||||||
CompoundTag nbttagcompound = entity.saveWithoutId(new CompoundTag());
|
CompoundTag nbttagcompound = entity.saveWithoutId(new CompoundTag());
|
||||||
|
|
||||||
this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound));
|
this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound));
|
||||||
@@ -1422,7 +1422,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1274,7 +1274,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
|
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix ClickEvents on Signs bypassing permissions
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||||
index f356196aaeb498a6d2c9ad2112329cef5a3103d6..a8d8445be1cfb67de1adcaf64847d0bfaf8c503d 100644
|
index 38cde466714e5663cd416b6afd5d2558e139ec09..ed48eaae75e709361a260421934b6b925ae9b427 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||||
@@ -8,8 +8,10 @@ import java.util.Objects;
|
@@ -8,8 +8,10 @@ import java.util.Objects;
|
@@ -5,7 +5,7 @@ Subject: [PATCH] Prevent velocity freeze
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||||
index 77f55bcb120295fa11140681f63175d37d8a78e2..fbdc893c2e8c3b668ad65d1304c889a2cc8eca27 100644
|
index 6c9a8f062f989db022154155e8a05b334a0510da..978fad27ad17de03d108ade2c2bfa464b7d83491 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
@@ -32,7 +32,7 @@ index 77f55bcb120295fa11140681f63175d37d8a78e2..fbdc893c2e8c3b668ad65d1304c889a2
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -146,6 +151,25 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -141,6 +146,25 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||||
nbt.put("power", this.newDoubleList(new double[]{this.xPower, this.yPower, this.zPower}));
|
nbt.put("power", this.newDoubleList(new double[]{this.xPower, this.yPower, this.zPower}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ index 77f55bcb120295fa11140681f63175d37d8a78e2..fbdc893c2e8c3b668ad65d1304c889a2
|
|||||||
@Override
|
@Override
|
||||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||||
super.readAdditionalSaveData(nbt);
|
super.readAdditionalSaveData(nbt);
|
||||||
@@ -153,9 +177,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -148,9 +172,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||||
ListTag nbttaglist = nbt.getList("power", 6);
|
ListTag nbttaglist = nbt.getList("power", 6);
|
||||||
|
|
||||||
if (nbttaglist.size() == 3) {
|
if (nbttaglist.size() == 3) {
|
||||||
@@ -75,7 +75,7 @@ index 77f55bcb120295fa11140681f63175d37d8a78e2..fbdc893c2e8c3b668ad65d1304c889a2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,9 +217,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
@@ -184,9 +212,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||||
Vec3 vec3d = entity.getLookAngle();
|
Vec3 vec3d = entity.getLookAngle();
|
||||||
|
|
||||||
this.setDeltaMovement(vec3d);
|
this.setDeltaMovement(vec3d);
|
@@ -60,7 +60,7 @@ index c0a80824a0307ea673805015119cc834b268f0dc..9f28f86b1b56ea55ab39f6ac988c1f47
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index dc28a954a9ac0fa0615c7cf4797db5fca2e48989..38b60dde9ec9fcadc8e62ec25ae1646aecc10dfb 100644
|
index 67b5447ffcf54c54b2087df456690a9bed98fbd3..94cc122aad0e48687ea9f25cd810f07dc893acc6 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
@@ -70,7 +70,7 @@ index dc28a954a9ac0fa0615c7cf4797db5fca2e48989..38b60dde9ec9fcadc8e62ec25ae1646a
|
|||||||
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.primitives.Floats;
|
import com.google.common.primitives.Floats;
|
||||||
@@ -2404,7 +2405,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -2220,7 +2221,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
|
private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
|
||||||
@@ -79,7 +79,7 @@ index dc28a954a9ac0fa0615c7cf4797db5fca2e48989..38b60dde9ec9fcadc8e62ec25ae1646a
|
|||||||
this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes
|
this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes
|
||||||
} else {
|
} else {
|
||||||
this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED));
|
this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED));
|
||||||
@@ -2460,6 +2461,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -2276,6 +2277,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment);
|
Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment);
|
||||||
|
|
||||||
if (optional.isEmpty()) {
|
if (optional.isEmpty()) {
|
||||||
@@ -87,7 +87,7 @@ index dc28a954a9ac0fa0615c7cf4797db5fca2e48989..38b60dde9ec9fcadc8e62ec25ae1646a
|
|||||||
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
|
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
|
||||||
this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes
|
this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes
|
||||||
}
|
}
|
||||||
@@ -2691,6 +2693,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -2484,6 +2486,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
|
||||||
synchronized (this.lastSeenMessages) {
|
synchronized (this.lastSeenMessages) {
|
||||||
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
|
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
|
||||||
@@ -95,7 +95,7 @@ index dc28a954a9ac0fa0615c7cf4797db5fca2e48989..38b60dde9ec9fcadc8e62ec25ae1646a
|
|||||||
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
|
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
|
||||||
this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes
|
this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes
|
||||||
}
|
}
|
||||||
@@ -3761,6 +3764,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -3462,6 +3465,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) {
|
public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
@@ -0,0 +1,78 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luna <lunahatesgogle@gmail.com>
|
||||||
|
Date: Sun, 2 Apr 2023 16:29:51 -0300
|
||||||
|
Subject: [PATCH] Patch large selector distance crash
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
||||||
|
index 8897496323378080135127f53db004d576476c21..5f957d3241c1931f8166bc9e4960cef15679e932 100644
|
||||||
|
--- a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
||||||
|
+++ b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
||||||
|
@@ -129,9 +129,9 @@ public interface MinMaxBounds<T extends Number> {
|
||||||
|
|
||||||
|
public static record Doubles(Optional<Double> min, Optional<Double> max, Optional<Double> minSq, Optional<Double> maxSq) implements MinMaxBounds<Double> {
|
||||||
|
public static final MinMaxBounds.Doubles ANY = new MinMaxBounds.Doubles(Optional.empty(), Optional.empty());
|
||||||
|
- public static final Codec<MinMaxBounds.Doubles> CODEC = MinMaxBounds.createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new);
|
||||||
|
+ public static final Codec<MinMaxBounds.Doubles> CODEC = MinMaxBounds.<Double, MinMaxBounds.Doubles>createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new); // Scissors - compile fixes
|
||||||
|
|
||||||
|
- private Doubles(Optional<Double> optional, Optional<Double> optional2) {
|
||||||
|
+ public Doubles(Optional<Double> optional, Optional<Double> optional2) { // Scissors - private -> public
|
||||||
|
this(optional, optional2, squareOpt(optional), squareOpt(optional2));
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -202,7 +202,7 @@ public interface MinMaxBounds<T extends Number> {
|
||||||
|
|
||||||
|
public static record Ints(Optional<Integer> min, Optional<Integer> max, Optional<Long> minSq, Optional<Long> maxSq) implements MinMaxBounds<Integer> {
|
||||||
|
public static final MinMaxBounds.Ints ANY = new MinMaxBounds.Ints(Optional.empty(), Optional.empty());
|
||||||
|
- public static final Codec<MinMaxBounds.Ints> CODEC = MinMaxBounds.createCodec(Codec.INT, MinMaxBounds.Ints::new);
|
||||||
|
+ public static final Codec<MinMaxBounds.Ints> CODEC = MinMaxBounds.<Integer, MinMaxBounds.Ints>createCodec(Codec.INT, MinMaxBounds.Ints::new); // Scissors - compile fixes
|
||||||
|
|
||||||
|
private Ints(Optional<Integer> optional, Optional<Integer> optional2) {
|
||||||
|
this(optional, optional2, optional.map((integer) -> {
|
||||||
|
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||||
|
index 73c15a0c56a103ba4e62f0a51af8d42566b07245..6cb3e86f2d661a55536b782729f768ef72163223 100644
|
||||||
|
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||||
|
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||||
|
@@ -5,11 +5,13 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
+import java.util.Optional; // Scissors
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
+import me.totalfreedom.scissors.MathUtility; // Scissors
|
||||||
|
import net.minecraft.advancements.critereon.MinMaxBounds;
|
||||||
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
|
import net.minecraft.commands.arguments.EntityArgument;
|
||||||
|
@@ -60,9 +62,26 @@ public class EntitySelector {
|
||||||
|
this.includesEntities = includesNonPlayers;
|
||||||
|
this.worldLimited = localWorldOnly;
|
||||||
|
this.predicate = basePredicate;
|
||||||
|
- this.range = distance;
|
||||||
|
+ // Scissors start - Patch large selector distance crash
|
||||||
|
+ this.range = new MinMaxBounds.Doubles(
|
||||||
|
+ distance.min().map(min -> Math.min(min, 1024)),
|
||||||
|
+ distance.max().map(max -> Math.min(max, 1024))
|
||||||
|
+ );
|
||||||
|
this.position = positionOffset;
|
||||||
|
- this.aabb = box;
|
||||||
|
+ if (box != null) {
|
||||||
|
+ this.aabb = new AABB(
|
||||||
|
+ MathUtility.clampDouble(box.minX, -1024, 1025),
|
||||||
|
+ MathUtility.clampDouble(box.minY, -1024, 1025),
|
||||||
|
+ MathUtility.clampDouble(box.minZ, -1024, 1025),
|
||||||
|
+ MathUtility.clampDouble(box.maxX, -1024, 1025),
|
||||||
|
+ MathUtility.clampDouble(box.maxY, -1024, 1025),
|
||||||
|
+ MathUtility.clampDouble(box.maxZ, -1024, 1025),
|
||||||
|
+ false
|
||||||
|
+ );
|
||||||
|
+ } else {
|
||||||
|
+ this.aabb = null;
|
||||||
|
+ }
|
||||||
|
+ // Scissors end
|
||||||
|
this.order = sorter;
|
||||||
|
this.currentEntity = senderOnly;
|
||||||
|
this.playerName = playerName;
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Patch invalid entity rotation log spam
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index c3e587abaf61772f2a6872ece6ea65b18cf7cdee..a6bfdf0e95f3e7b1cf792d44340f308774ce7c00 100644
|
index e8845d6ec1bcba6df2eb8e1af0d658b10299831a..015d5e9b6de5f1fb466e1801bdf5fb430ba91f35 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -5411,7 +5411,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
@@ -4696,7 +4696,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||||
|
|
||||||
public void setXRot(float pitch) {
|
public void setXRot(float pitch) {
|
||||||
if (!Float.isFinite(pitch)) {
|
if (!Float.isFinite(pitch)) {
|
||||||
|
@@ -0,0 +1,19 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luna <lunahatesgogle@gmail.com>
|
||||||
|
Date: Mon, 10 Apr 2023 13:56:18 -0300
|
||||||
|
Subject: [PATCH] Limit sculk catalyst cursor positions
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/block/SculkSpreader.java b/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
||||||
|
index de90a216321f7d82310a0d1c915fefe64360534c..7e52f6c26234cf6fa092151d51c0c6b70dc22ca8 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
||||||
|
@@ -181,7 +181,7 @@ public class SculkSpreader {
|
||||||
|
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
SculkSpreader.ChargeCursor sculkspreader_a = (SculkSpreader.ChargeCursor) iterator.next();
|
||||||
|
-
|
||||||
|
+ if (!world.getMinecraftWorld().isLoadedAndInBounds(sculkspreader_a.getPos())) continue; // Scissors
|
||||||
|
sculkspreader_a.update(world, pos, random, this, shouldConvertToBlock);
|
||||||
|
if (sculkspreader_a.charge <= 0) {
|
||||||
|
world.levelEvent(3006, sculkspreader_a.getPos(), 0);
|
@@ -1,61 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Luna <lunahatesgogle@gmail.com>
|
|
||||||
Date: Sun, 2 Apr 2023 16:29:51 -0300
|
|
||||||
Subject: [PATCH] Patch large selector distance crash
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
|
||||||
index 60d32afe2eecdfebdc91531ca3672f8f130ac30e..73b0f516f80ef810379860ea74697a3429c646e5 100644
|
|
||||||
--- a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
|
||||||
+++ b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
|
|
||||||
@@ -177,7 +177,7 @@ public abstract class MinMaxBounds<T extends Number> {
|
|
||||||
return value == null ? null : value * value;
|
|
||||||
}
|
|
||||||
|
|
||||||
- private Doubles(@Nullable Double min, @Nullable Double max) {
|
|
||||||
+ public Doubles(@Nullable Double min, @Nullable Double max) { // Scissors - private -> public
|
|
||||||
super(min, max);
|
|
||||||
this.minSq = squareOpt(min);
|
|
||||||
this.maxSq = squareOpt(max);
|
|
||||||
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
|
||||||
index f25b9330e068c7d9e12cb57a7761cfef9ebaf7bc..e8cf963f0190438bbf65f827d144775ab0b02b63 100644
|
|
||||||
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
|
||||||
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
|
||||||
@@ -10,6 +10,7 @@ import java.util.function.BiConsumer;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
+import me.totalfreedom.scissors.MathUtility; // Scissors
|
|
||||||
import net.minecraft.advancements.critereon.MinMaxBounds;
|
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
|
||||||
import net.minecraft.commands.arguments.EntityArgument;
|
|
||||||
@@ -60,9 +61,27 @@ public class EntitySelector {
|
|
||||||
this.includesEntities = includesNonPlayers;
|
|
||||||
this.worldLimited = localWorldOnly;
|
|
||||||
this.predicate = basePredicate;
|
|
||||||
- this.range = distance;
|
|
||||||
+
|
|
||||||
+ // Scissors start - Patch large selector distance crash
|
|
||||||
+ this.range = new MinMaxBounds.Doubles(
|
|
||||||
+ distance.getMin() != null ? Math.min(distance.getMin(), 1024) : null,
|
|
||||||
+ distance.getMax() != null ? Math.min(distance.getMax(), 1024) : null
|
|
||||||
+ );
|
|
||||||
this.position = positionOffset;
|
|
||||||
- this.aabb = box;
|
|
||||||
+ if (box != null) {
|
|
||||||
+ this.aabb = new AABB(
|
|
||||||
+ MathUtility.clampDouble(box.minX, -1024, 1025),
|
|
||||||
+ MathUtility.clampDouble(box.minY, -1024, 1025),
|
|
||||||
+ MathUtility.clampDouble(box.minZ, -1024, 1025),
|
|
||||||
+ MathUtility.clampDouble(box.maxX, -1024, 1025),
|
|
||||||
+ MathUtility.clampDouble(box.maxY, -1024, 1025),
|
|
||||||
+ MathUtility.clampDouble(box.maxZ, -1024, 1025),
|
|
||||||
+ false
|
|
||||||
+ );
|
|
||||||
+ } else {
|
|
||||||
+ this.aabb = null;
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
this.order = sorter;
|
|
||||||
this.currentEntity = senderOnly;
|
|
||||||
this.playerName = playerName;
|
|
36
patches/server/0038-Limit-map-decorations.patch
Normal file
36
patches/server/0038-Limit-map-decorations.patch
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luna <lunahatesgogle@gmail.com>
|
||||||
|
Date: Fri, 28 Apr 2023 16:29:23 -0300
|
||||||
|
Subject: [PATCH] Limit map decorations
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||||
|
index 81f3e64d94fa17e45411e5c1641d9c5a2fe3d2e2..bcf6e2ce9f00d1688a5fa00ec055a57389346922 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
||||||
|
@@ -65,7 +65,8 @@ public class ClientboundMapItemDataPacket implements Packet<ClientGamePacketList
|
||||||
|
b.writeByte(icon.x());
|
||||||
|
b.writeByte(icon.y());
|
||||||
|
b.writeByte(icon.rot() & 15);
|
||||||
|
- b.writeNullable(icon.name(), FriendlyByteBuf::writeComponent);
|
||||||
|
+ final boolean passedNameCap = icon.name() == null || icon.name().getString().length() <= 32; // Scissors
|
||||||
|
+ b.writeNullable(passedNameCap ? icon.name() : null, FriendlyByteBuf::writeComponent); // Scissors
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if (this.colorPatch != null) {
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||||
|
index e4c4948e076cd64686dfd16ae0568fafc1437140..eff53c21b18574750b691b784fb1688885d4ace7 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||||
|
@@ -361,6 +361,11 @@ public class MapItemSavedData extends SavedData {
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addDecoration(MapDecoration.Type type, @Nullable LevelAccessor world, String key, double x, double z, double rotation, @Nullable Component text) {
|
||||||
|
+ // Scissors start - Limit decoration count
|
||||||
|
+ if (this.decorations.size() > 32) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // Scissors end
|
||||||
|
int i = 1 << this.scale;
|
||||||
|
float f = (float) (x - (double) this.centerX) / (float) i;
|
||||||
|
float f1 = (float) (z - (double) this.centerZ) / (float) i;
|
@@ -1,18 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Luna <lunahatesgogle@gmail.com>
|
|
||||||
Date: Mon, 10 Apr 2023 13:56:18 -0300
|
|
||||||
Subject: [PATCH] Limit sculk catalyst cursor positions
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/SculkSpreader.java b/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
|
||||||
index ab732f0e52ef3c3d3be6ddc827d693fe294e4167..9785f2d8c94552b4a1139fa6d936fdaa61e5827c 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/SculkSpreader.java
|
|
||||||
@@ -141,6 +141,7 @@ public class SculkSpreader {
|
|
||||||
Object2IntMap<BlockPos> object2IntMap = new Object2IntOpenHashMap<>();
|
|
||||||
|
|
||||||
for(SculkSpreader.ChargeCursor chargeCursor : this.cursors) {
|
|
||||||
+ if (!world.getMinecraftWorld().isLoadedAndInBounds(chargeCursor.getPos())) continue; // Scissors
|
|
||||||
chargeCursor.update(world, pos, random, this, shouldConvertToBlock);
|
|
||||||
if (chargeCursor.charge <= 0) {
|
|
||||||
world.levelEvent(3006, chargeCursor.getPos(), 0);
|
|
@@ -1,46 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Luna <lunahatesgogle@gmail.com>
|
|
||||||
Date: Fri, 28 Apr 2023 16:29:23 -0300
|
|
||||||
Subject: [PATCH] Limit map decorations
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java
|
|
||||||
index 347d2914f9560a3ee8cea59444bc0dfbb7cf3456..b6a38b1458957bd444fea439fa81d2976ffb86e0 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java
|
|
||||||
@@ -2,6 +2,7 @@ package net.minecraft.world.level.saveddata.maps;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
+import net.minecraft.ChatFormatting; // Scissors
|
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
|
|
||||||
@@ -14,6 +15,11 @@ public class MapDecoration {
|
|
||||||
private final Component name;
|
|
||||||
|
|
||||||
public MapDecoration(MapDecoration.Type type, byte x, byte z, byte rotation, @Nullable Component text) {
|
|
||||||
+ // Scissors start - Limit decoration text length
|
|
||||||
+ if (text != null && text.getString().length() > 32) {
|
|
||||||
+ text = null;
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
this.type = type;
|
|
||||||
this.x = x;
|
|
||||||
this.y = z;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
|
||||||
index 2b862066388cfede202a0c709f93ae89e2d17b30..465be29b3586dde779acfa44fe126850ccae3789 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
|
|
||||||
@@ -355,6 +355,11 @@ public class MapItemSavedData extends SavedData {
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addDecoration(MapDecoration.Type type, @Nullable LevelAccessor world, String key, double x, double z, double rotation, @Nullable Component text) {
|
|
||||||
+ // Scissors start - Limit decoration count
|
|
||||||
+ if (this.decorations.size() > 32) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ // Scissors end
|
|
||||||
int i = 1 << this.scale;
|
|
||||||
float f = (float) (x - (double) this.centerX) / (float) i;
|
|
||||||
float f1 = (float) (z - (double) this.centerZ) / (float) i;
|
|
@@ -5,12 +5,12 @@ Subject: [PATCH] Prevent player banning using duplicate UUIDs
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index cf8f93734121e5c1959959f0ba13ee4e6db31959..e9a7755ec85eef3e9cc05b4deb6dfe10954bcadd 100644
|
index 17610196db7a1c6feb2cf74a02479a8691aa323f..70c52e2293d64d32fdcebbcd0678e0c80d35fbb8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -1690,7 +1690,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1644,7 +1644,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
ServerLevel.LOGGER.warn("Force-added player with duplicate UUID {}", player.getUUID().toString());
|
ServerLevel.LOGGER.warn("Force-added player with duplicate UUID {}", player.getUUID());
|
||||||
entity.unRide();
|
entity.unRide();
|
||||||
- this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED);
|
- this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED);
|
||||||
+ // Scissors start - Prevent player banning using duplicate UUIDs
|
+ // Scissors start - Prevent player banning using duplicate UUIDs
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't warn on duplicate entity UUIDs
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
diff --git a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||||
index 0cdf092d5c3f65a23e26f201768c0e2fea1ffe09..cfed22910f3b73c0dc115b7887bd5b117749a939 100644
|
index 15ee41452992714108efe53b708b5a4e1da7c1ff..5054dce35127cb0132431021578c345fcbb1f92a 100644
|
||||||
--- a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
--- a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||||
+++ b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
+++ b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||||
@@ -416,7 +416,7 @@ public final class EntityLookup implements LevelEntityGetter<Entity> {
|
@@ -415,7 +415,7 @@ public final class EntityLookup implements LevelEntityGetter<Entity> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.entityByUUID.containsKey(entity.getUUID())) {
|
if (this.entityByUUID.containsKey(entity.getUUID())) {
|
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix component extra empty array exploit
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
index 2873ed7c443ed8c8c57a8b1d3e444d229f10f07b..a2149452ee461002ea74189c5aa49cddd943d0cf 100644
|
index 9cb6fa8e35c89f73e7c95dbe219a4bf6d00b60a9..fa6151a2361684426bdd3bf3b433fe4dbd0cf47b 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
@@ -266,6 +266,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
@@ -266,6 +266,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
@@ -5,7 +5,7 @@ Subject: [PATCH] Add depth limit to Component deserializer
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
index a2149452ee461002ea74189c5aa49cddd943d0cf..f1d1501211a923c0ccab6b5982887c3a9262889b 100644
|
index fa6151a2361684426bdd3bf3b433fe4dbd0cf47b..4dd93e02f2b18e5c75be14ff8f052220ca69f427 100644
|
||||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
||||||
@@ -26,6 +26,7 @@ import java.util.List;
|
@@ -26,6 +26,7 @@ import java.util.List;
|
@@ -18,7 +18,7 @@ index c99fc118013cb3d4043638e2001a8297e79ddf9c..cdaa81e1f2167b29ec01cc25e51a8400
|
|||||||
private final boolean trackOutput;
|
private final boolean trackOutput;
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 38b60dde9ec9fcadc8e62ec25ae1646aecc10dfb..61000ef4e49050cd2f6f182423638bc00fa26561 100644
|
index 94cc122aad0e48687ea9f25cd810f07dc893acc6..bcb195b1e40f562d0cd5ecca236ebba87150d236 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -1,6 +1,8 @@
|
@@ -1,6 +1,8 @@
|
||||||
@@ -30,7 +30,7 @@ index 38b60dde9ec9fcadc8e62ec25ae1646aecc10dfb..61000ef4e49050cd2f6f182423638bc0
|
|||||||
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.primitives.Floats;
|
import com.google.common.primitives.Floats;
|
||||||
@@ -159,6 +161,7 @@ import net.minecraft.world.entity.player.Inventory;
|
@@ -154,6 +156,7 @@ import net.minecraft.world.entity.player.Inventory;
|
||||||
import net.minecraft.world.entity.player.ProfilePublicKey;
|
import net.minecraft.world.entity.player.ProfilePublicKey;
|
||||||
import net.minecraft.world.entity.projectile.AbstractArrow;
|
import net.minecraft.world.entity.projectile.AbstractArrow;
|
||||||
import net.minecraft.world.entity.vehicle.Boat;
|
import net.minecraft.world.entity.vehicle.Boat;
|
||||||
@@ -38,7 +38,7 @@ index 38b60dde9ec9fcadc8e62ec25ae1646aecc10dfb..61000ef4e49050cd2f6f182423638bc0
|
|||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import net.minecraft.world.item.BucketItem;
|
import net.minecraft.world.item.BucketItem;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
@@ -187,6 +190,8 @@ import net.minecraft.world.phys.Vec3;
|
@@ -181,6 +184,8 @@ import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraft.world.phys.shapes.BooleanOp;
|
import net.minecraft.world.phys.shapes.BooleanOp;
|
||||||
import net.minecraft.world.phys.shapes.Shapes;
|
import net.minecraft.world.phys.shapes.Shapes;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
@@ -47,7 +47,7 @@ index 38b60dde9ec9fcadc8e62ec25ae1646aecc10dfb..61000ef4e49050cd2f6f182423638bc0
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -1029,6 +1034,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -893,6 +898,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity);
|
this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ index 38b60dde9ec9fcadc8e62ec25ae1646aecc10dfb..61000ef4e49050cd2f6f182423638bc0
|
|||||||
commandblocklistenerabstract.setCommand(s);
|
commandblocklistenerabstract.setCommand(s);
|
||||||
commandblocklistenerabstract.setTrackOutput(flag);
|
commandblocklistenerabstract.setTrackOutput(flag);
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
@@ -1060,7 +1075,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -924,7 +939,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level());
|
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level());
|
||||||
|
|
||||||
if (commandblocklistenerabstract != null) {
|
if (commandblocklistenerabstract != null) {
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Add depth limit to SNBT
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java
|
diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java
|
||||||
index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..b70bafe2766efcbcce00287e6511a588560564a6 100644
|
index ee012f1ef1ff7f2adf76d1690dbd5611af7deb4d..d79723047317c24c53fb85c423de8dd9f84891ac 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/TagParser.java
|
--- a/src/main/java/net/minecraft/nbt/TagParser.java
|
||||||
+++ b/src/main/java/net/minecraft/nbt/TagParser.java
|
+++ b/src/main/java/net/minecraft/nbt/TagParser.java
|
||||||
@@ -169,9 +169,56 @@ public class TagParser {
|
@@ -179,9 +179,56 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.expect('}');
|
this.expect('}');
|
||||||
@@ -66,7 +66,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..b70bafe2766efcbcce00287e6511a588
|
|||||||
private Tag readListTag() throws CommandSyntaxException {
|
private Tag readListTag() throws CommandSyntaxException {
|
||||||
this.expect('[');
|
this.expect('[');
|
||||||
this.reader.skipWhitespace();
|
this.reader.skipWhitespace();
|
||||||
@@ -203,7 +250,7 @@ public class TagParser {
|
@@ -213,7 +260,7 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.expect(']');
|
this.expect(']');
|
||||||
@@ -75,7 +75,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..b70bafe2766efcbcce00287e6511a588
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +275,7 @@ public class TagParser {
|
@@ -238,7 +285,7 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
private <T extends Number> List<T> readArray(TagType<?> arrayTypeReader, TagType<?> typeReader) throws CommandSyntaxException {
|
private <T extends Number> List<T> readArray(TagType<?> arrayTypeReader, TagType<?> typeReader) throws CommandSyntaxException {
|
||||||
@@ -84,7 +84,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..b70bafe2766efcbcce00287e6511a588
|
|||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
if (this.reader.peek() != ']') {
|
if (this.reader.peek() != ']') {
|
||||||
@@ -241,11 +288,11 @@ public class TagParser {
|
@@ -251,11 +298,11 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeReader == ByteTag.TYPE) {
|
if (typeReader == ByteTag.TYPE) {
|
||||||
@@ -99,7 +99,7 @@ index fbfe810e8be6cb159742f7fd85e7491b9cefa4dc..b70bafe2766efcbcce00287e6511a588
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasElementSeparator()) {
|
if (this.hasElementSeparator()) {
|
||||||
@@ -257,7 +304,7 @@ public class TagParser {
|
@@ -267,7 +314,7 @@ public class TagParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.expect(']');
|
this.expect(']');
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Limit beacon effectRange
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||||
index 3b866e2c20ee7bfc981ff09b29065530de993778..cbffd654a25a5c498ea96059aa97ef0c012c923c 100644
|
index f13943db6f2fb923c52dcf9e8bf7000041d0a362..2fdcc47dd6a813d5f7a32dc58ca67b6b965c8749 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||||
@@ -83,7 +83,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
@@ -87,7 +87,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||||
private double effectRange = -1;
|
private double effectRange = -1;
|
||||||
|
|
||||||
public double getEffectRange() {
|
public double getEffectRange() {
|
||||||
@@ -17,7 +17,7 @@ index 3b866e2c20ee7bfc981ff09b29065530de993778..cbffd654a25a5c498ea96059aa97ef0c
|
|||||||
return this.levels * 10 + 10;
|
return this.levels * 10 + 10;
|
||||||
} else {
|
} else {
|
||||||
return effectRange;
|
return effectRange;
|
||||||
@@ -424,6 +424,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
@@ -456,6 +456,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||||
|
|
||||||
this.lockKey = LockCode.fromTag(nbt);
|
this.lockKey = LockCode.fromTag(nbt);
|
||||||
this.effectRange = nbt.contains(PAPER_RANGE_TAG, 6) ? nbt.getDouble(PAPER_RANGE_TAG) : -1; // Paper
|
this.effectRange = nbt.contains(PAPER_RANGE_TAG, 6) ? nbt.getDouble(PAPER_RANGE_TAG) : -1; // Paper
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't log on too many chained updates
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
||||||
index 5ddd8108e077bc7c1a9524854ac591c6ab99c174..b6577352c043b44df2e32a35a6af2711339f15eb 100644
|
index 598dc0d3a2b9387e76d7e4e19e54c4573a24bc54..9eed28bf8bc7e2fa528729cde01a535bc7040815 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
--- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
+++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
|
||||||
@@ -57,7 +57,7 @@ public class CollectingNeighborUpdater implements NeighborUpdater {
|
@@ -56,7 +56,7 @@ public class CollectingNeighborUpdater implements NeighborUpdater {
|
||||||
this.stack.push(entry);
|
this.stack.push(entry);
|
||||||
}
|
}
|
||||||
} else if (this.count - 1 == this.maxChainedNeighborUpdates) {
|
} else if (this.count - 1 == this.maxChainedNeighborUpdates) {
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix packet-related lag exploits
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 61000ef4e49050cd2f6f182423638bc00fa26561..4306f6fe53dcf73875bb68309bd1f037f71ee8c1 100644
|
index bcb195b1e40f562d0cd5ecca236ebba87150d236..fee0a88c6ccecd71ebf63651655dec2d5097f894 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -994,7 +994,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -858,7 +858,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
|
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
|
||||||
} else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission
|
} else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission
|
||||||
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
|
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
|
||||||
@@ -17,7 +17,7 @@ index 61000ef4e49050cd2f6f182423638bc00fa26561..4306f6fe53dcf73875bb68309bd1f037
|
|||||||
BaseCommandBlock commandblocklistenerabstract = null;
|
BaseCommandBlock commandblocklistenerabstract = null;
|
||||||
CommandBlockEntity tileentitycommand = null;
|
CommandBlockEntity tileentitycommand = null;
|
||||||
BlockPos blockposition = packet.getPos();
|
BlockPos blockposition = packet.getPos();
|
||||||
@@ -1161,7 +1161,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1025,7 +1025,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
@@ -26,7 +26,7 @@ index 61000ef4e49050cd2f6f182423638bc00fa26561..4306f6fe53dcf73875bb68309bd1f037
|
|||||||
BlockPos blockposition = packet.getPos();
|
BlockPos blockposition = packet.getPos();
|
||||||
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
||||||
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
||||||
@@ -1219,7 +1219,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1083,7 +1083,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||||
@@ -35,7 +35,7 @@ index 61000ef4e49050cd2f6f182423638bc00fa26561..4306f6fe53dcf73875bb68309bd1f037
|
|||||||
BlockPos blockposition = packet.getPos();
|
BlockPos blockposition = packet.getPos();
|
||||||
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
||||||
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
||||||
@@ -1242,7 +1242,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -1106,7 +1106,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
@@ -5,7 +5,7 @@ Subject: [PATCH] Limit save data for Bees and Vexes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||||
index 55026e1731e41b4e3e4c6a8fef5d96a32051a556..4a8383d48da4fcf39ec528a00cd09417f8d08c57 100644
|
index 9a7956befc346e1b58f064213800fd099a052fc6..2ebedd806bafc6ff7c4bf5a962ead50ce2ad1a8a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||||
@@ -227,8 +227,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
@@ -227,8 +227,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
@@ -24,7 +24,7 @@ index 55026e1731e41b4e3e4c6a8fef5d96a32051a556..4a8383d48da4fcf39ec528a00cd09417
|
|||||||
|
|
||||||
this.savedFlowerPos = null;
|
this.savedFlowerPos = null;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Vex.java b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Vex.java b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||||
index 65cb385ab294e362d666a6d03c4496cdc3b64890..42c3e946e51f6dcb100078969a4fb46c77f42b2d 100644
|
index 90e577b1a89b02c38daff2845a63dafe5ed929e1..1a2b6ee032ab6952634c9f596820db3e7374fb50 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||||
@@ -118,8 +118,12 @@ public class Vex extends Monster implements TraceableEntity {
|
@@ -118,8 +118,12 @@ public class Vex extends Monster implements TraceableEntity {
|
@@ -5,10 +5,10 @@ Subject: [PATCH] Mute invalid attributes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
index dd1102d5291ef6f18e82400a6d8a0a376cc071e9..d304612325d6c70a4100582d6c0fbfeecd8716d1 100644
|
index 7204b973c3ad9239e82355513f6d538107102e48..2463444778f19f937b18173798c04d9d9788a824 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
@@ -145,7 +145,7 @@ public class AttributeMap {
|
@@ -147,7 +147,7 @@ public class AttributeMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
}, () -> {
|
}, () -> {
|
||||||
@@ -18,10 +18,10 @@ index dd1102d5291ef6f18e82400a6d8a0a376cc071e9..d304612325d6c70a4100582d6c0fbfee
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
||||||
index 8de09eea46c27db9d8c472e84f768976769d1b0b..c8d05d35368e0cf593bcc3589b6c108a901bdc22 100644
|
index a7380ce6dcbf64ad8a51dd047d178ae887518041..cb015941e5ea4618bd0964f4aa66a9f0fceb27a1 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeModifier.java
|
||||||
@@ -90,7 +90,7 @@ public class AttributeModifier {
|
@@ -92,7 +92,7 @@ public class AttributeModifier {
|
||||||
AttributeModifier.Operation operation = AttributeModifier.Operation.fromValue(nbt.getInt("Operation"));
|
AttributeModifier.Operation operation = AttributeModifier.Operation.fromValue(nbt.getInt("Operation"));
|
||||||
return new AttributeModifier(uUID, nbt.getString("Name"), nbt.getDouble("Amount"), operation);
|
return new AttributeModifier(uUID, nbt.getString("Name"), nbt.getDouble("Amount"), operation);
|
||||||
} catch (Exception var3) {
|
} catch (Exception var3) {
|
@@ -6,23 +6,11 @@ Subject: [PATCH] Don't return null Components in the Component codec
|
|||||||
Found by Sk8kman
|
Found by Sk8kman
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/util/ExtraCodecs.java b/src/main/java/net/minecraft/util/ExtraCodecs.java
|
diff --git a/src/main/java/net/minecraft/util/ExtraCodecs.java b/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||||
index 066d423dc908080157586555ba01053a2477d570..aa6e5de37ce69c9bc6b8e1e0b5ab0ee918fc27e2 100644
|
index 607f32b856c6c1fb81d3f1604f3bf3fb240d713f..5afdc9d93e696568cc8a263ab0142fbac258e874 100644
|
||||||
--- a/src/main/java/net/minecraft/util/ExtraCodecs.java
|
--- a/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||||
+++ b/src/main/java/net/minecraft/util/ExtraCodecs.java
|
+++ b/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||||
@@ -62,7 +62,10 @@ public class ExtraCodecs {
|
@@ -70,7 +70,10 @@ public class ExtraCodecs {
|
||||||
});
|
public static final Codec<Component> COMPONENT = adaptJsonSerializer(Component.Serializer::fromJson, Component.Serializer::toJsonTree);
|
||||||
public static final Codec<Component> COMPONENT = JSON.flatXmap((element) -> {
|
|
||||||
try {
|
|
||||||
- return DataResult.success(Component.Serializer.fromJson(element));
|
|
||||||
+ // Scissors start
|
|
||||||
+ final Component component = Component.Serializer.fromJson(element);
|
|
||||||
+ return DataResult.success(component != null ? component : Component.empty());
|
|
||||||
+ // Scissors end
|
|
||||||
} catch (JsonParseException var2) {
|
|
||||||
return DataResult.error(var2::getMessage);
|
|
||||||
}
|
|
||||||
@@ -75,7 +78,10 @@ public class ExtraCodecs {
|
|
||||||
});
|
|
||||||
public static final Codec<Component> FLAT_COMPONENT = Codec.STRING.flatXmap((json) -> {
|
public static final Codec<Component> FLAT_COMPONENT = Codec.STRING.flatXmap((json) -> {
|
||||||
try {
|
try {
|
||||||
- return DataResult.success(Component.Serializer.fromJson(json));
|
- return DataResult.success(Component.Serializer.fromJson(json));
|
||||||
@@ -33,7 +21,19 @@ index 066d423dc908080157586555ba01053a2477d570..aa6e5de37ce69c9bc6b8e1e0b5ab0ee9
|
|||||||
} catch (JsonParseException var2) {
|
} catch (JsonParseException var2) {
|
||||||
return DataResult.error(var2::getMessage);
|
return DataResult.error(var2::getMessage);
|
||||||
}
|
}
|
||||||
@@ -246,7 +252,7 @@ public class ExtraCodecs {
|
@@ -233,7 +236,10 @@ public class ExtraCodecs {
|
||||||
|
public static <T> Codec<T> adaptJsonSerializer(Function<JsonElement, T> deserializer, Function<T, JsonElement> serializer) {
|
||||||
|
return JSON.flatXmap((json) -> {
|
||||||
|
try {
|
||||||
|
- return DataResult.success(deserializer.apply(json));
|
||||||
|
+ // Scissors start
|
||||||
|
+ final T value = deserializer.apply(json);
|
||||||
|
+ return DataResult.success(value != null ? value : (T)Component.empty());
|
||||||
|
+ // Scissors end
|
||||||
|
} catch (JsonParseException var3) {
|
||||||
|
return DataResult.error(var3::getMessage);
|
||||||
|
}
|
||||||
|
@@ -260,7 +266,7 @@ public class ExtraCodecs {
|
||||||
}, (pair) -> {
|
}, (pair) -> {
|
||||||
return ImmutableList.of(leftFunction.apply(pair), rightFunction.apply(pair));
|
return ImmutableList.of(leftFunction.apply(pair), rightFunction.apply(pair));
|
||||||
});
|
});
|
||||||
@@ -42,7 +42,7 @@ index 066d423dc908080157586555ba01053a2477d570..aa6e5de37ce69c9bc6b8e1e0b5ab0ee9
|
|||||||
return instance.group(codec.fieldOf(leftFieldName).forGetter(Pair::getFirst), codec.fieldOf(rightFieldName).forGetter(Pair::getSecond)).apply(instance, Pair::of);
|
return instance.group(codec.fieldOf(leftFieldName).forGetter(Pair::getFirst), codec.fieldOf(rightFieldName).forGetter(Pair::getSecond)).apply(instance, Pair::of);
|
||||||
}).comapFlatMap((pair) -> {
|
}).comapFlatMap((pair) -> {
|
||||||
return combineFunction.apply((P)pair.getFirst(), (P)pair.getSecond());
|
return combineFunction.apply((P)pair.getFirst(), (P)pair.getSecond());
|
||||||
@@ -278,7 +284,7 @@ public class ExtraCodecs {
|
@@ -286,7 +292,7 @@ public class ExtraCodecs {
|
||||||
Optional<Pair<A, T>> optional = dataResult.resultOrPartial(mutableObject::setValue);
|
Optional<Pair<A, T>> optional = dataResult.resultOrPartial(mutableObject::setValue);
|
||||||
return optional.isPresent() ? dataResult : DataResult.error(() -> {
|
return optional.isPresent() ? dataResult : DataResult.error(() -> {
|
||||||
return "(" + (String)mutableObject.getValue() + " -> using default)";
|
return "(" + (String)mutableObject.getValue() + " -> using default)";
|
||||||
@@ -51,12 +51,3 @@ index 066d423dc908080157586555ba01053a2477d570..aa6e5de37ce69c9bc6b8e1e0b5ab0ee9
|
|||||||
}
|
}
|
||||||
|
|
||||||
public <T> DataResult<T> coApply(DynamicOps<T> dynamicOps, A objectx, DataResult<T> dataResult) {
|
public <T> DataResult<T> coApply(DynamicOps<T> dynamicOps, A objectx, DataResult<T> dataResult) {
|
||||||
@@ -565,7 +571,7 @@ public class ExtraCodecs {
|
|
||||||
|
|
||||||
static record LazyInitializedCodec<A>(Supplier<Codec<A>> delegate) implements Codec<A> {
|
|
||||||
LazyInitializedCodec {
|
|
||||||
- supplier = Suppliers.memoize(supplier::get);
|
|
||||||
+ delegate = Suppliers.memoize(delegate::get); // Scissors - Decompile error
|
|
||||||
}
|
|
||||||
|
|
||||||
public <T> DataResult<Pair<A, T>> decode(DynamicOps<T> dynamicOps, T object) {
|
|
@@ -0,0 +1,19 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Allink <arclicious@vivaldi.net>
|
||||||
|
Date: Fri, 25 Aug 2023 11:51:47 +0100
|
||||||
|
Subject: [PATCH] Add length limit to note block sound
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
||||||
|
index 238b6cd88cb24ca63770db607f2241fcd7210574..ec02597810a4022112ddf31928eb6976e6ac5371 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
|
||||||
|
@@ -92,7 +92,7 @@ public class SkullBlockEntity extends BlockEntity {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nbt.contains("note_block_sound", 8)) {
|
||||||
|
- this.noteBlockSound = ResourceLocation.tryParse(nbt.getString("note_block_sound"));
|
||||||
|
+ this.noteBlockSound = ResourceLocation.tryParse(StringUtil.truncateStringIfNecessary(nbt.getString("note_block_sound"), 32767, false)); // Scissors - Add length limit to note block sound
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user