Skip to content

Commit

Permalink
Updated Upstream (Bukkit/CraftBukkit)
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
e2160a1 Make MapCursor#type not depends on deprecated values

CraftBukkit Changes:
6ce1726 SPIGOT-7761: Ender pearl does not damage or spawn endermites
f5a63f7 SPIGOT-7759: Chunk not there when requested in ChunkUnloadEvent
2828725 Remove unused import
eb9a7dd SPIGOT-7757: Cannot set item in Stonecutter Inventory
f8be9d7 Move deserialized removed unhandled tags to dedicated removedTags
a7e5761 Fix potential mutability issue with CraftMetaItem copy constructor
9958854 SPIGOT-7741: Vanilla ItemComponent in commands can't remove components
9ef69aa PR-1284: Move ItemType <-> ItemMeta linking to a centralized place
3e82eaf PR-1420: Fix DirectEntity and CausingEntity Damager for Creepers ignited by Player
c23daa7 SPIGOT-7751: Fix crash caused by arrows from trial spawners
Make MapCursor#type not depends on deprecated values
SPIGOT-7761: Ender pearl does not damage or spawn endermites
  • Loading branch information
kennytv committed Jun 15, 2024
1 parent 5d834b1 commit 4bc15f1
Show file tree
Hide file tree
Showing 163 changed files with 758 additions and 725 deletions.
50 changes: 25 additions & 25 deletions patches/api/0006-Adventure.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4804,19 +4804,19 @@ index bd512a7840d4686759097ee4cbd8b375c530956b..f2242ddc4085f7e7cdd748d860857822
+ // Paper end - adventure
}
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index 7736ef1020b658206056af02fdb8c04de2d55541..4e84e3c5d0fa23bbb063d8429c18abcd7ee6b82a 100644
index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f100ea9467e 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -12,7 +12,7 @@ public final class MapCursor {
@@ -13,7 +13,7 @@ public final class MapCursor {
private byte x, y;
private byte direction, type;
private byte direction;
private boolean visible;
- private String caption;
+ private net.kyori.adventure.text.Component caption; // Paper
private Type type;

/**
* Initialize the map cursor.
@@ -26,7 +26,7 @@ public final class MapCursor {
@@ -28,7 +28,7 @@ public final class MapCursor {
*/
@Deprecated
public MapCursor(byte x, byte y, byte direction, byte type, boolean visible) {
Expand All @@ -4825,7 +4825,7 @@ index 7736ef1020b658206056af02fdb8c04de2d55541..4e84e3c5d0fa23bbb063d8429c18abcd
}

/**
@@ -39,7 +39,7 @@ public final class MapCursor {
@@ -41,7 +41,7 @@ public final class MapCursor {
* @param visible Whether the cursor is visible by default.
*/
public MapCursor(byte x, byte y, byte direction, @NotNull Type type, boolean visible) {
Expand All @@ -4834,22 +4834,22 @@ index 7736ef1020b658206056af02fdb8c04de2d55541..4e84e3c5d0fa23bbb063d8429c18abcd
}

/**
@@ -51,7 +51,7 @@ public final class MapCursor {
@@ -53,7 +53,7 @@ public final class MapCursor {
* @param type The type (color/style) of the map cursor.
* @param visible Whether the cursor is visible by default.
* @param caption cursor caption
- * @deprecated Magic value
+ * @deprecated Magic value. Use {@link #MapCursor(byte, byte, byte, byte, boolean, net.kyori.adventure.text.Component)}
- * @deprecated Magic value, use {@link #MapCursor(byte, byte, byte, Type, boolean, String)}
+ * @deprecated Magic value. Use {@link #MapCursor(byte, byte, byte, Type, boolean, net.kyori.adventure.text.Component)}
*/
@Deprecated
public MapCursor(byte x, byte y, byte direction, byte type, boolean visible, @Nullable String caption) {
@@ -60,8 +60,42 @@ public final class MapCursor {
@@ -62,8 +62,42 @@ public final class MapCursor {
setDirection(direction);
setRawType(type);
this.visible = visible;
- this.caption = caption;
+ this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper
}
+ }
+ // Paper start
+ /**
+ * Initialize the map cursor.
Expand All @@ -4867,7 +4867,7 @@ index 7736ef1020b658206056af02fdb8c04de2d55541..4e84e3c5d0fa23bbb063d8429c18abcd
+ this.x = x; this.y = y; this.visible = visible; this.caption = caption;
+ setDirection(direction);
+ setRawType(type);
+ }
}
+ /**
+ * Initialize the map cursor.
+ *
Expand All @@ -4887,25 +4887,25 @@ index 7736ef1020b658206056af02fdb8c04de2d55541..4e84e3c5d0fa23bbb063d8429c18abcd

/**
* Initialize the map cursor.
@@ -79,7 +113,7 @@ public final class MapCursor {
@@ -81,7 +115,7 @@ public final class MapCursor {
setDirection(direction);
setType(type);
this.type = type;
this.visible = visible;
- this.caption = caption;
+ this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper
}

/**
@@ -202,23 +236,45 @@ public final class MapCursor {
@@ -200,23 +234,45 @@ public final class MapCursor {
this.visible = visible;
}

+ // Paper start
+ /**
+ * Gets the caption on this cursor.
+ *
+ * @return caption
+ */
/**
* Gets the caption on this cursor.
*
* @return caption
*/
+ public net.kyori.adventure.text.@Nullable Component caption() {
+ return this.caption;
+ }
Expand All @@ -4918,12 +4918,12 @@ index 7736ef1020b658206056af02fdb8c04de2d55541..4e84e3c5d0fa23bbb063d8429c18abcd
+ this.caption = caption;
+ }
+ // Paper end
/**
* Gets the caption on this cursor.
*
* @return caption
+ /**
+ * Gets the caption on this cursor.
+ *
+ * @return caption
+ * @deprecated in favour of {@link #caption()}
*/
+ */
@Nullable
+ @Deprecated // Paper
public String getCaption() {
Expand Down
16 changes: 8 additions & 8 deletions patches/api/0166-Fix-Spigot-annotation-mistakes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1677,10 +1677,10 @@ index edef478786bb7456af29ca960009873095830050..e8ac449e6280827beb6d2699df75b1d5

/**
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index 4e84e3c5d0fa23bbb063d8429c18abcd7ee6b82a..a17b755da4eca0370680a9777ff3c7de422f5079 100644
index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711cc4d8e550 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -158,9 +158,9 @@ public final class MapCursor {
@@ -159,9 +159,9 @@ public final class MapCursor {
* Get the type of this cursor.
*
* @return The type (color/style) of the map cursor.
Expand All @@ -1690,9 +1690,9 @@ index 4e84e3c5d0fa23bbb063d8429c18abcd7ee6b82a..a17b755da4eca0370680a9777ff3c7de
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getRawType() {
return type;
return type.value;
}
@@ -217,9 +217,9 @@ public final class MapCursor {
@@ -216,9 +216,9 @@ public final class MapCursor {
* Set the type of this cursor.
*
* @param type The type (color/style) of the map cursor.
Expand All @@ -1702,9 +1702,9 @@ index 4e84e3c5d0fa23bbb063d8429c18abcd7ee6b82a..a17b755da4eca0370680a9777ff3c7de
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.2") // Paper
public void setRawType(byte type) {
if (type < 0 || type > 34) {
throw new IllegalArgumentException("Type must be in the range 0-34");
@@ -339,9 +339,9 @@ public final class MapCursor {
Type enumType = Type.byValue(type);
Preconditions.checkArgument(enumType != null, "Unknown type by id %s", type);
@@ -337,9 +337,9 @@ public final class MapCursor {
* Gets the internal value of the cursor.
*
* @return the value
Expand All @@ -1716,7 +1716,7 @@ index 4e84e3c5d0fa23bbb063d8429c18abcd7ee6b82a..a17b755da4eca0370680a9777ff3c7de
public byte getValue() {
return value;
}
@@ -351,9 +351,9 @@ public final class MapCursor {
@@ -349,9 +349,9 @@ public final class MapCursor {
*
* @param value the value
* @return the matching type
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0432-add-missing-Experimental-annotations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ index e404cd1e2ba44e4c2d09524bc7cf730d8ffbdabd..cea0ebf50876dd32ab7fba6025b30f29
public interface BundleMeta extends ItemMeta {

diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index a17b755da4eca0370680a9777ff3c7de422f5079..aa3b84ef523cd493b89159ed9d81fc19c2285709 100644
index 82993302cb3cf62ad4a94a0ebaa7711cc4d8e550..44773ab211f11e924aadea14b965ec52b0483377 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -311,12 +311,25 @@ public final class MapCursor {
@@ -309,12 +309,25 @@ public final class MapCursor {
BANNER_RED(24, "banner_red"),
BANNER_BLACK(25, "banner_black"),
RED_X(26, "red_x"),
Expand Down
30 changes: 0 additions & 30 deletions patches/api/0474-Allow-to-define-new-map-cursor-types.patch

This file was deleted.

6 changes: 3 additions & 3 deletions patches/server/0004-Test-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,11 @@ index ebcb65cb74acdb9d1bcf2b4b3551a2dc6d809bc9..7d9dbed7281099b78d7f898885b37cdc

@Test
diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java
index 4153866f3e630e54a23dc085aaac5e804344aa43..b8fe92fc75c611ee1efb82a8ab7089f28bf338ea 100644
index 1acdf5bc439c073c1777c2c4f5743ae082f4a621..bd13fd46f79ab9000b708526acbadcc7210c8a92 100644
--- a/src/test/java/org/bukkit/support/DummyServer.java
+++ b/src/test/java/org/bukkit/support/DummyServer.java
@@ -50,6 +50,15 @@ public final class DummyServer {
return registers.computeIfAbsent(aClass, key -> CraftRegistry.createRegistry(aClass, AbstractTestingBase.REGISTRY_CUSTOM));
@@ -99,6 +99,15 @@ public final class DummyServer {
return null;
});

+ // Paper start - testing additions
Expand Down
24 changes: 12 additions & 12 deletions patches/server/0009-MC-Utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6132,7 +6132,7 @@ index 40adb6117b9e0d5f70103113202a07715e403e2a..b1325e090f2c7aff31d27fc38ca7173e
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index 5d4336210e11ee39521b4096a5f0874329053cdc..09d7b416c02eb13c506e9dc92d78e983bf43f4f0 100644
index f40a2f348c45a29168ca3d4eef07b5b628060bee..c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -37,9 +37,9 @@ public class ChunkHolder extends GenerationChunkHolder {
Expand Down Expand Up @@ -6189,8 +6189,8 @@ index 5d4336210e11ee39521b4096a5f0874329053cdc..09d7b416c02eb13c506e9dc92d78e983
+ // Paper end
// CraftBukkit start
public LevelChunk getFullChunkNow() {
return (LevelChunk) this.getChunkIfPresent(ChunkStatus.FULL);
@@ -86,20 +112,20 @@ public class ChunkHolder extends GenerationChunkHolder {
// Note: We use the oldTicketLevel for isLoaded checks.
@@ -88,20 +114,20 @@ public class ChunkHolder extends GenerationChunkHolder {
}
// CraftBukkit end

Expand All @@ -6215,7 +6215,7 @@ index 5d4336210e11ee39521b4096a5f0874329053cdc..09d7b416c02eb13c506e9dc92d78e983
return (LevelChunk) ((ChunkResult) this.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).orElse(null); // CraftBukkit - decompile error
}

@@ -123,6 +149,20 @@ public class ChunkHolder extends GenerationChunkHolder {
@@ -125,6 +151,20 @@ public class ChunkHolder extends GenerationChunkHolder {

}

Expand All @@ -6236,7 +6236,7 @@ index 5d4336210e11ee39521b4096a5f0874329053cdc..09d7b416c02eb13c506e9dc92d78e983
public CompletableFuture<?> getSaveSyncFuture() {
return this.saveSync;
}
@@ -266,7 +306,7 @@ public class ChunkHolder extends GenerationChunkHolder {
@@ -268,7 +308,7 @@ public class ChunkHolder extends GenerationChunkHolder {
}

@Override
Expand All @@ -6245,7 +6245,7 @@ index 5d4336210e11ee39521b4096a5f0874329053cdc..09d7b416c02eb13c506e9dc92d78e983
return this.ticketLevel;
}

@@ -335,12 +375,28 @@ public class ChunkHolder extends GenerationChunkHolder {
@@ -337,12 +377,28 @@ public class ChunkHolder extends GenerationChunkHolder {

this.wasAccessibleSinceLastSave |= flag1;
if (!flag && flag1) {
Expand Down Expand Up @@ -6274,7 +6274,7 @@ index 5d4336210e11ee39521b4096a5f0874329053cdc..09d7b416c02eb13c506e9dc92d78e983
this.fullChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK);
this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
}
@@ -351,11 +407,25 @@ public class ChunkHolder extends GenerationChunkHolder {
@@ -353,11 +409,25 @@ public class ChunkHolder extends GenerationChunkHolder {
if (!flag2 && flag3) {
this.tickingChunkFuture = chunkLoadingManager.prepareTickingChunk(this);
this.scheduleFullChunkPromotion(chunkLoadingManager, this.tickingChunkFuture, executor, FullChunkStatus.BLOCK_TICKING);
Expand All @@ -6301,7 +6301,7 @@ index 5d4336210e11ee39521b4096a5f0874329053cdc..09d7b416c02eb13c506e9dc92d78e983
this.tickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
}

@@ -369,11 +439,24 @@ public class ChunkHolder extends GenerationChunkHolder {
@@ -371,11 +441,24 @@ public class ChunkHolder extends GenerationChunkHolder {

this.entityTickingChunkFuture = chunkLoadingManager.prepareEntityTickingChunk(this);
this.scheduleFullChunkPromotion(chunkLoadingManager, this.entityTickingChunkFuture, executor, FullChunkStatus.ENTITY_TICKING);
Expand All @@ -6327,7 +6327,7 @@ index 5d4336210e11ee39521b4096a5f0874329053cdc..09d7b416c02eb13c506e9dc92d78e983
this.entityTickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
}

@@ -423,4 +506,18 @@ public class ChunkHolder extends GenerationChunkHolder {
@@ -425,4 +508,18 @@ public class ChunkHolder extends GenerationChunkHolder {

List<ServerPlayer> getPlayers(ChunkPos chunkPos, boolean onlyOnWatchDistanceEdge);
}
Expand Down Expand Up @@ -6655,7 +6655,7 @@ index b6cc33943fe7e4667944f3e6f868b3033ea9ca18..27065ffc5473c518acee3a3096b83fac

while (objectiterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 47ae79cb2a03b43cbb881bcdea7ca231082b6614..117aca5a73dca70cd38c15e028c79d74eb834e81 100644
index d39268911ed7c4d60ee6a82178be23245aae58c4..ab57071cc6ce8b79d883f2426855c1abf577e90d 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -48,6 +48,7 @@ import net.minecraft.world.level.storage.LevelStorageSource;
Expand Down Expand Up @@ -7043,7 +7043,7 @@ index 586acbb52b0fcb09cda195b49b6c737a29a4e35e..b0843917caedc32f800c50cc54706ace
public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 791c647de951f996f25bcc4418a6e820ab0512c9..9deb6b90f3c4281280deb2f609a55923147a675a 100644
index 726354da4a0008c0f09a0ac8a668378c75ee99b0..2345d79ebf1562054cb071ff1786392a937c8243 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -282,6 +282,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
Expand Down Expand Up @@ -7866,7 +7866,7 @@ index 91539582b65a87e2ed9901f2837c3148455d2669..c025542b1073ce7e6e30a43744276fd1
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 9e8526a1d1f4f66031903cac7eecbc4edc22a33b..c557a54f15943e07d272c3ad41ca4f90c4dc82ac 100644
index 48e3923347341f1bb2027cf48b0dea9d0dcd20cf..21ed720118073b14bc8b5d1d665b0e17a8bbc1d2 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -22,6 +22,20 @@ import org.bukkit.material.MaterialData;
Expand Down
Loading

0 comments on commit 4bc15f1

Please sign in to comment.