Archiviert
13
0
Dieser Commit ist enthalten in:
Bjarne Koll 2024-06-14 11:59:44 +02:00
Ursprung 4140de28eb
Commit 6d4e235784
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 27F6CCCF55D2EE62
45 geänderte Dateien mit 190 neuen und 443 gelöschten Zeilen

Datei anzeigen

@ -6342,7 +6342,7 @@ index 5d4336210e11ee39521b4096a5f0874329053cdc..526d5b9bd6ce8eade59d3d3cf8bd7ad7
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 419a27a8bdc8adfeb6ea89e3bfe1838a80d75a33..ce0d22452171857e3cf070bf01450a7653ec7142 100644 index 5b920beb39dad8d392b4e5e12a89880720e41942..319f51eb8adde7584c74780ac0539f4b8ef8fe7f 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -170,6 +170,62 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -170,6 +170,62 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -978,7 +978,7 @@ index d38ecbc208c34509eaf77751ac45d9ef51a5dce8..b51c3f8c485496734ea58c15377a1215
// CraftBukkit end // CraftBukkit end
} }
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index ce0d22452171857e3cf070bf01450a7653ec7142..6581566ca4e4fac0691e4f5851f8895d9ac7a38f 100644 index 319f51eb8adde7584c74780ac0539f4b8ef8fe7f..ddadb0f13b96a39ec89cdaeea7bc02ee62ef2a06 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,8 +1,10 @@ @@ -1,8 +1,10 @@

Datei anzeigen

