Skip to content

Commit

Permalink
#20240203.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LemonCaramel committed Feb 3, 2024
1 parent ec9ed5e commit 0c69d4c
Show file tree
Hide file tree
Showing 20 changed files with 189 additions and 131 deletions.
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.20.4-R0.1-SNAPSHOT

mcVersion = 1.20.4

paperCommit = 1ed50dade82437bf45fe74833d7e6ac2961842a2
paperCommit = c5d168cef92148a6799141832fdb5f95732c1a38

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
9 changes: 5 additions & 4 deletions patches/0003-Add-Brigadier-Command-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Add Brigadier Command API


diff --git a/build.gradle.kts b/build.gradle.kts
index bf01892c248b988531d21d9fb0f74d0adf2205ac..e8be7692a9637313dde844d9cd4a3a3d108ebb6d 100644
index 50dd795c67557c7d2668068af0bba87a1ec8dc43..5637dc6b5a565a3c71b02bc026c73801d4aa251b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -55,6 +55,7 @@ dependencies {
Expand Down Expand Up @@ -1879,12 +1879,12 @@ index 9d263ab3afb938c215c0b64d9171345fca6ceb2c..ab63f82029c09cbf5d9717a89d1d55c3
@Override
default [email protected] Component name() {
diff --git a/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java b/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java
index e4f8a0d14ae66468bbb0a5d6bf9c1ee417dc866c..def7e364b543e598f9df31ef65e7c56fe2b54631 100644
index 9bdeeecdb6021d61fd9141270011e56b06a58a76..0231a38067e4194587217e6e585eb82ca287e4e0 100644
--- a/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java
+++ b/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java
@@ -19,10 +19,28 @@ public class UnknownCommandEvent extends Event {
@Nullable private Component message;
@@ -23,10 +23,29 @@ public class UnknownCommandEvent extends Event {

@ApiStatus.Internal
public UnknownCommandEvent(@NotNull final CommandSender sender, @NotNull final String commandLine, @Nullable final Component message) {
+ // Daydream start - Add Brigadier Command API
+ this(sender, commandLine, message, false);
Expand All @@ -1901,6 +1901,7 @@ index e4f8a0d14ae66468bbb0a5d6bf9c1ee417dc866c..def7e364b543e598f9df31ef65e7c56f
+ return brigadier;
+ }
+
+ @ApiStatus.Internal
+ public UnknownCommandEvent(@NotNull final CommandSender sender, @NotNull final String commandLine, @Nullable final Component message, final boolean brigadier) {
+ // Daydream end - Add Brigadier Command API
super(false);
Expand Down
18 changes: 9 additions & 9 deletions patches/0004-Add-more-Player-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ index 5637dc6b5a565a3c71b02bc026c73801d4aa251b..387a40a9b0d34dc9e95a3fdde31d78e3
api("org.apache.maven:maven-resolver-provider:3.9.6") // Paper - make API dependency for Paper Plugins
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
diff --git a/src/main/java/io/papermc/paper/event/player/AbstractChatEvent.java b/src/main/java/io/papermc/paper/event/player/AbstractChatEvent.java
index ed8e885f226b02b9875b23ae2294a9056d2e8b29..b8f6ebd8198accab13fb7f98608ff52d1916b271 100644
index a0fd845bc9b2540c398fe1dbbf821803a7017a28..b19c79a40c1bbf1f7b9584bd265baf4c366375be 100644
--- a/src/main/java/io/papermc/paper/event/player/AbstractChatEvent.java
+++ b/src/main/java/io/papermc/paper/event/player/AbstractChatEvent.java
@@ -25,6 +25,38 @@ public abstract class AbstractChatEvent extends PlayerEvent implements Cancellab
private ChatRenderer renderer;
@@ -27,6 +27,38 @@ public abstract class AbstractChatEvent extends PlayerEvent implements Cancellab
private Component message;
private boolean cancelled = false;

private boolean cancelled;
+ // Daydream start - Add more Player API (Improve Chat System)
+ private net.kyori.adventure.chat.ChatType chatType = null;
+
Expand Down Expand Up @@ -52,18 +52,18 @@ index ed8e885f226b02b9875b23ae2294a9056d2e8b29..b8f6ebd8198accab13fb7f98608ff52d
+ *
+ * @param chatType 채팅 포맷
+ */
+ public void chatType(@NotNull net.kyori.adventure.chat.ChatType chatType) {
+ public void chatType(final @NotNull net.kyori.adventure.chat.ChatType chatType) {
+ this.chatType = chatType;
+ }
+ // Daydream end - Add more Player API (Improve Chat System)

AbstractChatEvent(final boolean async, final @NotNull Player player, final @NotNull Set<Audience> viewers, final @NotNull ChatRenderer renderer, final @NotNull Component message, final @NotNull Component originalMessage, final @NotNull SignedMessage signedMessage) {
super(player, async);
diff --git a/src/main/java/io/papermc/paper/event/player/ChatEvent.java b/src/main/java/io/papermc/paper/event/player/ChatEvent.java
index af025704e978dc0b11be277ab4646da77eb3a60b..5e8a57811b1a5655bf03351b40266bac9fa00698 100644
index 7411f58f9f36beaadcc47c2264a4af313956ee03..18506bef176ffaba5bd45bf496b0591fb6108123 100644
--- a/src/main/java/io/papermc/paper/event/player/ChatEvent.java
+++ b/src/main/java/io/papermc/paper/event/player/ChatEvent.java
@@ -29,6 +29,13 @@ public final class ChatEvent extends AbstractChatEvent {
@@ -28,6 +28,13 @@ public final class ChatEvent extends AbstractChatEvent {
super(false, player, viewers, renderer, message, originalMessage, signedMessage);
}

Expand Down Expand Up @@ -122,10 +122,10 @@ index 31aa6ef5fc2b3b88c72f5a15b8cc7a0e50c29f46..c20ed717c773f8ecbc7ccc7d344ae8fa
/**
* Gets a copy of this players profile
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
index f8b69b52ec8efa103e4e78e1b5c6a015e73d2a75..e276c5eae73f3d3c3f246b83f1d0ebce7fd2bccd 100644
index bdb7d2345e7d3a48a2f0561832ce126a16781e89..5e1003de98c57b8200c21e7336eb1bd60b118438 100644
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
@@ -283,6 +283,29 @@ public class AsyncPlayerPreLoginEvent extends Event {
@@ -282,6 +282,29 @@ public class AsyncPlayerPreLoginEvent extends Event {
}
// Paper end

Expand Down
10 changes: 5 additions & 5 deletions patches/0006-Add-More-API-for-EntityDamageEvent.patch
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,13 @@ index 0000000000000000000000000000000000000000..aca7b9e9076a6c48cf3f27f42f841cd0
+ void setOverrideKnockback(final @Nullable Vector knockback);
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index a4b38f284d4fea7df7f9df9bf44e4f68fefaf20f..cfc27f4d20a5f75f8a5e0d4fdb86e578e0cc4465 100644
index 923d8655a84e26960d35d8dc6e4ebc0b10c295d5..d07cd759d6314afd2a16208ba005158bf7edd8fa 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -260,4 +260,6 @@ public interface UnsafeValues {

String getStatisticCriteriaKey(@NotNull org.bukkit.Statistic statistic);
// Paper end
@@ -273,4 +273,6 @@ public interface UnsafeValues {
*/
@Nullable org.bukkit.Color getSpawnEggLayerColor(org.bukkit.entity.EntityType entityType, int layer);
// Paper end - spawn egg color visibility
+
+ @NotNull moe.caramel.daydream.world.DamageMata getDamageMeta(@NotNull Object damageSource); // Daydream - Add more API for EntityDamageEvent
}
Expand Down
8 changes: 5 additions & 3 deletions patches/0007-Add-PlayerSendIllegalChatEvent.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ Subject: [PATCH] Add PlayerSendIllegalChatEvent

diff --git a/src/main/java/moe/caramel/daydream/event/packet/PlayerSendIllegalChatEvent.java b/src/main/java/moe/caramel/daydream/event/packet/PlayerSendIllegalChatEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..71df551a10936f26dc54664f43a343fd46635a2c
index 0000000000000000000000000000000000000000..6c210fd6aabf28e2aea6aff27c779a0f57ad3988
--- /dev/null
+++ b/src/main/java/moe/caramel/daydream/event/packet/PlayerSendIllegalChatEvent.java
@@ -0,0 +1,51 @@
@@ -0,0 +1,53 @@
+package moe.caramel.daydream.event.packet;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
Expand All @@ -28,7 +29,8 @@ index 0000000000000000000000000000000000000000..71df551a10936f26dc54664f43a343fd
+
+ private final Action action;
+
+ public PlayerSendIllegalChatEvent(@NotNull Player player, @NotNull Action action) {
+ @ApiStatus.Internal
+ public PlayerSendIllegalChatEvent(final @NotNull Player player, final @NotNull Action action) {
+ super(player);
+ this.action = action;
+ }
Expand Down
10 changes: 6 additions & 4 deletions patches/0008-Add-PlayerInteractManager.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ Subject: [PATCH] Add PlayerInteractManager

diff --git a/src/main/java/moe/caramel/daydream/event/player/PlayerIPSChangeEvent.java b/src/main/java/moe/caramel/daydream/event/player/PlayerIPSChangeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..c8aed0e9fdf27d87646cdea7603d294a19105c8d
index 0000000000000000000000000000000000000000..f475e84175a917ec709dd7ccc61ff028d0eef951
--- /dev/null
+++ b/src/main/java/moe/caramel/daydream/event/player/PlayerIPSChangeEvent.java
@@ -0,0 +1,64 @@
@@ -0,0 +1,66 @@
+package moe.caramel.daydream.event.player;
+
+import moe.caramel.daydream.player.InteractManager.Key;
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
Expand All @@ -30,7 +31,8 @@ index 0000000000000000000000000000000000000000..c8aed0e9fdf27d87646cdea7603d294a
+ private final int current, max;
+ private final Key key;
+
+ public PlayerIPSChangeEvent(@NotNull Player player, @NotNull Key key, int current, int max) {
+ @ApiStatus.Internal
+ public PlayerIPSChangeEvent(final @NotNull Player player, final @NotNull Key key, final int current, final int max) {
+ super(player);
+ this.current = current;
+ this.max = max;
Expand Down Expand Up @@ -186,7 +188,7 @@ index 0000000000000000000000000000000000000000..b8acc4f1d9b313842772a56d239ba03e
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 37c75babc67d2867e2e11f81988533bcd9404ae3..0b8124d940ef88c6607fd5a8176e069f6afe29ec 100644
index 70729a82bc1d8c5b528c81c72df82ddd195b2acf..176c915ba7f7bf29a6ca90335479220f14c8c104 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -54,6 +54,16 @@ import org.jetbrains.annotations.Nullable;
Expand Down
8 changes: 5 additions & 3 deletions patches/0009-Add-PlayerSendIllegalPacketEvent.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ Subject: [PATCH] Add PlayerSendIllegalPacketEvent

diff --git a/src/main/java/moe/caramel/daydream/event/packet/PlayerSendIllegalPacketEvent.java b/src/main/java/moe/caramel/daydream/event/packet/PlayerSendIllegalPacketEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..7e7b21ee49f15fa0ed4748cc9f4342b50dd86a86
index 0000000000000000000000000000000000000000..099c162dcd3335df5f5bd77400ae46027baf8ec6
--- /dev/null
+++ b/src/main/java/moe/caramel/daydream/event/packet/PlayerSendIllegalPacketEvent.java
@@ -0,0 +1,74 @@
@@ -0,0 +1,76 @@
+package moe.caramel.daydream.event.packet;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
Expand All @@ -30,7 +31,8 @@ index 0000000000000000000000000000000000000000..7e7b21ee49f15fa0ed4748cc9f4342b5
+ private final Action action;
+ private final String value;
+
+ public PlayerSendIllegalPacketEvent(@NotNull Player player, @NotNull Action action, @Nullable String value) {
+ @ApiStatus.Internal
+ public PlayerSendIllegalPacketEvent(final @NotNull Player player, final @NotNull Action action, final @Nullable String value) {
+ super(player);
+ this.action = action;
+ this.value = value;
Expand Down
10 changes: 6 additions & 4 deletions patches/0010-Add-PlayerStatisticOpenEvent.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ Subject: [PATCH] Add PlayerStatisticOpenEvent

diff --git a/src/main/java/moe/caramel/daydream/event/packet/PlayerStatisticOpenEvent.java b/src/main/java/moe/caramel/daydream/event/packet/PlayerStatisticOpenEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..73d0f6f9bcb155288674bb1103fb28cf6881eed1
index 0000000000000000000000000000000000000000..9b4623dabfd202ac8b0966a1a5fb663e129450ac
--- /dev/null
+++ b/src/main/java/moe/caramel/daydream/event/packet/PlayerStatisticOpenEvent.java
@@ -0,0 +1,47 @@
@@ -0,0 +1,49 @@
+package moe.caramel.daydream.event.packet;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
Expand All @@ -29,7 +30,8 @@ index 0000000000000000000000000000000000000000..73d0f6f9bcb155288674bb1103fb28cf
+
+ private boolean cancelled;
+
+ public PlayerStatisticOpenEvent(@NotNull Player player) {
+ @ApiStatus.Internal
+ public PlayerStatisticOpenEvent(final @NotNull Player player) {
+ super(player);
+ }
+
Expand All @@ -53,7 +55,7 @@ index 0000000000000000000000000000000000000000..73d0f6f9bcb155288674bb1103fb28cf
+ * @param cancel {@code true}인 경우 통계 패킷을 전송하지 않습니다.
+ */
+ @Override
+ public void setCancelled(boolean cancel) {
+ public void setCancelled(final boolean cancel) {
+ this.cancelled = cancel;
+ }
+}
31 changes: 31 additions & 0 deletions patches/0011-Add-more-World-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,37 @@ index 25650e9a31bcaf672acd115547abc1ec41a1de34..1533b28fb0e8600e443abe214b8d2449
/**
* Causes the block to be ticked, this is different from {@link Block#randomTick()},
* in that it is usually scheduled to occur, for example
diff --git a/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java b/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java
index 7873d387f337b1580d8ea1a85595c033c1d7787c..5620c665fac8b8f5a19a17998e56fbf9de719246 100644
--- a/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java
+++ b/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java
@@ -13,8 +13,26 @@ public class ChunkLoadEvent extends ChunkEvent {
private final boolean newChunk;

public ChunkLoadEvent(@NotNull final Chunk chunk, final boolean newChunk) {
+ // Daydream start - Add more World API
+ this(chunk, newChunk, null);
+ }
+ private final Object rawLevelChunk;
+
+ /**
+ * NMS 청크를 가져옵니다.
+ *
+ * @return NMS 청크
+ */
+ @NotNull
+ public Object getRawLevelChunk() {
+ return rawLevelChunk;
+ }
+
+ public ChunkLoadEvent(@NotNull final Chunk chunk, final boolean newChunk, @NotNull final Object rawLevelChunk) {
+ // Daydream end - Add more World API
super(chunk);
this.newChunk = newChunk;
+ this.rawLevelChunk = rawLevelChunk; // Daydream - Add more World API
}

/**
diff --git a/src/main/java/org/bukkit/util/StructureSearchResult.java b/src/main/java/org/bukkit/util/StructureSearchResult.java
index 129c14ef4a89bcd14b31343a756773bde43d48ab..05dec9d6faf9b4c343ac235a79b7b15cb96ee348 100644
--- a/src/main/java/org/bukkit/util/StructureSearchResult.java
Expand Down
12 changes: 7 additions & 5 deletions patches/0012-Add-SendEntityEquipmentEvent.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Add SendEntityEquipmentEvent

diff --git a/src/main/java/moe/caramel/daydream/event/packet/SendEntityEquipmentEvent.java b/src/main/java/moe/caramel/daydream/event/packet/SendEntityEquipmentEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..df5bc5fdecde55306bb27ee185518fc6425f40d2
index 0000000000000000000000000000000000000000..8dcf5e4a73a0742b9caa26ffb4c24fe86b3ffc24
--- /dev/null
+++ b/src/main/java/moe/caramel/daydream/event/packet/SendEntityEquipmentEvent.java
@@ -0,0 +1,87 @@
@@ -0,0 +1,89 @@
+package moe.caramel.daydream.event.packet;
+
+import org.bukkit.entity.Entity;
Expand All @@ -19,6 +19,7 @@ index 0000000000000000000000000000000000000000..df5bc5fdecde55306bb27ee185518fc6
+import org.bukkit.event.entity.EntityEvent;
+import org.bukkit.inventory.EquipmentSlot;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import java.util.Map;
+
Expand All @@ -36,7 +37,8 @@ index 0000000000000000000000000000000000000000..df5bc5fdecde55306bb27ee185518fc6
+ private final Map<EquipmentSlot, ItemStack> data;
+ private boolean cancelled;
+
+ public SendEntityEquipmentEvent(@NotNull Entity source, @NotNull Reason reason, @NotNull Player target, @NotNull Map<EquipmentSlot, ItemStack> data) {
+ @ApiStatus.Internal
+ public SendEntityEquipmentEvent(final @NotNull Entity source, final @NotNull Reason reason, final @NotNull Player target, final @NotNull Map<EquipmentSlot, ItemStack> data) {
+ super(source);
+ this.reason = reason;
+ this.target = target;
Expand Down Expand Up @@ -79,8 +81,8 @@ index 0000000000000000000000000000000000000000..df5bc5fdecde55306bb27ee185518fc6
+ }
+
+ @Override
+ public void setCancelled(boolean cancelled) {
+ this.cancelled = cancelled;
+ public void setCancelled(final boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ /**
Expand Down
Loading

0 comments on commit 0c69d4c

Please sign in to comment.