Merge remote-tracking branch 'upstream/1.20.1' into slime/1.20.1

This commit is contained in:
Luna 2023-08-22 18:49:01 -03:00
commit 26dc35bc15
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 version=1.20.1-R0.1-SNAPSHOT
mcVersion=1.20.1 mcVersion=1.20.1
paperRef=73af2d4cea597e65dd13dafab6325ea5709c9067 paperRef=3716832282a136dbbd29ab04d1a37ae88ac3726e
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=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 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 --- a/src/main/java/org/bukkit/Server.java
+++ b/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 // 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 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 --- 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
@@ -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); resource = CraftNamespacedKey.fromMinecraft(key);
} }
} catch (IllegalArgumentException ex) { } 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 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 --- 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
@@ -235,7 +235,7 @@ public final class NbtUtils { @@ -234,7 +234,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,7 +18,7 @@ index a9c3c55eb622b18c74d8a9bd472e4e871d11b2aa..a78595e91cbb6a815c9ef6b4596cdb0e
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 7226be19248a1ffb8ff2c89b55882529d33a6c0c..e77605a506edd5fd7380eaa13de0213cbd370f65 100644 index fa885337085348308604e50049ecc5bb52023884..366f70bfe6559e4d43844473a2c080c3ec52a4fc 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
@@ -541,7 +541,7 @@ public abstract class AbstractArrow extends Projectile { @@ -541,7 +541,7 @@ public abstract class AbstractArrow extends Projectile {

View File

@ -128,10 +128,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 2edab21bb271405f200de5a19e9c748bb14aba7d..afd25ef82b88521925d2b92286ab8fbda9983a0a 100644 index e8485fb900b25e911a858678a833852731cb2ace..842f8af14b2bd694a48ee6573d98e6cfcf910e16 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
@@ -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()); 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");

View File

@ -447,7 +447,7 @@ index 9f422cbeaa52b3e6a0a27af4f8ad4ddb7808483f..bbfb536ddec7f44d2a75d35ab495be26
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 258234cf68b1b98e5cb3aa4445a3a6f36ac87e8c..28aeeac753a7d3ff10979f31f2aac781fcf41bb6 100644 index 45f43dc72647f2f3fa91dad767b949d851f7dd46..c59e7ca3c5faaa4a5347699f5e66084103f89443 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
@@ -1056,6 +1056,7 @@ public final class CraftServer implements Server { @@ -1056,6 +1056,7 @@ public final class CraftServer implements Server {
@ -466,7 +466,7 @@ index 258234cf68b1b98e5cb3aa4445a3a6f36ac87e8c..28aeeac753a7d3ff10979f31f2aac781
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");
@@ -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); 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 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 3903ca3970db787d96053f8b40044c1dac2c909b..0bc117a53ecf2851d5b89d8082b549bc0de7ffda 100644 index f9741039dada19391e80d9623f2d8cabc1089506..38238d9e6d464990caf10557997c6ca88ee100c0 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 3903ca3970db787d96053f8b40044c1dac2c909b..0bc117a53ecf2851d5b89d8082b549bc
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;
@@ -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); 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

@ -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 721243ebf0fb126cf5c0de76c6bd990807f097f4..ad24f48d9d3d633d37d42978ded3c98a4a447e50 100644 index 3c0651fa5a5db880202c9a3805a6455269c5f16d..d7ddd44fb9b571850515edc6ee2e6801092f6446 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 721243ebf0fb126cf5c0de76c6bd990807f097f4..ad24f48d9d3d633d37d42978ded3c98a
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;
@@ -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); 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 ad24f48d9d3d633d37d42978ded3c98a4a447e50..e3691dfadf6290775eaedd24383e02aeec5d0a9f 100644 index d7ddd44fb9b571850515edc6ee2e6801092f6446..3c4825e295eefc7fcd628ba804fcc7dd5f160f28 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;
@ -16,7 +16,7 @@ index ad24f48d9d3d633d37d42978ded3c98a4a447e50..e3691dfadf6290775eaedd24383e02ae
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory; 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; 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 diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e3691dfadf6290775eaedd24383e02aeec5d0a9f..054f25b360a46330391cd22ed9888ccc8c40de4d 100644 index 3c4825e295eefc7fcd628ba804fcc7dd5f160f28..280ebeee9bfae3059b6681873fa5633a9e929161 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
@@ -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)) { 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 e3691dfadf6290775eaedd24383e02aeec5d0a9f..054f25b360a46330391cd22ed9888ccc
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));
@@ -1376,7 +1376,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1388,7 +1388,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@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());

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 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 --- 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 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa
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;
@@ -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) { private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
@ -79,7 +79,7 @@ index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa
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));
@@ -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); Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment);
if (optional.isEmpty()) { if (optional.isEmpty()) {
@ -87,7 +87,7 @@ index 054f25b360a46330391cd22ed9888ccc8c40de4d..82b1a4008805f7eb2df61b3909cdbdaa
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
} }
@@ -2641,6 +2643,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2653,6 +2655,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
synchronized (this.lastSeenMessages) { synchronized (this.lastSeenMessages) {
if (!this.lastSeenMessages.applyOffset(packet.offset())) { 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()); 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
} }
@@ -3682,6 +3685,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3694,6 +3697,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@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());

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 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 --- 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
@@ -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) { public void setXRot(float pitch) {
if (!Float.isFinite(pitch)) { if (!Float.isFinite(pitch)) {

View File

@ -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 82b1a4008805f7eb2df61b3909cdbdaa8f073e08..d16d9c0a271b85f8c1758e22359129ad0f5f3366 100644 index 08390409bbaf9f3ae8260ab36ea5e0580e93b3e3..e2f7cef0edf2775083eb87b1cb5984ec8b25c76f 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 @@
@ -47,7 +47,7 @@ index 82b1a4008805f7eb2df61b3909cdbdaa8f073e08..d16d9c0a271b85f8c1758e22359129ad
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // 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); this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity);
} }
@ -64,7 +64,7 @@ index 82b1a4008805f7eb2df61b3909cdbdaa8f073e08..d16d9c0a271b85f8c1758e22359129ad
commandblocklistenerabstract.setCommand(s); commandblocklistenerabstract.setCommand(s);
commandblocklistenerabstract.setTrackOutput(flag); commandblocklistenerabstract.setTrackOutput(flag);
if (!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()); BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level());
if (commandblocklistenerabstract != null) { 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 diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d16d9c0a271b85f8c1758e22359129ad0f5f3366..a56b70845e5f21927d5786e1e300f581a6ae153d 100644 index e2f7cef0edf2775083eb87b1cb5984ec8b25c76f..c645e05ec6c309448460c7e983931b9dc79a7f7e 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
@@ -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")); 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 d16d9c0a271b85f8c1758e22359129ad0f5f3366..a56b70845e5f21927d5786e1e300f581
BaseCommandBlock commandblocklistenerabstract = null; BaseCommandBlock commandblocklistenerabstract = null;
CommandBlockEntity tileentitycommand = null; CommandBlockEntity tileentitycommand = null;
BlockPos blockposition = packet.getPos(); 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 @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 d16d9c0a271b85f8c1758e22359129ad0f5f3366..a56b70845e5f21927d5786e1e300f581
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);
@@ -1185,7 +1185,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1197,7 +1197,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@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 d16d9c0a271b85f8c1758e22359129ad0f5f3366..a56b70845e5f21927d5786e1e300f581
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);
@@ -1208,7 +1208,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1220,7 +1220,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@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());