@ -19,10 +19,10 @@ index b24e8255ab18eb5b2e4968aa62aa3d72ef33f0eb..12b7d50f49a2184aaf220a4a50a137b2
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index 4091d4d68b58bdefb2fdac1815e351d4f7c8a523..b7d0a48f38f0d8ae586012bb4e9a9faec21103c2 100644 index 40f2f4d052add3b4270d29c843e49fb621e1bc8d..df099d4c7f101f50d40dae99b45c271b02712434 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -134,6 +134,11 @@ public class RegionFileStorage implements AutoCloseable { @@ -134,6 +134,11 @@ public final class RegionFileStorage implements AutoCloseable {
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException { protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit
@ -34,7 +34,7 @@ index 4091d4d68b58bdefb2fdac1815e351d4f7c8a523..b7d0a48f38f0d8ae586012bb4e9a9fae
if (nbt == null) { if (nbt == null) {
regionfile.clear(pos); regionfile.clear(pos);
@@ -158,7 +163,18 @@ public class RegionFileStorage implements AutoCloseable { @@ -158,7 +163,18 @@ public final class RegionFileStorage implements AutoCloseable {
dataoutputstream.close(); dataoutputstream.close();
} }
} }

Datei anzeigen

@ -11,10 +11,10 @@ The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap).
The maximum size of the RegionFileCache is also made configurable. The maximum size of the RegionFileCache is also made configurable.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index b7d0a48f38f0d8ae586012bb4e9a9faec21103c2..7d4aa3d375bde32e0d2606346202929d481acad0 100644 index df099d4c7f101f50d40dae99b45c271b02712434..491035aaefff4ee96435ec5d3f9417e28eae0796 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -39,7 +39,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -39,7 +39,7 @@ public final class RegionFileStorage implements AutoCloseable {
if (regionfile != null) { if (regionfile != null) {
return regionfile; return regionfile;
} else { } else {

Datei anzeigen

@ -9,7 +9,7 @@ from triggering monster spawns on a server.
Also a highly more effecient way to blanket block spawns in a world Also a highly more effecient way to blanket block spawns in a world
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 6581566ca4e4fac0691e4f5851f8895d9ac7a38f..c96346bd0207537899d266fe2c8f29a1663e10c3 100644 index ddadb0f13b96a39ec89cdaeea7bc02ee62ef2a06..d04b69838c6f5fd1808782cacb31c6e00087bbac 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1101,7 +1101,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1101,7 +1101,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index c96346bd0207537899d266fe2c8f29a1663e10c3..e2f176d34443f0d1b00649efa45c65138042a015 100644 index d04b69838c6f5fd1808782cacb31c6e00087bbac..96b7f0ac35a1e87c3f78a24180b207c32749fb71 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1321,6 +1321,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1321,6 +1321,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -8,7 +8,7 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
Also ignores Enderdragon, defaulting it to Mojang's setting Also ignores Enderdragon, defaulting it to Mojang's setting
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index e2f176d34443f0d1b00649efa45c65138042a015..3784fbe3548727ab5ad8cfefef2d8d594a76123f 100644 index 96b7f0ac35a1e87c3f78a24180b207c32749fb71..795c81c8f6fa59eded8b5a5084a8acb46d118fdb 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1613,6 +1613,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1613,6 +1613,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -7,7 +7,7 @@ Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing. Stack will identify any causer of this and warn instead of crashing.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 3784fbe3548727ab5ad8cfefef2d8d594a76123f..5732aded2e4dbeea84dbe6ebac71c2ad5ce4729a 100644 index 795c81c8f6fa59eded8b5a5084a8acb46d118fdb..1709821c73362b2ae54681ec1d59b40bfa9335b3 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1308,6 +1308,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1308,6 +1308,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -31,7 +31,7 @@ delays anymore.
public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 5732aded2e4dbeea84dbe6ebac71c2ad5ce4729a..d1247df5c51b0d377a27ea7cc5b5a2d1f1bf9b32 100644 index 1709821c73362b2ae54681ec1d59b40bfa9335b3..68a1cc5f4f7f5997dfb7d40647e3e027c23ffb14 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1315,6 +1315,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1315,6 +1315,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -7,7 +7,7 @@ Reference2BooleanOpenHashMap is going to have
better lookups than HashMap. better lookups than HashMap.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index d1247df5c51b0d377a27ea7cc5b5a2d1f1bf9b32..cf7c7813d528429a18dc25051df7fc06dc159930 100644 index 68a1cc5f4f7f5997dfb7d40647e3e027c23ffb14..77f064fb4437c1d98cf91dde98d4d88b28afa7c8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1529,7 +1529,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1529,7 +1529,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -44,10 +44,10 @@ index 12b7d50f49a2184aaf220a4a50a137b217c57124..f1237f6fd6414900ffbad0caee31aa83
public void close() throws IOException { public void close() throws IOException {
ByteBuffer bytebuffer = ByteBuffer.wrap(this.buf, 0, this.count); ByteBuffer bytebuffer = ByteBuffer.wrap(this.buf, 0, this.count);
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index 7d4aa3d375bde32e0d2606346202929d481acad0..36e914b26de070035f195f67c65ee1df0d10daf0 100644 index 491035aaefff4ee96435ec5d3f9417e28eae0796..4c1212c6ef48594e766fa9e35a6e15916602d587 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -147,10 +147,17 @@ public class RegionFileStorage implements AutoCloseable { @@ -147,10 +147,17 @@ public final class RegionFileStorage implements AutoCloseable {
try { try {
NbtIo.write(nbt, (DataOutput) dataoutputstream); NbtIo.write(nbt, (DataOutput) dataoutputstream);
@ -66,7 +66,7 @@ index 7d4aa3d375bde32e0d2606346202929d481acad0..36e914b26de070035f195f67c65ee1df
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
throwable.addSuppressed(throwable1); throwable.addSuppressed(throwable1);
} }
@@ -158,10 +165,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -158,10 +165,7 @@ public final class RegionFileStorage implements AutoCloseable {
throw throwable; throw throwable;
} }
@ -78,7 +78,7 @@ index 7d4aa3d375bde32e0d2606346202929d481acad0..36e914b26de070035f195f67c65ee1df
} }
// Paper start - Chunk save reattempt // Paper start - Chunk save reattempt
return; return;
@@ -208,4 +212,13 @@ public class RegionFileStorage implements AutoCloseable { @@ -208,4 +212,13 @@ public final class RegionFileStorage implements AutoCloseable {
public RegionStorageInfo info() { public RegionStorageInfo info() {
return this.info; return this.info;
} }

Datei anzeigen

@ -85,7 +85,7 @@ index 6854ca4d4fec2b4fa541c3fabf63787665572609..e7b444a10b244828827b3c66c5346520
} }
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index cf7c7813d528429a18dc25051df7fc06dc159930..ef46d904fa49a779c235971883380b3e33e6dba1 100644 index 77f064fb4437c1d98cf91dde98d4d88b28afa7c8..ccbd527803a2a4e911a01f815cc9c7ab785af836 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1091,7 +1091,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1091,7 +1091,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Player Entity Tracking Events
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index ef46d904fa49a779c235971883380b3e33e6dba1..8eae75993ad60226a86456487f3b3a59999ab423 100644 index ccbd527803a2a4e911a01f815cc9c7ab785af836..e2521e1a56df8dcb1de815e5973de952408d3b8b 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1601,7 +1601,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1601,7 +1601,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Configurable entity tracking range by Y coordinate
Options to configure entity tracking by Y coordinate, also for each entity category. Options to configure entity tracking by Y coordinate, also for each entity category.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 8eae75993ad60226a86456487f3b3a59999ab423..38df456d3646c384d17ae9aec60c18fcd0651b4b 100644 index e2521e1a56df8dcb1de815e5973de952408d3b8b..6c5557aad2455b79bb2adf8939eb9a6127ccc3c3 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1593,6 +1593,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1593,6 +1593,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Don't check if we can see non-visible entities
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 38df456d3646c384d17ae9aec60c18fcd0651b4b..cf4517e57169856acd0782e5ced4eb8c045b8d78 100644 index 6c5557aad2455b79bb2adf8939eb9a6127ccc3c3..469f1dcb22c06025681e727e281b5b53f2b21c1f 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1604,7 +1604,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1604,7 +1604,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -18,7 +18,7 @@ index a043ac10834562d357ef0b5aded2e916e2a0d056..74276c368016fcc4dbf9579b2ecbadc9
@VisibleForTesting @VisibleForTesting
static long encode(double value) { static long encode(double value) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index cf4517e57169856acd0782e5ced4eb8c045b8d78..6129720c9da217745fcd281186de7894597c267c 100644 index 469f1dcb22c06025681e727e281b5b53f2b21c1f..2ce7da9707d7c1a48b5609ae51a516d599d7aee8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1587,10 +1587,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1587,10 +1587,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

Datei anzeigen

@ -13,10 +13,10 @@ A config is provided if you rather let players use these exploits, and let
them destroy the worlds End Portals and get on top of the nether easy. them destroy the worlds End Portals and get on top of the nether easy.
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 4107756fb31e4ad99f643184118d877aef09e9f4..ef40b996864c81d7e8fbb0727ea0a96f866c725f 100644 index 69914a048987c21ee2ed2c489aab269862fda8f2..bff83fe413c7baef4ba56a3270ea4463a58c792f 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java --- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -192,6 +192,7 @@ public class Explosion { @@ -193,6 +193,7 @@ public class Explosion {
for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) { for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) {
BlockPos blockposition = BlockPos.containing(d4, d5, d6); BlockPos blockposition = BlockPos.containing(d4, d5, d6);
BlockState iblockdata = this.level.getBlockState(blockposition); BlockState iblockdata = this.level.getBlockState(blockposition);
@ -25,10 +25,10 @@ index 4107756fb31e4ad99f643184118d877aef09e9f4..ef40b996864c81d7e8fbb0727ea0a96f
if (!this.level.isInWorldBounds(blockposition)) { if (!this.level.isInWorldBounds(blockposition)) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index ee49f59ba8ce5708fc5e244eba7b1f910cf69263..d3d7abb2d31e8ce9f9c53eca66a83a1c28fec792 100644 index 4d6409875771413de7ae20def2aaad4049709c30..dd519eacd6d4bea5447bea471f0ac6540d9bb49c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -533,6 +533,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -449,6 +449,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) { public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
// CraftBukkit start - tree generation // CraftBukkit start - tree generation
if (this.captureTreeGeneration) { if (this.captureTreeGeneration) {
@ -40,10 +40,10 @@ index ee49f59ba8ce5708fc5e244eba7b1f910cf69263..d3d7abb2d31e8ce9f9c53eca66a83a1c
if (blockstate == null) { if (blockstate == null) {
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags); blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 7f0c0ca49e7575c18935b71e3180d112440289f7..054593fc0b8d13f6bf449cc20a1f7ddfd5f1d1f0 100644 index bf52c36f31992a01a7403d8c85151327c9e944c4..45704653310efe9cb755a644674b54b8722c2c84 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java --- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -90,6 +90,19 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -89,6 +89,19 @@ public class Block extends BlockBehaviour implements ItemLike {
protected final StateDefinition<Block, BlockState> stateDefinition; protected final StateDefinition<Block, BlockState> stateDefinition;
private BlockState defaultBlockState; private BlockState defaultBlockState;
// Paper start // Paper start
@ -106,10 +106,10 @@ index e6bfbe2588e0c2a1be14e38d654e889d392ad4db..e0c62227b279a5fe0f3868fbf9ce8c78
world.playSound((Player) null, pos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F); world.playSound((Player) null, pos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F);
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index c7da359c525522b55763e594a1db0c26a026b73f..55efd0d379bac79935f62446cd3479d1e59361a4 100644 index 936b56c116de63b38a416d5bab4223a88d0469d0..6c4a339be29bb9c07b741a1ca12de2217c8687ba 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -174,7 +174,7 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -173,7 +173,7 @@ public abstract class BlockBehaviour implements FeatureElement {
} }
protected void onExplosionHit(BlockState state, Level world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stackMerger) { protected void onExplosionHit(BlockState state, Level world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stackMerger) {
@ -118,7 +118,7 @@ index c7da359c525522b55763e594a1db0c26a026b73f..55efd0d379bac79935f62446cd3479d1
Block block = state.getBlock(); Block block = state.getBlock();
boolean flag = explosion.getIndirectSourceEntity() instanceof Player; boolean flag = explosion.getIndirectSourceEntity() instanceof Player;
@@ -254,7 +254,7 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -253,7 +253,7 @@ public abstract class BlockBehaviour implements FeatureElement {
} }
protected boolean canBeReplaced(BlockState state, BlockPlaceContext context) { protected boolean canBeReplaced(BlockState state, BlockPlaceContext context) {
@ -127,7 +127,7 @@ index c7da359c525522b55763e594a1db0c26a026b73f..55efd0d379bac79935f62446cd3479d1
} }
protected boolean canBeReplaced(BlockState state, Fluid fluid) { protected boolean canBeReplaced(BlockState state, Fluid fluid) {
@@ -896,6 +896,12 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -888,6 +888,12 @@ public abstract class BlockBehaviour implements FeatureElement {
return this.legacySolid; return this.legacySolid;
} }
@ -140,7 +140,7 @@ index c7da359c525522b55763e594a1db0c26a026b73f..55efd0d379bac79935f62446cd3479d1
public boolean isValidSpawn(BlockGetter world, BlockPos pos, EntityType<?> type) { public boolean isValidSpawn(BlockGetter world, BlockPos pos, EntityType<?> type) {
return this.getBlock().properties.isValidSpawn.test(this.asState(), world, pos, type); return this.getBlock().properties.isValidSpawn.test(this.asState(), world, pos, type);
} }
@@ -999,7 +1005,7 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -991,7 +997,7 @@ public abstract class BlockBehaviour implements FeatureElement {
} }
public PushReaction getPistonPushReaction() { public PushReaction getPistonPushReaction() {
@ -150,10 +150,10 @@ index c7da359c525522b55763e594a1db0c26a026b73f..55efd0d379bac79935f62446cd3479d1
public boolean isSolidRender(BlockGetter world, BlockPos pos) { public boolean isSolidRender(BlockGetter world, BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
index 03dd833d61d5152af3032f23dd1fc4c75da9bc4f..a61959700d5e00739a79eaa617ac383160335f26 100644 index 5c4b2a33d4007c36aef68604bca40a4eba510b4e..fd04a50183ccb1f21fc6efa70256e1bb4db2d6d4 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
@@ -221,6 +221,13 @@ public class PortalForcer { @@ -207,6 +207,13 @@ public class PortalForcer {
for (int j = -1; j < 3; ++j) { for (int j = -1; j < 3; ++j) {
for (int k = -1; k < 4; ++k) { for (int k = -1; k < 4; ++k) {
temp.setWithOffset(pos, portalDirection.getStepX() * j + enumdirection1.getStepX() * distanceOrthogonalToPortal, k, portalDirection.getStepZ() * j + enumdirection1.getStepZ() * distanceOrthogonalToPortal); temp.setWithOffset(pos, portalDirection.getStepX() * j + enumdirection1.getStepX() * distanceOrthogonalToPortal, k, portalDirection.getStepZ() * j + enumdirection1.getStepZ() * distanceOrthogonalToPortal);

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add config for mobs immune to default effects
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
index c23d4ee0a16d1ae7168b2496d97189a14256bdcc..7ddca52f7fe3f289b4b867e134326b1ead1a2aee 100644 index 62271e74399a827a488159da234465ef18e15e6e..d3b4d492aee380dc17f4232d90eaae4f07bb9f86 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -604,7 +604,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @@ -604,7 +604,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
@ -18,7 +18,7 @@ index c23d4ee0a16d1ae7168b2496d97189a14256bdcc..7ddca52f7fe3f289b4b867e134326b1e
private class WitherDoNothingGoal extends Goal { private class WitherDoNothingGoal extends Goal {
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
index ef8911f7bcf6a97496675abb4689bb09cf322e85..fa0316e9d2a4cf213982994dc8bf310299cca984 100644 index f0127f1b55999aa4a841341ad02cbcde45702b50..e675f1e3e5b6f9e1aa0d928ebb9abe76458edb38 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java --- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java +++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
@@ -126,7 +126,7 @@ public class Spider extends Monster { @@ -126,7 +126,7 @@ public class Spider extends Monster {
@ -31,10 +31,10 @@ index ef8911f7bcf6a97496675abb4689bb09cf322e85..fa0316e9d2a4cf213982994dc8bf3102
public boolean isClimbing() { public boolean isClimbing() {
diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
index 05e9b083f7e49bd7a24f04fd2c46acef6d011e48..3f1191795e58f31b7e2fe34ef2774df13b9a789f 100644 index 56f23d7c7b5838ff8761de8691e685dd59d2eaa2..bb2e7cee612dc1fafa042674a0b0d07d7165b54c 100644
--- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java --- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
@@ -113,6 +113,6 @@ public class WitherSkeleton extends AbstractSkeleton { @@ -114,6 +114,6 @@ public class WitherSkeleton extends AbstractSkeleton {
@Override @Override
public boolean canBeAffected(MobEffectInstance effect) { public boolean canBeAffected(MobEffectInstance effect) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Deep clone nbt tags in PDC
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 e3ac829ae4f2b39c103e5626180ec9220c2b1f33..2b131cc6f511416d4c8964848caff373a9c6325d 100644 index 758e01a05f5ca88f72ea3d54a7cdc49bbfadfaf5..737b325f87bcaa8871dbed5deec01215a1f11bf7 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
@@ -307,7 +307,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -318,7 +318,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.damage = meta.damage; this.damage = meta.damage;
this.maxDamage = meta.maxDamage; this.maxDamage = meta.maxDamage;
this.unhandledTags = meta.unhandledTags; this.unhandledTags = meta.unhandledTags;
@ -17,7 +17,7 @@ index e3ac829ae4f2b39c103e5626180ec9220c2b1f33..2b131cc6f511416d4c8964848caff373
this.customTag = meta.customTag; this.customTag = meta.customTag;
@@ -1601,7 +1601,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1641,7 +1641,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
if (this.customTag != null) { if (this.customTag != null) {
clone.customTag = this.customTag.copy(); clone.customTag = this.customTag.copy();
} }

Datei anzeigen

@ -8,15 +8,15 @@ it will not disable the shield if the attacker is holding
an axe item. an axe item.
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 4928dc3c879ddad0fe8c377b1b26e543a1c40cca..6118de380a95b0c927a239ac3e288780f114289e 100644 index d535bb7adff273c9d4cdaac73f7dfe5bbd663c15..890d453fa5ee4b167ec83cce8e2882e2e4585b14 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
@@ -2325,7 +2325,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -2325,7 +2325,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING)); this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING));
Entity entity = damagesource.getDirectEntity(); Entity entity = damagesource.getDirectEntity();
- if (entity instanceof LivingEntity && entity.distanceToSqr(this) <= (200.0D * 200.0D)) { // Paper - Improve boat collision performance - if (entity instanceof LivingEntity) {
+ if (!damagesource.is(DamageTypeTags.IS_PROJECTILE) && entity instanceof LivingEntity && entity.distanceToSqr(this) <= (200.0D * 200.0D)) { // Paper - Improve boat collision performance + if (!damagesource.is(DamageTypeTags.IS_PROJECTILE) && entity instanceof LivingEntity) { // Paper - Fix shield disable inconsistency
this.blockUsingShield((LivingEntity) entity); this.blockUsingShield((LivingEntity) entity);
} }
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Don't lose removed data components in ItemMeta
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 2b131cc6f511416d4c8964848caff373a9c6325d..b525bfbab2c4a5ea408981287f477a8b35d699ca 100644 index 737b325f87bcaa8871dbed5deec01215a1f11bf7..8a5785565d71f3f74a9ce0179a26dbff5530023d 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
@@ -191,6 +191,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -196,6 +196,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this; return this;
} }
@ -22,7 +22,7 @@ index 2b131cc6f511416d4c8964848caff373a9c6325d..b525bfbab2c4a5ea408981287f477a8b
DataComponentPatch build() { DataComponentPatch build() {
return this.builder.build(); return this.builder.build();
} }
@@ -410,7 +417,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -424,7 +431,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
Set<Map.Entry<DataComponentType<?>, Optional<?>>> keys = tag.entrySet(); Set<Map.Entry<DataComponentType<?>, Optional<?>>> keys = tag.entrySet();
for (Map.Entry<DataComponentType<?>, Optional<?>> key : keys) { for (Map.Entry<DataComponentType<?>, Optional<?>> key : keys) {
@ -33,7 +33,7 @@ index 2b131cc6f511416d4c8964848caff373a9c6325d..b525bfbab2c4a5ea408981287f477a8b
key.getValue().ifPresentOrElse((value) -> { key.getValue().ifPresentOrElse((value) -> {
this.unhandledTags.set((DataComponentType) key.getKey(), value); this.unhandledTags.set((DataComponentType) key.getKey(), value);
}, () -> { }, () -> {
@@ -809,9 +818,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -832,9 +841,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
for (Map.Entry<DataComponentType<?>, Optional<?>> e : this.unhandledTags.build().entrySet()) { for (Map.Entry<DataComponentType<?>, Optional<?>> e : this.unhandledTags.build().entrySet()) {

Datei anzeigen

@ -7,10 +7,10 @@ If a players inventory is too big to send in a single packet,
split the inventory set into multiple packets instead. split the inventory set into multiple packets instead.
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 7fb162fa031fd76aa9a94f5fdaa3e32ceb9b9abc..58d28b6c1cc7da7d786f78308db971f7502ad844 100644 index a8dfe7a4b3d01bf75587be078f471d1ef1d7a667..ea16dfa718b526d6520d7fcfc21d28f972f1f2bf 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -180,6 +180,21 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -176,6 +176,21 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
} }
public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) { public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) {
@ -71,7 +71,7 @@ index 046bfc212b640de174b300e7a05cc30bb3cac93e..af3ec112e142a2c91c46882dad6180b1
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/network/protocol/Packet.java b/src/main/java/net/minecraft/network/protocol/Packet.java diff --git a/src/main/java/net/minecraft/network/protocol/Packet.java b/src/main/java/net/minecraft/network/protocol/Packet.java
index 5ee2ba1225fb7e4f02152b45adeb66f79ed1650d..c9d283b7fc9ede79dc6cbc39dfc9e7ae986a6a47 100644 index 4c776c591dd0a7b36945a6487fdfe86d1187b4af..82fc12ffbd1585b4a8d09a025914830af77b0f8d 100644
--- a/src/main/java/net/minecraft/network/protocol/Packet.java --- a/src/main/java/net/minecraft/network/protocol/Packet.java
+++ b/src/main/java/net/minecraft/network/protocol/Packet.java +++ b/src/main/java/net/minecraft/network/protocol/Packet.java
@@ -11,6 +11,19 @@ public interface Packet<T extends PacketListener> { @@ -11,6 +11,19 @@ public interface Packet<T extends PacketListener> {
@ -121,10 +121,10 @@ index 7e555ece0555b3d2a983ab2c39c5e7ec23fc7e88..8cca2ac616a2c80268c96b9f95e33f83
buf.writeByte(this.containerId); buf.writeByte(this.containerId);
buf.writeVarInt(this.stateId); buf.writeVarInt(this.stateId);
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 2501fbaf497d226051800c53d60a39bbc80db91c..0a8d07bf68b0ceabd13c70196d357fce79dcc2c3 100644 index ec1cb034d840633240f2b379b09f7d2f1c8971a5..cf8fd671490863e126c059157e1ca234e6509d9f 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
@@ -80,7 +80,7 @@ public class ClientboundLevelChunkPacketData { @@ -52,7 +52,7 @@ public class ClientboundLevelChunkPacketData {
throw new RuntimeException("Can't read heightmap in packet for [" + x + ", " + z + "]"); throw new RuntimeException("Can't read heightmap in packet for [" + x + ", " + z + "]");
} else { } else {
int i = buf.readVarInt(); int i = buf.readVarInt();

Datei anzeigen

@ -33,10 +33,10 @@ index fca0cfba14dd2cc6f24b56eaf269594b2d87fd04..8734f0b777432cd8639094b75a3da1b9
@Override @Override
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 b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826484c16db 100644 index 8a5785565d71f3f74a9ce0179a26dbff5530023d..dbcf9a27112ac525722fd9b80ec736797864bfdf 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
@@ -243,6 +243,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -250,6 +250,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
static final ItemMetaKeyType<Unit> HIDE_ADDITIONAL_TOOLTIP = new ItemMetaKeyType(DataComponents.HIDE_ADDITIONAL_TOOLTIP); static final ItemMetaKeyType<Unit> HIDE_ADDITIONAL_TOOLTIP = new ItemMetaKeyType(DataComponents.HIDE_ADDITIONAL_TOOLTIP);
@Specific(Specific.To.NBT) @Specific(Specific.To.NBT)
static final ItemMetaKeyType<CustomData> CUSTOM_DATA = new ItemMetaKeyType<>(DataComponents.CUSTOM_DATA); static final ItemMetaKeyType<CustomData> CUSTOM_DATA = new ItemMetaKeyType<>(DataComponents.CUSTOM_DATA);
@ -49,7 +49,7 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
// We store the raw original JSON representation of all text data. See SPIGOT-5063, SPIGOT-5656, SPIGOT-5304 // We store the raw original JSON representation of all text data. See SPIGOT-5063, SPIGOT-5656, SPIGOT-5304
private Component displayName; private Component displayName;
@@ -319,6 +325,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -330,6 +336,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.customTag = meta.customTag; this.customTag = meta.customTag;
this.version = meta.version; this.version = meta.version;
@ -60,7 +60,7 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
} }
CraftMetaItem(DataComponentPatch tag) { CraftMetaItem(DataComponentPatch tag) {
@@ -414,6 +424,20 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -428,6 +438,20 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.customTag = null; this.customTag = null;
} }
}); });
@ -81,7 +81,7 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
Set<Map.Entry<DataComponentType<?>, Optional<?>>> keys = tag.entrySet(); Set<Map.Entry<DataComponentType<?>, Optional<?>>> keys = tag.entrySet();
for (Map.Entry<DataComponentType<?>, Optional<?>> key : keys) { for (Map.Entry<DataComponentType<?>, Optional<?>> key : keys) {
@@ -603,7 +627,16 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -622,7 +646,16 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(unhandled)); ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(unhandled));
try { try {
CompoundTag unhandledTag = NbtIo.readCompressed(buf, NbtAccounter.unlimitedHeap()); CompoundTag unhandledTag = NbtIo.readCompressed(buf, NbtAccounter.unlimitedHeap());
@ -99,7 +99,7 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
} catch (IOException ex) { } catch (IOException ex) {
Logger.getLogger(CraftMetaItem.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(CraftMetaItem.class.getName()).log(Level.SEVERE, null, ex);
} }
@@ -817,6 +850,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -840,6 +873,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
itemTag.put(CraftMetaItem.MAX_DAMAGE, this.maxDamage); itemTag.put(CraftMetaItem.MAX_DAMAGE, this.maxDamage);
} }
@ -115,7 +115,7 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
for (Map.Entry<DataComponentType<?>, Optional<?>> e : this.unhandledTags.build().entrySet()) { for (Map.Entry<DataComponentType<?>, Optional<?>> e : this.unhandledTags.build().entrySet()) {
e.getValue().ifPresentOrElse((value) -> { e.getValue().ifPresentOrElse((value) -> {
itemTag.builder.set((DataComponentType) e.getKey(), value); itemTag.builder.set((DataComponentType) e.getKey(), value);
@@ -891,7 +933,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -914,7 +956,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Overridden @Overridden
boolean isEmpty() { boolean isEmpty() {
@ -124,8 +124,8 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
} }
// Paper start // Paper start
@@ -1544,6 +1586,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1583,6 +1625,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
&& (this.hasTool() ? that.hasTool() && this.tool.equals(that.tool) : !that.hasTool()) && (this.hasJukeboxPlayable() ? that.hasJukeboxPlayable() && this.jukebox.equals(that.jukebox) : !that.hasJukeboxPlayable())
&& (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage()) && (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage())
&& (this.hasMaxDamage() ? that.hasMaxDamage() && this.maxDamage.equals(that.maxDamage) : !that.hasMaxDamage()) && (this.hasMaxDamage() ? that.hasMaxDamage() && this.maxDamage.equals(that.maxDamage) : !that.hasMaxDamage())
+ && (this.canPlaceOnPredicates != null ? that.canPlaceOnPredicates != null && this.canPlaceOnPredicates.equals(that.canPlaceOnPredicates) : that.canPlaceOnPredicates == null) // Paper + && (this.canPlaceOnPredicates != null ? that.canPlaceOnPredicates != null && this.canPlaceOnPredicates.equals(that.canPlaceOnPredicates) : that.canPlaceOnPredicates == null) // Paper
@ -133,7 +133,7 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
&& (this.version == that.version); && (this.version == that.version);
} }
@@ -1587,6 +1631,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1627,6 +1671,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
hash = 61 * hash + (this.hasDamage() ? this.damage : 0); hash = 61 * hash + (this.hasDamage() ? this.damage : 0);
hash = 61 * hash + (this.hasMaxDamage() ? 1231 : 1237); hash = 61 * hash + (this.hasMaxDamage() ? 1231 : 1237);
hash = 61 * hash + (this.hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0); hash = 61 * hash + (this.hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0);
@ -142,7 +142,7 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
hash = 61 * hash + this.version; hash = 61 * hash + this.version;
return hash; return hash;
} }
@@ -1627,6 +1673,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1670,6 +1716,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
clone.damage = this.damage; clone.damage = this.damage;
clone.maxDamage = this.maxDamage; clone.maxDamage = this.maxDamage;
clone.version = this.version; clone.version = this.version;
@ -157,7 +157,7 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
return clone; return clone;
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
throw new Error(e); throw new Error(e);
@@ -1740,6 +1794,16 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1787,6 +1841,16 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
} }
@ -174,7 +174,7 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
if (!this.unhandledTags.isEmpty()) { if (!this.unhandledTags.isEmpty()) {
Tag unhandled = DataComponentPatch.CODEC.encodeStart(MinecraftServer.getDefaultRegistryAccess().createSerializationContext(NbtOps.INSTANCE), this.unhandledTags.build()).getOrThrow(IllegalStateException::new); Tag unhandled = DataComponentPatch.CODEC.encodeStart(MinecraftServer.getDefaultRegistryAccess().createSerializationContext(NbtOps.INSTANCE), this.unhandledTags.build()).getOrThrow(IllegalStateException::new);
try { try {
@@ -1750,6 +1814,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1797,6 +1861,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
Logger.getLogger(CraftMetaItem.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(CraftMetaItem.class.getName()).log(Level.SEVERE, null, ex);
} }
} }
@ -189,7 +189,7 @@ index b525bfbab2c4a5ea408981287f477a8b35d699ca..43a4a76d3829fb2ed7b5635d804fd826
if (!this.persistentDataContainer.isEmpty()) { // Store custom tags, wrapped in their compound if (!this.persistentDataContainer.isEmpty()) { // Store custom tags, wrapped in their compound
builder.put(CraftMetaItem.BUKKIT_CUSTOM_TAG.BUKKIT, this.persistentDataContainer.serialize()); builder.put(CraftMetaItem.BUKKIT_CUSTOM_TAG.BUKKIT, this.persistentDataContainer.serialize());
@@ -1888,6 +1960,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1936,6 +2008,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CraftMetaItem.MAX_DAMAGE.TYPE, CraftMetaItem.MAX_DAMAGE.TYPE,
CraftMetaItem.CUSTOM_DATA.TYPE, CraftMetaItem.CUSTOM_DATA.TYPE,
CraftMetaItem.ATTRIBUTES.TYPE, CraftMetaItem.ATTRIBUTES.TYPE,

Datei anzeigen

@ -7,10 +7,10 @@ Affect the falling stalactite damage type where the
reduction is not applied like in Vanilla reduction is not applied like in Vanilla
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 96070da795755f71e99979288e32b7d7e2d869fb..dfbe0914ab2771ac632fd064719878ac47559e9f 100644 index 0b1741cd68d5066114a35cc14ed08b57f4f08fb2..f769f249ada432ee400055deabdb5e4aeaa88c05 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1212,7 +1212,7 @@ public class CraftEventFactory { @@ -1213,7 +1213,7 @@ public class CraftEventFactory {
Map<DamageModifier, Function<? super Double, Double>> modifierFunctions = new EnumMap<>(DamageModifier.class); Map<DamageModifier, Function<? super Double, Double>> modifierFunctions = new EnumMap<>(DamageModifier.class);
modifiers.put(DamageModifier.BASE, rawDamage); modifiers.put(DamageModifier.BASE, rawDamage);
modifierFunctions.put(DamageModifier.BASE, CraftEventFactory.ZERO); modifierFunctions.put(DamageModifier.BASE, CraftEventFactory.ZERO);

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Revert to vanilla handling of LivingEntity#actuallyHurt
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 6118de380a95b0c927a239ac3e288780f114289e..d0b6ade676d94e768c92432dc6cee9f200acf5f2 100644 index 890d453fa5ee4b167ec83cce8e2882e2e4585b14..81b70e2dcf31ef651256a0ddf928c6370458c3dd 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
@@ -2210,7 +2210,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -2210,7 +2210,7 @@ public abstract class LivingEntity extends Entity implements Attackable {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] improve checking handled tags in itemmeta
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 7249ff939dfa786395595f687338315b779e0931..c0bf7efac56e558052992d2ce2455fccff4d9897 100644 index f6e84cccb0e805f73efe2c9625986c94099bb0d4..3c0d3faddcfcba74d90e1d5fccb60b891ef7c458 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -156,10 +156,11 @@ public final class CraftItemStack extends ItemStack { @@ -156,10 +156,11 @@ public final class CraftItemStack extends ItemStack {
@ -404,10 +404,10 @@ index b444bd26d6c3def3494d3cc0520e462408272be3..8e0dd4b7a7a25a8beb27b507047bc48d
getOrEmpty(tag, CraftMetaFirework.FIREWORKS).ifPresent((fireworks) -> { getOrEmpty(tag, CraftMetaFirework.FIREWORKS).ifPresent((fireworks) -> {
this.power = fireworks.flightDuration(); this.power = fireworks.flightDuration();
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 43a4a76d3829fb2ed7b5635d804fd826484c16db..5d86861a0df7308ae9b8440e5d9136fa7c8f1835 100644 index dbcf9a27112ac525722fd9b80ec736797864bfdf..5cdb9e07f79355e4590984b32be554053754ef5b 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
@@ -331,7 +331,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -342,7 +342,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
// Paper end // Paper end
} }
@ -416,7 +416,7 @@ index 43a4a76d3829fb2ed7b5635d804fd826484c16db..5d86861a0df7308ae9b8440e5d9136fa
CraftMetaItem.getOrEmpty(tag, CraftMetaItem.NAME).ifPresent((component) -> { CraftMetaItem.getOrEmpty(tag, CraftMetaItem.NAME).ifPresent((component) -> {
this.displayName = component; this.displayName = component;
}); });
@@ -439,11 +439,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -453,11 +453,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}); });
// Paper end - fix ItemFlags // Paper end - fix ItemFlags
@ -436,7 +436,7 @@ index 43a4a76d3829fb2ed7b5635d804fd826484c16db..5d86861a0df7308ae9b8440e5d9136fa
key.getValue().ifPresentOrElse((value) -> { key.getValue().ifPresentOrElse((value) -> {
this.unhandledTags.set((DataComponentType) key.getKey(), value); this.unhandledTags.set((DataComponentType) key.getKey(), value);
}, () -> { }, () -> {
@@ -1936,67 +1943,74 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1983,68 +1990,75 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.version = version; this.version = version;
} }
@ -460,6 +460,7 @@ index 43a4a76d3829fb2ed7b5635d804fd826484c16db..5d86861a0df7308ae9b8440e5d9136fa
- CraftMetaItem.RARITY.TYPE, - CraftMetaItem.RARITY.TYPE,
- CraftMetaItem.FOOD.TYPE, - CraftMetaItem.FOOD.TYPE,
- CraftMetaItem.TOOL.TYPE, - CraftMetaItem.TOOL.TYPE,
- CraftMetaItem.JUKEBOX_PLAYABLE.TYPE,
- CraftMetaItem.DAMAGE.TYPE, - CraftMetaItem.DAMAGE.TYPE,
- CraftMetaItem.MAX_DAMAGE.TYPE, - CraftMetaItem.MAX_DAMAGE.TYPE,
- CraftMetaItem.CUSTOM_DATA.TYPE, - CraftMetaItem.CUSTOM_DATA.TYPE,
@ -519,6 +520,7 @@ index 43a4a76d3829fb2ed7b5635d804fd826484c16db..5d86861a0df7308ae9b8440e5d9136fa
+ CraftMetaItem.RARITY.TYPE, + CraftMetaItem.RARITY.TYPE,
+ CraftMetaItem.FOOD.TYPE, + CraftMetaItem.FOOD.TYPE,
+ CraftMetaItem.TOOL.TYPE, + CraftMetaItem.TOOL.TYPE,
+ CraftMetaItem.JUKEBOX_PLAYABLE.TYPE,
+ CraftMetaItem.DAMAGE.TYPE, + CraftMetaItem.DAMAGE.TYPE,
+ CraftMetaItem.MAX_DAMAGE.TYPE, + CraftMetaItem.MAX_DAMAGE.TYPE,
+ CraftMetaItem.CUSTOM_DATA.TYPE, + CraftMetaItem.CUSTOM_DATA.TYPE,
@ -691,7 +693,7 @@ index 1c2b0407b51906a255e6d240fab969578743938e..b98e656c0bb382667bd186a500c5505f
getOrEmpty(tag, CraftMetaSpawnEgg.ENTITY_TAG).ifPresent((nbt) -> { getOrEmpty(tag, CraftMetaSpawnEgg.ENTITY_TAG).ifPresent((nbt) -> {
this.entityTag = nbt.copyTag(); this.entityTag = nbt.copyTag();
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
index 14e944b4e83b80e0fc6d81e346cc305ab00561c5..39cab624de062514358a2a2942aea0e58cbd6e3e 100644 index 8fc3cd507d333d2bdea759d7c102a56e88ad5f5a..f6b3798cf06f94d7e3e76d1b6e83236ded5b21e0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
@@ -34,8 +34,8 @@ public class CraftMetaSuspiciousStew extends CraftMetaItem implements Suspicious @@ -34,8 +34,8 @@ public class CraftMetaSuspiciousStew extends CraftMetaItem implements Suspicious

Datei anzeigen

@ -10,10 +10,10 @@ public org/bukkit/craftbukkit/block/CraftBlockStates getBlockState(Lorg/bukkit/W
public net/minecraft/world/level/block/entity/BlockEntity saveId(Lnet/minecraft/nbt/CompoundTag;)V public net/minecraft/world/level/block/entity/BlockEntity saveId(Lnet/minecraft/nbt/CompoundTag;)V
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 066feef97f92b3f788dd6d25d188f2cc36fc4c80..7c7b9b1e0b604b0164b431873e6753b60421f970 100644 index 486c3769a0e6a1ecb5530a35e2591f78776619b9..b800b03ae034b276740c3b41555a52b778ad9aad 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
@@ -1258,6 +1258,11 @@ public final class ItemStack implements DataComponentHolder { @@ -1275,6 +1275,11 @@ public final class ItemStack implements DataComponentHolder {
public void setItem(Item item) { public void setItem(Item item) {
this.bukkitStack = null; // Paper this.bukkitStack = null; // Paper
this.item = item; this.item = item;
@ -26,10 +26,10 @@ index 066feef97f92b3f788dd6d25d188f2cc36fc4c80..7c7b9b1e0b604b0164b431873e6753b6
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 139cc0123921bf981d10334d9bd7378d19ec5f3b..c0563260277f9f4bd9ff08993b2efb4bca9a0c60 100644 index 6207c6063cd11ccb1177fe7016c49c02a3416990..cd3b952a228c09077c2e74183a34ddb32811280b 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -140,6 +140,11 @@ public abstract class BlockEntity { @@ -139,6 +139,11 @@ public abstract class BlockEntity {
CompoundTag nbttagcompound = new CompoundTag(); CompoundTag nbttagcompound = new CompoundTag();
this.saveAdditional(nbttagcompound, registryLookup); this.saveAdditional(nbttagcompound, registryLookup);
@ -66,7 +66,7 @@ index 397eb1a101bd60f49dbb2fa8eddf28f6f233167f..2c61e8d5bbab59c691f4cb003041e7e5
protected void load(T tileEntity) { protected void load(T tileEntity) {
if (tileEntity != null && tileEntity != this.snapshot) { if (tileEntity != null && tileEntity != this.snapshot) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index c0bf7efac56e558052992d2ce2455fccff4d9897..3eb650bcb60f23ce0ac0f856526b4bd131cb7a20 100644 index 3c0d3faddcfcba74d90e1d5fccb60b891ef7c458..ddaa96a313bc92249f240deec1796150adc5d3aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -328,7 +328,14 @@ public final class CraftItemStack extends ItemStack { @@ -328,7 +328,14 @@ public final class CraftItemStack extends ItemStack {
@ -830,10 +830,10 @@ index 8e0dd4b7a7a25a8beb27b507047bc48d8227627c..77489c3ffaa3a72d4cf105499a77150f
} }
} }
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 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a32313c171cc 100644 index 5cdb9e07f79355e4590984b32be554053754ef5b..31972619256c09bce46312b55153ddaef11cb236 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
@@ -175,9 +175,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -180,9 +180,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
} }
@ -846,7 +846,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
<T> Applicator put(ItemMetaKeyType<T> key, T value) { <T> Applicator put(ItemMetaKeyType<T> key, T value) {
this.builder.set(key.TYPE, value); this.builder.set(key.TYPE, value);
@@ -299,7 +300,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -307,7 +308,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.enchantments = new EnchantmentMap(meta.enchantments); // Paper this.enchantments = new EnchantmentMap(meta.enchantments); // Paper
} }
@ -855,7 +855,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
this.attributeModifiers = LinkedHashMultimap.create(meta.attributeModifiers); this.attributeModifiers = LinkedHashMultimap.create(meta.attributeModifiers);
} }
@@ -332,6 +333,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -343,6 +344,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
CraftMetaItem(DataComponentPatch tag, Set<DataComponentType<?>> extraHandledTags) { // Paper - improve handled tags on type changes CraftMetaItem(DataComponentPatch tag, Set<DataComponentType<?>> extraHandledTags) { // Paper - improve handled tags on type changes
@ -867,7 +867,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
CraftMetaItem.getOrEmpty(tag, CraftMetaItem.NAME).ifPresent((component) -> { CraftMetaItem.getOrEmpty(tag, CraftMetaItem.NAME).ifPresent((component) -> {
this.displayName = component; this.displayName = component;
}); });
@@ -750,7 +756,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -769,7 +775,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
Map<?, ?> mods = SerializableMeta.getObject(Map.class, map, key.BUKKIT, true); Map<?, ?> mods = SerializableMeta.getObject(Map.class, map, key.BUKKIT, true);
Multimap<Attribute, AttributeModifier> result = LinkedHashMultimap.create(); Multimap<Attribute, AttributeModifier> result = LinkedHashMultimap.create();
if (mods == null) { if (mods == null) {
@ -876,7 +876,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
} }
for (Object obj : mods.keySet()) { for (Object obj : mods.keySet()) {
@@ -908,10 +914,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -931,10 +937,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
void applyModifiers(Multimap<Attribute, AttributeModifier> modifiers, CraftMetaItem.Applicator tag) { void applyModifiers(Multimap<Attribute, AttributeModifier> modifiers, CraftMetaItem.Applicator tag) {
@ -889,7 +889,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
return; return;
} }
@@ -940,7 +944,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -963,7 +967,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Overridden @Overridden
boolean isEmpty() { boolean isEmpty() {
@ -898,7 +898,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
} }
// Paper start // Paper start
@@ -1036,6 +1040,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1059,6 +1063,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public void lore(final List<? extends net.kyori.adventure.text.Component> lore) { public void lore(final List<? extends net.kyori.adventure.text.Component> lore) {
@ -906,7 +906,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
this.lore = lore != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(lore) : null; this.lore = lore != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(lore) : null;
} }
// Paper end // Paper end
@@ -1160,6 +1165,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1183,6 +1188,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
// Paper end // Paper end
@Override @Override
public void setLore(List<String> lore) { public void setLore(List<String> lore) {
@ -914,7 +914,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
if (lore == null || lore.isEmpty()) { if (lore == null || lore.isEmpty()) {
this.lore = null; this.lore = null;
} else { } else {
@@ -1175,6 +1181,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1198,6 +1204,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
// Paper start // Paper start
@Override @Override
public void setLoreComponents(List<net.md_5.bungee.api.chat.BaseComponent[]> lore) { public void setLoreComponents(List<net.md_5.bungee.api.chat.BaseComponent[]> lore) {
@ -922,16 +922,16 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
if (lore == null) { if (lore == null) {
this.lore = null; this.lore = null;
} else { } else {
@@ -1316,7 +1323,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1339,7 +1346,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public FoodComponent getFood() { public FoodComponent getFood() {
- return (this.hasFood()) ? new CraftFoodComponent(this.food) : new CraftFoodComponent(new FoodProperties(0, 0, false, 0, Collections.emptyList())); - return (this.hasFood()) ? new CraftFoodComponent(this.food) : new CraftFoodComponent(new FoodProperties(0, 0, false, 0, Optional.empty(), Collections.emptyList()));
+ return (this.hasFood()) ? new CraftFoodComponent(this.food) : new CraftFoodComponent(new FoodProperties(0, 0, false, FoodProperties.DEFAULT_EAT_SECONDS, Collections.emptyList())); // Paper - create a valid food properties + return (this.hasFood()) ? new CraftFoodComponent(this.food) : new CraftFoodComponent(new FoodProperties(0, 0, false, FoodProperties.DEFAULT_EAT_SECONDS, Optional.empty(), Collections.emptyList())); // Paper - create a valid food properties
} }
@Override @Override
@@ -1357,7 +1364,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1395,7 +1402,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public Multimap<Attribute, AttributeModifier> getAttributeModifiers(@Nullable EquipmentSlot slot) { public Multimap<Attribute, AttributeModifier> getAttributeModifiers(@Nullable EquipmentSlot slot) {
@ -940,7 +940,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
SetMultimap<Attribute, AttributeModifier> result = LinkedHashMultimap.create(); SetMultimap<Attribute, AttributeModifier> result = LinkedHashMultimap.create();
for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) { for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) {
if (entry.getValue().getSlot() == null || entry.getValue().getSlot() == slot) { if (entry.getValue().getSlot() == null || entry.getValue().getSlot() == slot) {
@@ -1370,6 +1377,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1408,6 +1415,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public Collection<AttributeModifier> getAttributeModifiers(@Nonnull Attribute attribute) { public Collection<AttributeModifier> getAttributeModifiers(@Nonnull Attribute attribute) {
Preconditions.checkNotNull(attribute, "Attribute cannot be null"); Preconditions.checkNotNull(attribute, "Attribute cannot be null");
@ -948,21 +948,21 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
return this.attributeModifiers.containsKey(attribute) ? ImmutableList.copyOf(this.attributeModifiers.get(attribute)) : null; return this.attributeModifiers.containsKey(attribute) ? ImmutableList.copyOf(this.attributeModifiers.get(attribute)) : null;
} }
@@ -1377,10 +1385,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1415,10 +1423,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
public boolean addAttributeModifier(@Nonnull Attribute attribute, @Nonnull AttributeModifier modifier) { public boolean addAttributeModifier(@Nonnull Attribute attribute, @Nonnull AttributeModifier modifier) {
Preconditions.checkNotNull(attribute, "Attribute cannot be null"); Preconditions.checkNotNull(attribute, "Attribute cannot be null");
Preconditions.checkNotNull(modifier, "AttributeModifier cannot be null"); Preconditions.checkNotNull(modifier, "AttributeModifier cannot be null");
- this.checkAttributeList(); - this.checkAttributeList();
+ if (this.attributeModifiers != null) { // Paper + if (this.attributeModifiers != null) { // Paper
for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) { for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) {
Preconditions.checkArgument(!(entry.getValue().getUniqueId().equals(modifier.getUniqueId()) && entry.getKey() == attribute), "Cannot register AttributeModifier. Modifier is already applied! %s", modifier); // Paper Preconditions.checkArgument(!entry.getValue().getKey().equals(modifier.getKey()) && entry.getKey() == attribute, "Cannot register AttributeModifier. Modifier is already applied! %s", modifier); // Paper - attribute modifiers with same namespaced key but on different attributes are fine
} }
+ } // Paper + } // Paper
+ this.checkAttributeList(); // Paper - moved down + this.checkAttributeList(); // Paper - moved down
return this.attributeModifiers.put(attribute, modifier); return this.attributeModifiers.put(attribute, modifier);
} }
@@ -1391,8 +1401,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1429,8 +1439,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return; return;
} }
@ -976,7 +976,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
Iterator<Map.Entry<Attribute, AttributeModifier>> iterator = attributeModifiers.entries().iterator(); Iterator<Map.Entry<Attribute, AttributeModifier>> iterator = attributeModifiers.entries().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -1402,6 +1415,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1440,6 +1453,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
iterator.remove(); iterator.remove();
continue; continue;
} }
@ -984,7 +984,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
this.attributeModifiers.put(next.getKey(), next.getValue()); this.attributeModifiers.put(next.getKey(), next.getValue());
} }
} }
@@ -1409,13 +1423,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1447,13 +1461,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public boolean removeAttributeModifier(@Nonnull Attribute attribute) { public boolean removeAttributeModifier(@Nonnull Attribute attribute) {
Preconditions.checkNotNull(attribute, "Attribute cannot be null"); Preconditions.checkNotNull(attribute, "Attribute cannot be null");
@ -1000,7 +1000,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
int removed = 0; int removed = 0;
Iterator<Map.Entry<Attribute, AttributeModifier>> iter = this.attributeModifiers.entries().iterator(); Iterator<Map.Entry<Attribute, AttributeModifier>> iter = this.attributeModifiers.entries().iterator();
@@ -1435,7 +1449,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1473,7 +1487,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
public boolean removeAttributeModifier(@Nonnull Attribute attribute, @Nonnull AttributeModifier modifier) { public boolean removeAttributeModifier(@Nonnull Attribute attribute, @Nonnull AttributeModifier modifier) {
Preconditions.checkNotNull(attribute, "Attribute cannot be null"); Preconditions.checkNotNull(attribute, "Attribute cannot be null");
Preconditions.checkNotNull(modifier, "AttributeModifier cannot be null"); Preconditions.checkNotNull(modifier, "AttributeModifier cannot be null");
@ -1009,7 +1009,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
int removed = 0; int removed = 0;
Iterator<Map.Entry<Attribute, AttributeModifier>> iter = this.attributeModifiers.entries().iterator(); Iterator<Map.Entry<Attribute, AttributeModifier>> iter = this.attributeModifiers.entries().iterator();
@@ -1457,7 +1471,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1495,7 +1509,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public String getAsString() { public String getAsString() {
@ -1018,7 +1018,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
this.applyToItem(tag); this.applyToItem(tag);
DataComponentPatch patch = tag.build(); DataComponentPatch patch = tag.build();
Tag nbt = DataComponentPatch.CODEC.encodeStart(MinecraftServer.getDefaultRegistryAccess().createSerializationContext(NbtOps.INSTANCE), patch).getOrThrow(); Tag nbt = DataComponentPatch.CODEC.encodeStart(MinecraftServer.getDefaultRegistryAccess().createSerializationContext(NbtOps.INSTANCE), patch).getOrThrow();
@@ -1466,7 +1480,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1504,7 +1518,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public String getAsComponentString() { public String getAsComponentString() {
@ -1027,7 +1027,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
this.applyToItem(tag); this.applyToItem(tag);
DataComponentPatch patch = tag.build(); DataComponentPatch patch = tag.build();
@@ -1506,6 +1520,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1544,6 +1558,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
if (first == null || second == null) { if (first == null || second == null) {
return false; return false;
} }
@ -1035,7 +1035,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
for (Map.Entry<Attribute, AttributeModifier> entry : first.entries()) { for (Map.Entry<Attribute, AttributeModifier> entry : first.entries()) {
if (!second.containsEntry(entry.getKey(), entry.getValue())) { if (!second.containsEntry(entry.getKey(), entry.getValue())) {
return false; return false;
@@ -1531,6 +1546,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1569,6 +1584,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public void setDamage(int damage) { public void setDamage(int damage) {
@ -1044,7 +1044,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
this.damage = damage; this.damage = damage;
} }
@@ -1547,6 +1564,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1585,6 +1602,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public void setMaxDamage(Integer maxDamage) { public void setMaxDamage(Integer maxDamage) {
@ -1052,7 +1052,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
this.maxDamage = maxDamage; this.maxDamage = maxDamage;
} }
@@ -1578,7 +1596,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1616,7 +1634,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
&& (this.hasCustomModelData() ? that.hasCustomModelData() && this.customModelData.equals(that.customModelData) : !that.hasCustomModelData()) && (this.hasCustomModelData() ? that.hasCustomModelData() && this.customModelData.equals(that.customModelData) : !that.hasCustomModelData())
&& (this.hasBlockData() ? that.hasBlockData() && this.blockData.equals(that.blockData) : !that.hasBlockData()) && (this.hasBlockData() ? that.hasBlockData() && this.blockData.equals(that.blockData) : !that.hasBlockData())
&& (this.hasRepairCost() ? that.hasRepairCost() && this.repairCost == that.repairCost : !that.hasRepairCost()) && (this.hasRepairCost() ? that.hasRepairCost() && this.repairCost == that.repairCost : !that.hasRepairCost())
@ -1061,9 +1061,9 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
&& (this.unhandledTags.equals(that.unhandledTags)) && (this.unhandledTags.equals(that.unhandledTags))
&& (Objects.equals(this.customTag, that.customTag)) && (Objects.equals(this.customTag, that.customTag))
&& (this.persistentDataContainer.equals(that.persistentDataContainer)) && (this.persistentDataContainer.equals(that.persistentDataContainer))
@@ -1636,8 +1654,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1676,8 +1694,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
hash = 61 * hash + (this.hasFood() ? this.food.hashCode() : 0);
hash = 61 * hash + (this.hasTool() ? this.tool.hashCode() : 0); hash = 61 * hash + (this.hasTool() ? this.tool.hashCode() : 0);
hash = 61 * hash + (this.hasJukeboxPlayable() ? this.jukebox.hashCode() : 0);
hash = 61 * hash + (this.hasDamage() ? this.damage : 0); hash = 61 * hash + (this.hasDamage() ? this.damage : 0);
- hash = 61 * hash + (this.hasMaxDamage() ? 1231 : 1237); - hash = 61 * hash + (this.hasMaxDamage() ? 1231 : 1237);
- hash = 61 * hash + (this.hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0); - hash = 61 * hash + (this.hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0);
@ -1072,7 +1072,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
hash = 61 * hash + (this.canPlaceOnPredicates != null ? this.canPlaceOnPredicates.hashCode() : 0); // Paper hash = 61 * hash + (this.canPlaceOnPredicates != null ? this.canPlaceOnPredicates.hashCode() : 0); // Paper
hash = 61 * hash + (this.canBreakPredicates != null ? this.canBreakPredicates.hashCode() : 0); // Paper hash = 61 * hash + (this.canBreakPredicates != null ? this.canBreakPredicates.hashCode() : 0); // Paper
hash = 61 * hash + this.version; hash = 61 * hash + this.version;
@@ -1657,7 +1675,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1697,7 +1715,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
if (this.enchantments != null) { if (this.enchantments != null) {
clone.enchantments = new EnchantmentMap(this.enchantments); // Paper clone.enchantments = new EnchantmentMap(this.enchantments); // Paper
} }
@ -1081,7 +1081,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers); clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
} }
if (this.customTag != null) { if (this.customTag != null) {
@@ -1864,7 +1882,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1911,7 +1929,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
static void serializeModifiers(Multimap<Attribute, AttributeModifier> modifiers, ImmutableMap.Builder<String, Object> builder, ItemMetaKey key) { static void serializeModifiers(Multimap<Attribute, AttributeModifier> modifiers, ImmutableMap.Builder<String, Object> builder, ItemMetaKey key) {
@ -1090,7 +1090,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
return; return;
} }
@@ -1946,7 +1964,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1993,7 +2011,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
// Paper start - improve checking handled tags // Paper start - improve checking handled tags
@org.jetbrains.annotations.VisibleForTesting @org.jetbrains.annotations.VisibleForTesting
public static final Map<Class<? extends CraftMetaItem>, Set<DataComponentType<?>>> HANDLED_DCTS_PER_TYPE = new HashMap<>(); public static final Map<Class<? extends CraftMetaItem>, Set<DataComponentType<?>>> HANDLED_DCTS_PER_TYPE = new HashMap<>();
@ -1099,7 +1099,7 @@ index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..60aa9dd1617d302c3b49af21d581a323
CraftMetaItem.NAME.TYPE, CraftMetaItem.NAME.TYPE,
CraftMetaItem.ITEM_NAME.TYPE, CraftMetaItem.ITEM_NAME.TYPE,
CraftMetaItem.LORE.TYPE, CraftMetaItem.LORE.TYPE,
@@ -2013,7 +2031,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -2061,7 +2079,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
// Paper end - improve checking handled data component types // Paper end - improve checking handled data component types
protected static <T> Optional<? extends T> getOrEmpty(DataComponentPatch tag, ItemMetaKeyType<T> type) { protected static <T> Optional<? extends T> getOrEmpty(DataComponentPatch tag, ItemMetaKeyType<T> type) {
@ -1425,18 +1425,18 @@ index 8b407a33b04af6ae396ada0b8aca7dc246d314ef..d204845cf0b9de00589593469755cb8e
+ // Paper end - General ItemMeta Fixes + // Paper end - General ItemMeta Fixes
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java
index c68e85cca0f532a94545c0b7f6ed54451ce5a47e..b647b5205b9c54ccb83e09a9410c722e33e5378d 100644 index 63fc9138dc3388ceb9acf672b3f75ba0976e8e54..cad52601583c1f304f94de954c4d18a6005906e3 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java
@@ -103,6 +103,7 @@ public final class CraftFoodComponent implements FoodComponent { @@ -109,6 +109,7 @@ public final class CraftFoodComponent implements FoodComponent {
@Override @Override
public void setEatSeconds(float eatSeconds) { public void setEatSeconds(float eatSeconds) {
+ Preconditions.checkArgument(eatSeconds > 0, "Eat seconds must be positive"); // Paper - validate eat_seconds + Preconditions.checkArgument(eatSeconds > 0, "Eat seconds must be positive"); // Paper - validate eat_seconds
this.handle = new FoodProperties(this.handle.nutrition(), this.handle.saturation(), this.handle.canAlwaysEat(), eatSeconds, this.handle.effects()); this.handle = new FoodProperties(this.handle.nutrition(), this.handle.saturation(), this.handle.canAlwaysEat(), eatSeconds, this.handle.usingConvertsTo(), this.handle.effects());
} }
@@ -118,6 +119,7 @@ public final class CraftFoodComponent implements FoodComponent { @@ -134,6 +135,7 @@ public final class CraftFoodComponent implements FoodComponent {
@Override @Override
public FoodEffect addEffect(PotionEffect effect, float probability) { public FoodEffect addEffect(PotionEffect effect, float probability) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Added API to get player ha proxy address
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 58d28b6c1cc7da7d786f78308db971f7502ad844..02833deaa2bb7e5abc655bc1bdbe15c4b3ac7119 100644 index ea16dfa718b526d6520d7fcfc21d28f972f1f2bf..4b9da6e2140b14f1e56056f5e9e94b2169d85501 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -157,6 +157,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -153,6 +153,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
this.stopReadingPackets = true; this.stopReadingPackets = true;
} }
// Paper end - packet limiter // Paper end - packet limiter
@ -17,10 +17,10 @@ index 58d28b6c1cc7da7d786f78308db971f7502ad844..02833deaa2bb7e5abc655bc1bdbe15c4
public Connection(PacketFlow side) { public Connection(PacketFlow side) {
this.receiving = side; this.receiving = side;
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index 52f537b7bfbdeaad9d17c0e88a1ed1c8925a833f..8aff5129f85ab5729b3da2e465871be62d15bdf2 100644 index 96355e1da8feb6687ea0069dda4a82fcd7e25e8a..1f696644b958538e9f5d568a2e4bba69d74a191e 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java +++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
@@ -146,6 +146,13 @@ public class ServerConnectionListener { @@ -138,6 +138,13 @@ public class ServerConnectionListener {
Connection connection = (Connection) channel.pipeline().get("packet_handler"); Connection connection = (Connection) channel.pipeline().get("packet_handler");
connection.address = socketaddr; connection.address = socketaddr;
@ -35,10 +35,10 @@ index 52f537b7bfbdeaad9d17c0e88a1ed1c8925a833f..8aff5129f85ab5729b3da2e465871be6
} else { } else {
super.channelRead(ctx, msg); super.channelRead(ctx, msg);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 815bcfd90218b932ca004c0f18db8b4de5d35c19..40155cc70ba959eea8011626a30e26f44298c99d 100644 index 35ff3eae4f68fd1fe9bacbeacfd826a5022f8899..744ddef0ee833fc5caebe4036638812383f126f3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -273,6 +273,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -275,6 +275,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Print data component type on encoding error
diff --git a/src/main/java/net/minecraft/core/component/DataComponentPatch.java b/src/main/java/net/minecraft/core/component/DataComponentPatch.java diff --git a/src/main/java/net/minecraft/core/component/DataComponentPatch.java b/src/main/java/net/minecraft/core/component/DataComponentPatch.java
index 33340e8ebe23a1a9ce587be34551fb929c41d0fd..b8977749d35dd7343021425f477445bec470d46b 100644 index 87dd1f570fd294daf826ef7e6403776e42ed4f61..cee4a0639b3c73e300a8450f8a831cb4a71958ba 100644
--- a/src/main/java/net/minecraft/core/component/DataComponentPatch.java --- a/src/main/java/net/minecraft/core/component/DataComponentPatch.java
+++ b/src/main/java/net/minecraft/core/component/DataComponentPatch.java +++ b/src/main/java/net/minecraft/core/component/DataComponentPatch.java
@@ -143,7 +143,13 @@ public final class DataComponentPatch { @@ -144,7 +144,13 @@ public final class DataComponentPatch {
} }
private static <T> void encodeComponent(RegistryFriendlyByteBuf buf, DataComponentType<T> type, Object value) { private static <T> void encodeComponent(RegistryFriendlyByteBuf buf, DataComponentType<T> type, Object value) {

Datei anzeigen

@ -2015,7 +2015,7 @@ index 5ba0ef6eda157c4e61d1de99c6b017ceb34430ec..bc5fc57018e347caa5ca453430a45669
// CraftBukkit end // CraftBukkit end
}; };
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
index e6c7f62ed379a78645933670299e4fcda8540ed1..59d7e8a3d83d3ab7aa28606401bb129ccaeff240 100644 index 3c0d2332207ba638faaaa4280bce18c334a01271..4017b82e72fefd6685e9250a936686fd8a0891f1 100644
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
@@ -45,8 +45,7 @@ import net.minecraft.world.phys.Vec2; @@ -45,8 +45,7 @@ import net.minecraft.world.phys.Vec2;
@ -2069,10 +2069,10 @@ index e6c7f62ed379a78645933670299e4fcda8540ed1..59d7e8a3d83d3ab7aa28606401bb129c
public org.bukkit.command.CommandSender getBukkitSender() { public org.bukkit.command.CommandSender getBukkitSender() {
return this.source.getBukkitSender(this); return this.source.getBukkitSender(this);
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index aa2fca6917fb67fe0e9ba067d11487c3a274f675..0126906e2afc8dd525f27a0c5e82116075c9d352 100644 index df794ef564882a76fde18014403e97cc22f0905d..d0a2581bc87df5335c064fa7854caf0bab512e91 100644
--- a/src/main/java/net/minecraft/commands/Commands.java --- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -156,7 +156,7 @@ public class Commands { @@ -155,7 +155,7 @@ public class Commands {
private final com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher = new com.mojang.brigadier.CommandDispatcher(); private final com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher = new com.mojang.brigadier.CommandDispatcher();
public Commands(Commands.CommandSelection environment, CommandBuildContext commandRegistryAccess) { public Commands(Commands.CommandSelection environment, CommandBuildContext commandRegistryAccess) {
@ -2081,7 +2081,7 @@ index aa2fca6917fb67fe0e9ba067d11487c3a274f675..0126906e2afc8dd525f27a0c5e821160
AdvancementCommands.register(this.dispatcher); AdvancementCommands.register(this.dispatcher);
AttributeCommand.register(this.dispatcher, commandRegistryAccess); AttributeCommand.register(this.dispatcher, commandRegistryAccess);
ExecuteCommand.register(this.dispatcher, commandRegistryAccess); ExecuteCommand.register(this.dispatcher, commandRegistryAccess);
@@ -265,11 +265,24 @@ public class Commands { @@ -263,11 +263,24 @@ public class Commands {
} }
} }
// Paper end - Vanilla command permission fixes // Paper end - Vanilla command permission fixes
@ -2111,7 +2111,7 @@ index aa2fca6917fb67fe0e9ba067d11487c3a274f675..0126906e2afc8dd525f27a0c5e821160
this.dispatcher.setConsumer(ExecutionCommandSource.resultConsumer()); this.dispatcher.setConsumer(ExecutionCommandSource.resultConsumer());
} }
@@ -325,6 +338,11 @@ public class Commands { @@ -323,6 +336,11 @@ public class Commands {
} }
public void performCommand(ParseResults<CommandSourceStack> parseresults, String s, String label) { // CraftBukkit public void performCommand(ParseResults<CommandSourceStack> parseresults, String s, String label) { // CraftBukkit
@ -2123,7 +2123,7 @@ index aa2fca6917fb67fe0e9ba067d11487c3a274f675..0126906e2afc8dd525f27a0c5e821160
CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource(); CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource();
commandlistenerwrapper.getServer().getProfiler().push(() -> { commandlistenerwrapper.getServer().getProfiler().push(() -> {
@@ -339,10 +357,11 @@ public class Commands { @@ -337,10 +355,11 @@ public class Commands {
}); });
} }
} catch (Exception exception) { } catch (Exception exception) {
@ -2136,7 +2136,7 @@ index aa2fca6917fb67fe0e9ba067d11487c3a274f675..0126906e2afc8dd525f27a0c5e821160
StackTraceElement[] astacktraceelement = exception.getStackTrace(); StackTraceElement[] astacktraceelement = exception.getStackTrace();
for (int i = 0; i < Math.min(astacktraceelement.length, 3); ++i) { for (int i = 0; i < Math.min(astacktraceelement.length, 3); ++i) {
@@ -477,7 +496,7 @@ public class Commands { @@ -475,7 +494,7 @@ public class Commands {
Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues
RootCommandNode vanillaRoot = new RootCommandNode(); RootCommandNode vanillaRoot = new RootCommandNode();
@ -2145,15 +2145,15 @@ index aa2fca6917fb67fe0e9ba067d11487c3a274f675..0126906e2afc8dd525f27a0c5e821160
map.put(vanilla, vanillaRoot); map.put(vanilla, vanillaRoot);
this.fillUsableCommands(vanilla, vanillaRoot, player.createCommandSourceStack(), (Map) map); this.fillUsableCommands(vanilla, vanillaRoot, player.createCommandSourceStack(), (Map) map);
@@ -515,6 +534,7 @@ public class Commands { @@ -513,6 +532,7 @@ public class Commands {
} }
private void fillUsableCommands(CommandNode<CommandSourceStack> tree, CommandNode<SharedSuggestionProvider> result, CommandSourceStack source, Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> resultNodes) { private void fillUsableCommands(CommandNode<CommandSourceStack> tree, CommandNode<SharedSuggestionProvider> result, CommandSourceStack source, Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> resultNodes) {
+ resultNodes.keySet().removeIf((node) -> !org.spigotmc.SpigotConfig.sendNamespaced && node.getName().contains( ":" )); // Paper - Remove namedspaced from result nodes to prevent redirect trimming ~ see comment below + resultNodes.keySet().removeIf((node) -> !org.spigotmc.SpigotConfig.sendNamespaced && node.getName().contains( ":" )); // Paper - Remove namedspaced from result nodes to prevent redirect trimming ~ see comment below
Iterator iterator = tree.getChildren().iterator(); Iterator iterator = tree.getChildren().iterator();
boolean registeredAskServerSuggestionsForTree = false; // Paper - tell clients to ask server for suggestions for EntityArguments while (iterator.hasNext()) {
@@ -529,6 +549,42 @@ public class Commands { @@ -526,6 +546,42 @@ public class Commands {
if (commandnode2.canUse(source)) { if (commandnode2.canUse(source)) {
ArgumentBuilder argumentbuilder = commandnode2.createBuilder(); // CraftBukkit - decompile error ArgumentBuilder argumentbuilder = commandnode2.createBuilder(); // CraftBukkit - decompile error
@ -2213,19 +2213,19 @@ index 982b2bab27e3d55d0ba07060862c0c3183ad91b0..5fa8a3343ffc11e82c20b78a73205fd8
Component component = message.resolveComponent(commandSourceStack); Component component = message.resolveComponent(commandSourceStack);
CommandSigningContext commandSigningContext = commandSourceStack.getSigningContext(); CommandSigningContext commandSigningContext = commandSourceStack.getSigningContext();
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 5df535aae94bbba940da5d21eb72afc945915f4c..3751c2a077bd13bac330b93c6efc2a640a17f4f2 100644 index 837fc12dfc57f36f06bd8e49681bb4b98a87397c..6915522f669631779c1fb8a8e2db330f4b9fb921 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
@@ -299,7 +299,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -306,7 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static int currentTick; // Paper - improve tick loop public static int currentTick; // Paper - improve tick loop
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod; public int autosavePeriod;
- public Commands vanillaCommandDispatcher; - public Commands vanillaCommandDispatcher;
+ // Paper - don't store the vanilla dispatcher + // Paper - don't store the vanilla dispatcher
public boolean forceTicks; // Paper private boolean forceTicks;
// CraftBukkit end // CraftBukkit end
// Spigot start // Spigot start
@@ -390,7 +390,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -393,7 +393,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start // CraftBukkit start
this.options = options; this.options = options;
this.worldLoader = worldLoader; this.worldLoader = worldLoader;
@ -2233,7 +2233,7 @@ index 5df535aae94bbba940da5d21eb72afc945915f4c..3751c2a077bd13bac330b93c6efc2a64
// Paper start - Handled by TerminalConsoleAppender // Paper start - Handled by TerminalConsoleAppender
// Try to see if we're actually running in a terminal, disable jline if not // Try to see if we're actually running in a terminal, disable jline if not
/* /*
@@ -675,6 +674,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -678,6 +677,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD); this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins
@ -2243,7 +2243,7 @@ index 5df535aae94bbba940da5d21eb72afc945915f4c..3751c2a077bd13bac330b93c6efc2a64
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP)); this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.connection.acceptConnections(); this.connection.acceptConnections();
} }
@@ -2296,9 +2298,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2187,9 +2189,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return new MinecraftServer.ReloadableResources(resourcemanager, datapackresources); return new MinecraftServer.ReloadableResources(resourcemanager, datapackresources);
}); });
}).thenAcceptAsync((minecraftserver_reloadableresources) -> { }).thenAcceptAsync((minecraftserver_reloadableresources) -> {
@ -2254,7 +2254,7 @@ index 5df535aae94bbba940da5d21eb72afc945915f4c..3751c2a077bd13bac330b93c6efc2a64
this.packRepository.setSelected(dataPacks); this.packRepository.setSelected(dataPacks);
WorldDataConfiguration worlddataconfiguration = new WorldDataConfiguration(MinecraftServer.getSelectedPacks(this.packRepository, true), this.worldData.enabledFeatures()); WorldDataConfiguration worlddataconfiguration = new WorldDataConfiguration(MinecraftServer.getSelectedPacks(this.packRepository, true), this.worldData.enabledFeatures());
@@ -2317,8 +2319,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2200,8 +2202,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().reloadResources(); this.getPlayerList().reloadResources();
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary()); this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager); this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
@ -2302,7 +2302,7 @@ index 84b4bfe8363adc015821e9cabedfabed98c0336c..6de563b7adea957a7ead1c00c4900060
manager, reloadableServerResources.listeners(), prepareExecutor, applyExecutor, DATA_RELOAD_INITIAL_TASK, LOGGER.isDebugEnabled() manager, reloadableServerResources.listeners(), prepareExecutor, applyExecutor, DATA_RELOAD_INITIAL_TASK, LOGGER.isDebugEnabled()
) )
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
index a0ec6c3d122ad28d65d37f1b9f82541997b37d37..c6d7ee0d498bd92d4321acd30ade10abea611e42 100644 index ec29e95d796305b8d44c2075629a8147a05f48c1..9cd4f7c6910727c849ac7f5d675dc6105c4bbba2 100644
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java --- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java +++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
@@ -36,7 +36,7 @@ public class ServerFunctionManager { @@ -36,7 +36,7 @@ public class ServerFunctionManager {
@ -2315,10 +2315,10 @@ index a0ec6c3d122ad28d65d37f1b9f82541997b37d37..c6d7ee0d498bd92d4321acd30ade10ab
public void tick() { public void tick() {
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 5678414a608623a7698f72173fef87bde44f6aaa..ad967cc2283f902c76e48a59d59cf0dbdacbb5e3 100644 index b4af03c4bdd1ce0861f36c3b75fc7e89d701c46a..0761d5bc5f2813bb4a9f664ac7a05b9744d0a778 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
@@ -233,7 +233,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -237,7 +237,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
@ -2327,10 +2327,10 @@ index 5678414a608623a7698f72173fef87bde44f6aaa..ad967cc2283f902c76e48a59d59cf0db
this.setPvpAllowed(dedicatedserverproperties.pvp); this.setPvpAllowed(dedicatedserverproperties.pvp);
this.setFlightAllowed(dedicatedserverproperties.allowFlight); this.setFlightAllowed(dedicatedserverproperties.allowFlight);
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 3faf80fca51d66480265eaf3cc89149e53ceb215..b9b3277c8ed94e0cd30b20b9c00a33eaad48e5ac 100644 index 9116d0c89fc84ee79d2d0b81ade77264c362c25d..addf6f02980f0089763c8119623dff6c01259950 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
@@ -2464,33 +2464,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2408,33 +2408,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
} }
@ -2377,10 +2377,10 @@ index 3faf80fca51d66480265eaf3cc89149e53ceb215..b9b3277c8ed94e0cd30b20b9c00a33ea
// CraftBukkit end // CraftBukkit end
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 3eea023d24c8e1b991f548632564508bfc565d8a..5db08432b6afd3639688830e717f40ceaf599248 100644 index 3374795786ff6a50e56678a1b3b5098812936439..b9bacf85d6e385afb5e0482374998ab598926021 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
@@ -271,11 +271,11 @@ public final class CraftServer implements Server { @@ -272,11 +272,11 @@ public final class CraftServer implements Server {
private final Logger logger = Logger.getLogger("Minecraft"); private final Logger logger = Logger.getLogger("Minecraft");
private final ServicesManager servicesManager = new SimpleServicesManager(); private final ServicesManager servicesManager = new SimpleServicesManager();
private final CraftScheduler scheduler = new CraftScheduler(); private final CraftScheduler scheduler = new CraftScheduler();
@ -2395,8 +2395,8 @@ index 3eea023d24c8e1b991f548632564508bfc565d8a..5db08432b6afd3639688830e717f40ce
private final StructureManager structureManager; private final StructureManager structureManager;
protected final DedicatedServer console; protected final DedicatedServer console;
protected final DedicatedPlayerList playerList; protected final DedicatedPlayerList playerList;
@@ -401,6 +401,12 @@ public final class CraftServer implements Server { @@ -404,6 +404,12 @@ public final class CraftServer implements Server {
this.serverTickManager = new CraftServerTickManager(console.tickRateManager()); this.serverLinks = new CraftServerLinks(console);
Bukkit.setServer(this); Bukkit.setServer(this);
+ // Paper start + // Paper start
@ -2408,7 +2408,7 @@ index 3eea023d24c8e1b991f548632564508bfc565d8a..5db08432b6afd3639688830e717f40ce
CraftRegistry.setMinecraftRegistry(console.registryAccess()); CraftRegistry.setMinecraftRegistry(console.registryAccess());
@@ -590,48 +596,11 @@ public final class CraftServer implements Server { @@ -593,48 +599,11 @@ public final class CraftServer implements Server {
} }
private void setVanillaCommands(boolean first) { // Spigot private void setVanillaCommands(boolean first) { // Spigot
@ -2459,7 +2459,7 @@ index 3eea023d24c8e1b991f548632564508bfc565d8a..5db08432b6afd3639688830e717f40ce
// Refresh commands // Refresh commands
for (ServerPlayer player : this.getHandle().players) { for (ServerPlayer player : this.getHandle().players) {
@@ -1018,17 +987,31 @@ public final class CraftServer implements Server { @@ -1021,17 +990,31 @@ public final class CraftServer implements Server {
return true; return true;
} }
@ -2501,7 +2501,7 @@ index 3eea023d24c8e1b991f548632564508bfc565d8a..5db08432b6afd3639688830e717f40ce
return false; return false;
} }
@@ -1037,7 +1020,7 @@ public final class CraftServer implements Server { @@ -1040,7 +1023,7 @@ public final class CraftServer implements Server {
public void reload() { public void reload() {
// Paper start - lifecycle events // Paper start - lifecycle events
if (io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.INSTANCE.blocksPluginReloading()) { if (io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.INSTANCE.blocksPluginReloading()) {
@ -2510,7 +2510,7 @@ index 3eea023d24c8e1b991f548632564508bfc565d8a..5db08432b6afd3639688830e717f40ce
} }
// Paper end - lifecycle events // Paper end - lifecycle events
org.spigotmc.WatchdogThread.hasStarted = false; // Paper - Disable watchdog early timeout on reload org.spigotmc.WatchdogThread.hasStarted = false; // Paper - Disable watchdog early timeout on reload
@@ -1091,8 +1074,9 @@ public final class CraftServer implements Server { @@ -1094,8 +1077,9 @@ public final class CraftServer implements Server {
} }
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@ -2521,7 +2521,7 @@ index 3eea023d24c8e1b991f548632564508bfc565d8a..5db08432b6afd3639688830e717f40ce
// Paper start // Paper start
for (Plugin plugin : pluginClone) { for (Plugin plugin : pluginClone) {
entityMetadata.removeAll(plugin); entityMetadata.removeAll(plugin);
@@ -1132,6 +1116,12 @@ public final class CraftServer implements Server { @@ -1135,6 +1119,12 @@ public final class CraftServer implements Server {
this.enablePlugins(PluginLoadOrder.STARTUP); this.enablePlugins(PluginLoadOrder.STARTUP);
this.enablePlugins(PluginLoadOrder.POSTWORLD); this.enablePlugins(PluginLoadOrder.POSTWORLD);
if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins
@ -2560,7 +2560,7 @@ index 4b1ac1fe7ea07f419ae2818251900e7ba434ee16..90ed57a7fbcd0625b64084347460e986
public Map<String, Command> getKnownCommands() { public Map<String, Command> getKnownCommands() {
diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
index dd1507f65a7f1d84bc7f236f81a60ac1302a13b8..5b70f53bc4b27a715b8b7aa13586082adbc4bd16 100644 index 2ee33c55890fa659f6d251e486264c85d9e89802..d7a41421784cf9066518310e00031e26d9817171 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java --- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
@@ -23,14 +23,26 @@ import org.bukkit.craftbukkit.entity.CraftMinecartCommand; @@ -23,14 +23,26 @@ import org.bukkit.craftbukkit.entity.CraftMinecartCommand;
@ -2615,7 +2615,7 @@ index dd1507f65a7f1d84bc7f236f81a60ac1302a13b8..5b70f53bc4b27a715b8b7aa13586082a
suggestions.getList().forEach((s) -> results.add(s.getText())); suggestions.getList().forEach((s) -> results.add(s.getText()));
}); });
@@ -114,4 +126,15 @@ public final class VanillaCommandWrapper extends BukkitCommand { @@ -111,4 +123,15 @@ public final class VanillaCommandWrapper extends BukkitCommand {
private String toDispatcher(String[] args, String name) { private String toDispatcher(String[] args, String name) {
return name + ((args.length > 0) ? " " + Joiner.on(' ').join(args) : ""); return name + ((args.length > 0) ? " " + Joiner.on(' ').join(args) : "");
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix issues with Recipe API
diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
index 482d7b12b80328fba97a01bcfeb974b7ac4bcdb7..fb4c8a2a15e8e3e26454b7da920454e9861336c6 100644 index 63cf2b66f51df68aa3f6d98c69368ce454869d64..1bf54b0142fe41b29b21c8b97d3f52bb24a36a92 100644
--- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java --- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java +++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
@@ -91,7 +91,7 @@ public class ShapedRecipe extends io.papermc.paper.inventory.recipe.RecipeBookEx @@ -90,7 +90,7 @@ public class ShapedRecipe extends io.papermc.paper.inventory.recipe.RecipeBookEx
char c = 'a'; char c = 'a';
for (Ingredient list : this.pattern.ingredients()) { for (Ingredient list : this.pattern.ingredients()) {
RecipeChoice choice = CraftRecipe.toBukkit(list); RecipeChoice choice = CraftRecipe.toBukkit(list);

Datei anzeigen

@ -32,10 +32,10 @@ index 9d74577af071954e1e37201a96368c1360076209..eafa54c870c3e2aef30c3f9f96f51660
throw new IllegalArgumentException("Not implemented. This is a bug"); throw new IllegalArgumentException("Not implemented. This is a bug");
} }
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 60aa9dd1617d302c3b49af21d581a32313c171cc..b6cd6897844aa9c8b9a94e41c56c4cfe4ac78780 100644 index 31972619256c09bce46312b55153ddaef11cb236..bcd108cf3a4d10e6bf2058f84c7aa591addd5ced 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
@@ -1367,7 +1367,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1405,7 +1405,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
if (this.attributeModifiers == null) return LinkedHashMultimap.create(); // Paper - don't change the components if (this.attributeModifiers == null) return LinkedHashMultimap.create(); // Paper - don't change the components
SetMultimap<Attribute, AttributeModifier> result = LinkedHashMultimap.create(); SetMultimap<Attribute, AttributeModifier> result = LinkedHashMultimap.create();
for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) { for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) {
@ -44,7 +44,7 @@ index 60aa9dd1617d302c3b49af21d581a32313c171cc..b6cd6897844aa9c8b9a94e41c56c4cfe
result.put(entry.getKey(), entry.getValue()); result.put(entry.getKey(), entry.getValue());
} }
} }
@@ -1435,9 +1435,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1473,9 +1473,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
while (iter.hasNext()) { while (iter.hasNext()) {
Map.Entry<Attribute, AttributeModifier> entry = iter.next(); Map.Entry<Attribute, AttributeModifier> entry = iter.next();

Datei anzeigen

@ -112,10 +112,10 @@ index 0000000000000000000000000000000000000000..e9436f8a73ee0a02096d66e14d73edaa
+ +
+} +}
diff --git a/src/main/java/net/minecraft/core/component/DataComponents.java b/src/main/java/net/minecraft/core/component/DataComponents.java diff --git a/src/main/java/net/minecraft/core/component/DataComponents.java b/src/main/java/net/minecraft/core/component/DataComponents.java
index 5632974af9c603d333ffc30a5a1b1e851821a3bb..9b2a209cda955ef3e5d8ff3ed1b2249888c7d139 100644 index c9aef759c1485da753e820f9b509117ca50a31e4..60757f8df706cba92350d73503b73913cff3bcfc 100644
--- a/src/main/java/net/minecraft/core/component/DataComponents.java --- a/src/main/java/net/minecraft/core/component/DataComponents.java
+++ b/src/main/java/net/minecraft/core/component/DataComponents.java +++ b/src/main/java/net/minecraft/core/component/DataComponents.java
@@ -139,10 +139,10 @@ public class DataComponents { @@ -138,10 +138,10 @@ public class DataComponents {
"map_post_processing", builder -> builder.networkSynchronized(MapPostProcessing.STREAM_CODEC) "map_post_processing", builder -> builder.networkSynchronized(MapPostProcessing.STREAM_CODEC)
); );
public static final DataComponentType<ChargedProjectiles> CHARGED_PROJECTILES = register( public static final DataComponentType<ChargedProjectiles> CHARGED_PROJECTILES = register(
@ -128,7 +128,7 @@ index 5632974af9c603d333ffc30a5a1b1e851821a3bb..9b2a209cda955ef3e5d8ff3ed1b22498
); );
public static final DataComponentType<PotionContents> POTION_CONTENTS = register( public static final DataComponentType<PotionContents> POTION_CONTENTS = register(
"potion_contents", builder -> builder.persistent(PotionContents.CODEC).networkSynchronized(PotionContents.STREAM_CODEC).cacheEncoding() "potion_contents", builder -> builder.persistent(PotionContents.CODEC).networkSynchronized(PotionContents.STREAM_CODEC).cacheEncoding()
@@ -206,7 +206,7 @@ public class DataComponents { @@ -208,7 +208,7 @@ public class DataComponents {
"pot_decorations", builder -> builder.persistent(PotDecorations.CODEC).networkSynchronized(PotDecorations.STREAM_CODEC).cacheEncoding() "pot_decorations", builder -> builder.persistent(PotDecorations.CODEC).networkSynchronized(PotDecorations.STREAM_CODEC).cacheEncoding()
); );
public static final DataComponentType<ItemContainerContents> CONTAINER = register( public static final DataComponentType<ItemContainerContents> CONTAINER = register(
@ -188,10 +188,10 @@ index e092a486c4041ab1cfe9e29c88d0d94528a6e9a6..3945ca04ede578121b370592482ac917
@Override @Override
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index f16a69775332a08ed0e87d27acd0fc959359694c..a2279262c93408c11f5d2290b48fd794975e8cfe 100644 index 0e7ace92522fbd4cef7b2c2b8a0f8b86c2cce192..1d849ce4e2c85f149af25318b8ffb6dcef6c6788 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -361,7 +361,7 @@ public class ServerEntity { @@ -349,7 +349,7 @@ public class ServerEntity {
} }
if (!list.isEmpty()) { if (!list.isEmpty()) {
@ -201,10 +201,10 @@ index f16a69775332a08ed0e87d27acd0fc959359694c..a2279262c93408c11f5d2290b48fd794
((LivingEntity) this.entity).detectEquipmentUpdatesPublic(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending ((LivingEntity) this.entity).detectEquipmentUpdatesPublic(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending
} }
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 b9b3277c8ed94e0cd30b20b9c00a33eaad48e5ac..c450447585af4c8cdc87abe871c229ff895c3e53 100644 index addf6f02980f0089763c8119623dff6c01259950..ea0fc33d12a2147db71347c88df1df6cddc52e84 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
@@ -2788,7 +2788,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2732,7 +2732,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
entity.refreshEntityData(ServerGamePacketListenerImpl.this.player); entity.refreshEntityData(ServerGamePacketListenerImpl.this.player);
// SPIGOT-7136 - Allays // SPIGOT-7136 - Allays
if (entity instanceof Allay) { if (entity instanceof Allay) {
@ -214,10 +214,10 @@ index b9b3277c8ed94e0cd30b20b9c00a33eaad48e5ac..c450447585af4c8cdc87abe871c229ff
} }
} }
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 d0b6ade676d94e768c92432dc6cee9f200acf5f2..21e61bb75ac7ce468bc757633ce678b21bcb9deb 100644 index 81b70e2dcf31ef651256a0ddf928c6370458c3dd..0a9fe513df3afc50baae656bf6a9b2a6122465c1 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
@@ -3302,7 +3302,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3322,7 +3322,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
}); });

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent NPE if hooked entity was cleared
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
index 9962d50ea342cd47428a814519b2d54f547753a4..6ea34a76707d9f60076b7423ac0bb1de200308ae 100644 index 270f4c94912b16c7d4a2d62670847cbb5e011819..6ce65e5b336be9b49db84f1c4755c2e2ce7f8378 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -503,11 +503,13 @@ public class FishingHook extends Projectile { @@ -504,11 +504,13 @@ public class FishingHook extends Projectile {
if (playerFishEvent.isCancelled()) { if (playerFishEvent.isCancelled()) {
return 0; return 0;
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix cancelling BlockPlaceEvent calling onRemove
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 7c7b9b1e0b604b0164b431873e6753b60421f970..f8589837070039b4911a9532b92fa959c7af6352 100644 index b800b03ae034b276740c3b41555a52b778ad9aad..86197725f0f2ac1e650297ae7a79907578e0e8f1 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
@@ -473,9 +473,11 @@ public final class ItemStack implements DataComponentHolder { @@ -494,9 +494,11 @@ public final class ItemStack implements DataComponentHolder {
world.capturedTileEntities.clear(); // Paper - Allow chests to be placed with NBT data; clear out block entities as chests and such will pop loot world.capturedTileEntities.clear(); // Paper - Allow chests to be placed with NBT data; clear out block entities as chests and such will pop loot
// revert back all captured blocks // revert back all captured blocks
world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710 world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710
@ -21,10 +21,10 @@ index 7c7b9b1e0b604b0164b431873e6753b60421f970..f8589837070039b4911a9532b92fa959
// Brute force all possible updates // Brute force all possible updates
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 0a8eeebb2d702ebcefd9f26cc0f41d1eab497902..14281a4e72f49dc4eb2ca3da8479c1f81a3a175d 100644 index dd519eacd6d4bea5447bea471f0ac6540d9bb49c..6f822e9487bef5b9766d5ae86ebbd687e4eadc42 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -150,6 +150,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -151,6 +151,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710 public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710
public boolean captureBlockStates = false; public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false; public boolean captureTreeGeneration = false;
@ -33,10 +33,10 @@ index 0a8eeebb2d702ebcefd9f26cc0f41d1eab497902..14281a4e72f49dc4eb2ca3da8479c1f8
public Map<BlockPos, BlockEntity> capturedTileEntities = new java.util.LinkedHashMap<>(); // Paper - Retain block place order when capturing blockstates public Map<BlockPos, BlockEntity> capturedTileEntities = new java.util.LinkedHashMap<>(); // Paper - Retain block place order when capturing blockstates
public List<ItemEntity> captureDrops; public List<ItemEntity> captureDrops;
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 2a8609e33716949ff1877b6d10f64a9d7a7c81e9..14ee7b5b9b804bebd4e2a846b238547a28a36035 100644 index 849efe41ff14be1fc95789b083e340363cbc93ab..f0e88f4613eb22d6685fe010da01daef573f8079 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -452,7 +452,7 @@ public class LevelChunk extends ChunkAccess { @@ -444,7 +444,7 @@ public class LevelChunk extends ChunkAccess {
boolean flag3 = iblockdata1.hasBlockEntity(); boolean flag3 = iblockdata1.hasBlockEntity();

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add missing fishing event state
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
index 6ea34a76707d9f60076b7423ac0bb1de200308ae..7dd5e0b935d98d552c916f8412569ff4aa0e9b04 100644 index 6ce65e5b336be9b49db84f1c4755c2e2ce7f8378..1223c5d23d0ea6aed068bdf0f5725e2ad49fc82c 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -410,6 +410,15 @@ public class FishingHook extends Projectile { @@ -411,6 +411,15 @@ public class FishingHook extends Projectile {
this.fishAngle = Mth.nextFloat(this.random, this.minLureAngle, this.maxLureAngle); this.fishAngle = Mth.nextFloat(this.random, this.minLureAngle, this.maxLureAngle);
this.timeUntilHooked = Mth.nextInt(this.random, this.minLureTime, this.maxLureTime); this.timeUntilHooked = Mth.nextInt(this.random, this.minLureTime, this.maxLureTime);
// CraftBukkit end // CraftBukkit end

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Deprecate InvAction#HOTBAR_MOVE_AND_READD
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 c450447585af4c8cdc87abe871c229ff895c3e53..4ae88bfcead40cd05f9514a48a922a37767cb3cf 100644 index ea0fc33d12a2147db71347c88df1df6cddc52e84..258d0193d23041fb4be0e5b4b1eb31d8a4011331 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
@@ -3054,14 +3054,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2998,14 +2998,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Slot clickedSlot = this.player.containerMenu.getSlot(packet.getSlotNum()); Slot clickedSlot = this.player.containerMenu.getSlot(packet.getSlotNum());
if (clickedSlot.mayPickup(this.player)) { if (clickedSlot.mayPickup(this.player)) {
ItemStack hotbar = this.player.getInventory().getItem(packet.getButtonNum()); ItemStack hotbar = this.player.getInventory().getItem(packet.getButtonNum());

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Fix sending disconnect packet in phases where it doesn't
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 02833deaa2bb7e5abc655bc1bdbe15c4b3ac7119..f40420a6841f03983b0837e177ea2ae7c3a37ca1 100644 index 4b9da6e2140b14f1e56056f5e9e94b2169d85501..55848fa832d0f4d2d03f99df51e10c5fdfcd2ded 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -214,7 +214,8 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -218,7 +218,8 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
if (player != null) player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.ERRONEOUS_STATE; // Paper - Add API for quit reason if (player != null) player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.ERRONEOUS_STATE; // Paper - Add API for quit reason
if (flag) { if (flag) {
Connection.LOGGER.debug("Failed to sent packet", throwable); Connection.LOGGER.debug("Failed to sent packet", throwable);

Datei anzeigen

@ -1,255 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 26 Apr 2024 23:15:27 -0700
Subject: [PATCH] Add experimental improved give command
Supports removing data components from itemstacks
diff --git a/src/main/java/net/minecraft/commands/arguments/item/ItemArgument.java b/src/main/java/net/minecraft/commands/arguments/item/ItemArgument.java
index d76296c6d53065aecb010d8ea682c9acd7365f17..9314a94764786982eff0974411f8341bb0353ecf 100644
--- a/src/main/java/net/minecraft/commands/arguments/item/ItemArgument.java
+++ b/src/main/java/net/minecraft/commands/arguments/item/ItemArgument.java
@@ -16,7 +16,12 @@ public class ItemArgument implements ArgumentType<ItemInput> {
private final ItemParser parser;
public ItemArgument(CommandBuildContext commandRegistryAccess) {
- this.parser = new ItemParser(commandRegistryAccess);
+ // Paper start - support component removals
+ this(commandRegistryAccess, false);
+ }
+ public ItemArgument(CommandBuildContext commandRegistryAccess, boolean allowRemovals) {
+ this.parser = new ItemParser(commandRegistryAccess, allowRemovals);
+ // Paper end - support component removals
}
public static ItemArgument item(CommandBuildContext commandRegistryAccess) {
@@ -25,7 +30,7 @@ public class ItemArgument implements ArgumentType<ItemInput> {
public ItemInput parse(StringReader stringReader) throws CommandSyntaxException {
ItemParser.ItemResult itemResult = this.parser.parse(stringReader);
- return new ItemInput(itemResult.item(), itemResult.components());
+ return new ItemInput(itemResult.item(), itemResult.components(), itemResult.patch()); // Paper - support component removals
}
public static <S> ItemInput getItem(CommandContext<S> context, String name) {
diff --git a/src/main/java/net/minecraft/commands/arguments/item/ItemInput.java b/src/main/java/net/minecraft/commands/arguments/item/ItemInput.java
index 3d24fbca90bc7d8bdbac1be2176555c15ae75039..94ea5f0b1913ffa03794d231a6768dd786dc9697 100644
--- a/src/main/java/net/minecraft/commands/arguments/item/ItemInput.java
+++ b/src/main/java/net/minecraft/commands/arguments/item/ItemInput.java
@@ -25,8 +25,15 @@ public class ItemInput {
);
private final Holder<Item> item;
private final DataComponentMap components;
+ @javax.annotation.Nullable private final net.minecraft.core.component.DataComponentPatch patch; // Paper
public ItemInput(Holder<Item> item, DataComponentMap components) {
+ // Paper start
+ this(item, components, null);
+ }
+ public ItemInput(Holder<Item> item, DataComponentMap components, @javax.annotation.Nullable final net.minecraft.core.component.DataComponentPatch patch) {
+ this.patch = patch;
+ // Paper end
this.item = item;
this.components = components;
}
@@ -37,7 +44,13 @@ public class ItemInput {
public ItemStack createItemStack(int amount, boolean checkOverstack) throws CommandSyntaxException {
ItemStack itemStack = new ItemStack(this.item, amount);
- itemStack.applyComponents(this.components);
+ // Paper start - support component removals
+ if (this.patch != null) {
+ itemStack.applyComponents(this.patch);
+ } else {
+ itemStack.applyComponents(this.components);
+ }
+ // Paper end - support component removals
if (checkOverstack && amount > itemStack.getMaxStackSize()) {
throw ERROR_STACK_TOO_BIG.create(this.getItemName(), itemStack.getMaxStackSize());
} else {
diff --git a/src/main/java/net/minecraft/commands/arguments/item/ItemParser.java b/src/main/java/net/minecraft/commands/arguments/item/ItemParser.java
index 5347a96be3bfbbd2963747ba4b5f222215d80371..fa431de18de902c580855e9c4419125519b6176b 100644
--- a/src/main/java/net/minecraft/commands/arguments/item/ItemParser.java
+++ b/src/main/java/net/minecraft/commands/arguments/item/ItemParser.java
@@ -59,8 +59,15 @@ public class ItemParser {
static final Function<SuggestionsBuilder, CompletableFuture<Suggestions>> SUGGEST_NOTHING = SuggestionsBuilder::buildFuture;
final HolderLookup.RegistryLookup<Item> items;
final DynamicOps<Tag> registryOps;
+ final boolean allowRemoves; // Paper - support component removals
public ItemParser(HolderLookup.Provider registriesLookup) {
+ // Paper start - support component removals
+ this(registriesLookup, false);
+ }
+ public ItemParser(HolderLookup.Provider registriesLookup, boolean allowRemoves) {
+ this.allowRemoves = allowRemoves;
+ // Paper end - support component removals
this.items = registriesLookup.lookupOrThrow(Registries.ITEM);
this.registryOps = registriesLookup.createSerializationContext(NbtOps.INSTANCE);
}
@@ -68,6 +75,7 @@ public class ItemParser {
public ItemParser.ItemResult parse(StringReader reader) throws CommandSyntaxException {
final MutableObject<Holder<Item>> mutableObject = new MutableObject<>();
final DataComponentMap.Builder builder = DataComponentMap.builder();
+ final net.minecraft.core.component.DataComponentPatch.Builder patchBuilder = net.minecraft.core.component.DataComponentPatch.builder(); // Paper - support component removals
this.parse(reader, new ItemParser.Visitor() {
@Override
public void visitItem(Holder<Item> item) {
@@ -77,12 +85,19 @@ public class ItemParser {
@Override
public <T> void visitComponent(DataComponentType<T> type, T value) {
builder.set(type, value);
+ // Paper start - support component removals
+ patchBuilder.set(type, value);
+ }
+ @Override
+ public <T> void visitComponentRemove(final DataComponentType<T> type) {
+ patchBuilder.remove(type);
+ // Paper end - support component removals
}
});
Holder<Item> holder = Objects.requireNonNull(mutableObject.getValue(), "Parser gave no item");
DataComponentMap dataComponentMap = builder.build();
validateComponents(reader, holder, dataComponentMap);
- return new ItemParser.ItemResult(holder, dataComponentMap);
+ return new ItemParser.ItemResult(holder, dataComponentMap, this.allowRemoves ? patchBuilder.build() : null); // Paper - support component removals
}
private static void validateComponents(StringReader reader, Holder<Item> item, DataComponentMap components) throws CommandSyntaxException {
@@ -116,7 +131,7 @@ public class ItemParser {
return suggestionsVisitor.resolveSuggestions(builder, stringReader);
}
- public static record ItemResult(Holder<Item> item, DataComponentMap components) {
+ public static record ItemResult(Holder<Item> item, DataComponentMap components, @javax.annotation.Nullable net.minecraft.core.component.DataComponentPatch patch) { // Paper
}
class State {
@@ -154,17 +169,28 @@ public class ItemParser {
while (this.reader.canRead() && this.reader.peek() != ']') {
this.reader.skipWhitespace();
+ boolean removing = ItemParser.this.allowRemoves && this.reader.canRead() && this.reader.peek() == '!';
+ if (removing) {
+ this.reader.skip();
+ this.visitor.visitSuggestions(builder -> this.suggestComponentAssignment(builder, false));
+ }
DataComponentType<?> dataComponentType = readComponentType(this.reader);
if (!set.add(dataComponentType)) {
throw ItemParser.ERROR_REPEATED_COMPONENT.create(dataComponentType);
}
+ // Paper start - support component removals
+ if (removing) {
+ this.visitor.visitComponentRemove(dataComponentType);
+ } else {
+ // Paper end - support component removals
this.visitor.visitSuggestions(this::suggestAssignment);
this.reader.skipWhitespace();
this.reader.expect('=');
this.visitor.visitSuggestions(ItemParser.SUGGEST_NOTHING);
this.reader.skipWhitespace();
this.readComponent(dataComponentType);
+ } // Paper - support component removals
this.reader.skipWhitespace();
this.visitor.visitSuggestions(this::suggestNextOrEndComponents);
if (!this.reader.canRead() || this.reader.peek() != ',') {
@@ -239,12 +265,18 @@ public class ItemParser {
}
private CompletableFuture<Suggestions> suggestComponentAssignment(SuggestionsBuilder builder) {
+ // Paper start - support component removals
+ return this.suggestComponentAssignment(builder, true);
+ }
+ private CompletableFuture<Suggestions> suggestComponentAssignment(SuggestionsBuilder builder, boolean suggestRemove) {
String string = builder.getRemaining().toLowerCase(Locale.ROOT);
+ if (suggestRemove && string.isBlank()) builder.suggest("!", Component.literal("Remove a data component"));
+ // Paper end - support component removals
SharedSuggestionProvider.filterResources(BuiltInRegistries.DATA_COMPONENT_TYPE.entrySet(), string, entry -> entry.getKey().location(), entry -> {
DataComponentType<?> dataComponentType = entry.getValue();
if (dataComponentType.codec() != null) {
ResourceLocation resourceLocation = entry.getKey().location();
- builder.suggest(resourceLocation.toString() + "=");
+ builder.suggest(resourceLocation.toString() + (suggestRemove ? "=" : "")); // Paper - support component removals
}
});
return builder.buildFuture();
@@ -270,6 +302,7 @@ public class ItemParser {
default <T> void visitComponent(DataComponentType<T> type, T value) {
}
+ default <T> void visitComponentRemove(DataComponentType<T> type) {} // Paper
default void visitSuggestions(Function<SuggestionsBuilder, CompletableFuture<Suggestions>> suggestor) {
}
diff --git a/src/main/java/net/minecraft/server/commands/GiveCommand.java b/src/main/java/net/minecraft/server/commands/GiveCommand.java
index 0d9de4c61c7b26a6ff37c12fde629161fd0c3d5a..47355158e5e762540a10dc67b23092a0fc53bce3 100644
--- a/src/main/java/net/minecraft/server/commands/GiveCommand.java
+++ b/src/main/java/net/minecraft/server/commands/GiveCommand.java
@@ -34,6 +34,38 @@ public class GiveCommand {
})).then(net.minecraft.commands.Commands.argument("count", IntegerArgumentType.integer(1)).executes((commandcontext) -> {
return GiveCommand.giveItem((CommandSourceStack) commandcontext.getSource(), ItemArgument.getItem(commandcontext, "item"), EntityArgument.getPlayers(commandcontext, "targets"), IntegerArgumentType.getInteger(commandcontext, "count"));
})))));
+ // Paper start - support component removals with a custom pgive command
+ final com.mojang.brigadier.tree.CommandNode<net.minecraft.commands.CommandSourceStack> node = net.minecraft.commands.Commands
+ .literal("pgive").requires((css) -> css.hasPermission(2))
+ .then(net.minecraft.commands.Commands.argument("targets", EntityArgument.players())
+ .then(net.minecraft.commands.Commands.argument("item", new ItemArgument(commandRegistryAccess, true)).executes((ctx) -> {
+ return GiveCommand.giveItem(ctx.getSource(), ItemArgument.getItem(ctx, "item"), EntityArgument.getPlayers(ctx, "targets"), 1);
+ })
+ .then(net.minecraft.commands.Commands.argument("count", IntegerArgumentType.integer(1)).executes((ctx) -> {
+ return GiveCommand.giveItem(ctx.getSource(), ItemArgument.getItem(ctx, "item"), EntityArgument.getPlayers(ctx, "targets"), IntegerArgumentType.getInteger(ctx, "count"));
+ }))
+ )
+ ).build();
+ setClientNodes(node);
+ dispatcher.getRoot().addChild(node);
+ }
+ static void setClientNodes(com.mojang.brigadier.tree.CommandNode<net.minecraft.commands.CommandSourceStack> node) {
+ if (node instanceof com.mojang.brigadier.tree.ArgumentCommandNode<net.minecraft.commands.CommandSourceStack,?> argumentNode) {
+ if (argumentNode.getType() instanceof ItemArgument) {
+ node.clientNode = new com.mojang.brigadier.tree.ArgumentCommandNode<>(
+ argumentNode.getName(),
+ com.mojang.brigadier.arguments.StringArgumentType.greedyString(),
+ argumentNode.getCommand(),
+ argumentNode.getRequirement(),
+ argumentNode.getRedirect(),
+ argumentNode.getRedirectModifier(),
+ argumentNode.isFork(),
+ (ctx, builder) -> builder.buildFuture()
+ );
+ }
+ }
+ node.getChildren().forEach(GiveCommand::setClientNodes);
+ // Paper end - support component removals with a custom pgive command
}
private static int giveItem(CommandSourceStack source, ItemInput item, Collection<ServerPlayer> targets, int count) throws CommandSyntaxException {
diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
index 2ee33c55890fa659f6d251e486264c85d9e89802..dd1507f65a7f1d84bc7f236f81a60ac1302a13b8 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
@@ -96,6 +96,9 @@ public final class VanillaCommandWrapper extends BukkitCommand {
vanillaCommand = vanillaCommand.getRedirect();
}
final String commandName = vanillaCommand.getName();
+ if ("pgive".equals(stripDefaultNamespace(commandName))) {
+ return "bukkit.command.paper.pgive";
+ }
return "minecraft.command." + stripDefaultNamespace(commandName);
}
diff --git a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
index ca71c688b37ce2c8b712a4f9216cf872c8edf78e..2f3ff50bf3f70b6b404d02d5ffcc079162a63bc1 100644
--- a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
+++ b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java
@@ -45,6 +45,9 @@ public class MinecraftCommandPermissionsTest extends AbstractTestingBase {
Set<String> foundPerms = new HashSet<>();
for (CommandNode<CommandSourceStack> child : root.getChildren()) {
final String vanillaPerm = VanillaCommandWrapper.getPermission(child);
+ if ("bukkit.command.paper.pgive".equals(vanillaPerm)) { // skip our custom give command
+ continue;
+ }
if (!perms.contains(vanillaPerm)) {
missing.add("Missing permission for " + child.getName() + " (" + vanillaPerm + ") command");
} else {