Update Paper

This commit is contained in:
Telesphoreo 2023-04-13 18:31:29 -05:00
parent db22a6b194
commit da48bc9763
9 changed files with 23 additions and 23 deletions

View File

@ -2,7 +2,7 @@ group=me.totalfreedom.scissors
version=1.19.4-R0.1-SNAPSHOT version=1.19.4-R0.1-SNAPSHOT
mcVersion=1.19.4 mcVersion=1.19.4
paperRef=29b17a892d11697dce9ee35d8eab593bb4748fb1 paperRef=bd35d605e843b58c7c07c5508a5ef463d385575d
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View File

@ -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 58c1d07f41fc382b23df17739090f5031fd41aad..92be52c3d193878ef9a3ed0e938c10d59247b256 100644 index 936f8babf74b2be6240e5dbc2d0a84f8badada2e..e3d5ded703be73343d821f329175710609dc388f 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
@@ -1794,8 +1794,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1799,8 +1799,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
resource = CraftNamespacedKey.fromMinecraft(key); resource = CraftNamespacedKey.fromMinecraft(key);
} }
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {

View File

@ -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 92be52c3d193878ef9a3ed0e938c10d59247b256..fe50f9a7771dd2085dc6f3f76d15b735961958a1 100644 index e3d5ded703be73343d821f329175710609dc388f..7c04bab95a49c527831949c9618ab96320b1b7ad 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,7 +17,7 @@ index 92be52c3d193878ef9a3ed0e938c10d59247b256..fe50f9a7771dd2085dc6f3f76d15b735
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.EnumUtils; import org.apache.commons.lang3.EnumUtils;
@@ -482,7 +483,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -484,7 +485,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(ATTRIBUTES_IDENTIFIER.NBT)); // Paper

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Validate coordinates before attempting to get block entities
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 177aac1ab10189bb5a52217e86ba5c8a535b4197..8bd5be47e30c7a25762e758566bbceb046e66270 100644 index 9c5754ac3b00d3f0cb80ec83a2beefadee6d0a14..8bdcae709d9e4ae916d21eb8efe8c387603b1665 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
@@ -1920,6 +1920,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1921,6 +1921,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// Spigot end // Spigot end
@ -28,7 +28,7 @@ index 177aac1ab10189bb5a52217e86ba5c8a535b4197..8bd5be47e30c7a25762e758566bbceb0
@Override @Override
public void handleUseItemOn(ServerboundUseItemOnPacket packet) { public void handleUseItemOn(ServerboundUseItemOnPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
@@ -3337,17 +3349,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3338,17 +3350,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (!itemstack.isEmpty() && nbttagcompound != null && nbttagcompound.contains("x") && nbttagcompound.contains("y") && nbttagcompound.contains("z") && this.player.getBukkitEntity().hasPermission("minecraft.nbt.copy")) { // Spigot if (!itemstack.isEmpty() && nbttagcompound != null && nbttagcompound.contains("x") && nbttagcompound.contains("y") && nbttagcompound.contains("z") && this.player.getBukkitEntity().hasPermission("minecraft.nbt.copy")) { // Spigot
BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound); BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound);

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Reset large tags
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 3bfef8ed7dd73f603aef06172f362bb0ed0a5c83..3c5b4d57004c04fbeaef3e916113db5e18a9d1b2 100644 index a7533d18fe6148d7bfd3106b9cdcb6fa3347cf7c..135c1c3013bd75673a8352b9386679195eb681d3 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -20,6 +20,7 @@ import java.util.function.Predicate; @@ -20,6 +20,7 @@ import java.util.function.Predicate;
@ -16,7 +16,7 @@ index 3bfef8ed7dd73f603aef06172f362bb0ed0a5c83..3c5b4d57004c04fbeaef3e916113db5e
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;
@@ -256,6 +257,12 @@ public final class ItemStack { @@ -258,6 +259,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) {
@ -29,7 +29,7 @@ index 3bfef8ed7dd73f603aef06172f362bb0ed0a5c83..3c5b4d57004c04fbeaef3e916113db5e
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)) {
@@ -525,7 +532,11 @@ public final class ItemStack { @@ -538,7 +545,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) {
@ -42,7 +42,7 @@ index 3bfef8ed7dd73f603aef06172f362bb0ed0a5c83..3c5b4d57004c04fbeaef3e916113db5e
} }
return nbt; return nbt;
@@ -861,6 +872,9 @@ public final class ItemStack { @@ -874,6 +885,9 @@ public final class ItemStack {
// Paper end // Paper end
public void setTag(@Nullable CompoundTag nbt) { public void setTag(@Nullable CompoundTag nbt) {

View File

@ -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 8bd5be47e30c7a25762e758566bbceb046e66270..cf5ba11ecceb3fd42c5848fc854f79058d1c45b5 100644 index 8bdcae709d9e4ae916d21eb8efe8c387603b1665..4d571eb214a189b54c96aae81e1a2a5c69b06501 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -15,7 +15,7 @@ index 8bd5be47e30c7a25762e758566bbceb046e66270..cf5ba11ecceb3fd42c5848fc854f7905
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.brigadier.ParseResults;
@@ -2066,6 +2067,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2067,6 +2068,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Entity entity = packet.getEntity(worldserver); Entity entity = packet.getEntity(worldserver);
if (entity != null) { if (entity != null) {

View File

@ -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 cf5ba11ecceb3fd42c5848fc854f79058d1c45b5..ef3c1cfcf56d7dd5767db293b069dc138d5e0d3a 100644 index 4d571eb214a189b54c96aae81e1a2a5c69b06501..acdf0f705649a7569cb81a96c848a286d60bc44e 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,8 @@ import java.util.function.UnaryOperator; @@ -30,6 +30,8 @@ import java.util.function.UnaryOperator;
@ -17,7 +17,7 @@ index cf5ba11ecceb3fd42c5848fc854f79058d1c45b5..ef3c1cfcf56d7dd5767db293b069dc13
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory; import net.minecraft.CrashReportCategory;
@@ -2979,6 +2981,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2980,6 +2982,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleContainerClick(ServerboundContainerClickPacket packet) { public void handleContainerClick(ServerboundContainerClickPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (this.player.isImmobile()) return; // CraftBukkit if (this.player.isImmobile()) return; // CraftBukkit
@ -25,7 +25,7 @@ index cf5ba11ecceb3fd42c5848fc854f79058d1c45b5..ef3c1cfcf56d7dd5767db293b069dc13
this.player.resetLastActionTime(); this.player.resetLastActionTime();
if (this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu.stillValid(this.player)) { // CraftBukkit if (this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu.stillValid(this.player)) { // CraftBukkit
boolean cancelled = this.player.isSpectator(); // CraftBukkit - see below if boolean cancelled = this.player.isSpectator(); // CraftBukkit - see below if
@@ -3000,6 +3003,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3001,6 +3004,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return; return;
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Validate block entity tag query positions
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ef3c1cfcf56d7dd5767db293b069dc138d5e0d3a..10a4806e2b65b99b3a3a9091829bb029ce7cee2b 100644 index acdf0f705649a7569cb81a96c848a286d60bc44e..ef21a5eed89f9a4883a19ade4093bbb7a3b5b594 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
@@ -1370,7 +1370,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1371,7 +1371,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) { public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());

View File

@ -486,7 +486,7 @@ index a7e133f3495e9132a5fdae2c24f225e7b026295a..16f0daad2456ce23f8d73389f62aac9f
this.setFlightAllowed(dedicatedserverproperties.allowFlight); this.setFlightAllowed(dedicatedserverproperties.allowFlight);
this.setMotd(dedicatedserverproperties.motd); this.setMotd(dedicatedserverproperties.motd);
diff --git a/src/main/java/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 10a4806e2b65b99b3a3a9091829bb029ce7cee2b..c5902b6bc9cbd8d95688047f0cb84b4e2cfa4e43 100644 index ef21a5eed89f9a4883a19ade4093bbb7a3b5b594..a6ec29e95d147bdc9273a2144d3a2d9ce75f2e56 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 @@
@ -496,7 +496,7 @@ index 10a4806e2b65b99b3a3a9091829bb029ce7cee2b..c5902b6bc9cbd8d95688047f0cb84b4e
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.primitives.Floats; import com.google.common.primitives.Floats;
@@ -2369,6 +2370,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2370,6 +2371,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment); Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment);
if (optional.isEmpty()) { if (optional.isEmpty()) {
@ -509,7 +509,7 @@ index 10a4806e2b65b99b3a3a9091829bb029ce7cee2b..c5902b6bc9cbd8d95688047f0cb84b4e
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
} }
@@ -2601,11 +2608,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2602,11 +2609,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleChatAck(ServerboundChatAckPacket packet) { public void handleChatAck(ServerboundChatAckPacket packet) {
LastSeenMessagesValidator lastseenmessagesvalidator = this.lastSeenMessages; LastSeenMessagesValidator lastseenmessagesvalidator = this.lastSeenMessages;
@ -663,7 +663,7 @@ index 4da4edae517a0efec6e03a719ec47b700509dab1..837b20be528bc33f62c0c675d90afebd
} }
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 c714eb04b9ca520e83a704a4c5464cafe9bd9447..47406504e3b5f4ef8a3c5549b40e2ae808d121fd 100644 index a6877783bcbb04b0070af8630f1e3db520d8186f..a3c9196fbf5bc895aa076849f7d36a52269d7678 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
@@ -955,6 +955,7 @@ public final class CraftServer implements Server { @@ -955,6 +955,7 @@ public final class CraftServer implements Server {