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 24, 2025
1 parent e07c1b8 commit de2bbf3
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,40 +1,16 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: LemonCaramel <admin@caramel.moe>
Date: Tue, 9 Jan 2024 10:58:07 +0900
Subject: [PATCH] Add Configuration Phase API
Subject: [PATCH] Add Configuration ResourcePack Event


diff --git a/src/main/java/moe/caramel/daydream/event/configure/ConfigurationPhaseEvent.java b/src/main/java/moe/caramel/daydream/event/configure/ConfigurationPhaseEvent.java
diff --git a/src/main/java/moe/caramel/daydream/event/configuration/ConfigurationResourcePackRequestEvent.java b/src/main/java/moe/caramel/daydream/event/configuration/ConfigurationResourcePackRequestEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..45026d1315ddfcc064ceb58b495db0d999e14db4
index 0000000000000000000000000000000000000000..f742695e5d90b7b153cc8dd1e8d2851c5585660f
--- /dev/null
+++ b/src/main/java/moe/caramel/daydream/event/configure/ConfigurationPhaseEvent.java
@@ -0,0 +1,18 @@
+package moe.caramel.daydream.event.configure;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Configuration 페이즈에서 호출되는 이벤트
+ */
+@NullMarked
+public abstract class ConfigurationPhaseEvent extends PlayerEvent {
+
+ @ApiStatus.Internal
+ public ConfigurationPhaseEvent(final Player who, final boolean async) {
+ super(who, async);
+ }
+}
diff --git a/src/main/java/moe/caramel/daydream/event/configure/ConfigurationResourcePackRequestEvent.java b/src/main/java/moe/caramel/daydream/event/configure/ConfigurationResourcePackRequestEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..935dec08ac4c9251ee90887b953dbfbe5e3ea017
--- /dev/null
+++ b/src/main/java/moe/caramel/daydream/event/configure/ConfigurationResourcePackRequestEvent.java
+++ b/src/main/java/moe/caramel/daydream/event/configuration/ConfigurationResourcePackRequestEvent.java
@@ -0,0 +1,179 @@
+package moe.caramel.daydream.event.configure;
+package moe.caramel.daydream.event.configuration;
+
+import net.kyori.adventure.resource.ResourcePackCallback;
+import net.kyori.adventure.resource.ResourcePackInfoLike;
Expand All @@ -55,7 +31,7 @@ index 0000000000000000000000000000000000000000..935dec08ac4c9251ee90887b953dbfbe
+ * <p>이 이벤트를 사용하여 리소스팩을 적용하는 경우, server.properties의 리소스팩 로직이 무시됩니다.</p>
+ */
+@NullMarked
+public final class ConfigurationResourcePackRequestEvent extends ConfigurationPhaseEvent {
+public final class ConfigurationResourcePackRequestEvent extends ConfigurationEvent {
+
+ private final List<ResourcePackInfoLike> packs;
+ private final List<ResourcePackCallback> callbacks;
Expand All @@ -65,7 +41,7 @@ index 0000000000000000000000000000000000000000..935dec08ac4c9251ee90887b953dbfbe
+
+ @ApiStatus.Internal
+ public ConfigurationResourcePackRequestEvent(final Player what) {
+ super(what, !Bukkit.isPrimaryThread());
+ super(what);
+ this.packs = new ArrayList<>();
+ this.callbacks = new ArrayList<>();
+ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Date: Sun, 10 Dec 2023 16:28:01 +0900
Subject: [PATCH] Add Client Detector


diff --git a/src/main/java/moe/caramel/daydream/event/configure/ConfigurationClientTypeDetectedEvent.java b/src/main/java/moe/caramel/daydream/event/configure/ConfigurationClientTypeDetectedEvent.java
diff --git a/src/main/java/moe/caramel/daydream/event/configuration/ConfigurationClientTypeDetectedEvent.java b/src/main/java/moe/caramel/daydream/event/configuration/ConfigurationClientTypeDetectedEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..f1ebef97a226f55be63fb3cd8c4062e3331db2d7
index 0000000000000000000000000000000000000000..2785b263d3fc5dfe21f59559b5e27c5c522ba0ca
--- /dev/null
+++ b/src/main/java/moe/caramel/daydream/event/configure/ConfigurationClientTypeDetectedEvent.java
+++ b/src/main/java/moe/caramel/daydream/event/configuration/ConfigurationClientTypeDetectedEvent.java
@@ -0,0 +1,72 @@
+package moe.caramel.daydream.event.configure;
+package moe.caramel.daydream.event.configuration;
+
+import moe.caramel.daydream.player.ClientType;
+import net.kyori.adventure.text.Component;
Expand All @@ -24,13 +24,13 @@ index 0000000000000000000000000000000000000000..f1ebef97a226f55be63fb3cd8c4062e3
+ * Configuration 페이즈에서 플레이어의 클라이언트 종류를 감지 완료하였을 때 호출됩니다.
+ */
+@NullMarked
+public final class ConfigurationClientTypeDetectedEvent extends ConfigurationPhaseEvent {
+public final class ConfigurationClientTypeDetectedEvent extends ConfigurationEvent {
+
+ private @Nullable Component disconnectReason;
+
+ @ApiStatus.Internal
+ public ConfigurationClientTypeDetectedEvent(final Player who) {
+ super(who, true);
+ super(who);
+ }
+
+ /**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -66,6 +_,15 @@
@NotNull
public MainHand getMainHand();

+ // Daydream start - Settable Player Arm
+ /**
+ * 플레이어의 주로 사용하는 손을 변경합니다.
+ *
+ * @param mainHand 주로 사용하는 손
+ */
+ public void setMainHand(@NotNull MainHand mainHand);
+ // Daydream end - Settable Player Arm
+
/**
* If the player currently has an inventory window open, this method will
* set a property of that window, such as the state of a progress bar.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- a/src/main/java/org/bukkit/event/player/PlayerChangedMainHandEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerChangedMainHandEvent.java
@@ -12,7 +_,7 @@

private static final HandlerList handlers = new HandlerList();
//
- private final MainHand mainHand;
+ private MainHand mainHand; // Daydream - Settable Player Arm (remove final)

public PlayerChangedMainHandEvent(@NotNull Player who, @NotNull MainHand mainHand) {
super(who);
@@ -29,6 +_,17 @@
public MainHand getMainHand() {
return mainHand;
}
+
+ // Daydream start - Settable Player Arm
+ /**
+ * 플레이어의 주로 사용하는 손을 변경합니다.
+ *
+ * @param mainHand 주로 사용하는 손
+ */
+ public void setMainHand(final @NotNull MainHand mainHand) {
+ this.mainHand = mainHand;
+ }
+ // Daydream end - Settable Player Arm

@NotNull
@Override
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package moe.caramel.daydream.event.configuration;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

/**
* Configuration 페이즈에서 호출되는 이벤트
*/
@NullMarked
public abstract class ConfigurationEvent extends PlayerEvent {

@ApiStatus.Internal
public ConfigurationEvent(final Player who) {
super(who, !Bukkit.isPrimaryThread()); // (...)
}
}
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 = 30fdfb1aa173a8362e3a5bf19a4e309341f3ee19
paperCommit = 88bbead13b07914c01866e35df16b72110fa501e

org.gradle.configuration-cache = true
org.gradle.caching = true
Expand Down

0 comments on commit de2bbf3

Please sign in to comment.