Update to 1.20

This commit is contained in:
Telesphoreo 2023-06-08 19:58:46 -05:00
parent ab53c6814b
commit a40a8e3ed6
No known key found for this signature in database
GPG Key ID: 68B745F7F8C2FADA
27 changed files with 150 additions and 174 deletions

View File

@ -1,8 +1,8 @@
group=me.totalfreedom.scissors group=me.totalfreedom.scissors
version=1.19.4-R0.1-SNAPSHOT version=1.20-R0.1-SNAPSHOT
mcVersion=1.19.4 mcVersion=1.20
paperRef=bc4a6647c99ae98c52c1c81597834be8fec6aa0d paperRef=8ce5219e074e4ab0dc3ecb8c3f7ff9fdc4b527f8
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View File

@ -5,7 +5,7 @@ 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 4f2fa65ade89c5703451dad4f80eeef162b277d1..9c1dc30f351b62bf7f527afed9da0021b4234aaf 100644 index a3a76b9b7efa773117d2ee1ce53ef784b09b277d..fad5e021f1282cd478f6ce484edbc135494b81b3 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -7,8 +7,10 @@ plugins { @@ -7,8 +7,10 @@ plugins {
@ -15,7 +15,7 @@ index 4f2fa65ade89c5703451dad4f80eeef162b277d1..9c1dc30f351b62bf7f527afed9da0021
- implementation(project(":paper-api")) - implementation(project(":paper-api"))
- implementation(project(":paper-mojangapi")) - implementation(project(":paper-mojangapi"))
+ implementation(project(":Scissors-API")) + implementation(project(":Scissors-API"))
+ implementation("io.papermc.paper:paper-mojangapi:1.19.4-R0.1-SNAPSHOT") { + implementation("io.papermc.paper:paper-mojangapi:1.20-R0.1-SNAPSHOT") {
+ exclude("io.papermc.paper", "paper-api") + exclude("io.papermc.paper", "paper-api")
+ } + }
// Paper start // Paper start
@ -51,10 +51,10 @@ index 4f2fa65ade89c5703451dad4f80eeef162b277d1..9c1dc30f351b62bf7f527afed9da0021
standardInput = System.`in` standardInput = System.`in`
workingDir = rootProject.layout.projectDirectory workingDir = rootProject.layout.projectDirectory
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 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..c048169628a53462baf2e418136459719b2ac709 100644 index fb82bb52f219e7683fe1d3c0fb3acbe2251de8d4..0f9928bf68f8bc5abfe02f41c98c63888987d9b9 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
@@ -1682,7 +1682,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1681,7 +1681,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate @DontObfuscate
public String getServerModName() { public String getServerModName() {
@ -64,7 +64,7 @@ index 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..c048169628a53462baf2e41813645971
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 9f2536d9a73bdb15b5b3004d4da79ca32cee205b..c5e22893b1a570e582fc4d0c36a04470639411d9 100644 index aefbb6a3f49a74a4c8fd004aa6a4ab1ab907e878..777b727a360683a72cef8c06ab7ab1439d69ac0a 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
@@ -262,7 +262,7 @@ import javax.annotation.Nullable; // Paper @@ -262,7 +262,7 @@ import javax.annotation.Nullable; // Paper

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

View File

@ -1,22 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Video <videogamesm12@gmail.com> From: Telesphoreo <me@telesphoreo.me>
Date: Sun, 13 Mar 2022 08:14:44 -0600 Date: Thu, 8 Jun 2023 19:19:37 -0500
Subject: [PATCH] Ignore errors thrown when trying to remove minecart entities Subject: [PATCH] Ignore errors thrown when trying to remove minecart entities
with content in them with content in them
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
index b8fb7b5a347298ada16bc8b818edf1863e3f6040..7ec912bfec20d6b5d91f23341c4e9e3188d1236b 100644 index 272095d7a09ab41227d741172735f66fd2798ce1..ea966ea94062be3ed9b6b2c460a316378c016fa7 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
@@ -139,7 +139,12 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme @@ -139,7 +139,12 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
@Override @Override
public void remove(Entity.RemovalReason reason) { public void remove(Entity.RemovalReason reason) {
if (!this.level.isClientSide && reason.shouldDestroy()) { if (!this.level().isClientSide && reason.shouldDestroy()) {
- Containers.dropContents(this.level, (Entity) this, (Container) this); - Containers.dropContents(this.level(), (Entity) this, (Container) this);
+ // Scissors start - Ignore errors thrown when trying to remove minecart entities with content in them + // Scissors start - Ignore errors thrown when trying to remove minecart entities with content in them
+ try { + try {
+ Containers.dropContents(this.level, (Entity) this, (Container) this); + Containers.dropContents(this.level(), (Entity) this, (Container) this);
+ } catch (Exception ignored) { + } catch (Exception ignored) {
+ } + }
+ // Scissors end + // Scissors end

View File

@ -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 d47b3ac633e7936d30abfda6fc46c2c7412d76fe..1b4d21b5960ef09bada7c707fc5ba4e5cc39630c 100644 index 3d41dbe0285f8fec8adae1e93010cf464df9b08c..7ee2c5beaaca9deb61589074f55e4004d1dd76b5 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
@@ -416,11 +416,15 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -420,11 +420,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
CompoundTag nbttagcompound1 = nbt.getCompound("Item"); CompoundTag nbttagcompound1 = nbt.getCompound("Item");

View File

@ -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 30aec9dff249ae629b22318e52902361a9fa4099..f87a58097889720cbc6510345696e03722b4f0a8 100644 index 955316687e2e29ad75a0052317a7b0f89034c82a..2537c48d1269d8ea51222412b2eeaac26a7dc4d4 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
@@ -432,7 +432,7 @@ public class ItemFrame extends HangingEntity { @@ -431,7 +431,7 @@ public class ItemFrame extends HangingEntity {
ItemStack itemstack = ItemStack.of(nbttagcompound1); ItemStack itemstack = ItemStack.of(nbttagcompound1);
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Even more resource location validation
diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java diff --git a/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java b/src/main/java/net/minecraft/world/entity/AreaEffectCloud.java
index 168b60fda38a7172f4473017ccc42447b36faab2..9f01b0f18bf656a7ab62f07cc98aaded96432665 100644 index db3cddf8b227453c9b08e481b21101c5d2e0472d..77ae3bc5fd6cf34aae7bd3baa563f3e23e57de26 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
@@ -145,7 +145,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity { @@ -145,7 +145,7 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
@ -18,7 +18,7 @@ index 168b60fda38a7172f4473017ccc42447b36faab2..9f01b0f18bf656a7ab62f07cc98aaded
// CraftBukkit end // CraftBukkit end
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 ceacc0d383e2ee674783d3c0a7df0a951595faca..32b2558fca4642373f7794449e89bfe275c5cf0d 100644 index 9afc81ccb237c3655d64cdbe8a0db9a4d7791043..ffcb77755b28bcdb3eae981fc735e6dde664bb6e 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 @@ -588,7 +588,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@ -40,10 +40,10 @@ index ceacc0d383e2ee674783d3c0a7df0a951595faca..32b2558fca4642373f7794449e89bfe2
@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 02cb6b8c1d59855ff4a8aad3024fe12007eca0ee..9a64944c6769ced4d82b8edbbc045b870a256cb9 100644 index e2a25c29ec74147b3e66aa0b3deb85a8f6ee53a5..b0c953ad8275740679c847e348b311de93d64965 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
@@ -615,7 +615,7 @@ public abstract class Mob extends LivingEntity implements Targeting { @@ -618,7 +618,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)) {

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 e3d5ded703be73343d821f329175710609dc388f..7c04bab95a49c527831949c9618ab96320b1b7ad 100644 index af5a1111a06789e1401f8c60bb4c8838587f2376..bfcdc18f9b06023a5c461e06abbb93eea32bcdba 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;
@ -15,9 +15,9 @@ index e3d5ded703be73343d821f329175710609dc388f..7c04bab95a49c527831949c9618ab963
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
+import net.minecraft.resources.ResourceLocation; +import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.level.block.state.BlockState;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.EnumUtils; @@ -485,7 +486,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

@ -1,19 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Telesphoreo <me@telesphoreo.me> From: Telesphoreo <me@telesphoreo.me>
Date: Sat, 10 Dec 2022 23:23:52 -0600 Date: Thu, 8 Jun 2023 19:24:05 -0500
Subject: [PATCH] Fix negative death times 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 e9d3e34520b706627205e0d5b17b25e09f198e7e..36b1fcc106909aa7305d63bb4710b4330cb9bc6a 100644 index 67627bbf84f5aab2872f636b1dcb6728c8494147..468f64afb7e9b3ef579205d3beea025deb31b460 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
@@ -612,7 +612,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -630,7 +630,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
protected void tickDeath() { protected void tickDeath() {
++this.deathTime; ++this.deathTime;
- if (this.deathTime >= 20 && !this.level.isClientSide() && !this.isRemoved()) { - if (this.deathTime >= 20 && !this.level().isClientSide() && !this.isRemoved()) {
+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level.isClientSide() && !this.isRemoved()) { + if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level().isClientSide() && !this.isRemoved()) {
this.level.broadcastEntityEvent(this, (byte) 60); this.level().broadcastEntityEvent(this, (byte) 60);
this.remove(Entity.RemovalReason.KILLED); this.remove(Entity.RemovalReason.KILLED);
} }

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 aa287d7f37f38d938d195114408cb6dbda59063d..80384bf470da2da2d6214a9d3429c8556aa18320 100644 index 1288f651fa83d5ab99a88858f52a6d3212284df0..61f6b51b9d868ae6bd79185cc066976a094da8ce 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
@@ -1922,6 +1922,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1920,6 +1920,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// Spigot end // Spigot end
@ -27,27 +27,27 @@ index aa287d7f37f38d938d195114408cb6dbda59063d..80384bf470da2da2d6214a9d3429c855
+ +
@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.serverLevel());
@@ -3345,17 +3357,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3344,17 +3356,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);
- if (this.player.level.isLoaded(blockposition)) { - if (this.player.level().isLoaded(blockposition)) {
- // Paper start - // Paper start
- BlockEntity tileentity = null; - BlockEntity tileentity = null;
- if (this.player.distanceToSqr(blockposition.getX(), blockposition.getY(), blockposition.getZ()) < 32 * 32 && this.player.getLevel().isLoadedAndInBounds(blockposition)) { - if (this.player.distanceToSqr(blockposition.getX(), blockposition.getY(), blockposition.getZ()) < 32 * 32 && this.player.serverLevel().isLoadedAndInBounds(blockposition)) {
- tileentity = this.player.level.getBlockEntity(blockposition); - tileentity = this.player.level().getBlockEntity(blockposition);
- } - }
- // Paper end - // Paper end
+ if (this.player.level.isLoaded(blockposition)) + if (this.player.level().isLoaded(blockposition))
+ { + {
+ // Scissors start - Validate coordinates and whether the player can reach them + // Scissors start - Validate coordinates and whether the player can reach them
+ if (Level.isInSpawnableBounds(blockposition) && !isOutsideOfReach(blockposition.getX(), blockposition.getY(), blockposition.getZ())) + if (Level.isInSpawnableBounds(blockposition) && !isOutsideOfReach(blockposition.getX(), blockposition.getY(), blockposition.getZ()))
+ { + {
+ BlockEntity tileentity = null; + BlockEntity tileentity = null;
+ if (this.player.distanceToSqr(blockposition.getX(), blockposition.getY(), blockposition.getZ()) < 32 * 32 && this.player.getLevel().isLoadedAndInBounds(blockposition)) + if (this.player.distanceToSqr(blockposition.getX(), blockposition.getY(), blockposition.getZ()) < 32 * 32 && this.player.serverLevel().isLoadedAndInBounds(blockposition))
+ { + {
+ tileentity = this.player.level.getBlockEntity(blockposition); + tileentity = this.player.level().getBlockEntity(blockposition);
+ } + }
+ // Paper end + // Paper end

View File

@ -5,10 +5,10 @@ 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 a7533d18fe6148d7bfd3106b9cdcb6fa3347cf7c..135c1c3013bd75673a8352b9386679195eb681d3 100644 index 103ad5f373a59fadb4783892579f3e681a8fd596..ab1065ce7b626ad242905dbbfec98839fd0cd9c6 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; @@ -21,6 +21,7 @@ import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -16,7 +16,7 @@ index a7533d18fe6148d7bfd3106b9cdcb6fa3347cf7c..135c1c3013bd75673a8352b938667919
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;
@@ -258,6 +259,12 @@ public final class ItemStack { @@ -253,6 +254,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 a7533d18fe6148d7bfd3106b9cdcb6fa3347cf7c..135c1c3013bd75673a8352b938667919
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)) {
@@ -538,7 +545,11 @@ public final class ItemStack { @@ -546,7 +553,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 a7533d18fe6148d7bfd3106b9cdcb6fa3347cf7c..135c1c3013bd75673a8352b938667919
} }
return nbt; return nbt;
@@ -874,6 +885,9 @@ public final class ItemStack { @@ -876,6 +887,9 @@ public final class ItemStack {
// Paper end // Paper end
public void setTag(@Nullable CompoundTag nbt) { public void setTag(@Nullable CompoundTag nbt) {

View File

@ -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 ee4f924afe15c9a4d96af7a55b357076c7b28501..939e4ef5a2fcedce6dfc08f1ee618bb9f21226ef 100644 index 9948a28dae4edba877c13ef0156be5ff58df3fa2..93f359c71659c0b2fdf25b1c76c072bf9209db2a 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 ee4f924afe15c9a4d96af7a55b357076c7b28501..939e4ef5a2fcedce6dfc08f1ee618bb9
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.BlockUtil; import net.minecraft.BlockUtil;
import net.minecraft.Util; import net.minecraft.Util;
@@ -106,6 +107,7 @@ public abstract class AbstractMinecart extends Entity { @@ -107,6 +108,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,9 +25,9 @@ index ee4f924afe15c9a4d96af7a55b357076c7b28501..939e4ef5a2fcedce6dfc08f1ee618bb9
public double maxSpeed = 0.4D; public double maxSpeed = 0.4D;
// CraftBukkit end // CraftBukkit end
@@ -432,8 +434,10 @@ public abstract class AbstractMinecart extends Entity { @@ -434,8 +436,10 @@ 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) { - for (int l = 0; l < list.size(); ++l) {
@ -38,7 +38,7 @@ index ee4f924afe15c9a4d96af7a55b357076c7b28501..939e4ef5a2fcedce6dfc08f1ee618bb9
Entity entity = (Entity) list.get(l); Entity entity = (Entity) list.get(l);
if (!(entity instanceof Player) && !(entity instanceof IronGolem) && !(entity instanceof AbstractMinecart) && !this.isVehicle() && !entity.isPassenger()) { if (!(entity instanceof Player) && !(entity instanceof IronGolem) && !(entity instanceof AbstractMinecart) && !this.isVehicle() && !entity.isPassenger()) {
@@ -460,6 +464,16 @@ public abstract class AbstractMinecart extends Entity { @@ -462,6 +466,16 @@ public abstract class AbstractMinecart extends Entity {
entity.push(this); entity.push(this);
} }
} }
@ -54,9 +54,9 @@ index ee4f924afe15c9a4d96af7a55b357076c7b28501..939e4ef5a2fcedce6dfc08f1ee618bb9
+ } + }
} }
} else { } else {
Iterator iterator = this.level.getEntities(this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D)).iterator(); Iterator iterator = this.level().getEntities(this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D)).iterator();
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java 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 12e3209c5246ede89daaf8455fe70b4a517e12f6..a1480258f3713ea32dc0a2f6c651fd95924214da 100644 index 35aeba4e8430e6419caa9db4a0b931a994228618..11b337298ac824adce04cf0608f8f960e59640c9 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;
@ -77,12 +77,12 @@ index 12e3209c5246ede89daaf8455fe70b4a517e12f6..a1480258f3713ea32dc0a2f6c651fd95
super(type, world); super(type, world);
@@ -421,10 +423,12 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> { @@ -421,10 +423,12 @@ 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()) {
+ // Scissors - Add collision debounce + // Scissors - Add collision debounce
+ if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Using TimeUnit for better code readability + if (!list.isEmpty() && (System.currentTimeMillis() - lastLargeCollision) >= TimeUnit.SECONDS.toMillis(5)) { // Using TimeUnit for better code readability
boolean flag = !this.level.isClientSide && !(this.getControllingPassenger() instanceof Player); boolean flag = !this.level().isClientSide && !(this.getControllingPassenger() instanceof Player);
- for (int j = 0; j < list.size(); ++j) { - for (int j = 0; j < list.size(); ++j) {
+ // Scissors - Limit amount of vehicle collision checks to 3 maximum + // Scissors - Limit amount of vehicle collision checks to 3 maximum

View File

@ -110,10 +110,10 @@ index 97a2657bc98d41c3c1e376b266d2c85f685acc88..7b6476455e095eed15c92797ce3a3e11
} }
}).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 280ee1838106201f5e3ba7753caced6d030f7e55..ade4ed2f219d32050a372283eaebe75f9014ec78 100644 index 92202262eff01ae3bbeff0e6ebdcf26ad613c169..38c027c0fbddf58136b7d67eb7156403a79de4d1 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
@@ -2354,12 +2354,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2473,12 +2473,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");
@ -128,7 +128,7 @@ index 280ee1838106201f5e3ba7753caced6d030f7e55..ade4ed2f219d32050a372283eaebe75f
this.setCustomNameVisible(nbt.getBoolean("CustomNameVisible")); this.setCustomNameVisible(nbt.getBoolean("CustomNameVisible"));
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java 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 ef740d1ad6352ca4af299001a081b720bc472d2e..f2325c0c475bb465f5275f78c71949648a860d0c 100644 index 59246e24558569f7f50b4d4d508616798091c888..5005a0ad5f703727ea9c618ae4b769a77d5655b5 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
@@ -410,7 +410,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -410,7 +410,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name

View File

@ -5,7 +5,7 @@ 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 9d0d5a44c5948bde037165147d18aaabe21ce50a..c42b8b4daa1ffa6f3ae89b35056edbf61ae47283 100644 index 584a58659fae6ba3d8b53858890bc6ec509ffb0e..0dcee5b53740126e0886058dacc43e447836b8d8 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,10 @@ public class ComponentUtils { @@ -39,8 +39,10 @@ public class ComponentUtils {

View File

@ -1,15 +1,15 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Allink <arclicious@vivaldi.net> From: Telesphoreo <me@telesphoreo.me>
Date: Tue, 17 May 2022 05:57:52 +0100 Date: Thu, 8 Jun 2023 19:32:11 -0500
Subject: [PATCH] Don't log invalid teams to console 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 36b1fcc106909aa7305d63bb4710b4330cb9bc6a..795ebbea0c0100cd05661caad74ed2ae1a32e045 100644 index 468f64afb7e9b3ef579205d3beea025deb31b460..71a32f8dfdf043f55f092225a13884ae8935e67c 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
@@ -844,7 +844,9 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -862,7 +862,9 @@ 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) {
- LivingEntity.LOGGER.warn("Unable to add mob to team \"{}\" (that team probably doesn't exist)", s); - LivingEntity.LOGGER.warn("Unable to add mob to team \"{}\" (that team probably doesn't exist)", s);

View File

@ -1,18 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: ayunami2000 <spwilliamsiam@gmail.com> From: Telesphoreo <me@telesphoreo.me>
Date: Fri, 17 Jun 2022 15:28:43 -0500 Date: Thu, 8 Jun 2023 19:41:10 -0500
Subject: [PATCH] Block server side chunkbans 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..d9ed02aa0dcec82bdf9d42c224694773b9307cfe 100644 index fbfadeb83719b81f42724e79c59e92ed88fdece7..bcb9d99359fb3e03c86d7429d9bcfe63b6c0f5d5 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,26 @@ import io.netty.channel.ChannelHandlerContext; @@ -6,9 +6,18 @@ import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder; import io.netty.handler.codec.MessageToByteEncoder;
import io.papermc.paper.adventure.PaperAdventure; // Paper import io.papermc.paper.adventure.PaperAdventure; // Paper
import java.io.IOException; import java.io.IOException;
+import java.util.Collections; +import java.util.Collections;
+
+import net.minecraft.ChatFormatting; +import net.minecraft.ChatFormatting;
+import net.minecraft.core.NonNullList; +import net.minecraft.core.NonNullList;
+import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.CompoundTag;
@ -20,22 +21,13 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..d9ed02aa0dcec82bdf9d42c224694773
+import net.minecraft.network.chat.SignedMessageBody; +import net.minecraft.network.chat.SignedMessageBody;
import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketFlow; import net.minecraft.network.protocol.PacketFlow;
+import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; +import net.minecraft.network.protocol.game.*;
+import net.minecraft.network.protocol.game.ClientboundContainerSetContentPacket;
+import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket;
+import net.minecraft.network.protocol.game.ClientboundDisguisedChatPacket;
+import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData;
+import net.minecraft.network.protocol.game.ClientboundMapItemDataPacket;
+import net.minecraft.network.protocol.game.ClientboundPlayerChatPacket;
+import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket;
+import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket;
+import net.minecraft.network.protocol.game.ClientboundSystemChatPacket;
import net.minecraft.util.profiling.jfr.JvmProfiler; import net.minecraft.util.profiling.jfr.JvmProfiler;
+import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.ItemStack;
import org.slf4j.Logger; import org.slf4j.Logger;
public class PacketEncoder extends MessageToByteEncoder<Packet<?>> { public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
@@ -19,6 +36,23 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> { @@ -19,6 +28,23 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
this.flow = side; this.flow = side;
} }
@ -59,13 +51,13 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..d9ed02aa0dcec82bdf9d42c224694773
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(); ConnectionProtocol connectionProtocol = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get();
if (connectionProtocol == null) { if (connectionProtocol == null) {
@@ -33,38 +67,87 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> { @@ -33,38 +59,66 @@ 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(PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper
-
+ // Scissors start + // Scissors start
+ int k; + int k;
try { try {
@ -107,46 +99,26 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..d9ed02aa0dcec82bdf9d42c224694773
} }
+ // Scissors start + // Scissors start
+ private static Packet capPacket(Packet packet, int i) + private static Packet capPacket(Packet packet, int i) {
+ { + if (packet instanceof ClientboundBlockEntityDataPacket blockEntityDataPacket) {
+ if (packet instanceof ClientboundBlockEntityDataPacket blockEntityDataPacket)
+ {
+ packet = new ClientboundBlockEntityDataPacket(blockEntityDataPacket.getPos(), blockEntityDataPacket.getType(), new CompoundTag()); + packet = new ClientboundBlockEntityDataPacket(blockEntityDataPacket.getPos(), blockEntityDataPacket.getType(), new CompoundTag());
+ } + } else if (packet instanceof ClientboundLevelChunkPacketData chunkPacket) {
+ else if (packet instanceof ClientboundLevelChunkPacketData chunkPacket)
+ {
+ chunkPacket.clearNBT(); + chunkPacket.clearNBT();
+ } + } else if (packet instanceof ClientboundSetEntityDataPacket) {
+ else if (packet instanceof ClientboundSetEntityDataPacket)
+ {
+ return null; // Skip + return null; // Skip
+ } + } else if (packet instanceof ClientboundContainerSetContentPacket containerSetContentPacket) {
+ else if (packet instanceof ClientboundContainerSetContentPacket containerSetContentPacket)
+ {
+ packet = new ClientboundContainerSetContentPacket(containerSetContentPacket.getContainerId(), containerSetContentPacket.getStateId(), NonNullList.create(), ItemStack.EMPTY); + packet = new ClientboundContainerSetContentPacket(containerSetContentPacket.getContainerId(), containerSetContentPacket.getStateId(), NonNullList.create(), ItemStack.EMPTY);
+ } + } else if (packet instanceof ClientboundSetEquipmentPacket setEquipmentPacket) {
+ else if (packet instanceof ClientboundSetEquipmentPacket setEquipmentPacket)
+ {
+ packet = new ClientboundSetEquipmentPacket(setEquipmentPacket.getEntity(), Collections.emptyList()); + packet = new ClientboundSetEquipmentPacket(setEquipmentPacket.getEntity(), Collections.emptyList());
+ } + } else if (packet instanceof ClientboundContainerSetSlotPacket containerSetSlotPacket) {
+ else if (packet instanceof ClientboundContainerSetSlotPacket containerSetSlotPacket)
+ {
+ packet = new ClientboundContainerSetSlotPacket(containerSetSlotPacket.getContainerId(), containerSetSlotPacket.getStateId(), containerSetSlotPacket.getSlot(), ItemStack.EMPTY); + packet = new ClientboundContainerSetSlotPacket(containerSetSlotPacket.getContainerId(), containerSetSlotPacket.getStateId(), containerSetSlotPacket.getSlot(), ItemStack.EMPTY);
+ } + } else if (packet instanceof ClientboundMapItemDataPacket mapItemDataPacket) {
+ else if (packet instanceof ClientboundMapItemDataPacket mapItemDataPacket)
+ {
+ packet = new ClientboundMapItemDataPacket(mapItemDataPacket.getMapId(), mapItemDataPacket.getScale(), mapItemDataPacket.isLocked(), null, null); + packet = new ClientboundMapItemDataPacket(mapItemDataPacket.getMapId(), mapItemDataPacket.getScale(), mapItemDataPacket.isLocked(), null, null);
+ } + } else if (packet instanceof ClientboundSystemChatPacket) {
+ else if (packet instanceof ClientboundSystemChatPacket)
+ {
+ return null; + return null;
+ } + } else if (packet instanceof ClientboundDisguisedChatPacket) {
+ else if (packet instanceof ClientboundDisguisedChatPacket)
+ {
+ return null; + return null;
+ } + } else if (packet instanceof ClientboundPlayerChatPacket playerChatPacket) {
+ else if (packet instanceof ClientboundPlayerChatPacket playerChatPacket)
+ {
+ final SignedMessageBody.Packed body = playerChatPacket.body(); + final SignedMessageBody.Packed body = playerChatPacket.body();
+ packet = new ClientboundPlayerChatPacket(playerChatPacket.sender(), // Not sending this packet results in a kick when someone says something. + packet = new ClientboundPlayerChatPacket(playerChatPacket.sender(), // Not sending this packet results in a kick when someone says something.
+ playerChatPacket.index(), + playerChatPacket.index(),
@ -156,9 +128,7 @@ index fbfadeb83719b81f42724e79c59e92ed88fdece7..d9ed02aa0dcec82bdf9d42c224694773
+ playerChatPacket.filterMask(), + playerChatPacket.filterMask(),
+ playerChatPacket.chatType() + playerChatPacket.chatType()
+ ); + );
+ } + } else {
+ else
+ {
+ LOGGER.error("Packet with ID {} was too large and was not caught. Please report this to the Scissors developers.", i); + LOGGER.error("Packet with ID {} was too large and was not caught. Please report this to the Scissors developers.", i);
+ return null; + return null;
+ } + }
@ -184,21 +154,20 @@ 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 f3fa2678796c33f3a408a02a1995ad117eac9169..c8dd976240aa4f640bb2d223d472f81fdd8dcf7c 100644 index bd439aef96aeecb9c72b5f50d748d231cccbc970..fda495bfefac4c3b147f5f6b6eb18ad5d103fef2 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,14 @@ public class ClientboundLevelChunkPacketData { @@ -33,6 +33,13 @@ public class ClientboundLevelChunkPacketData {
} }
// Paper end // Paper end
+ // Scissors start + // Scissors start
+ public void clearNBT() + public void clearNBT() {
+ {
+ this.blockEntitiesData.clear(); + this.blockEntitiesData.clear();
+ this.extraPackets.clear(); + this.extraPackets.clear();
+ } + }
+ // Scissors end + // Scissors end
+ +
// Paper start - Anti-Xray - Add chunk packet info public ClientboundLevelChunkPacketData(LevelChunk chunk) {
@Deprecated @io.papermc.paper.annotation.DoNotUse public ClientboundLevelChunkPacketData(LevelChunk chunk) { this(chunk, null); } this.heightmaps = new CompoundTag();
public ClientboundLevelChunkPacketData(LevelChunk chunk, com.destroystokyo.paper.antixray.ChunkPacketInfo<net.minecraft.world.level.block.state.BlockState> chunkPacketInfo) {

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 80384bf470da2da2d6214a9d3429c8556aa18320..cf0bd9aba6de16e8061d5f8b4268969fe812fa37 100644 index 61f6b51b9d868ae6bd79185cc066976a094da8ce..2807dbb730974ca4d3a7c7fd1358e2438628bc50 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 80384bf470da2da2d6214a9d3429c8556aa18320..cf0bd9aba6de16e8061d5f8b4268969f
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;
@@ -2068,6 +2069,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2066,6 +2067,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 cf0bd9aba6de16e8061d5f8b4268969fe812fa37..f5f94b7a7f7055dd9dfeb0da161de3553b8e7d38 100644 index 2807dbb730974ca4d3a7c7fd1358e2438628bc50..37fcbdcddaa6cbfd6ae37d70cffab957c90f4e07 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,15 +17,15 @@ index cf0bd9aba6de16e8061d5f8b4268969fe812fa37..f5f94b7a7f7055dd9dfeb0da161de355
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory; import net.minecraft.CrashReportCategory;
@@ -2987,6 +2989,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2985,6 +2987,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.serverLevel());
if (this.player.isImmobile()) return; // CraftBukkit if (this.player.isImmobile()) return; // CraftBukkit
+ +
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
@@ -3008,6 +3011,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3006,6 +3009,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return; return;
} }

View File

@ -5,15 +5,15 @@ 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 f5f94b7a7f7055dd9dfeb0da161de3553b8e7d38..5c347c8ff0eb3eb500a7bd49d61fb19925d780ce 100644 index 37fcbdcddaa6cbfd6ae37d70cffab957c90f4e07..01f88bf2f4872884a9c4c2d1d5f1369c61fb0ebf 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
@@ -1372,7 +1372,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1375,7 +1375,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.serverLevel());
- if (this.player.hasPermissions(2)) { - if (this.player.hasPermissions(2)) {
+ if (this.player.hasPermissions(2) && Level.isInSpawnableBounds(packet.getPos())) { // Scissors - Validate block entity tag query positions + if (this.player.hasPermissions(2) && Level.isInSpawnableBounds(packet.getPos())) { // Scissors - Validate block entity tag query positions
BlockEntity tileentity = this.player.getLevel().getBlockEntity(packet.getPos()); BlockEntity tileentity = this.player.level().getBlockEntity(packet.getPos());
CompoundTag nbttagcompound = tileentity != null ? tileentity.saveWithoutMetadata() : null; CompoundTag nbttagcompound = tileentity != null ? tileentity.saveWithoutMetadata() : null;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fixes out of bounds HangingEntity crash exploit
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
index f7d031e9a5aa533d78a49ed6147dd47dd0f27f01..68bd4f64e85f26071640b219bb91b868f8e8aded 100644 index 66cf0a6cd1525ecf2615809210a26d55f445d07d..b645a6cc8321c116dbee3990d2bbd83234110f13 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java --- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java +++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
@@ -271,6 +271,13 @@ public abstract class HangingEntity extends Entity { @@ -270,6 +270,13 @@ public abstract class HangingEntity extends Entity {
public void readAdditionalSaveData(CompoundTag nbt) { public void readAdditionalSaveData(CompoundTag nbt) {
BlockPos blockposition = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ")); BlockPos blockposition = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ"));

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add Scissors configuration file & command
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index c07eb451a576811a39021f6f97103c77488fd001..b91d3ddf586a103770d63cdcf7ec590f95ee388f 100644 index a2f71a6d1a9e98133dff6cd0f625da9435a8af14..f83b2c4298bd1a5f65487f64bd6a11fb190a622d 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java --- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java +++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -25,6 +25,7 @@ package co.aikar.timings; @@ -25,6 +25,7 @@ package co.aikar.timings;
@ -453,7 +453,7 @@ index 74cf1c043beef03cfd5adf481414a5ee78bef2a6..182f68359a7a8c0b331acd103ed3952e
} }
} }
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 cdbf10339a8e8846a8c364de483a0ccd95cd225a..3863684cdf3d613c39935e9f46fd4e7066f95eab 100644 index dae36c6452ccd57a436dd918547b64d59957ab0a..d450cf3cf8ab5cbb5d32a28ee2e4a6717941adef 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 { @@ -136,6 +136,7 @@ public class Main {
@ -465,7 +465,7 @@ index cdbf10339a8e8846a8c364de483a0ccd95cd225a..3863684cdf3d613c39935e9f46fd4e70
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 a7e133f3495e9132a5fdae2c24f225e7b026295a..16f0daad2456ce23f8d73389f62aac9f10235100 100644 index 7f0b8cdae07e7e4745a099242a4f0c5914be8667..ac218f02b4799dd4117b0de663e9a073d76be05b 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
@ -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 5c347c8ff0eb3eb500a7bd49d61fb19925d780ce..2549ff41d1d63ba0dbdaee3e526a44f953945b6d 100644 index 01f88bf2f4872884a9c4c2d1d5f1369c61fb0ebf..a2b96f7b1e98586017dbbf28a73446196738ee99 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 5c347c8ff0eb3eb500a7bd49d61fb19925d780ce..2549ff41d1d63ba0dbdaee3e526a44f9
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;
@@ -2377,6 +2378,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2375,6 +2376,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 5c347c8ff0eb3eb500a7bd49d61fb19925d780ce..2549ff41d1d63ba0dbdaee3e526a44f9
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
} }
@@ -2609,11 +2616,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2607,11 +2614,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;
@ -608,12 +608,12 @@ index 31911c09fe15753ae32fa39417bdc9e9de552a88..97ce45c6e44b1400b8d60b5239761703
@Override @Override
public boolean isFoil(ItemStack stack) { public boolean isFoil(ItemStack stack) {
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 4da4edae517a0efec6e03a719ec47b700509dab1..837b20be528bc33f62c0c675d90afebd0a781b6f 100644 index 80695b2698d2904cec2c54ebe0ef880d95ed9583..9facb07939972ee40875b9a30dde11ba40002778 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
@@ -4,8 +4,11 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; @@ -8,8 +8,11 @@ import java.util.Objects;
import java.util.UUID; import java.util.UUID;
import java.util.function.Function; import java.util.function.UnaryOperator;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+ +
+import me.totalfreedom.scissors.ScissorsConfig; +import me.totalfreedom.scissors.ScissorsConfig;
@ -622,48 +622,55 @@ index 4da4edae517a0efec6e03a719ec47b700509dab1..837b20be528bc33f62c0c675d90afebd
+import net.minecraft.commands.Commands; +import net.minecraft.commands.Commands;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.ClickEvent; import net.minecraft.nbt.NbtOps;
@@ -15,6 +18,7 @@ import net.minecraft.network.chat.ComponentUtils; @@ -19,6 +22,7 @@ import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.chat.ComponentUtils;
import net.minecraft.network.chat.Style; import net.minecraft.network.chat.Style;
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
+import net.minecraft.server.MinecraftServer; +import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.FormattedCharSequence; import net.minecraft.server.network.FilteredText;
@@ -24,6 +28,8 @@ import net.minecraft.world.item.DyeColor; @@ -30,13 +34,14 @@ import net.minecraft.world.level.block.SignBlock;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.slf4j.Logger;
import org.bukkit.block.sign.Side;
import org.bukkit.craftbukkit.block.CraftBlock;
-import org.bukkit.craftbukkit.util.CraftChatMessage;
import org.bukkit.entity.Player;
import org.bukkit.event.block.SignChangeEvent;
// CraftBukkit end
+import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.entity.CraftPlayer;
public class SignBlockEntity extends BlockEntity implements CommandSource { // CraftBukkit - implements public class SignBlockEntity extends BlockEntity implements CommandSource { // CraftBukkit - implements
private static final boolean CONVERT_LEGACY_SIGNS = Boolean.getBoolean("convertLegacySigns"); // Paper
@@ -272,6 +278,21 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C @@ -285,6 +290,21 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
} }
player.getServer().getCommands().performPrefixedCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle()), event.getMessage()); player.getServer().getCommands().performPrefixedCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle(), world, pos), event.getMessage());
// Paper end // Paper end
+ // Scissors start - Add optional permissions to command signs + // Scissors start - Add optional permissions to command signs
+ final MinecraftServer vanillaServer = player.getServer(); + final MinecraftServer vanillaServer = player.getServer();
+ final CraftServer craftServer = vanillaServer.server; + final CraftServer craftServer = vanillaServer.server;
+ final CraftPlayer craftPlayer = player.getBukkitEntity(); + final CraftHumanEntity craftPlayer = player.getBukkitEntity();
+ final Commands commands = vanillaServer.getCommands(); + final Commands commands = vanillaServer.getCommands();
+ +
+ if (ScissorsConfig.commandSignsBypassPermissions) + if (ScissorsConfig.commandSignsBypassPermissions)
+ { + {
+ commands.performPrefixedCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle()), event.getMessage()); + commands.performPrefixedCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle(), world, pos), event.getMessage());
+ } + }
+ else + else
+ { + {
+ craftServer.dispatchCommand(craftPlayer, command.substring(1)); + craftServer.dispatchCommand(craftPlayer, command.substring(1));
+ } + }
+ // Scissors end + // Scissors end
flag1 = true;
} }
} }
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 c5e22893b1a570e582fc4d0c36a04470639411d9..bf3f6253aa1f90c39d63119dd3140dae6a85217a 100644 index 777b727a360683a72cef8c06ab7ab1439d69ac0a..852831cfbcfe969f3cb6080ff923a04b1467e1b4 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
@@ -978,6 +978,7 @@ public final class CraftServer implements Server { @@ -978,6 +978,7 @@ public final class CraftServer implements Server {
@ -682,7 +689,7 @@ index c5e22893b1a570e582fc4d0c36a04470639411d9..bf3f6253aa1f90c39d63119dd3140dae
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");
@@ -2763,6 +2765,12 @@ public final class CraftServer implements Server { @@ -2759,6 +2761,12 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
} }
@ -696,7 +703,7 @@ index c5e22893b1a570e582fc4d0c36a04470639411d9..bf3f6253aa1f90c39d63119dd3140dae
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 1fe26cb620e8b550790c3e110e2a1180cf0838fd..6305c9cf0cec52bee5a327ba3dd1531a8198eec4 100644 index 0fb3a648ee6bd6cb88515770bcfc70e368313527..5bbfcfe68dace755fe6ec4bc94965d216d998382 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,9 +180,27 @@ public class Main { @@ -180,9 +180,27 @@ public class Main {

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 ade4ed2f219d32050a372283eaebe75f9014ec78..deb54926662b2872f40d688db2756faadbf6aa6e 100644 index 38c027c0fbddf58136b7d67eb7156403a79de4d1..ff3940a0d552140cae820fbed16bfb5e69507822 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
@@ -4482,7 +4482,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4615,7 +4615,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void setYRot(float yaw) { public void setYRot(float yaw) {
if (!Float.isFinite(yaw)) { if (!Float.isFinite(yaw)) {
@ -19,7 +19,7 @@ index ade4ed2f219d32050a372283eaebe75f9014ec78..deb54926662b2872f40d688db2756faa
} else { } else {
this.yRot = yaw; this.yRot = yaw;
} }
@@ -4494,7 +4496,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4627,7 +4629,9 @@ 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

@ -5,10 +5,10 @@ Subject: [PATCH] Limit map decoration count
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java 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 25a64250ce57fe4cd90f8b95d1e003d961662152..60e013d418b1aa8c154ca9474186191aa5c9041d 100644 index 3b12030b49b1c539684d75ca3896eb498400ef99..a1f042e5329343489cf30e436a8f553d39e5a6e4 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java --- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -356,6 +356,12 @@ public class MapItemSavedData extends SavedData { @@ -354,6 +354,12 @@ public class MapItemSavedData extends SavedData {
} }
private void addDecoration(MapDecoration.Type type, @Nullable LevelAccessor world, String key, double x, double z, double rotation, @Nullable Component text) { private void addDecoration(MapDecoration.Type type, @Nullable LevelAccessor world, String key, double x, double z, double rotation, @Nullable Component text) {

View File

@ -5,10 +5,10 @@ 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 45804711255f04110e9509df8d60900314aa10b7..b1fd209b2893d2d6bfc2ae552c7919ab8abda695 100644 index 2ac23779222369ace69f1e3f7fb12184865b7a43..05c8e4e30b2dce565e84f4c09b3f27244f8c0451 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
@@ -1468,7 +1468,14 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1610,7 +1610,14 @@ 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().toString());
entity.unRide(); entity.unRide();

View File

@ -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 61c170555c8854b102c640b0b6a615f9f732edbf..29f46a137584a5f52f3c30b4c352d58ca61488a3 100644 index 82ccaf612548a7dbab7e5aeffb6eb8db84367477..5147c5860f0b485ecb82fa06336939d5bb54057d 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
@@ -366,7 +366,7 @@ public final class EntityLookup implements LevelEntityGetter<Entity> { @@ -367,7 +367,7 @@ public final class EntityLookup implements LevelEntityGetter<Entity> {
return false; return false;
} }
if (this.entityByUUID.containsKey(entity.getUUID())) { if (this.entityByUUID.containsKey(entity.getUUID())) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Implement command block events
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2549ff41d1d63ba0dbdaee3e526a44f953945b6d..2748949301ce9b2c3b098dd2a7d2caee331980a7 100644 index a2b96f7b1e98586017dbbf28a73446196738ee99..0227e2c7197c3684677f76ff7f0fe0acc21b6c14 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 @@
@ -33,8 +33,8 @@ index 2549ff41d1d63ba0dbdaee3e526a44f953945b6d..2748949301ce9b2c3b098dd2a7d2caee
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -994,6 +998,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1001,6 +1005,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player.level.getChunkAt(blockposition).setBlockEntity(tileentity); this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity);
} }
+ // Scissors start - Implement command block events + // Scissors start - Implement command block events
@ -55,8 +55,8 @@ index 2549ff41d1d63ba0dbdaee3e526a44f953945b6d..2748949301ce9b2c3b098dd2a7d2caee
commandblocklistenerabstract.setCommand(s); commandblocklistenerabstract.setCommand(s);
commandblocklistenerabstract.setTrackOutput(flag); commandblocklistenerabstract.setTrackOutput(flag);
if (!flag) { if (!flag) {
@@ -1025,7 +1044,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1032,7 +1051,27 @@ 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) {
- commandblocklistenerabstract.setCommand(packet.getCommand()); - commandblocklistenerabstract.setCommand(packet.getCommand());