Skip to content

Commit

Permalink
#20240111.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LemonCaramel committed Jan 11, 2024
1 parent af6e3c0 commit 970e2fa
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions patches/0036-Add-Configuration-Phase-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ index 0000000000000000000000000000000000000000..4c380e4ddbc9cd2d42a1e3d23cb3493d
+}
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..092fe3d6e91c19cf5c14dbc59424d5be12547c16
index 0000000000000000000000000000000000000000..832eb6907f1dabd8bd5bbe43cc4fe8c2033e03f1
--- /dev/null
+++ b/src/main/java/moe/caramel/daydream/event/configure/ConfigurationResourcePackRequestEvent.java
@@ -0,0 +1,147 @@
@@ -0,0 +1,174 @@
+package moe.caramel.daydream.event.configure;
+
+import net.kyori.adventure.resource.ResourcePackCallback;
Expand Down Expand Up @@ -92,6 +92,7 @@ index 0000000000000000000000000000000000000000..092fe3d6e91c19cf5c14dbc59424d5be
+ private final List<ResourcePackInfoLike> packs;
+ private final List<ResourcePackCallback> callbacks;
+ private Component prompt, disconnectMessage;
+ private boolean replacePacks;
+ private boolean strictCheck;
+
+ public ConfigurationResourcePackRequestEvent(final @NotNull Player what) {
Expand All @@ -118,7 +119,9 @@ index 0000000000000000000000000000000000000000..092fe3d6e91c19cf5c14dbc59424d5be
+ */
+ @NotNull
+ public ConfigurationResourcePackRequestEvent callback(final @NotNull ResourcePackCallback callback) {
+ this.callbacks.add(callback);
+ if (callback != ResourcePackCallback.noOp()) {
+ this.callbacks.add(callback);
+ }
+ return this;
+ }
+
Expand Down Expand Up @@ -157,6 +160,30 @@ index 0000000000000000000000000000000000000000..092fe3d6e91c19cf5c14dbc59424d5be
+ }
+
+ /**
+ * 플레이어가 기존에 가지고 있던 서버 리소스팩을 모두 언로드합니다.
+ * <p>
+ * 서버 네트워크 환경에서 작동 중인 서버의 경우, 클라이언트가
+ * 다른 서버의 리소스팩을 가지고 있을 수도 있습니다.
+ * </p>
+ *
+ * @return this
+ */
+ @NotNull
+ public ConfigurationResourcePackRequestEvent enableReplacePacks() {
+ this.replacePacks = true;
+ return this;
+ }
+
+ /**
+ * 클라이언트가 가진 기존 서버 리소스팩의 로드를 해제할 지 여부를 가져옵니다.
+ *
+ * @return 만약 {@code true}인 경우 플레이어가 가진 서버 리소스팩을 모두 언로드합니다.
+ */
+ public boolean isReplacePacks() {
+ return replacePacks;
+ }
+
+ /**
+ * 엄격한 검사를 활성화합니다. 클라이언트의 반환이
+ * {@link ResourcePackStatus#SUCCESSFULLY_LOADED}가
+ * 아닌 경우, 플레이어를 서버에서 추방합니다.
Expand Down Expand Up @@ -207,7 +234,7 @@ index 0000000000000000000000000000000000000000..092fe3d6e91c19cf5c14dbc59424d5be
+ }
+ })
+ .prompt(this.prompt)
+ .replace(true)
+ .replace(this.replacePacks)
+ .required(true)
+ .build();
+ }
Expand Down

0 comments on commit 970e2fa

Please sign in to comment.