This is all of them except 1

This commit is contained in:
Telesphoreo 2022-12-11 00:04:11 -06:00
parent 5e3b6a6cf9
commit 0a8af0044c
19 changed files with 69 additions and 69 deletions

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
index 4ab50df1e4c855587ef030cf3f2a1502798cb721..c7d7711be1bd17a25c98578ad68154255135facd 100644
index 0c2255b6e2fb7752f85b0f83d4f84732758bd14d..ff72911cca59528f7090533e52450a59ea50a92a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1934,6 +1934,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1926,6 +1926,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// Spigot end
@ -28,7 +28,7 @@ index 4ab50df1e4c855587ef030cf3f2a1502798cb721..c7d7711be1bd17a25c98578ad6815425
@Override
public void handleUseItemOn(ServerboundUseItemOnPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
@@ -3451,17 +3463,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3310,17 +3322,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
BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound);

View File

@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Business Goose <arclicious@vivaldi.net>
Date: Sat, 11 Jun 2022 23:16:06 -0500
From: Telesphoreo <me@telesphoreo.me>
Date: Sat, 10 Dec 2022 23:38:53 -0600
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
index c18a0bc94d0210396046f4475e49a739088593f3..ee3db7c8b21547ebe941a15de74d9d8d65ea21e7 100644
index 8450a22b0fc6e8dc5cad0f61ac52a82b3cd3791e..4ed50b7863bdc762775064b777a7d0e733ee52fe 100644
--- a/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;
@ -16,7 +16,7 @@ index c18a0bc94d0210396046f4475e49a739088593f3..ee3db7c8b21547ebe941a15de74d9d8d
import net.minecraft.ChatFormatting;
import net.minecraft.Util;
import net.minecraft.advancements.CriteriaTriggers;
@@ -251,6 +252,12 @@ public final class ItemStack {
@@ -255,6 +256,12 @@ public final class ItemStack {
// CraftBukkit - break into own method
private void load(CompoundTag nbttagcompound) {
@ -26,10 +26,10 @@ index c18a0bc94d0210396046f4475e49a739088593f3..ee3db7c8b21547ebe941a15de74d9d8d
+ nbttagcompound = NbtUtility.Item.removeItemData(nbttagcompound);
+ }
+ // Scissors end
this.item = (Item) Registry.ITEM.get(new ResourceLocation(nbttagcompound.getString("id")));
this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id")));
this.count = nbttagcompound.getByte("Count");
if (nbttagcompound.contains("tag", 10)) {
@@ -507,7 +514,11 @@ public final class ItemStack {
@@ -515,7 +522,11 @@ public final class ItemStack {
nbt.putString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
nbt.putByte("Count", (byte) this.count);
if (this.tag != null) {
@ -42,7 +42,7 @@ index c18a0bc94d0210396046f4475e49a739088593f3..ee3db7c8b21547ebe941a15de74d9d8d
}
return nbt;
@@ -839,6 +850,9 @@ public final class ItemStack {
@@ -846,6 +857,9 @@ public final class ItemStack {
// Paper end
public void setTag(@Nullable CompoundTag nbt) {

View File

@ -59,7 +59,7 @@ index 4092c7a8c2b0d9d26e6f4d97386735236300d132..9e0ab51dd7a4f9fed8f9edde962d42d4
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index c6aeda6497cb59673b469588142f5f15a338389d..8847a3b3cec47bd36670b77cedab4ef66a8c9270 100644
index cac2768fe520b591990c7bc943ae7e95f49efb31..f734cba350ed85dbbf52ff527c9bb14b9eb04c86 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -9,6 +9,7 @@ import java.util.Iterator;
@ -70,7 +70,7 @@ index c6aeda6497cb59673b469588142f5f15a338389d..8847a3b3cec47bd36670b77cedab4ef6
import net.minecraft.SharedConstants;
import net.minecraft.Util;
import net.minecraft.core.BlockPos;
@@ -217,6 +218,16 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
@@ -211,6 +212,16 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
public List<ItemStack> getContents() {
@ -88,7 +88,7 @@ index c6aeda6497cb59673b469588142f5f15a338389d..8847a3b3cec47bd36670b77cedab4ef6
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
index f52487e1cfcfab1bf22ab2cb52f998283a86e340..7170c2e4167a102d4abbe69be4b21feec15d600f 100644
index 416aa989ebb18a8741cc9d605a1180ab830f6643..893cf89dd2b022e2b785318e7e86eb5d75be8ed8 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
@@ -1,5 +1,6 @@
@ -230,7 +230,7 @@ index ccad692aba2ed77259f6814d88f01b91ed9d229b..da4fc1027e106fd4e4baedd7b9490c41
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
index 137bdf1168b9e1d00164471e4e79f56c000c2696..8d3b4ec1f1d717af53240febaca1015f4ce0b39f 100644
index b7686fd63b7c5d88c3a12ec4ee9bc01a17f997e0..c2904048625bb4439c7f0ba8a2605d3194b66070 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
@@ -3,6 +3,7 @@ package net.minecraft.world.level.block.entity;

View File

@ -1,12 +1,12 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Business Goose <arclicious@vivaldi.net>
Date: Sun, 1 May 2022 14:23:35 -0500
From: Telesphoreo <me@telesphoreo.me>
Date: Sat, 10 Dec 2022 23:44:05 -0600
Subject: [PATCH] Limit amount of vehicle collision checks to 3 and discard
vehicles if they collide with more than 15 other entities
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 c71120fe57a76c4638be5dcbda5a756cc2d62ffc..db2ed9a3603dbb1a0ce05a0d9d6d372474441ffb 100644
index eec7d7a5b558830111831792c42665724613af23..79f296388a7f86944f33b9a783ab81b3a9e4d4dc 100644
--- a/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;
@ -17,7 +17,7 @@ index c71120fe57a76c4638be5dcbda5a756cc2d62ffc..db2ed9a3603dbb1a0ce05a0d9d6d3724
import javax.annotation.Nullable;
import net.minecraft.BlockUtil;
import net.minecraft.Util;
@@ -106,6 +107,7 @@ public abstract class AbstractMinecart extends Entity {
@@ -105,6 +106,7 @@ public abstract class AbstractMinecart extends Entity {
private double flyingX = 0.949999988079071D; // Paper - restore vanilla precision
private double flyingY = 0.949999988079071D; // Paper - restore vanilla precision
private double flyingZ = 0.949999988079071D; // Paper - restore vanilla precision
@ -25,7 +25,7 @@ index c71120fe57a76c4638be5dcbda5a756cc2d62ffc..db2ed9a3603dbb1a0ce05a0d9d6d3724
public double maxSpeed = 0.4D;
// CraftBukkit end
@@ -432,8 +434,10 @@ public abstract class AbstractMinecart extends Entity {
@@ -431,8 +433,10 @@ public abstract class AbstractMinecart extends Entity {
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));
@ -38,7 +38,7 @@ index c71120fe57a76c4638be5dcbda5a756cc2d62ffc..db2ed9a3603dbb1a0ce05a0d9d6d3724
Entity entity = (Entity) list.get(l);
if (!(entity instanceof Player) && !(entity instanceof IronGolem) && !(entity instanceof AbstractMinecart) && !this.isVehicle() && !entity.isPassenger()) {
@@ -460,6 +464,16 @@ public abstract class AbstractMinecart extends Entity {
@@ -459,6 +463,16 @@ public abstract class AbstractMinecart extends Entity {
entity.push(this);
}
}
@ -56,18 +56,18 @@ index c71120fe57a76c4638be5dcbda5a756cc2d62ffc..db2ed9a3603dbb1a0ce05a0d9d6d3724
} else {
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
index 29da8a42406feccf7932097b07b1d32a38fa96b7..cc6c192bd821f704a0179007fe10fdcb70aede80 100644
index 85e1892866cd2ee0cec1552b8541c1f800bdf68c..2950f60e068cbeb945cfe38972eaf65b79e3a4f1 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.UnmodifiableIterator;
@@ -5,6 +5,7 @@ import com.google.common.collect.UnmodifiableIterator;
import java.util.Iterator;
import java.util.List;
import java.util.function.IntFunction;
+import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
import net.minecraft.BlockUtil;
import net.minecraft.core.BlockPos;
@@ -106,6 +107,7 @@ public class Boat extends Entity {
@@ -108,6 +109,7 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
public double unoccupiedDeceleration = -1;
public boolean landBoats = false;
// CraftBukkit end
@ -75,7 +75,7 @@ index 29da8a42406feccf7932097b07b1d32a38fa96b7..cc6c192bd821f704a0179007fe10fdcb
public Boat(EntityType<? extends Boat> type, Level world) {
super(type, world);
@@ -403,10 +405,12 @@ public class Boat extends Entity {
@@ -417,10 +419,12 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
this.checkInsideBlocks();
List<Entity> list = this.level.getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, -0.009999999776482582D, 0.20000000298023224D), EntitySelector.pushableBy(this));
@ -90,7 +90,7 @@ index 29da8a42406feccf7932097b07b1d32a38fa96b7..cc6c192bd821f704a0179007fe10fdcb
Entity entity = (Entity) list.get(j);
if (!entity.hasPassenger((Entity) this)) {
@@ -417,6 +421,16 @@ public class Boat extends Entity {
@@ -431,6 +435,16 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
}
}
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't log invalid teams to console
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 4d179230f712fbf2a8a8af9f0b7861fe2f83cbf7..5680c69494ffadf4ba02549be7403282d7e1d174 100644
index 2012c147f60f39ae7dbae74641fd00b3b282a991..d828b838216083192d9a344ca978f6a7360e0363 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -851,7 +851,9 @@ public abstract class LivingEntity extends Entity {
@@ -850,7 +850,9 @@ public abstract class LivingEntity extends Entity {
boolean flag = scoreboardteam != null && this.level.getScoreboard().addPlayerToTeam(this.getStringUUID(), scoreboardteam);
if (!flag) {

View File

@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Telesphoreo <me@telesphoreo.me>
Date: Sun, 30 Oct 2022 18:40:45 -0500
Date: Sat, 10 Dec 2022 23:48:28 -0600
Subject: [PATCH] Better handling of invalid JSON components
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
index e7d9e2d8c87ddf3658b1c2e0f2a3e98ef8080cec..16192d2af2bd2c3f0bd4376e5fd7d6e46dac897c 100644
index 3ca733528acb40354b308019a84436ea67e05751..76932c683153c7dcbf46de78cccc14772babc5fc 100644
--- a/src/main/java/net/minecraft/network/chat/Component.java
+++ b/src/main/java/net/minecraft/network/chat/Component.java
@@ -26,6 +26,7 @@ import java.util.List;
@ -44,7 +44,7 @@ index e7d9e2d8c87ddf3658b1c2e0f2a3e98ef8080cec..16192d2af2bd2c3f0bd4376e5fd7d6e4
return Component.Serializer.GSON.toJsonTree(text);
}
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
index d38562b518b28ba4617d39e4587c7fa72859ab11..454e73bbcf449561e18bb8565932872c5a62a6e1 100644
index 7449a024265c42f28a6c9a1ed8d8f4b9e3096aac..487c68abc3eb5c18dc7fee762b2164001283cab7 100644
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
@@ -79,7 +79,7 @@ public class HoverEvent {
@ -80,7 +80,7 @@ index d38562b518b28ba4617d39e4587c7fa72859ab11..454e73bbcf449561e18bb8565932872c
CompoundTag compoundTag = TagParser.parseTag(text.getString());
- Component component = Component.Serializer.fromJson(compoundTag.getString("name"));
+ Component component = Component.Serializer.fromJsonSafe(compoundTag.getString("name")); // Scissors - Use safer method for getting Components from JSON
EntityType<?> entityType = Registry.ENTITY_TYPE.get(new ResourceLocation(compoundTag.getString("type")));
EntityType<?> entityType = BuiltInRegistries.ENTITY_TYPE.get(new ResourceLocation(compoundTag.getString("type")));
// Scissors start
UUID uUID;
diff --git a/src/main/java/net/minecraft/network/chat/contents/NbtContents.java b/src/main/java/net/minecraft/network/chat/contents/NbtContents.java
@ -110,10 +110,10 @@ index 97a2657bc98d41c3c1e376b266d2c85f685acc88..7b6476455e095eed15c92797ce3a3e11
}
}).reduce((accumulator, current) -> {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 6fa47becd0f83ac4273ef3a10c314aa27b08184b..a931aaa05f3e8c499e7e968f6fa1e908d0f2ea24 100644
index 7f94da8059147760cbdc2476d0e8beda4a105f40..1f7462cb8d71e703412fc802c54cdf0b85f8054b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2315,12 +2315,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2330,12 +2330,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.setRot(this.getYRot(), this.getXRot());
if (nbt.contains("CustomName", 8)) {
String s = nbt.getString("CustomName");
@ -128,10 +128,10 @@ index 6fa47becd0f83ac4273ef3a10c314aa27b08184b..a931aaa05f3e8c499e7e968f6fa1e908
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
index bb4ab75ec0e7a5d71dafeeb55e26d2204455e7a1..5ae750a2f12917ecddb0c14c23e6b02735385599 100644
index 49ca1d45bb4b3ddafc1d5952ff9830ba69b745e2..54ef6d8b7144c1872bf137fc9b387641ef99afa9 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -408,7 +408,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
@@ -410,7 +410,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
this.levels = nbt.getInt("Levels"); // SPIGOT-5053, use where available
// CraftBukkit end
if (nbt.contains("CustomName", 8)) {

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
index 10b133e95dbf2edb87764ea9d07974d8146bbed0..de1c251a0f4301beb2c6fd04dc25145c71887e27 100644
index 9d0d5a44c5948bde037165147d18aaabe21ce50a..c42b8b4daa1ffa6f3ae89b35056edbf61ae47283 100644
--- a/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 {

View File

@ -138,7 +138,7 @@ index 5fce1177e7198d791d4ab1c64b394c5b1c145782..744d93fac1db1a8cd6d6ce37de717db9
private static int MAX_PACKET_SIZE = 2097152;
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
index b1e326cf4f7fe447f81b588dcb0eda9a435e59a8..a49b4e711012b6047de113fc1d456a5190406d98 100644
index 3944852921335c78a04a9dc301882ab5b152b1ed..0d88828bc0bbd68328da4d0e7d3b880006d2c775 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
@@ -24,7 +24,8 @@ public class ClientboundBlockEntityDataPacket implements Packet<ClientGamePacket
@ -173,7 +173,7 @@ index dbd8b9b09b82c1b75e8be9dc7416d9f0863c8c87..24e0f4ee1dc9b5a46ed063e087d4b7bc
public ClientboundContainerSetContentPacket(int syncId, int revision, NonNullList<ItemStack> contents, ItemStack cursorStack) {
this.containerId = syncId;
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 76b6437a1d807c7e1b673f8feeed1f171ee9a803..3d9b0525f931a684e14a56c368dfb5b452bc7b4a 100644
index f3fa2678796c33f3a408a02a1995ad117eac9169..c8dd976240aa4f640bb2d223d472f81fdd8dcf7c 100644
--- a/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 {

View File

@ -57,7 +57,7 @@ index a3dac53b07618819b322b48339d850d80a1c55ba..4dd21b7ea247b3ced3d3ee6c67746cc6
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.InteractionHand;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
index b56e4be3228489b5b910c23bde1717d5d3e2ad9a..e22b91b7ac53ce8d3b7a39bda4525f82e187fc45 100644
index 182e16c1d968707a11329150d71b7d01df6c6e52..fa5cade3f5f2fecc37cc065b96403d0a1c1a2553 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
@@ -2,6 +2,8 @@ package net.minecraft.world.level.block.entity;
@ -69,7 +69,7 @@ index b56e4be3228489b5b910c23bde1717d5d3e2ad9a..e22b91b7ac53ce8d3b7a39bda4525f82
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
@@ -16,6 +18,7 @@ import net.minecraft.world.level.block.JigsawBlock;
@@ -17,6 +19,7 @@ import net.minecraft.world.level.block.JigsawBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement;
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
@ -77,7 +77,7 @@ index b56e4be3228489b5b910c23bde1717d5d3e2ad9a..e22b91b7ac53ce8d3b7a39bda4525f82
public class JigsawBlockEntity extends BlockEntity {
public static final String TARGET = "target";
@@ -106,6 +109,16 @@ public class JigsawBlockEntity extends BlockEntity {
@@ -107,6 +110,16 @@ public class JigsawBlockEntity extends BlockEntity {
}
public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) {
@ -92,7 +92,7 @@ index b56e4be3228489b5b910c23bde1717d5d3e2ad9a..e22b91b7ac53ce8d3b7a39bda4525f82
+ // Scissors end
+
BlockPos blockPos = this.getBlockPos().relative(this.getBlockState().getValue(JigsawBlock.ORIENTATION).front());
Registry<StructureTemplatePool> registry = world.registryAccess().registryOrThrow(Registry.TEMPLATE_POOL_REGISTRY);
Registry<StructureTemplatePool> registry = world.registryAccess().registryOrThrow(Registries.TEMPLATE_POOL);
// Paper start - Replace getHolderOrThrow with a null check
diff --git a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
index 9792bf3ee083f571f1f4089d30beb586839f5f6b..e9d584b0ca984f9b7c70f99e1665cdedecb710e1 100644

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add spectator teleport event
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c7d7711be1bd17a25c98578ad68154255135facd..21f2fa5b1e0eb2cdf73a0f3b6e4fec1c63fac062 100644
index ff72911cca59528f7090533e52450a59ea50a92a..8d626169874c4188e2a9bc214b1c0af9689b11b3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1,5 +1,6 @@
@ -15,7 +15,7 @@ index c7d7711be1bd17a25c98578ad68154255135facd..21f2fa5b1e0eb2cdf73a0f3b6e4fec1c
import com.google.common.collect.Lists;
import com.google.common.primitives.Floats;
import com.mojang.brigadier.ParseResults;
@@ -2077,6 +2078,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2072,6 +2073,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Entity entity = packet.getEntity(worldserver);
if (entity != null) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent invalid container events
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 21f2fa5b1e0eb2cdf73a0f3b6e4fec1c63fac062..ad44b5b98babdd16fd9cfadb052cb7b6ba963ea1 100644
index 8d626169874c4188e2a9bc214b1c0af9689b11b3..53a71e699e885aa36fcc07f04fb5f15e4661b7f2 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -29,6 +29,8 @@ import java.util.function.UnaryOperator;
@ -17,7 +17,7 @@ index 21f2fa5b1e0eb2cdf73a0f3b6e4fec1c63fac062..ad44b5b98babdd16fd9cfadb052cb7b6
import net.minecraft.ChatFormatting;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
@@ -3098,6 +3100,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2952,6 +2954,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleContainerClick(ServerboundContainerClickPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (this.player.isImmobile()) return; // CraftBukkit
@ -25,7 +25,7 @@ index 21f2fa5b1e0eb2cdf73a0f3b6e4fec1c63fac062..ad44b5b98babdd16fd9cfadb052cb7b6
this.player.resetLastActionTime();
if (this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu.stillValid(this.player)) { // CraftBukkit
boolean cancelled = this.player.isSpectator(); // CraftBukkit - see below if
@@ -3119,6 +3122,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2973,6 +2976,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Do not attempt to cast items to recipes
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index 8847a3b3cec47bd36670b77cedab4ef66a8c9270..b07757bbaf61303368763c681b4096f730e17a4c 100644
index f734cba350ed85dbbf52ff527c9bb14b9eb04c86..68912cc2bd670944465e6819d82c4aad6b7b324a 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -648,6 +648,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
@@ -642,6 +642,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
Entry<ResourceLocation> entry = (Entry) objectiterator.next();
worldserver.getRecipeManager().byKey((ResourceLocation) entry.getKey()).ifPresent((irecipe) -> {

View File

@ -388,10 +388,10 @@ index 0000000000000000000000000000000000000000..e08f502fc7165f9f466217910210edb5
+}
+
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 88ef769abfa163f923258d1f83d47b28c491eaca..632dfd34829515893a07b35dfa91302188d67a3c 100644
index 31faf2d6492696f7d0c99a48edbc0d6f15db1209..d6d3e802648eaf001f6e8143a361053ab41c5291 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -118,6 +118,7 @@ public class Main {
@@ -121,6 +121,7 @@ public class Main {
// Paper start - load config files for access below if needed
org.bukkit.configuration.file.YamlConfiguration bukkitConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("bukkit-settings"));
org.bukkit.configuration.file.YamlConfiguration spigotConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("spigot-settings"));
@ -400,10 +400,10 @@ index 88ef769abfa163f923258d1f83d47b28c491eaca..632dfd34829515893a07b35dfa913021
Path path1 = Paths.get("eula.txt");
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index ff3eced0e20c39b825586897ee2fed01dd471d88..a991be4e8a9836b50eca5d58e14773134aab9b79 100644
index 51b3db0b6c2cede95b584268e035c0fb36d38094..f8e49559657c1a2788a3aa8a15df6da7491c3fda 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -226,7 +226,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -221,7 +221,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
// Paper end
@ -421,10 +421,10 @@ index ff3eced0e20c39b825586897ee2fed01dd471d88..a991be4e8a9836b50eca5d58e1477313
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
this.setMotd(dedicatedserverproperties.motd);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6042a736a7af975331bcfeeae48529368a3057b1..9863921b98730976fad0da814c4e311bd9fe2a8a 100644
index 653c34ae4a5f55773f0c4af54c8cbb426ddb7d7b..9a2ed55bc6837875adfbf623b1cabf605801d5b4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -965,6 +965,8 @@ public final class CraftServer implements Server {
@@ -978,6 +978,8 @@ public final class CraftServer implements Server {
}
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
@ -433,7 +433,7 @@ index 6042a736a7af975331bcfeeae48529368a3057b1..9863921b98730976fad0da814c4e311b
this.console.paperConfigurations.reloadConfigs(this.console);
for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
@@ -996,6 +998,7 @@ public final class CraftServer implements Server {
@@ -1009,6 +1011,7 @@ public final class CraftServer implements Server {
this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
@ -441,7 +441,7 @@ index 6042a736a7af975331bcfeeae48529368a3057b1..9863921b98730976fad0da814c4e311b
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -2736,6 +2739,12 @@ public final class CraftServer implements Server {
@@ -2760,6 +2763,12 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}
@ -455,7 +455,7 @@ index 6042a736a7af975331bcfeeae48529368a3057b1..9863921b98730976fad0da814c4e311b
public void 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
index 604662cd3ac1e0a9b956d1a3078afa9e16beb473..96ee05b115d88a60e7953e3f0f7c1b8095ebf360 100644
index 21db4153a9eb5e52ff357b4146ae4302029d5cd5..f5b5eb6686684791c281604bd308107427861af2 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -173,6 +173,22 @@ public class Main {

View File

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

View File

@ -34,7 +34,7 @@ index 1aa418ef5e400aabdf17dbe81da6cee6a1f63d96..9cd5ffca69df27f794f5a72e687fc6b3
{
config.set(path, val);
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 58599ead28c25a76d9f41d2d29ee8024c9afdccd..a4ea00cbe0cae3664391d3b84a0e6956a3253491 100644
index 4da4edae517a0efec6e03a719ec47b700509dab1..1ec83cbfc2860e1153be301eefb628e209bf9186 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -1,11 +1,13 @@
@ -59,7 +59,7 @@ index 58599ead28c25a76d9f41d2d29ee8024c9afdccd..a4ea00cbe0cae3664391d3b84a0e6956
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.FormattedCharSequence;
@@ -23,6 +26,8 @@ import net.minecraft.world.item.DyeColor;
@@ -24,6 +27,8 @@ import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
@ -68,7 +68,7 @@ index 58599ead28c25a76d9f41d2d29ee8024c9afdccd..a4ea00cbe0cae3664391d3b84a0e6956
public class SignBlockEntity extends BlockEntity implements CommandSource { // CraftBukkit - implements
private static final boolean CONVERT_LEGACY_SIGNS = Boolean.getBoolean("convertLegacySigns"); // Paper
@@ -234,7 +239,21 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
@@ -270,7 +275,21 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
if (!event.callEvent()) {
return false;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent velocity freeze
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
index a603d99430aedb3c242c2833e0cc8a31aba49205..2be290fac27b0a8dea163f4337fcd19c0ee87168 100644
index d73c10167c9100615cd5180f5e5d09b00f7bdc2a..569d0eb30f3f8043197254bceaa4a702110d5e7c 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
@@ -41,9 +41,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
@@ -42,9 +42,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
if (d6 != 0.0D) {
@ -25,7 +25,7 @@ index a603d99430aedb3c242c2833e0cc8a31aba49205..2be290fac27b0a8dea163f4337fcd19c
}
}
@@ -150,6 +154,25 @@ public abstract class AbstractHurtingProjectile extends Projectile {
@@ -151,6 +155,25 @@ public abstract class AbstractHurtingProjectile extends Projectile {
nbt.put("power", this.newDoubleList(new double[]{this.xPower, this.yPower, this.zPower}));
}
@ -51,7 +51,7 @@ index a603d99430aedb3c242c2833e0cc8a31aba49205..2be290fac27b0a8dea163f4337fcd19c
@Override
public void readAdditionalSaveData(CompoundTag nbt) {
super.readAdditionalSaveData(nbt);
@@ -157,9 +180,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
@@ -158,9 +181,13 @@ public abstract class AbstractHurtingProjectile extends Projectile {
ListTag nbttaglist = nbt.getList("power", 6);
if (nbttaglist.size() == 3) {
@ -68,7 +68,7 @@ index a603d99430aedb3c242c2833e0cc8a31aba49205..2be290fac27b0a8dea163f4337fcd19c
}
}
@@ -193,9 +220,12 @@ public abstract class AbstractHurtingProjectile extends Projectile {
@@ -194,9 +221,12 @@ public abstract class AbstractHurtingProjectile extends Projectile {
Vec3 vec3d = entity.getLookAngle();
this.setDeltaMovement(vec3d);