From d3b386c9c492365ab9d6bb385eccaba1f123005a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 26 Jan 2025 06:36:50 +0000 Subject: [PATCH] Deploying to Daydream-API --- .../features/0008-Add-Packet-API.patch | 41 +------ .../0009-Add-more-Explosion-API.patch | 4 +- .../datacomponent/item/ItemLore.java.patch | 115 ++++++++++++++++++ .../src/main/java/org/bukkit/World.java.patch | 2 +- .../bukkit/inventory/meta/ItemMeta.java.patch | 28 ++++- .../CustomModelDataComponent.java.patch | 97 +++++++++++++++ gradle.properties | 2 +- 7 files changed, 246 insertions(+), 43 deletions(-) create mode 100644 daydream-api/paper-patches/files/src/main/java/io/papermc/paper/datacomponent/item/ItemLore.java.patch create mode 100644 daydream-api/paper-patches/files/src/main/java/org/bukkit/inventory/meta/components/CustomModelDataComponent.java.patch diff --git a/daydream-api/paper-patches/features/0008-Add-Packet-API.patch b/daydream-api/paper-patches/features/0008-Add-Packet-API.patch index 56e233d26..fb58fd77e 100644 --- a/daydream-api/paper-patches/features/0008-Add-Packet-API.patch +++ b/daydream-api/paper-patches/features/0008-Add-Packet-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Packet API diff --git a/src/main/java/moe/caramel/daydream/event/packet/PacketType.java b/src/main/java/moe/caramel/daydream/event/packet/PacketType.java new file mode 100644 -index 0000000000000000000000000000000000000000..360675e7abc45240925a983d21387bd4c8c0f114 +index 0000000000000000000000000000000000000000..2243c218fc51d51862dd5e4722c8945bc118b776 --- /dev/null +++ b/src/main/java/moe/caramel/daydream/event/packet/PacketType.java -@@ -0,0 +1,22 @@ +@@ -0,0 +1,21 @@ +package moe.caramel.daydream.event.packet; + +/** @@ -21,8 +21,7 @@ index 0000000000000000000000000000000000000000..360675e7abc45240925a983d21387bd4 + * [Client -> Server] Packets + */ + enum Client { -+ PONG, -+ PLAYER_LOADED ++ PONG + } + + /** @@ -83,34 +82,6 @@ index 0000000000000000000000000000000000000000..a1f6ce66d317fc190021aa0b7fcb8c1b + } + // +} -diff --git a/src/main/java/moe/caramel/daydream/event/packet/ReceivePlayerLoadedPacketEvent.java b/src/main/java/moe/caramel/daydream/event/packet/ReceivePlayerLoadedPacketEvent.java -new file mode 100644 -index 0000000000000000000000000000000000000000..b783aafc2006adc054cf2c6126bcd3f2eac8852c ---- /dev/null -+++ b/src/main/java/moe/caramel/daydream/event/packet/ReceivePlayerLoadedPacketEvent.java -@@ -0,0 +1,22 @@ -+package moe.caramel.daydream.event.packet; -+ -+import org.bukkit.entity.Player; -+import org.jetbrains.annotations.ApiStatus; -+import org.jspecify.annotations.NullMarked; -+ -+/** -+ * 서버가 클라이언트로부터 {@link PacketType.Client#PLAYER_LOADED} 패킷을 전달받았을 때 호출됩니다. -+ */ -+@NullMarked -+public final class ReceivePlayerLoadedPacketEvent extends ReceivePacketEvent { -+ -+ @ApiStatus.Internal -+ public ReceivePlayerLoadedPacketEvent(final Player who) { -+ super(who, PacketType.Client.PLAYER_LOADED, false); -+ } -+ -+ @Override -+ public String toString() { -+ return "ReceivePlayerLoadedPacketEvent"; -+ } -+} diff --git a/src/main/java/moe/caramel/daydream/event/packet/ReceivePongPacketEvent.java b/src/main/java/moe/caramel/daydream/event/packet/ReceivePongPacketEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..d6b15abc74fbc9fd1c2470dabbe6f730ff3fc9d2 @@ -1007,10 +978,10 @@ index ba5d2022c5ebec490b3ac36f5a651acb2cac8559..ea1b6f2b69a4e4c299eab857b68cc37f + // Daydream end - (feature) Add Packet API } diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 21675b7f8fab3ca1e6db0b1f2c5fba68993c10e9..87acad5995f5fe9ef251b6273ea94616c9c9c59d 100644 +index d95349839e47465826bab456d7fd414a2a96d40d..294aa555e0bc88390bbab070466abc70940cfd5f 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -1626,6 +1626,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -1627,6 +1627,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient public Entity getEntity(@NotNull java.util.UUID uuid); // Paper end @@ -1053,7 +1024,7 @@ index 6fba6948e937b079bedf3cc08d7659cf50c927d5..6e65ebccf9c037dba1179dfb697ce565 * Gets the amount of ticks this entity has lived for. *

diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index c7a5992442d087c5388d8bed03cb6ddb20c9c3f6..a675aad451521c148f459705748ae5137789a358 100644 +index 892e1703f951ccb6a2d970164529aa7b1f303710..367054cd58120eb795419f0f55d070a7f608f361 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -1094,6 +1094,31 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM diff --git a/daydream-api/paper-patches/features/0009-Add-more-Explosion-API.patch b/daydream-api/paper-patches/features/0009-Add-more-Explosion-API.patch index 4a742e8fe..b3f024322 100644 --- a/daydream-api/paper-patches/features/0009-Add-more-Explosion-API.patch +++ b/daydream-api/paper-patches/features/0009-Add-more-Explosion-API.patch @@ -175,10 +175,10 @@ index de260586b1d92d943039b03777ff3667b7883a50..dbaf0d58ed60c308fd5822e559c224fe /** * Returns whether or not this tag has an entry for the specified item. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 87acad5995f5fe9ef251b6273ea94616c9c9c59d..aa3fad33cd9c1a345373bd9e68cf6c1606226264 100644 +index 294aa555e0bc88390bbab070466abc70940cfd5f..ffe987fbad8b32c04293621ee3b1a6a520604066 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -2145,6 +2145,246 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -2160,6 +2160,246 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient */ public int getClearWeatherDuration(); diff --git a/daydream-api/paper-patches/files/src/main/java/io/papermc/paper/datacomponent/item/ItemLore.java.patch b/daydream-api/paper-patches/files/src/main/java/io/papermc/paper/datacomponent/item/ItemLore.java.patch new file mode 100644 index 000000000..0e9595069 --- /dev/null +++ b/daydream-api/paper-patches/files/src/main/java/io/papermc/paper/datacomponent/item/ItemLore.java.patch @@ -0,0 +1,115 @@ +--- a/src/main/java/io/papermc/paper/datacomponent/item/ItemLore.java ++++ b/src/main/java/io/papermc/paper/datacomponent/item/ItemLore.java +@@ -80,5 +_,112 @@ + */ + @Contract(value = "_ -> this", mutates = "this") + Builder addLines(List lines); ++ ++ // Daydream start - Add more item lore methods ++ ++ // No Italic ++ ++ /** ++ * 로어의 이탤릭체를 비활성화하고 설정합니다. ++ * ++ * @param lines 설정할 로어 리스트 ++ * @return the builder for chaining ++ * @see #lines() ++ */ ++ @Contract(value = "_ -> this", mutates = "this") ++ Builder noItalicLines(List lines); ++ ++ /** ++ * 로어의 이탤릭체를 비활성화하고 설정합니다. ++ * ++ * @param lines 설정할 로어 리스트 ++ * @return the builder for chaining ++ * @see #lines() ++ */ ++ @Contract(value = "_ -> this", mutates = "this") ++ Builder noItalicLines(ComponentLike... lines); ++ ++ /** ++ * 로어의 이탤릭체를 비활성화하고 추가합니다. ++ * ++ * @param line 추가할 로어 ++ * @return the builder for chaining ++ * @see #lines() ++ */ ++ @Contract(value = "_ -> this", mutates = "this") ++ Builder addNoItalicLine(ComponentLike line); ++ ++ /** ++ * 로어의 이탤릭체를 비활성화하고 추가합니다. ++ * ++ * @param lines 추가할 로어 리스트 ++ * @return the builder for chaining ++ * @see #lines() ++ */ ++ @Contract(value = "_ -> this", mutates = "this") ++ Builder addNoItalicLines(List lines); ++ ++ /** ++ * 로어의 이탤릭체를 비활성화하고 추가합니다. ++ * ++ * @param lines 추가할 로어 리스트 ++ * @return the builder for chaining ++ * @see #lines() ++ */ ++ @Contract(value = "_ -> this", mutates = "this") ++ Builder addNoItalicLines(ComponentLike... lines); ++ ++ // Default ++ ++ /** ++ * 로어를 설정하며 클라이언트의 로어 수정을 비활성화합니다. ++ * ++ * @param lines 설정할 로어 리스트 ++ * @return the builder for chaining ++ * @see #lines() ++ */ ++ @Contract(value = "_ -> this", mutates = "this") ++ Builder defaultLines(List lines); ++ ++ /** ++ * 로어를 설정하며 클라이언트의 로어 수정을 비활성화합니다. ++ * ++ * @param lines 설정할 로어 리스트 ++ * @return the builder for chaining ++ * @see #lines() ++ */ ++ @Contract(value = "_ -> this", mutates = "this") ++ Builder defaultLines(ComponentLike... lines); ++ ++ /** ++ * 로어를 추가하며 클라이언트의 로어 수정을 비활성화합니다. ++ * ++ * @param line 추가할 로어 ++ * @return the builder for chaining ++ * @see #lines() ++ */ ++ @Contract(value = "_ -> this", mutates = "this") ++ Builder addDefaultLine(ComponentLike line); ++ ++ /** ++ * 로어를 추가하며 클라이언트의 로어 수정을 비활성화합니다. ++ * ++ * @param lines 추가할 로어 리스트 ++ * @return the builder for chaining ++ * @see #lines() ++ */ ++ @Contract(value = "_ -> this", mutates = "this") ++ Builder addDefaultLines(List lines); ++ ++ /** ++ * 로어를 추가하며 클라이언트의 로어 수정을 비활성화합니다. ++ * ++ * @param lines 추가할 로어 리스트 ++ * @return the builder for chaining ++ * @see #lines() ++ */ ++ @Contract(value = "_ -> this", mutates = "this") ++ Builder addDefaultLines(ComponentLike... lines); ++ // Daydream end - Add more item lore methods + } + } diff --git a/daydream-api/paper-patches/files/src/main/java/org/bukkit/World.java.patch b/daydream-api/paper-patches/files/src/main/java/org/bukkit/World.java.patch index 64f3a8d10..1d52aa91e 100644 --- a/daydream-api/paper-patches/files/src/main/java/org/bukkit/World.java.patch +++ b/daydream-api/paper-patches/files/src/main/java/org/bukkit/World.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -3437,6 +_,38 @@ +@@ -3452,6 +_,38 @@ */ void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch); diff --git a/daydream-api/paper-patches/files/src/main/java/org/bukkit/inventory/meta/ItemMeta.java.patch b/daydream-api/paper-patches/files/src/main/java/org/bukkit/inventory/meta/ItemMeta.java.patch index f2615de55..09fe83173 100644 --- a/daydream-api/paper-patches/files/src/main/java/org/bukkit/inventory/meta/ItemMeta.java.patch +++ b/daydream-api/paper-patches/files/src/main/java/org/bukkit/inventory/meta/ItemMeta.java.patch @@ -171,11 +171,10 @@ // Paper start /** * Gets the lore. -@@ -336,6 +_,18 @@ - * @return the custom model data that is set +@@ -337,6 +_,18 @@ */ int getCustomModelData(); -+ + + // Daydream start - Add method to get raw CustomModelData + /** + * Gets the custom model data that is set. @@ -187,6 +186,27 @@ + */ + @Nullable Integer customModelData(); + // Daydream end - Add method to get raw CustomModelData - ++ /** * Gets the custom model data set on this item, or creates an empty custom + * model data instance. +@@ -368,6 +_,19 @@ + * @param customModelData new component + */ + void setCustomModelDataComponent(@Nullable CustomModelDataComponent customModelData); ++ ++ // Daydream start - Add CustomModelData utility methods ++ /** ++ * 커스텀 모델 데이터 컴포넌트를 설정합니다. ++ * ++ * @param consumer 컴포넌트 수정자 ++ */ ++ default void customModelData(final java.util.function.Consumer consumer) { ++ final CustomModelDataComponent component = this.getCustomModelDataComponent(); ++ consumer.accept(component); ++ this.setCustomModelDataComponent(component); ++ } ++ // Daydream start - Add CustomModelData utility methods + + /** + * Gets if the enchantable component is set. diff --git a/daydream-api/paper-patches/files/src/main/java/org/bukkit/inventory/meta/components/CustomModelDataComponent.java.patch b/daydream-api/paper-patches/files/src/main/java/org/bukkit/inventory/meta/components/CustomModelDataComponent.java.patch new file mode 100644 index 000000000..18a673768 --- /dev/null +++ b/daydream-api/paper-patches/files/src/main/java/org/bukkit/inventory/meta/components/CustomModelDataComponent.java.patch @@ -0,0 +1,97 @@ +--- a/src/main/java/org/bukkit/inventory/meta/components/CustomModelDataComponent.java ++++ b/src/main/java/org/bukkit/inventory/meta/components/CustomModelDataComponent.java +@@ -71,4 +_,94 @@ + * @param colors new list + */ + void setColors(@NotNull List colors); ++ ++ // Daydream start - Add CustomModelData utility methods ++ /** ++ * Sets a list of the custom floats. ++ * ++ * @param floats new list ++ * @return this ++ */ ++ default CustomModelDataComponent floats(@NotNull List floats) { ++ this.setFloats(floats); ++ return this; ++ } ++ ++ /** ++ * Sets a list of the custom floats. ++ * ++ * @param floats new list ++ * @return this ++ */ ++ default CustomModelDataComponent floats(@NotNull Float @NotNull... floats) { ++ this.setFloats(List.of(floats)); ++ return this; ++ } ++ ++ /** ++ * Sets a list of the custom flags. ++ * ++ * @param flags new list ++ * @return this ++ */ ++ default CustomModelDataComponent flags(@NotNull List flags) { ++ this.setFlags(flags); ++ return this; ++ } ++ ++ /** ++ * Sets a list of the custom flags. ++ * ++ * @param flags new list ++ * @return this ++ */ ++ default CustomModelDataComponent flags(@NotNull Boolean @NotNull... flags) { ++ this.setFlags(List.of(flags)); ++ return this; ++ } ++ ++ /** ++ * Sets a list of the custom strings. ++ * ++ * @param strings new list ++ * @return this ++ */ ++ default CustomModelDataComponent strings(@NotNull List strings) { ++ this.setStrings(strings); ++ return this; ++ } ++ ++ /** ++ * Sets a list of the custom strings. ++ * ++ * @param strings new list ++ * @return this ++ */ ++ default CustomModelDataComponent strings(@NotNull String @NotNull... strings) { ++ this.setStrings(List.of(strings)); ++ return this; ++ } ++ ++ /** ++ * Sets a list of the custom colors. ++ * ++ * @param colors new list ++ * @return this ++ */ ++ default CustomModelDataComponent colors(@NotNull List colors) { ++ this.setColors(colors); ++ return this; ++ } ++ ++ /** ++ * Sets a list of the custom colors. ++ * ++ * @param colors new list ++ * @return this ++ */ ++ default CustomModelDataComponent colors(@NotNull Color @NotNull... colors) { ++ this.setColors(List.of(colors)); ++ return this; ++ } ++ // Daydream end - Add CustomModelData utility methods + } diff --git a/gradle.properties b/gradle.properties index 6f4fe251e..c07813351 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ version = 1.21.4-R0.1-SNAPSHOT mcVersion = 1.21.4 -paperCommit = 88bbead13b07914c01866e35df16b72110fa501e +paperCommit = fb5b173c6a742c584413c8fc8b7c871d79234756 org.gradle.configuration-cache = true org.gradle.caching = true