Begin update to 1.20.5

This commit is contained in:
Jake Potrebic 2024-04-23 10:02:08 -07:00
parent 73da69c09e
commit 47ee5579ff
1080 changed files with 381 additions and 528 deletions

View file

@ -40,7 +40,7 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<version>1.20.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
@ -53,17 +53,17 @@ repositories {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.20.5-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
```
How To (Compiling Jar From Source)
------
To compile Paper, you need JDK 17 and an internet connection.
To compile Paper, you need JDK 21 and an internet connection.
Clone this repo, run `./gradlew applyPatches`, then `./gradlew createReobfBundlerJar` from your terminal. You can find the compiled jar in the project root's `build/libs` directory.

View file

@ -20,7 +20,7 @@ allprojects {
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}
}
@ -30,7 +30,7 @@ val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
subprojects {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release = 17
options.release = 21
}
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
@ -67,10 +67,10 @@ repositories {
}
dependencies {
paramMappings("net.fabricmc:yarn:1.20.4+build.1:mergedv2")
paramMappings("net.fabricmc:yarn:1.20.5+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.10.1:fat")
decompiler("org.vineflower:vineflower:1.10.1")
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.6")
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.12")
paperclip("io.papermc:paperclip:3.0.3")
}

View file

@ -1,9 +1,9 @@
group=io.papermc.paper
version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4
version=1.20.5-R0.1-SNAPSHOT
mcVersion=1.20.5
# Set to true while updating Minecraft version
updatingMinecraft=false
updatingMinecraft=true
org.gradle.caching=true
org.gradle.parallel=true

View file

@ -9,11 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/inventory/EquipmentSlot.java
+++ b/src/main/java/org/bukkit/inventory/EquipmentSlot.java
@@ -0,0 +0,0 @@ public enum EquipmentSlot {
LEGS,
CHEST,
HEAD
public EquipmentSlotGroup getGroup() {
return group;
}
+ // Paper start
+ ;
+ /**
+ * Checks whether this equipment slot is a hand:
+ * either {@link #HAND} or {@link #OFF_HAND}
@ -28,12 +27,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Checks whether this equipment slot
+ * is one of the armor slots:
+ * {@link #HEAD}, {@link #CHEST},
+ * {@link #LEGS}, or {@link #FEET}
+ * {@link #LEGS}, {@link #FEET}, or {@link #BODY}
+ *
+ * @return whether this is an armor slot
+ */
+ public boolean isArmor() {
+ return this == HEAD || this == CHEST || this == LEGS || this == FEET;
+ return this == HEAD || this == CHEST || this == LEGS || this == FEET || this == BODY;
+ }
+ // Paper end
}

View file

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/Tag.java
@@ -0,0 +0,0 @@ public interface Tag<T extends Keyed> extends Keyed {
*/
Tag<EntityType> ENTITY_TYPES_CAN_TURN_IN_BOATS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_turn_in_boats"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_REDIRECTABLE_PROJECTILE = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("redirectable_projectile"), EntityType.class);
+ // Paper start
+ String REGISTRY_GAME_EVENTS = "game_events";

View file

@ -195,8 +195,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-public abstract class MusicInstrument implements Keyed {
+public abstract class MusicInstrument implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - translation keys
public static final MusicInstrument PONDER = getInstrument("ponder_goat_horn");
public static final MusicInstrument SING = getInstrument("sing_goat_horn");
public static final MusicInstrument PONDER_GOAT_HORN = getInstrument("ponder_goat_horn");
public static final MusicInstrument SING_GOAT_HORN = getInstrument("sing_goat_horn");
@@ -0,0 +0,0 @@ public abstract class MusicInstrument implements Keyed {
return instrument;

View file

@ -20,11 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Visual effect of a splash potion breaking. Needs color data value as
* additional info.
*/
- POTION_BREAK(2002, Type.VISUAL, Potion.class),
+ POTION_BREAK(2002, Type.VISUAL, Color.class, Potion.class), // Paper - color is correct
/**
* Visual effect of an instant splash potion breaking. Needs color data
* value as additional info.
POTION_BREAK(2002, Type.VISUAL, Color.class),
@@ -0,0 +0,0 @@ public enum Effect {
* block.
*/

View file

@ -10,15 +10,6 @@ diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
@@ -0,0 +0,0 @@ package org.bukkit.event.player;
import java.net.InetAddress;
import java.util.UUID;
+import com.destroystokyo.paper.profile.PlayerProfile;
+import org.bukkit.Bukkit;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
@@ -0,0 +0,0 @@ public class AsyncPlayerPreLoginEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private Result result;
@ -26,31 +17,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- private final String name;
private final InetAddress ipAddress;
- private final UUID uniqueId;
+ private PlayerProfile profile; // Paper
+ private com.destroystokyo.paper.profile.PlayerProfile profile; // Paper
+ private final InetAddress rawAddress; // Paper
+ private final String hostname; // Paper
private final boolean transferred;
@Deprecated
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress) {
@@ -0,0 +0,0 @@ public class AsyncPlayerPreLoginEvent extends Event {
}
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId) {
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, boolean transferred) {
+ // Paper start
+ this(name, ipAddress, uniqueId, Bukkit.createProfile(uniqueId, name));
+ this(name, ipAddress, uniqueId, transferred, org.bukkit.Bukkit.createProfile(uniqueId, name));
+ }
+
+ @Deprecated(forRemoval = true)
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile) {
+ this(name, ipAddress, ipAddress, uniqueId, profile);
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, boolean transferred, @NotNull com.destroystokyo.paper.profile.PlayerProfile profile) {
+ this(name, ipAddress, ipAddress, uniqueId, transferred, profile);
+ }
+
+ @Deprecated(forRemoval = true)
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final InetAddress rawAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile) {
+ this(name, ipAddress, rawAddress, uniqueId, profile, "");
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final InetAddress rawAddress, @NotNull final UUID uniqueId, boolean transferred, @NotNull com.destroystokyo.paper.profile.PlayerProfile profile) {
+ this(name, ipAddress, rawAddress, uniqueId, transferred, profile, "");
+ }
+
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final InetAddress rawAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile, @NotNull String hostname) {
+ @org.jetbrains.annotations.ApiStatus.Internal
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final InetAddress rawAddress, @NotNull final UUID uniqueId, boolean transferred, @NotNull com.destroystokyo.paper.profile.PlayerProfile profile, @NotNull String hostname) {
+ // Paper end
super(true);
this.result = Result.ALLOWED;
this.message = net.kyori.adventure.text.Component.empty(); // Paper
@ -58,12 +51,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.profile = profile;
this.ipAddress = ipAddress;
- this.uniqueId = uniqueId;
+ this.rawAddress = rawAddress;
+ this.hostname = hostname;
+ // Paper end
+ this.rawAddress = rawAddress; // Paper
+ this.hostname = hostname; // Paper
this.transferred = transferred;
}
/**
@@ -0,0 +0,0 @@ public class AsyncPlayerPreLoginEvent extends Event {
*/
@NotNull
@ -87,7 +79,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @return The Profile
+ */
+ @NotNull
+ public PlayerProfile getPlayerProfile() {
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() {
+ return profile;
+ }
+
@ -95,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Changes the PlayerProfile the player will login as
+ * @param profile The profile to use
+ */
+ public void setPlayerProfile(@NotNull PlayerProfile profile) {
+ public void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile) {
+ this.profile = profile;
+ }
+
@ -120,6 +112,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
+
@NotNull
@Override
public HandlerList getHandlers() {
/**
* Gets if this connection has been transferred from another server.
*

View file

@ -1771,13 +1771,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return false;
@@ -0,0 +0,0 @@ public abstract class Command {
* command
*
* @return Permission check failed message
+ * @deprecated use {@link #permissionMessage()}
*/
@Deprecated
@Nullable
+ @Deprecated // Paper
public String getPermissionMessage() {
- return permissionMessage;
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serializeOrNull(permissionMessage); // Paper
@ -1785,13 +1780,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
@@ -0,0 +0,0 @@ public abstract class Command {
* @param permissionMessage new permission message, null to indicate
* default message, or an empty string to indicate no message
* @return this command object, for chaining
+ * @deprecated use {@link #permissionMessage(net.kyori.adventure.text.Component)}
*/
@Deprecated
@NotNull
+ @Deprecated // Paper
public Command setPermissionMessage(@Nullable String permissionMessage) {
- this.permissionMessage = permissionMessage;
+ this.permissionMessage = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserializeOrNull(permissionMessage); // Paper
@ -1807,7 +1797,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Gets the permission message.
+ *
+ * @return the permission message
+ * @deprecated permission messages have not worked for player-executed
+ * commands since 1.13 as clients without permission to execute a command
+ * are unaware of its existence and therefore will not send an unknown
+ * command execution to the server. This message will only ever be shown to
+ * consoles or when this command is executed with
+ * {@link Bukkit#dispatchCommand(CommandSender, String)}.
+ */
+ @Deprecated
+ public net.kyori.adventure.text.@Nullable Component permissionMessage() {
+ return this.permissionMessage;
+ }
@ -1816,7 +1813,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Sets the permission message.
+ *
+ * @param permissionMessage the permission message
+ * @deprecated permission messages have not worked for player-executed
+ * commands since 1.13 as clients without permission to execute a command
+ * are unaware of its existence and therefore will not send an unknown
+ * command execution to the server. This message will only ever be shown to
+ * consoles or when this command is executed with
+ * {@link Bukkit#dispatchCommand(CommandSender, String)}.
+ */
+ @Deprecated
+ public void permissionMessage(net.kyori.adventure.text.@Nullable Component permissionMessage) {
+ this.permissionMessage = permissionMessage;
+ }
@ -3354,7 +3358,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final InetAddress ipAddress;
private final UUID uniqueId;
@@ -0,0 +0,0 @@ public class AsyncPlayerPreLoginEvent extends Event {
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId) {
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, boolean transferred) {
super(true);
this.result = Result.ALLOWED;
- this.message = "";
@ -4357,187 +4361,7 @@ diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/ja
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
* Represents a book ({@link Material#WRITABLE_BOOK} or {@link
* Material#WRITTEN_BOOK}) that can have a title, an author, and pages.
*/
-public interface BookMeta extends ItemMeta {
+public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book { // Paper
/**
* Represents the generation (or level of copying) of a written book
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
*/
boolean hasPages();
+ // Paper start
+ /**
+ * Gets the title of the book.
+ * <p>
+ * Plugins should check that hasTitle() returns true before calling this
+ * method.
+ *
+ * @return the title of the book
+ */
+ @Override
+ net.kyori.adventure.text.@Nullable Component title();
+
+ /**
+ * Sets the title of the book.
+ * <p>
+ * Limited to 32 characters. Removes title when given null.
+ *
+ * @param title the title to set
+ * @return the same {@link BookMeta} instance
+ */
+ @org.jetbrains.annotations.Contract(value = "_ -> this", pure = false)
+ @Override
+ @NotNull BookMeta title(net.kyori.adventure.text.@Nullable Component title);
+
+ /**
+ * Gets the author of the book.
+ * <p>
+ * Plugins should check that hasAuthor() returns true before calling this
+ * method.
+ *
+ * @return the author of the book
+ */
+ @Override
+ net.kyori.adventure.text.@Nullable Component author();
+
+ /**
+ * Sets the author of the book. Removes author when given null.
+ *
+ * @param author the author to set
+ * @return the same {@link BookMeta} instance
+ */
+ @org.jetbrains.annotations.Contract(value = "_ -> this", pure = false)
+ @Override
+ @NotNull BookMeta author(net.kyori.adventure.text.@Nullable Component author);
+
+ /**
+ * Gets the specified page in the book. The page must exist.
+ * <p>
+ * Pages are 1-indexed.
+ *
+ * @param page the page number to get, in range [1, getPageCount()]
+ * @return the page from the book
+ */
+ net.kyori.adventure.text.@NotNull Component page(int page);
+
+ /**
+ * Sets the specified page in the book. Pages of the book must be
+ * contiguous.
+ * <p>
+ * The data can be up to 1024 characters in length, additional characters
+ * are truncated.
+ * <p>
+ * Pages are 1-indexed.
+ *
+ * @param page the page number to set, in range [1, getPageCount()]
+ * @param data the data to set for that page
+ */
+ void page(int page, net.kyori.adventure.text.@NotNull Component data);
+
+ /**
+ * Adds new pages to the end of the book. Up to a maximum of 100 pages with
+ * 1024 characters per page.
+ *
+ * @param pages A list of strings, each being a page
+ */
+ void addPages(net.kyori.adventure.text.@NotNull Component @NotNull ... pages);
+
+ interface BookMetaBuilder extends Builder {
+
+ @Override
+ @NotNull BookMetaBuilder title(net.kyori.adventure.text.@Nullable Component title);
+
+ @Override
+ @NotNull BookMetaBuilder author(net.kyori.adventure.text.@Nullable Component author);
+
+ @Override
+ @NotNull BookMetaBuilder addPage(net.kyori.adventure.text.@NotNull Component page);
+
+ @Override
+ @NotNull BookMetaBuilder pages(net.kyori.adventure.text.@NotNull Component @NotNull ... pages);
+
+ @Override
+ @NotNull BookMetaBuilder pages(java.util.@NotNull Collection<net.kyori.adventure.text.Component> pages);
+
+ @Override
+ @NotNull BookMeta build();
+ }
+
+ @Override
+ @NotNull BookMetaBuilder toBuilder();
+
+ // Paper end
+
/**
* Gets the specified page in the book. The given page must exist.
* <p>
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
*
* @param page the page number to get, in range [1, getPageCount()]
* @return the page from the book
+ * @deprecated in favour of {@link #page(int)}
*/
@NotNull
+ @Deprecated // Paper
String getPage(int page);
/**
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
*
* @param page the page number to set, in range [1, getPageCount()]
* @param data the data to set for that page
+ * @deprecated in favour of {@link #page(int, net.kyori.adventure.text.Component)}
*/
+ @Deprecated // Paper
void setPage(int page, @NotNull String data);
/**
* Gets all the pages in the book.
*
* @return list of all the pages in the book
+ * @deprecated in favour of {@link #pages()}
*/
@NotNull
+ @Deprecated // Paper
List<String> getPages();
/**
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 100 pages with 1024 characters per page.
*
* @param pages A list of pages to set the book to use
+ * @deprecated in favour of {@link #pages(List)}
*/
+ @Deprecated // Paper
void setPages(@NotNull List<String> pages);
/**
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 100 pages with 1024 characters per page.
*
* @param pages A list of strings, each being a page
+ * @deprecated in favour of {@link #pages(net.kyori.adventure.text.Component...)}
*/
+ @Deprecated // Paper
void setPages(@NotNull String... pages);
/**
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
* 1024 characters per page.
*
* @param pages A list of strings, each being a page
+ * @deprecated in favour of {@link #addPages(net.kyori.adventure.text.Component...)}
*/
+ @Deprecated // Paper
void addPage(@NotNull String... pages);
/**
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
@@ -0,0 +0,0 @@ public interface BookMeta extends WritableBookMeta {
*
* @param page the page number to get
* @return the page from the book
@ -4548,7 +4372,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public BaseComponent[] getPage(int page) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
@@ -0,0 +0,0 @@ public interface BookMeta extends WritableBookMeta {
*
* @param page the page number to set
* @param data the data to set for that page
@ -4558,7 +4382,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void setPage(int page, @Nullable BaseComponent... data) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
@@ -0,0 +0,0 @@ public interface BookMeta extends WritableBookMeta {
* Gets all the pages in the book.
*
* @return list of all the pages in the book
@ -4569,7 +4393,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public List<BaseComponent[]> getPages() {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
@@ -0,0 +0,0 @@ public interface BookMeta extends WritableBookMeta {
* pages. Maximum 50 pages with 256 characters per page.
*
* @param pages A list of pages to set the book to use
@ -4579,7 +4403,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void setPages(@NotNull List<BaseComponent[]> pages) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
@@ -0,0 +0,0 @@ public interface BookMeta extends WritableBookMeta {
* pages. Maximum 50 pages with 256 characters per page.
*
* @param pages A list of component arrays, each being a page
@ -4589,7 +4413,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void setPages(@NotNull BaseComponent[]... pages) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
@@ -0,0 +0,0 @@ public interface BookMeta extends WritableBookMeta {
* with 256 characters per page.
*
* @param pages A list of component arrays, each being a page
@ -4692,6 +4516,189 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Deprecated // Paper
void setLore(@Nullable List<String> lore);
/**
diff --git a/src/main/java/org/bukkit/inventory/meta/WritableBookMeta.java b/src/main/java/org/bukkit/inventory/meta/WritableBookMeta.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/WritableBookMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/WritableBookMeta.java
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
* Represents a book ({@link Material#WRITABLE_BOOK} or {@link
* Material#WRITTEN_BOOK}) that can have pages.
*/
-public interface WritableBookMeta extends ItemMeta {
+public interface WritableBookMeta extends ItemMeta, net.kyori.adventure.inventory.Book { // Paper
/**
* Checks for the existence of pages in the book.
@@ -0,0 +0,0 @@ public interface WritableBookMeta extends ItemMeta {
*/
boolean hasPages();
+ // Paper start
+ /**
+ * Gets the title of the book.
+ * <p>
+ * Plugins should check that hasTitle() returns true before calling this
+ * method.
+ *
+ * @return the title of the book
+ */
+ @Override
+ net.kyori.adventure.text.@org.jetbrains.annotations.Nullable Component title();
+
+ /**
+ * Sets the title of the book.
+ * <p>
+ * Limited to 32 characters. Removes title when given null.
+ *
+ * @param title the title to set
+ * @return the same {@link BookMeta} instance
+ */
+ @org.jetbrains.annotations.Contract(value = "_ -> this", pure = false)
+ @Override
+ @NotNull BookMeta title(net.kyori.adventure.text.@org.jetbrains.annotations.Nullable Component title);
+
+ /**
+ * Gets the author of the book.
+ * <p>
+ * Plugins should check that hasAuthor() returns true before calling this
+ * method.
+ *
+ * @return the author of the book
+ */
+ @Override
+ net.kyori.adventure.text.@org.jetbrains.annotations.Nullable Component author();
+
+ /**
+ * Sets the author of the book. Removes author when given null.
+ *
+ * @param author the author to set
+ * @return the same {@link BookMeta} instance
+ */
+ @org.jetbrains.annotations.Contract(value = "_ -> this", pure = false)
+ @Override
+ @NotNull BookMeta author(net.kyori.adventure.text.@org.jetbrains.annotations.Nullable Component author);
+
+ /**
+ * Gets the specified page in the book. The page must exist.
+ * <p>
+ * Pages are 1-indexed.
+ *
+ * @param page the page number to get, in range [1, getPageCount()]
+ * @return the page from the book
+ */
+ net.kyori.adventure.text.@NotNull Component page(int page);
+
+ /**
+ * Sets the specified page in the book. Pages of the book must be
+ * contiguous.
+ * <p>
+ * The data can be up to 1024 characters in length, additional characters
+ * are truncated.
+ * <p>
+ * Pages are 1-indexed.
+ *
+ * @param page the page number to set, in range [1, getPageCount()]
+ * @param data the data to set for that page
+ */
+ void page(int page, net.kyori.adventure.text.@NotNull Component data);
+
+ /**
+ * Adds new pages to the end of the book. Up to a maximum of 100 pages with
+ * 1024 characters per page.
+ *
+ * @param pages A list of strings, each being a page
+ */
+ void addPages(net.kyori.adventure.text.@NotNull Component @NotNull ... pages);
+
+ interface BookMetaBuilder extends net.kyori.adventure.inventory.Book.Builder {
+
+ @Override
+ @NotNull BookMetaBuilder title(net.kyori.adventure.text.@org.jetbrains.annotations.Nullable Component title);
+
+ @Override
+ @NotNull BookMetaBuilder author(net.kyori.adventure.text.@org.jetbrains.annotations.Nullable Component author);
+
+ @Override
+ @NotNull BookMetaBuilder addPage(net.kyori.adventure.text.@NotNull Component page);
+
+ @Override
+ @NotNull BookMetaBuilder pages(net.kyori.adventure.text.@NotNull Component @NotNull ... pages);
+
+ @Override
+ @NotNull BookMetaBuilder pages(java.util.@NotNull Collection<net.kyori.adventure.text.Component> pages);
+
+ @Override
+ @NotNull BookMeta build();
+ }
+
+ @Override
+ @NotNull BookMetaBuilder toBuilder();
+ // Paper end
+
/**
* Gets the specified page in the book. The given page must exist.
* <p>
@@ -0,0 +0,0 @@ public interface WritableBookMeta extends ItemMeta {
*
* @param page the page number to get, in range [1, getPageCount()]
* @return the page from the book
+ * @deprecated in favour of {@link #page(int)}
*/
@NotNull
+ @Deprecated // Paper
String getPage(int page);
/**
@@ -0,0 +0,0 @@ public interface WritableBookMeta extends ItemMeta {
*
* @param page the page number to set, in range [1, getPageCount()]
* @param data the data to set for that page
+ * @deprecated in favour of {@link #page(int, net.kyori.adventure.text.Component)}
*/
+ @Deprecated // Paper
void setPage(int page, @NotNull String data);
/**
* Gets all the pages in the book.
*
* @return list of all the pages in the book
+ * @deprecated in favour of {@link #pages()}
*/
@NotNull
+ @Deprecated // Paper
List<String> getPages();
/**
@@ -0,0 +0,0 @@ public interface WritableBookMeta extends ItemMeta {
* pages. Maximum 100 pages with 1024 characters per page.
*
* @param pages A list of pages to set the book to use
+ * @deprecated in favour of {@link #pages(List)}
*/
+ @Deprecated // Paper
void setPages(@NotNull List<String> pages);
/**
@@ -0,0 +0,0 @@ public interface WritableBookMeta extends ItemMeta {
* pages. Maximum 100 pages with 1024 characters per page.
*
* @param pages A list of strings, each being a page
+ * @deprecated in favour of {@link #pages(net.kyori.adventure.text.Component...)}
*/
+ @Deprecated // Paper
void setPages(@NotNull String... pages);
/**
@@ -0,0 +0,0 @@ public interface WritableBookMeta extends ItemMeta {
* 1024 characters per page.
*
* @param pages A list of strings, each being a page
+ * @deprecated in favour of {@link #addPages(net.kyori.adventure.text.Component...)}
*/
+ @Deprecated // Paper
void addPage(@NotNull String... pages);
/**
diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -4724,9 +4731,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
+++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
@@ -0,0 +0,0 @@ public interface TrimPattern extends Keyed, Translatable {
* {@link Material#HOST_ARMOR_TRIM_SMITHING_TEMPLATE}.
* {@link Material#BOLT_ARMOR_TRIM_SMITHING_TEMPLATE}.
*/
public static final TrimPattern HOST = Registry.TRIM_PATTERN.get(NamespacedKey.minecraft("host"));
public static final TrimPattern BOLT = Registry.TRIM_PATTERN.get(NamespacedKey.minecraft("bolt"));
+
+ // Paper start - adventure
+ /**

View file

@ -1,46 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tamion <70228790+notTamion@users.noreply.github.com>
Date: Sat, 27 Jan 2024 20:46:29 +0100
Subject: [PATCH] Conduit API
diff --git a/src/main/java/org/bukkit/block/Conduit.java b/src/main/java/org/bukkit/block/Conduit.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/block/Conduit.java
+++ b/src/main/java/org/bukkit/block/Conduit.java
@@ -0,0 +0,0 @@ package org.bukkit.block;
/**
* Represents a captured state of a conduit.
*/
-public interface Conduit extends TileState { }
+public interface Conduit extends TileState {
+
+ // Paper start - Conduit API
+
+ /**
+ * Gets if the conduit is currently active.
+ * <p>
+ * Requires the conduit to be placed in the world.
+ *
+ * @return if the conduit is active
+ */
+ boolean isActive();
+
+ /**
+ * Gets the range in which the Conduit Power effect gets added to players.
+ * <p>
+ * Requires the conduit to be placed in the world.
+ *
+ * @return the range
+ */
+ int getRange();
+
+ /**
+ * Gets the current target of the conduit.
+ *
+ * @return the current target
+ */
+ @org.jetbrains.annotations.Nullable
+ org.bukkit.entity.LivingEntity getTarget();
+ // Paper end - Conduit API
+}

View file

@ -135,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId>
- <version>1.20.4-R0.1-SNAPSHOT</version>
- <version>1.20.5-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>Spigot-API</name>
@ -144,8 +144,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-
- <properties>
- <skipTests>true</skipTests>
- <maven.compiler.source>17</maven.compiler.source>
- <maven.compiler.target>17</maven.compiler.target>
- <maven.compiler.release>17</maven.compiler.release>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
@ -266,7 +265,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.11.0</version>
- <version>3.13.0</version>
- <configuration>
- <!-- we use the Eclipse compiler as it doesn't need a JDK -->
- <compilerId>eclipse</compilerId>
@ -277,7 +276,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-eclipse</artifactId>
- <version>2.13.0</version>
- <version>2.15.0</version>
- </dependency>
- </dependencies>
- </plugin>

View file

@ -1,21 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Wesley Smith <me@wesjd.net>
Date: Fri, 24 Apr 2020 18:30:26 -0400
Subject: [PATCH] Fix Potion#toItemStack swapping the extended and upgraded
constructor values.
While the Potion class is deprecated, it is still used in some plugins for cross-version potion handling. This issue has existed for a long time, and has caused many heaches along the way.
diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/potion/Potion.java
+++ b/src/main/java/org/bukkit/potion/Potion.java
@@ -0,0 +0,0 @@ public class Potion {
}
ItemStack itemStack = new ItemStack(material, amount);
PotionMeta meta = (PotionMeta) itemStack.getItemMeta();
- meta.setBasePotionData(new PotionData(type, level == 2, extended));
+ meta.setBasePotionData(new PotionData(type, extended, level == 2)); // Paper - fix swapped values
itemStack.setItemMeta(meta);
return itemStack;
}

View file

@ -452,42 +452,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public byte getId() {
return note;
}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -0,0 +0,0 @@ public enum Particle implements Keyed {
BLOCK_CRACK("block", BlockData.class),
/**
* Uses {@link BlockData} as DataType
+ * @deprecated use {@link #BLOCK_CRACK}
*/
+ @Deprecated // Paper
BLOCK_DUST("block", BlockData.class, false),
WATER_DROP("rain"),
MOB_APPEARANCE("elder_guardian"),
@@ -0,0 +0,0 @@ public enum Particle implements Keyed {
// ----- Legacy Separator -----
/**
* Uses {@link MaterialData} as DataType
+ * @deprecated {@link MaterialData} is deprecated API
*/
+ @Deprecated // Paper
LEGACY_BLOCK_CRACK(null, MaterialData.class, false),
/**
* Uses {@link MaterialData} as DataType
+ * @deprecated {@link MaterialData} is deprecated API
*/
+ @Deprecated // Paper
LEGACY_BLOCK_DUST(null, MaterialData.class, false),
/**
* Uses {@link MaterialData} as DataType
+ * @deprecated {@link MaterialData} is deprecated API
*/
+ @Deprecated // Paper
LEGACY_FALLING_DUST(null, MaterialData.class, false);
private final NamespacedKey key;
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/Registry.java
@ -939,32 +903,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-@Deprecated
+@Deprecated(forRemoval = true) // Paper
public interface SplashPotion extends ThrownPotion { }
diff --git a/src/main/java/org/bukkit/entity/TextDisplay.java b/src/main/java/org/bukkit/entity/TextDisplay.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/TextDisplay.java
+++ b/src/main/java/org/bukkit/entity/TextDisplay.java
@@ -0,0 +0,0 @@ public interface TextDisplay extends Display {
* Gets the text background color.
*
* @return the background color
- * @deprecated API subject to change
*/
@Nullable
- @Deprecated
+ // @Deprecated // Paper - is stable API
Color getBackgroundColor();
/**
* Sets the text background color.
*
* @param color new background color
- * @deprecated API subject to change
*/
- @Deprecated
+ // @Deprecated // Paper - is stable API
void setBackgroundColor(@Nullable Color color);
/**
diff --git a/src/main/java/org/bukkit/entity/memory/MemoryKey.java b/src/main/java/org/bukkit/entity/memory/MemoryKey.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/memory/MemoryKey.java
@ -1651,32 +1589,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
*
+ * @deprecated Use {@link ItemMeta#displayName()} and check if it is instanceof a {@link net.kyori.adventure.text.TranslatableComponent}.
* @return true if this has a localized name
* @deprecated meta no longer exists
*/
+ @Deprecated // Paper - Deprecate old localized API
boolean hasLocalizedName();
/**
@@ -0,0 +0,0 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* Plugins should check that hasLocalizedName() returns <code>true</code>
* before calling this method.
*
+ * @deprecated Use {@link ItemMeta#displayName()} and cast it to a {@link net.kyori.adventure.text.TranslatableComponent}. No longer used by the client.
* @return the localized name that is set
* @deprecated meta no longer exists
*/
+ @Deprecated // Paper - Deprecate old localized API
@NotNull
@Deprecated(forRemoval = true)
String getLocalizedName();
@@ -0,0 +0,0 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
/**
* Sets the localized name.
*
+ * @deprecated Use {@link ItemMeta#displayName(Component)} with a {@link net.kyori.adventure.text.TranslatableComponent}. No longer used by the client.
* @param name the name to set
* @deprecated meta no longer exists
*/
+ @Deprecated // Paper - Deprecate old localized API
void setLocalizedName(@Nullable String name);
/**
diff --git a/src/main/java/org/bukkit/inventory/meta/MapMeta.java b/src/main/java/org/bukkit/inventory/meta/MapMeta.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/MapMeta.java

View file

@ -54,9 +54,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
@@ -0,0 +0,0 @@ public abstract class PotionEffectType implements Keyed, Translatable {
return from;
public static PotionEffectType[] values() {
return Lists.newArrayList(Registry.EFFECT).toArray(new PotionEffectType[0]);
}
+
+ // Paper start
+ /**
+ * Gets the effect attributes in an immutable map.

View file

@ -105,47 +105,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@NotNull
@Override
public HandlerList getHandlers() {
diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
+++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
@@ -0,0 +0,0 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Entity dismounted;
+ private final boolean isCancellable; // Paper
public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted) {
- super(what);
+ // Paper start
+ this(what, dismounted, true);
+ }
+
+
+ public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted, boolean isCancellable) {
+ // Paper end
+ super( what );
this.dismounted = dismounted;
+ this.isCancellable = isCancellable; // Paper
}
@NotNull
@@ -0,0 +0,0 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable {
@Override
public void setCancelled(boolean cancel) {
+ // Paper start
+ if (cancel && !isCancellable) {
+ return;
+ }
this.cancelled = cancel;
}
+ public boolean isCancellable() {
+ return isCancellable;
+ // Paper end
+ }
+
@NotNull
@Override
public HandlerList getHandlers() {

View file

@ -52,8 +52,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ void setDisplayNameComponent(@Nullable net.md_5.bungee.api.chat.BaseComponent[] component);
+ // Paper end
/**
* Checks for existence of a localized name.
*
* Checks for existence of an item name.
* <br>
@@ -0,0 +0,0 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@Nullable
List<String> getLore();

View file

@ -254,6 +254,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
BEE_SPAWN_EGG(22924),
BLAZE_SPAWN_EGG(4759),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
BOGGED_SPAWN_EGG(12042),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
BREEZE_SPAWN_EGG(7580),
CAT_SPAWN_EGG(29583),
@ -363,8 +366,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_KEY(12725),
/**
* BlockData: {@link Levelled}
@MinecraftExperimental
OMINOUS_TRIAL_KEY(4986),
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/Particle.java
@ -377,15 +380,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
GUST("gust"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
GUST_EMITTER("gust_emitter"),
SMALL_GUST("small_gust"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
GUST_DUST("gust_dust"),
GUST_EMITTER_LARGE("gust_emitter_large"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
GUST_EMITTER_SMALL("gust_emitter_small"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_SPAWNER_DETECTION("trial_spawner_detection"),
/**
* Uses {@link BlockData} as DataType
@MinecraftExperimental
TRIAL_SPAWNER_DETECTION_OMINOUS("trial_spawner_detection_ominous"),
diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/Sound.java
@ -468,15 +474,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
BLOCK_PORTAL_AMBIENT("block.portal.ambient"),
BLOCK_PORTAL_TRAVEL("block.portal.travel"),
@@ -0,0 +0,0 @@ public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type { // Pa
BLOCK_SWEET_BERRY_BUSH_PICK_BERRIES("block.sweet_berry_bush.pick_berries"),
BLOCK_SWEET_BERRY_BUSH_PLACE("block.sweet_berry_bush.place"),
@MinecraftExperimental
BLOCK_TRIAL_SPAWNER_ABOUT_TO_SPAWN_ITEM("block.trial_spawner.about_to_spawn_item"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
BLOCK_TRIAL_SPAWNER_AMBIENT("block.trial_spawner.ambient"),
@MinecraftExperimental
BLOCK_TRIAL_SPAWNER_AMBIENT_CHARGED("block.trial_spawner.ambient_charged"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
BLOCK_TRIAL_SPAWNER_BREAK("block.trial_spawner.break"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
BLOCK_TRIAL_SPAWNER_CHARGE_ACTIVATE("block.trial_spawner.charge_activate"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
BLOCK_TRIAL_SPAWNER_CLOSE_SHUTTER("block.trial_spawner.close_shutter"),
@MinecraftExperimental
@ -498,6 +509,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
BLOCK_TRIAL_SPAWNER_PLACE("block.trial_spawner.place"),
@MinecraftExperimental
BLOCK_TRIAL_SPAWNER_SPAWN_ITEM("block.trial_spawner.spawn_item"),
@MinecraftExperimental
BLOCK_TRIAL_SPAWNER_SPAWN_ITEM_BEGIN("block.trial_spawner.spawn_item_begin"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
BLOCK_TRIAL_SPAWNER_SPAWN_MOB("block.trial_spawner.spawn_mob"),
@MinecraftExperimental
@ -529,9 +544,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ENTITY_BOAT_PADDLE_LAND("entity.boat.paddle_land"),
ENTITY_BOAT_PADDLE_WATER("entity.boat.paddle_water"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_BOGGED_AMBIENT("entity.bogged.ambient"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_BOGGED_DEATH("entity.bogged.death"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_BOGGED_HURT("entity.bogged.hurt"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_BOGGED_SHEAR("entity.bogged.shear"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_BOGGED_STEP("entity.bogged.step"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_BREEZE_CHARGE("entity.breeze.charge"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_BREEZE_DEATH("entity.breeze.death"),
@MinecraftExperimental
ENTITY_BREEZE_DEFLECT("entity.breeze.deflect"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_BREEZE_HURT("entity.breeze.hurt"),
@MinecraftExperimental
@ -555,19 +590,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_BREEZE_SLIDE("entity.breeze.slide"),
ENTITY_CAMEL_AMBIENT("entity.camel.ambient"),
ENTITY_CAMEL_DASH("entity.camel.dash"),
@@ -0,0 +0,0 @@ public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type { // Pa
ENTITY_GENERIC_SPLASH("entity.generic.splash"),
ENTITY_GENERIC_SWIM("entity.generic.swim"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_GENERIC_WIND_BURST("entity.generic.wind_burst"),
ENTITY_GHAST_AMBIENT("entity.ghast.ambient"),
ENTITY_GHAST_DEATH("entity.ghast.death"),
ENTITY_BREEZE_WHIRL("entity.breeze.whirl"),
@@ -0,0 +0,0 @@ public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type { // Pa
ENTITY_PARROT_HURT("entity.parrot.hurt"),
ENTITY_PARROT_IMITATE_BLAZE("entity.parrot.imitate.blaze"),
@MinecraftExperimental
ENTITY_PARROT_IMITATE_BOGGED("entity.parrot.imitate.bogged"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
ENTITY_PARROT_IMITATE_BREEZE("entity.parrot.imitate.breeze"),
@ -593,22 +620,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/Tag.java
@@ -0,0 +0,0 @@ public interface Tag<T extends Keyed> extends Keyed {
/**
* Vanilla tag representing entities which deflect arrows.
* Vanilla tag representing entities which deflect projectiles.
*/
+ @org.jetbrains.annotations.ApiStatus.Experimental @MinecraftExperimental // Paper - add missing annotation
Tag<EntityType> ENTITY_TYPES_DEFLECTS_ARROWS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("deflects_arrows"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_DEFLECTS_PROJECTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("deflects_projectiles"), EntityType.class);
/**
* Vanilla tag representing entities which deflect tridents.
*/
+ @org.jetbrains.annotations.ApiStatus.Experimental @MinecraftExperimental // Paper - add missing annotation
Tag<EntityType> ENTITY_TYPES_DEFLECTS_TRIDENTS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("deflects_tridents"), EntityType.class);
* Vanilla tag representing entities which deflect arrows.
@@ -0,0 +0,0 @@ public interface Tag<T extends Keyed> extends Keyed {
/**
* Vanilla tag representing entities which can turn in boats.
*/
+ @org.jetbrains.annotations.ApiStatus.Experimental @MinecraftExperimental // Paper - add missing annotation
Tag<EntityType> ENTITY_TYPES_CAN_TURN_IN_BOATS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_turn_in_boats"), EntityType.class);
// Paper start
/**
* Vanilla tag representing all entities sensitive to illager enchantments.
diff --git a/src/main/java/org/bukkit/generator/structure/Structure.java b/src/main/java/org/bukkit/generator/structure/Structure.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/generator/structure/Structure.java
@ -632,6 +657,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS_REWARD("chests/trial_chambers/reward"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS_REWARD_COMMON("chests/trial_chambers/reward_common"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS_REWARD_RARE("chests/trial_chambers/reward_rare"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS_REWARD_UNIQUE("chests/trial_chambers/reward_unique"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS_REWARD_OMINOUS("chests/trial_chambers/reward_ominous"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS_REWARD_OMINOUS_COMMON("chests/trial_chambers/reward_ominous_common"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS_REWARD_OMINOUS_RARE("chests/trial_chambers/reward_ominous_rare"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS_REWARD_OMINOUS_UNIQUE("chests/trial_chambers/reward_ominous_unique"),
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS_SUPPLY("chests/trial_chambers/supply"),
@MinecraftExperimental
@ -658,8 +704,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBERS_CORRIDOR_POT("pots/trial_chambers/corridor"),
SHIPWRECK_MAP("chests/shipwreck_map"),
SHIPWRECK_SUPPLY("chests/shipwreck_supply"),
@MinecraftExperimental
EQUIPMENT_TRIAL_CHAMBER("equipment/trial_chamber"),
@@ -0,0 +0,0 @@ public enum LootTables implements Keyed {
PIGLIN_BARTERING("gameplay/piglin_bartering"),
// Spawners
@ -669,5 +715,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@MinecraftExperimental
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
TRIAL_CHAMBER_CONSUMABLES("spawners/trial_chamber/consumables"),
// Archaeology
DESERT_WELL_ARCHAEOLOGY("archaeology/desert_well"),
@MinecraftExperimental
OMINOUS_TRIAL_CHAMBER_KEY("spawners/ominous/trial_chamber/key"),

View file

@ -16,13 +16,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
dependencies {
implementation(project(":paper-api"))
implementation("jline:jline:2.12.1")
- implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") {
- implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") {
- exclude(group = "org.apache.logging.log4j", module = "log4j-api")
- }
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
implementation("org.ow2.asm:asm-commons:9.7")
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0")
@@ -0,0 +0,0 @@ tasks.jar {
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
@ -109,7 +109,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ .exposeNamespace("minecraft", ResourceLocation.PAPER_NAMESPACE) // Paper
.applyDevelopmentConfig()
.pushJarResources()
.build();
.build(VANILLA_PACK_INFO);
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
@ -122,7 +122,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
Calendar deadline = Calendar.getInstance();
deadline.add(Calendar.DAY_OF_YEAR, -28);
deadline.add(Calendar.DAY_OF_YEAR, -3);
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java

View file

@ -53,26 +53,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }).map((entity1) -> { // Paper - remap fix
LivingEntity entityliving1;
- if (entity instanceof LivingEntity) {
- LivingEntity entityliving2 = (LivingEntity) entity;
+ if (entity1 instanceof LivingEntity) { // Paper - remap fix
+ LivingEntity entityliving2 = (LivingEntity) entity1; // Paper - remap fix
- if (entity instanceof LivingEntity entityliving2) {
+ if (entity1 instanceof LivingEntity entityliving2) { // Paper - remap fix
entityliving1 = entityliving2;
} else {
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
@@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
Builder<ResourceLocation, RecipeHolder<?>> builder = ImmutableMap.builder();
recipes.forEach((recipeholder) -> {
- Map<ResourceLocation, RecipeHolder<?>> map1 = (Map) map.computeIfAbsent(recipeholder.value().getType(), (recipes) -> {
+ Map<ResourceLocation, RecipeHolder<?>> map1 = (Map) map.computeIfAbsent(recipeholder.value().getType(), (recipes_) -> { // Paper - remap fix
return new Object2ObjectLinkedOpenHashMap<>(); // CraftBukkit
});
ResourceLocation minecraftkey = recipeholder.id();
entityliving1 = null;
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java b/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java
@ -126,8 +111,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Check in CraftParticle if the conversion is still correct.
""", bukkit.getKey()));
- DataResult<Tag> encoded = assertDoesNotThrow(() -> minecraft.codec().encodeStart(DynamicOpsNBT.INSTANCE, particleParam),
+ DataResult<Tag> encoded = assertDoesNotThrow(() -> minecraft.codec().encodeStart(NbtOps.INSTANCE, particleParam), // Paper - remap fix
- DataResult<Tag> encoded = assertDoesNotThrow(() -> minecraft.codec().codec().encodeStart(DynamicOpsNBT.INSTANCE, particleParam),
+ DataResult<Tag> encoded = assertDoesNotThrow(() -> minecraft.codec().codec().encodeStart(NbtOps.INSTANCE, particleParam), // Paper - remap fix
String.format("""
Could not encoded particle param for particle %s.
This can indicated, that the wrong particle param is created in CraftParticle.

View file

@ -43,13 +43,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+dependencies {
+ implementation(project(":paper-api"))
+ implementation("jline:jline:2.12.1")
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") {
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") {
+ exclude(group = "org.apache.logging.log4j", module = "log4j-api")
+ }
+ implementation("org.ow2.asm:asm-commons:9.7")
+ implementation("commons-lang:commons-lang:2.6")
+ runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
+ runtimeOnly("com.mysql:mysql-connector-j:8.2.0")
+ runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0")
+ runtimeOnly("com.mysql:mysql-connector-j:8.3.0")
+
+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ testImplementation("org.ow2.asm:asm-tree:9.7")
+}
+
+val craftbukkitPackageVersion = "1_20_R3" // Paper
+val craftbukkitPackageVersion = "1_20_R4" // Paper
+tasks.jar {
+ archiveClassifier.set("dev")
+
@ -185,7 +185,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot</artifactId>
- <packaging>jar</packaging>
- <version>1.20.4-R0.1-SNAPSHOT</version>
- <version>1.20.5-R0.1-SNAPSHOT</version>
- <name>Spigot</name>
- <url>https://www.spigotmc.org/</url>
-
@ -201,9 +201,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <api.version>unknown</api.version>
- <bt.name>git</bt.name>
- <minecraft_version>1_20_R3</minecraft_version>
- <maven.compiler.source>17</maven.compiler.source>
- <maven.compiler.target>17</maven.compiler.target>
- <minecraft_version>1_20_R4</minecraft_version>
- <maven.compiler.release>21</maven.compiler.release>
- </properties>
-
- <repositories>
@ -236,7 +235,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-iostreams</artifactId>
- <version>2.19.0</version>
- <version>2.22.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
@ -249,13 +248,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>com.github.oshi</groupId>
- <artifactId>oshi-core</artifactId>
- <version>6.4.5</version>
- <version>6.4.10</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.mojang</groupId>
- <artifactId>authlib</artifactId>
- <version>5.0.51</version>
- <version>6.0.54</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
@ -267,19 +266,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>com.mojang</groupId>
- <artifactId>datafixerupper</artifactId>
- <version>6.0.8</version>
- <version>7.0.14</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.mojang</groupId>
- <artifactId>logging</artifactId>
- <version>1.1.1</version>
- <version>1.2.7</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.13.0</version>
- <version>2.15.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
@ -353,13 +352,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>net.java.dev.jna</groupId>
- <artifactId>jna</artifactId>
- <version>5.13.0</version>
- <version>5.14.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>net.java.dev.jna</groupId>
- <artifactId>jna-platform</artifactId>
- <version>5.13.0</version>
- <version>5.14.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
@ -371,25 +370,31 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>3.13.0</version>
- <version>3.14.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <version>2.19.0</version>
- <version>2.22.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j2-impl</artifactId>
- <version>2.19.0</version>
- <version>2.22.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>2.0.7</version>
- <version>2.0.9</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.lz4</groupId>
- <artifactId>lz4-java</artifactId>
- <version>1.8.0</version>
- <scope>compile</scope>
- </dependency>
- <!-- deprecated API depend -->
@ -415,13 +420,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>org.xerial</groupId>
- <artifactId>sqlite-jdbc</artifactId>
- <version>3.42.0.1</version>
- <version>3.45.3.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>com.mysql</groupId>
- <artifactId>mysql-connector-j</artifactId>
- <version>8.2.0</version>
- <version>8.3.0</version>
- <scope>runtime</scope>
- </dependency>
- <!-- add these back in as they are not exposed by the API -->
@ -673,7 +678,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.11.0</version>
- <version>3.13.0</version>
- <configuration>
- <!-- we use the Eclipse compiler as it doesn't need a JDK -->
- <compilerId>eclipse</compilerId>
@ -684,7 +689,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-eclipse</artifactId>
- <version>2.13.0</version>
- <version>2.15.0</version>
- </dependency>
- </dependencies>
- </plugin>

Some files were not shown because too many files have changed in this diff Show more