Updated Upstream (Bukkit/CraftBukkit)

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:
e2160a18 Make MapCursor#type not depends on deprecated values

CraftBukkit Changes:
6ce172642 SPIGOT-7761: Ender pearl does not damage or spawn endermites
f5a63f734 SPIGOT-7759: Chunk not there when requested in ChunkUnloadEvent
28287259c Remove unused import
eb9a7dde0 SPIGOT-7757: Cannot set item in Stonecutter Inventory
f8be9d752 Move deserialized removed unhandled tags to dedicated removedTags
a7e576186 Fix potential mutability issue with CraftMetaItem copy constructor
995885452 SPIGOT-7741: Vanilla ItemComponent in commands can't remove components
9ef69aa0b PR-1284: Move ItemType <-> ItemMeta linking to a centralized place
3e82eafbe PR-1420: Fix DirectEntity and CausingEntity Damager for Creepers ignited by Player
c23daa71f 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
This commit is contained in:
Nassim Jahnke
2024-06-15 18:28:18 +02:00
parent 9b3cf41d7a
commit efb91589dc
20 changed files with 311 additions and 278 deletions

View File

@@ -4809,13 +4809,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -0,0 +0,0 @@ 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.
@@ -0,0 +0,0 @@ public final class MapCursor {
*/
@Deprecated
@@ -4838,8 +4838,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @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) {
@@ -4849,7 +4849,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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.
@@ -4867,7 +4867,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.x = x; this.y = y; this.visible = visible; this.caption = caption;
+ setDirection(direction);
+ setRawType(type);
+ }
}
+ /**
+ * Initialize the map cursor.
+ *
@@ -4889,7 +4889,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* Initialize the map cursor.
@@ -0,0 +0,0 @@ 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
@@ -4901,11 +4901,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+ // 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;
+ }
@@ -4918,12 +4918,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ 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() {

View File

@@ -1,30 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Date: Fri, 24 May 2024 20:19:07 +0200
Subject: [PATCH] Allow to define new map cursor types
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -0,0 +0,0 @@ public final class MapCursor {
*/
@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");
+ if (type < 0 || type > Type.UPPER_MAP_CURSOR_TYPE_BOUND) { // Paper
+ throw new IllegalArgumentException("Type must be in the range 0-" + Type.UPPER_MAP_CURSOR_TYPE_BOUND); // Paper
}
this.type = type;
}
@@ -0,0 +0,0 @@ public final class MapCursor {
TRIAL_CHAMBERS(34, "trial_chambers")
;
+ static final int UPPER_MAP_CURSOR_TYPE_BOUND = Type.values().length - 1; // Paper - cached max value of Type
+
private byte value;
private final NamespacedKey key;

View File

@@ -1690,7 +1690,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getRawType() {
return type;
return type.value;
}
@@ -0,0 +0,0 @@ public final class MapCursor {
* Set the type of this cursor.
@@ -1702,8 +1702,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- @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");
Type enumType = Type.byValue(type);
Preconditions.checkArgument(enumType != null, "Unknown type by id %s", type);
@@ -0,0 +0,0 @@ public final class MapCursor {
* Gets the internal value of the cursor.
*