Skip to content

Commit

Permalink
Deploying to Daydream-API
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 26, 2025
1 parent de2bbf3 commit d3b386c
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 43 deletions.
41 changes: 6 additions & 35 deletions daydream-api/paper-patches/features/0008-Add-Packet-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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;
+
+/**
Expand All @@ -21,8 +21,7 @@ index 0000000000000000000000000000000000000000..360675e7abc45240925a983d21387bd4
+ * [Client -> Server] Packets
+ */
+ enum Client {
+ PONG,
+ PLAYER_LOADED
+ PONG
+ }
+
+ /**
Expand Down Expand Up @@ -83,34 +82,6 @@ index 0000000000000000000000000000000000000000..a1f6ce66d317fc190021aa0b7fcb8c1b
+ }
+ //</editor-fold>
+}
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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -1053,7 +1024,7 @@ index 6fba6948e937b079bedf3cc08d7659cf50c927d5..6e65ebccf9c037dba1179dfb697ce565
* Gets the amount of ticks this entity has lived for.
* <p>
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
@@ -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<? extends ComponentLike> 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<? extends ComponentLike> 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<? extends ComponentLike> 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<? extends ComponentLike> 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<? extends ComponentLike> 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
}
}
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<CustomModelDataComponent> 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.
Original file line number Diff line number Diff line change
@@ -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<Color> 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<Float> 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<Boolean> 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<String> 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<Color> 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
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d3b386c

Please sign in to comment.