Update Paper

This commit is contained in:
Telesphoreo 2023-08-22 15:45:16 -05:00
parent e1d2dd4813
commit e8dbeb27e9
14 changed files with 36 additions and 36 deletions

View File

@ -2,7 +2,7 @@ group=me.totalfreedom.scissors
version=1.20.1-R0.1-SNAPSHOT
mcVersion=1.20.1
paperRef=73af2d4cea597e65dd13dafab6325ea5709c9067
paperRef=3716832282a136dbbd29ab04d1a37ae88ac3726e
org.gradle.caching=true
org.gradle.parallel=true

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add Scissors configuration file
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 68206cf0178c26c0f528a1e14a5fb4e9ad410369..dc8621c4b020bfe896863fe05122f55e3fff7c62 100644
index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..9fd0d55bac867322e8c72dcf4a17bd18f7aa423c 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2081,6 +2081,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2121,6 +2121,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Paper end

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
index 076e06908a0cf97f86a64a15ca0231c5b0f06fec..3903ca3970db787d96053f8b40044c1dac2c909b 100644
index 3df1822b55358a9bdf41bcacd5b7fecfd8f05dfa..f9741039dada19391e80d9623f2d8cabc1089506 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -1807,8 +1807,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1813,8 +1813,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
resource = CraftNamespacedKey.fromMinecraft(key);
}
} catch (IllegalArgumentException ex) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Validate BlockState and SoundEvent values
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
index a9c3c55eb622b18c74d8a9bd472e4e871d11b2aa..a78595e91cbb6a815c9ef6b4596cdb0e560f9e42 100644
index efa800402413202d190926610d8264dfbf5019e7..1b3229128771adb85a7d007989891ef073a80278 100644
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
@@ -235,7 +235,7 @@ public final class NbtUtils {
@@ -234,7 +234,7 @@ public final class NbtUtils {
if (!nbt.contains("Name", 8)) {
return Blocks.AIR.defaultBlockState();
} else {
@ -18,7 +18,7 @@ index a9c3c55eb622b18c74d8a9bd472e4e871d11b2aa..a78595e91cbb6a815c9ef6b4596cdb0e
if (optional.isEmpty()) {
return Blocks.AIR.defaultBlockState();
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 7226be19248a1ffb8ff2c89b55882529d33a6c0c..e77605a506edd5fd7380eaa13de0213cbd370f65 100644
index fa885337085348308604e50049ecc5bb52023884..366f70bfe6559e4d43844473a2c080c3ec52a4fc 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -541,7 +541,7 @@ public abstract class AbstractArrow extends Projectile {

View File

@ -128,10 +128,10 @@ index 97a2657bc98d41c3c1e376b266d2c85f685acc88..9d20f3f1af8e663a8c13714c8928d4a9
}
}).reduce((accumulator, current) -> {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2edab21bb271405f200de5a19e9c748bb14aba7d..afd25ef82b88521925d2b92286ab8fbda9983a0a 100644
index e8485fb900b25e911a858678a833852731cb2ace..842f8af14b2bd694a48ee6573d98e6cfcf910e16 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2485,12 +2485,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2487,12 +2487,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.setRot(this.getYRot(), this.getXRot());
if (nbt.contains("CustomName", 8)) {
String s = nbt.getString("CustomName");

View File

@ -447,7 +447,7 @@ index 9f422cbeaa52b3e6a0a27af4f8ad4ddb7808483f..bbfb536ddec7f44d2a75d35ab495be26
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
this.setMotd(dedicatedserverproperties.motd);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 3758aab606498e7b5fe322bb49ac0731815269e7..8af5a986337c79580060217e1f5ef343719b1493 100644
index 45f43dc72647f2f3fa91dad767b949d851f7dd46..c59e7ca3c5faaa4a5347699f5e66084103f89443 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1056,6 +1056,7 @@ public final class CraftServer implements Server {
@ -466,7 +466,7 @@ index 3758aab606498e7b5fe322bb49ac0731815269e7..8af5a986337c79580060217e1f5ef343
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -2902,6 +2904,14 @@ public final class CraftServer implements Server {
@@ -2932,6 +2934,14 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}

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
index db7d7e2ab25f8559247e2496a54807161e24a203..3f8ab313979954c84dd42143fddc84b288a75890 100644
index f9741039dada19391e80d9623f2d8cabc1089506..38238d9e6d464990caf10557997c6ca88ee100c0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -46,6 +46,7 @@ import net.minecraft.nbt.NbtIo;
@ -17,7 +17,7 @@ index db7d7e2ab25f8559247e2496a54807161e24a203..3f8ab313979954c84dd42143fddc84b2
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.level.block.state.BlockState;
import org.apache.commons.lang3.EnumUtils;
@@ -484,7 +485,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -486,7 +487,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
String attributeName = CraftAttributeMap.convertIfNeeded(entry.getString(ATTRIBUTES_IDENTIFIER.NBT)); // Paper

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
index 80e050603e36134754136a8ee2bd14624f976e91..a25b87311883c2fc2e9bd3707c79b88cbab0c3d9 100644
index 3c0651fa5a5db880202c9a3805a6455269c5f16d..d7ddd44fb9b571850515edc6ee2e6801092f6446 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1,5 +1,6 @@
@ -15,7 +15,7 @@ index 80e050603e36134754136a8ee2bd14624f976e91..a25b87311883c2fc2e9bd3707c79b88c
import com.google.common.collect.Lists;
import com.google.common.primitives.Floats;
import com.mojang.brigadier.ParseResults;
@@ -2101,6 +2102,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2113,6 +2114,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Entity entity = packet.getEntity(worldserver);
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
index ad24f48d9d3d633d37d42978ded3c98a4a447e50..e3691dfadf6290775eaedd24383e02aeec5d0a9f 100644
index d7ddd44fb9b571850515edc6ee2e6801092f6446..3c4825e295eefc7fcd628ba804fcc7dd5f160f28 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -30,6 +30,7 @@ import java.util.function.UnaryOperator;
@ -16,7 +16,7 @@ index ad24f48d9d3d633d37d42978ded3c98a4a447e50..e3691dfadf6290775eaedd24383e02ae
import net.minecraft.ChatFormatting;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
@@ -3046,6 +3047,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3058,6 +3059,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Validate block entity/entity tag query positions
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ac0a79d48b721e00690dcdfe02fa3c631a5936f8..5903534f1245b0aaeff0f1ea29e63bb224877787 100644
index 3c4825e295eefc7fcd628ba804fcc7dd5f160f28..280ebeee9bfae3059b6681873fa5633a9e929161 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1364,7 +1364,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1376,7 +1376,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (this.player.hasPermissions(2)) {
Entity entity = this.player.level().getEntity(packet.getEntityId());
@ -17,7 +17,7 @@ index ac0a79d48b721e00690dcdfe02fa3c631a5936f8..5903534f1245b0aaeff0f1ea29e63bb2
CompoundTag nbttagcompound = entity.saveWithoutId(new CompoundTag());
this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound));
@@ -1376,7 +1376,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1388,7 +1388,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());

View File

@ -60,7 +60,7 @@ index c0a80824a0307ea673805015119cc834b268f0dc..9f28f86b1b56ea55ab39f6ac988c1f47
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa8f073e08 100644
index 280ebeee9bfae3059b6681873fa5633a9e929161..08390409bbaf9f3ae8260ab36ea5e0580e93b3e3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1,5 +1,6 @@
@ -70,7 +70,7 @@ index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
import com.google.common.collect.Lists;
import com.google.common.primitives.Floats;
@@ -2356,7 +2357,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2368,7 +2369,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
@ -79,7 +79,7 @@ index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa
this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes
} else {
this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED));
@@ -2412,6 +2413,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2424,6 +2425,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment);
if (optional.isEmpty()) {
@ -87,7 +87,7 @@ index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa
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
}
@@ -2641,6 +2643,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2653,6 +2655,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
synchronized (this.lastSeenMessages) {
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
@ -95,7 +95,7 @@ index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa
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
}
@@ -3682,6 +3685,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3694,6 +3697,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Patch invalid entity rotation log spam
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index afd25ef82b88521925d2b92286ab8fbda9983a0a..1d8c1090cffa7a7442d148b23a981ab10aaec712 100644
index 842f8af14b2bd694a48ee6573d98e6cfcf910e16..e9e98f09e13d7f21333450d892cdc80b0667c915 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4627,7 +4627,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4617,7 +4617,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void setXRot(float pitch) {
if (!Float.isFinite(pitch)) {

View File

@ -18,7 +18,7 @@ index c99fc118013cb3d4043638e2001a8297e79ddf9c..cdaa81e1f2167b29ec01cc25e51a8400
private final boolean trackOutput;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 52fafac90771554661ca4e0640fc1c7ca811bf6b..22e9ad5a55d43c91528c302c02725acb72bc1199 100644
index 08390409bbaf9f3ae8260ab36ea5e0580e93b3e3..e2f7cef0edf2775083eb87b1cb5984ec8b25c76f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1,6 +1,8 @@
@ -47,7 +47,7 @@ index 52fafac90771554661ca4e0640fc1c7ca811bf6b..22e9ad5a55d43c91528c302c02725acb
import org.slf4j.Logger;
// CraftBukkit start
@@ -1002,6 +1007,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1007,6 +1012,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity);
}
@ -64,7 +64,7 @@ index 52fafac90771554661ca4e0640fc1c7ca811bf6b..22e9ad5a55d43c91528c302c02725acb
commandblocklistenerabstract.setCommand(s);
commandblocklistenerabstract.setTrackOutput(flag);
if (!flag) {
@@ -1033,7 +1048,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1038,7 +1053,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level());
if (commandblocklistenerabstract != null) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix packet-related lag exploits
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 22e9ad5a55d43c91528c302c02725acb72bc1199..a6b39b348215db1afb0333575cdd5cee6a4b1c85 100644
index e2f7cef0edf2775083eb87b1cb5984ec8b25c76f..c645e05ec6c309448460c7e983931b9dc79a7f7e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -967,7 +967,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -972,7 +972,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
} else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
@ -17,7 +17,7 @@ index 22e9ad5a55d43c91528c302c02725acb72bc1199..a6b39b348215db1afb0333575cdd5cee
BaseCommandBlock commandblocklistenerabstract = null;
CommandBlockEntity tileentitycommand = null;
BlockPos blockposition = packet.getPos();
@@ -1127,7 +1127,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1139,7 +1139,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
@ -26,7 +26,7 @@ index 22e9ad5a55d43c91528c302c02725acb72bc1199..a6b39b348215db1afb0333575cdd5cee
BlockPos blockposition = packet.getPos();
BlockState iblockdata = this.player.level().getBlockState(blockposition);
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
@@ -1185,7 +1185,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1197,7 +1197,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
@ -35,7 +35,7 @@ index 22e9ad5a55d43c91528c302c02725acb72bc1199..a6b39b348215db1afb0333575cdd5cee
BlockPos blockposition = packet.getPos();
BlockState iblockdata = this.player.level().getBlockState(blockposition);
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
@@ -1208,7 +1208,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1220,7 +1220,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());