From 95d589adc277597b4337514bb3d61bfecdfa9b86 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 01:14:56 +0800
Subject: [PATCH 01/55] :sparkles: Add fabric, forge and spigot events
---
.../FabricServerCommandMessageEvent.java | 9 +++
...bricServerLivingEntityAfterDeathEvent.java | 10 ++++
.../fabric/FabricServerMessageEvent.java | 9 +++
...icServerPlayConnectionDisconnectEvent.java | 9 +++
.../FabricServerPlayConnectionJoinEvent.java | 9 +++
.../event/fabric/FabricServerPlayer.java | 40 +++++++++++++
.../event/forge/ForgeCommandEvent.java | 9 +++
.../event/forge/ForgePlayerDeathEvent.java | 10 ++++
.../event/forge/ForgePlayerLoggedInEvent.java | 9 +++
.../forge/ForgePlayerLoggedOutEvent.java | 9 +++
.../event/forge/ForgeServerChatEvent.java | 10 ++++
.../event/forge/ForgeServerPlayer.java | 45 ++++++++++++++
.../spigot/SpigotAsyncPlayerChatEvent.java | 10 ++++
.../queqiao/event/spigot/SpigotPlayer.java | 58 +++++++++++++++++++
.../SpigotPlayerCommandPreprocessEvent.java | 10 ++++
.../event/spigot/SpigotPlayerDeathEvent.java | 10 ++++
.../event/spigot/SpigotPlayerJoinEvent.java | 11 ++++
.../event/spigot/SpigotPlayerQuitEvent.java | 10 ++++
18 files changed, 287 insertions(+)
create mode 100644 fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerCommandMessageEvent.java
create mode 100644 fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerLivingEntityAfterDeathEvent.java
create mode 100644 fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerMessageEvent.java
create mode 100644 fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionDisconnectEvent.java
create mode 100644 fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionJoinEvent.java
create mode 100644 fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayer.java
create mode 100644 forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeCommandEvent.java
create mode 100644 forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerDeathEvent.java
create mode 100644 forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedInEvent.java
create mode 100644 forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedOutEvent.java
create mode 100644 forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerChatEvent.java
create mode 100644 forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerPlayer.java
create mode 100644 spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotAsyncPlayerChatEvent.java
create mode 100644 spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayer.java
create mode 100644 spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerCommandPreprocessEvent.java
create mode 100644 spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerDeathEvent.java
create mode 100644 spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerJoinEvent.java
create mode 100644 spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerQuitEvent.java
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerCommandMessageEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerCommandMessageEvent.java
new file mode 100644
index 0000000..0c02d64
--- /dev/null
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerCommandMessageEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.fabric;
+
+import com.github.theword.queqiao.tool.event.BaseCommandEvent;
+
+public class FabricServerCommandMessageEvent extends BaseCommandEvent {
+ public FabricServerCommandMessageEvent(String messageId, FabricServerPlayer player, String message) {
+ super("ServerCommandMessageEvent", messageId, player, message);
+ }
+}
\ No newline at end of file
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerLivingEntityAfterDeathEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerLivingEntityAfterDeathEvent.java
new file mode 100644
index 0000000..524dfe3
--- /dev/null
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerLivingEntityAfterDeathEvent.java
@@ -0,0 +1,10 @@
+package com.github.theword.queqiao.event.fabric;
+
+import com.github.theword.queqiao.tool.event.BasePlayerDeathEvent;
+
+public class FabricServerLivingEntityAfterDeathEvent extends BasePlayerDeathEvent {
+
+ public FabricServerLivingEntityAfterDeathEvent(String messageId, FabricServerPlayer player, String message) {
+ super("ServerLivingEntityAfterDeathEvent", messageId, player, message);
+ }
+}
\ No newline at end of file
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerMessageEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerMessageEvent.java
new file mode 100644
index 0000000..4f40953
--- /dev/null
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerMessageEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.fabric;
+
+import com.github.theword.queqiao.tool.event.BasePlayerChatEvent;
+
+public class FabricServerMessageEvent extends BasePlayerChatEvent {
+ public FabricServerMessageEvent(String messageId, FabricServerPlayer player, String message) {
+ super("ServerMessageEvent", messageId, player, message);
+ }
+}
\ No newline at end of file
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionDisconnectEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionDisconnectEvent.java
new file mode 100644
index 0000000..60812ec
--- /dev/null
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionDisconnectEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.fabric;
+
+import com.github.theword.queqiao.tool.event.BasePlayerQuitEvent;
+
+public class FabricServerPlayConnectionDisconnectEvent extends BasePlayerQuitEvent {
+ public FabricServerPlayConnectionDisconnectEvent(FabricServerPlayer player) {
+ super("ServerPlayConnectionDisconnectEvent", player);
+ }
+}
\ No newline at end of file
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionJoinEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionJoinEvent.java
new file mode 100644
index 0000000..9a25168
--- /dev/null
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionJoinEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.fabric;
+
+import com.github.theword.queqiao.tool.event.BasePlayerJoinEvent;
+
+public class FabricServerPlayConnectionJoinEvent extends BasePlayerJoinEvent {
+ public FabricServerPlayConnectionJoinEvent(FabricServerPlayer player) {
+ super("ServerPlayConnectionJoinEvent", player);
+ }
+}
\ No newline at end of file
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayer.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayer.java
new file mode 100644
index 0000000..7b3be08
--- /dev/null
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayer.java
@@ -0,0 +1,40 @@
+package com.github.theword.queqiao.event.fabric;
+
+import com.github.theword.queqiao.tool.event.BasePlayer;
+import com.google.gson.annotations.SerializedName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class FabricServerPlayer extends BasePlayer {
+ private String ip;
+ @SerializedName("display_name")
+ private String displayName;
+ @SerializedName("movement_speed")
+ private float movementSpeed;
+
+ @SerializedName("block_x")
+ private int blockX;
+ @SerializedName("block_y")
+ private int blockY;
+ @SerializedName("block_z")
+ private int blockZ;
+
+ @SerializedName("is_creative")
+ private boolean isCreative;
+ @SerializedName("is_spectator")
+ private boolean isSpectator;
+ @SerializedName("is_sneaking")
+ private boolean isSneaking;
+ @SerializedName("is_sleeping")
+ private boolean isSleeping;
+ @SerializedName("is_climbing")
+ private boolean isClimbing;
+ @SerializedName("is_swimming")
+ private boolean isSwimming;
+}
\ No newline at end of file
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeCommandEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeCommandEvent.java
new file mode 100644
index 0000000..0c474b2
--- /dev/null
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeCommandEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.forge;
+
+import com.github.theword.queqiao.tool.event.BaseCommandEvent;
+
+public class ForgeCommandEvent extends BaseCommandEvent {
+ public ForgeCommandEvent(String messageId, ForgeServerPlayer player, String command) {
+ super("CommandEvent", messageId, player, command);
+ }
+}
\ No newline at end of file
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerDeathEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerDeathEvent.java
new file mode 100644
index 0000000..1e091a6
--- /dev/null
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerDeathEvent.java
@@ -0,0 +1,10 @@
+package com.github.theword.queqiao.event.forge;
+
+import com.github.theword.queqiao.tool.event.BasePlayerDeathEvent;
+
+public class ForgePlayerDeathEvent extends BasePlayerDeathEvent {
+
+ public ForgePlayerDeathEvent(String messageId, ForgeServerPlayer player, String message) {
+ super("PlayerDeathEvent", messageId, player, message);
+ }
+}
\ No newline at end of file
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedInEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedInEvent.java
new file mode 100644
index 0000000..2aaf58e
--- /dev/null
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedInEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.forge;
+
+import com.github.theword.queqiao.tool.event.BasePlayerJoinEvent;
+
+public final class ForgePlayerLoggedInEvent extends BasePlayerJoinEvent {
+ public ForgePlayerLoggedInEvent(ForgeServerPlayer player) {
+ super("PlayerLoggedInEvent", player);
+ }
+}
\ No newline at end of file
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedOutEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedOutEvent.java
new file mode 100644
index 0000000..6f0fc29
--- /dev/null
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedOutEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.forge;
+
+import com.github.theword.queqiao.tool.event.BasePlayerQuitEvent;
+
+public final class ForgePlayerLoggedOutEvent extends BasePlayerQuitEvent {
+ public ForgePlayerLoggedOutEvent(ForgeServerPlayer player) {
+ super("PlayerLoggedOutEvent", player);
+ }
+}
\ No newline at end of file
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerChatEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerChatEvent.java
new file mode 100644
index 0000000..31aa1d6
--- /dev/null
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerChatEvent.java
@@ -0,0 +1,10 @@
+package com.github.theword.queqiao.event.forge;
+
+import com.github.theword.queqiao.tool.event.BasePlayerChatEvent;
+
+public final class ForgeServerChatEvent extends BasePlayerChatEvent {
+ public ForgeServerChatEvent(String messageId, ForgeServerPlayer player, String message) {
+ super("ServerChatEvent", messageId, player, message);
+ }
+
+}
\ No newline at end of file
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerPlayer.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerPlayer.java
new file mode 100644
index 0000000..e2c222b
--- /dev/null
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerPlayer.java
@@ -0,0 +1,45 @@
+package com.github.theword.queqiao.event.forge;
+
+import com.github.theword.queqiao.tool.event.BasePlayer;
+import com.google.gson.annotations.SerializedName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ForgeServerPlayer extends BasePlayer {
+
+ @SerializedName("display_name")
+ private String displayName;
+
+ @SerializedName("ip_address")
+ private String ipAddress;
+
+ private float speed;
+ @SerializedName("flying_speed")
+ private float flyingSpeed;
+
+ @SerializedName("is_flying")
+ private boolean isFlying;
+
+ @SerializedName("is_swimming")
+ private boolean isSwimming;
+ @SerializedName("is_sleeping")
+ private boolean isSleeping;
+ @SerializedName("is_blocking")
+ private boolean isBlocking;
+
+ @SerializedName("game_mode")
+ private String gameMode;
+
+ @SerializedName("block_x")
+ private int blockX;
+ @SerializedName("block_y")
+ private int blockY;
+ @SerializedName("block_z")
+ private int blockZ;
+}
\ No newline at end of file
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotAsyncPlayerChatEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotAsyncPlayerChatEvent.java
new file mode 100644
index 0000000..c306f6f
--- /dev/null
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotAsyncPlayerChatEvent.java
@@ -0,0 +1,10 @@
+package com.github.theword.queqiao.event.spigot;
+
+import com.github.theword.queqiao.tool.event.BasePlayerChatEvent;
+
+public class SpigotAsyncPlayerChatEvent extends BasePlayerChatEvent {
+
+ public SpigotAsyncPlayerChatEvent(SpigotPlayer player, String message) {
+ super("AsyncPlayerChatEvent", "", player, message);
+ }
+}
\ No newline at end of file
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayer.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayer.java
new file mode 100644
index 0000000..0bce464
--- /dev/null
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayer.java
@@ -0,0 +1,58 @@
+package com.github.theword.queqiao.event.spigot;
+
+import com.github.theword.queqiao.tool.event.BasePlayer;
+import com.google.gson.annotations.SerializedName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class SpigotPlayer extends BasePlayer {
+
+ @SerializedName("display_name")
+ private String displayName;
+ @SerializedName("player_list_name")
+ private String playerListName;
+ private String address;
+
+ @SerializedName("is_health_scaled")
+ private boolean isHealthScaled;
+ @SerializedName("health_scale")
+ private double healthScale;
+
+ private float exp;
+
+ @SerializedName("total_exp")
+ private int totalExp;
+ private int level;
+
+ private String locale;
+
+ private int ping;
+ @SerializedName("player_time")
+ private long playerTime;
+ @SerializedName("is_player_time_relative")
+ private boolean isPlayerTimeRelative;
+ @SerializedName("player_time_offset")
+ private long playerTimeOffset;
+ @SerializedName("walk_speed")
+ private float walkSpeed;
+ @SerializedName("fly_speed")
+ private float flySpeed;
+ @SerializedName("allow_flight")
+ private boolean allowFlight;
+ @SerializedName("is_sprinting")
+ private boolean isSprinting;
+ @SerializedName("is_sneaking")
+ private boolean isSneaking;
+ @SerializedName("is_flying")
+ private boolean isFlying;
+ @SerializedName("is_op")
+ private boolean isOp;
+
+}
\ No newline at end of file
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerCommandPreprocessEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerCommandPreprocessEvent.java
new file mode 100644
index 0000000..faf21b0
--- /dev/null
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerCommandPreprocessEvent.java
@@ -0,0 +1,10 @@
+package com.github.theword.queqiao.event.spigot;
+
+import com.github.theword.queqiao.tool.event.BaseCommandEvent;
+
+public class SpigotPlayerCommandPreprocessEvent extends BaseCommandEvent {
+
+ public SpigotPlayerCommandPreprocessEvent(SpigotPlayer player, String command) {
+ super("PlayerCommandPreprocessEvent", "", player, command);
+ }
+}
\ No newline at end of file
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerDeathEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerDeathEvent.java
new file mode 100644
index 0000000..186709c
--- /dev/null
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerDeathEvent.java
@@ -0,0 +1,10 @@
+package com.github.theword.queqiao.event.spigot;
+
+import com.github.theword.queqiao.tool.event.BasePlayerDeathEvent;
+
+public class SpigotPlayerDeathEvent extends BasePlayerDeathEvent {
+
+ public SpigotPlayerDeathEvent(SpigotPlayer player, String message) {
+ super("PlayerDeathEvent", "", player, message);
+ }
+}
\ No newline at end of file
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerJoinEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerJoinEvent.java
new file mode 100644
index 0000000..6f60c71
--- /dev/null
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerJoinEvent.java
@@ -0,0 +1,11 @@
+package com.github.theword.queqiao.event.spigot;
+
+import com.github.theword.queqiao.tool.event.BasePlayerJoinEvent;
+
+public class SpigotPlayerJoinEvent extends BasePlayerJoinEvent {
+
+ public SpigotPlayerJoinEvent(SpigotPlayer player) {
+ super("PlayerJoinEvent", player);
+ }
+
+}
\ No newline at end of file
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerQuitEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerQuitEvent.java
new file mode 100644
index 0000000..f9810ed
--- /dev/null
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerQuitEvent.java
@@ -0,0 +1,10 @@
+package com.github.theword.queqiao.event.spigot;
+
+import com.github.theword.queqiao.tool.event.BasePlayerQuitEvent;
+
+public class SpigotPlayerQuitEvent extends BasePlayerQuitEvent {
+
+ public SpigotPlayerQuitEvent(SpigotPlayer player) {
+ super("PlayerQuitEvent", player);
+ }
+}
\ No newline at end of file
From 6d1891dcd93e3aafb99ee0f5b6d32e5aa59f98dc Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 01:16:08 +0800
Subject: [PATCH 02/55] :heavy_plus_sign: Add lombok
---
forge/origin/build.gradle | 3 +++
spigot/origin/build.gradle | 3 +++
2 files changed, 6 insertions(+)
diff --git a/forge/origin/build.gradle b/forge/origin/build.gradle
index 9ec2d6f..37996a8 100644
--- a/forge/origin/build.gradle
+++ b/forge/origin/build.gradle
@@ -95,6 +95,9 @@ tasks.named ('jarJar') {
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
+ annotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
+ implementation "org.projectlombok:lombok:${project.lombok_version}"
+
minecraftLibrary("com.github.theword.queqiao:queqiao-tool:${tool_version}") {
exclude group: 'org.slf4j', module: 'slf4j-api'
}
diff --git a/spigot/origin/build.gradle b/spigot/origin/build.gradle
index 7acf068..6df12c5 100644
--- a/spigot/origin/build.gradle
+++ b/spigot/origin/build.gradle
@@ -51,6 +51,9 @@ dependencies {
compileOnly "org.spigotmc:spigot-api:${project.spigot_version}"
compileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}"
+ annotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
+ implementation "org.projectlombok:lombok:${project.lombok_version}"
+
implementation "com.github.theword.queqiao:queqiao-tool:${tool_version}"
implementation "org.slf4j:slf4j-api:${slf4j_version}"
implementation "org.slf4j:slf4j-simple:${slf4j_version}"
From ed7e351c9fd075e8b5dc7c2224c70d1d456327d8 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 01:19:28 +0800
Subject: [PATCH 03/55] :sparkles: Add private message API demo
---
.../theword/queqiao/handle/HandleApiService.java | 14 ++++++++++++++
.../theword/queqiao/handle/HandleApiService.java | 14 ++++++++++++++
.../theword/queqiao/handle/HandleApiService.java | 16 +++++++++++++++-
3 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java b/fabric/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
index a21f5ac..e79e8b6 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
@@ -25,6 +25,7 @@
import org.java_websocket.WebSocket;
import java.util.List;
+import java.util.UUID;
// IF <= fabric-1.18.2
//import java.util.UUID;
//
@@ -88,6 +89,19 @@ public void handleActionBarMessage(WebSocket webSocket, List messageList) {
+ webSocket.send("Unsupported API now.");
+ }
+
private void sendPacket(Packet> packet) {
for (ServerPlayerEntity player : minecraftServer.getPlayerManager().getPlayerList()) {
player.networkHandler.sendPacket(packet);
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java b/forge/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
index c0f0b9e..f8f2327 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
@@ -30,6 +30,7 @@
import org.java_websocket.WebSocket;
import java.util.List;
+import java.util.UUID;
import static com.github.theword.queqiao.QueQiao.minecraftServer;
@@ -107,6 +108,19 @@ public void handleActionBarMessage(WebSocket webSocket, List messageList) {
+ webSocket.send("Unsupported API now.");
+ }
+
// IF > forge-1.16.5
// private void sendPacket(Packet> packet) {
// for (ServerPlayer serverPlayer : minecraftServer.getPlayerList().getPlayers()) {
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java b/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
index f296d26..7a43535 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
@@ -13,6 +13,7 @@
import org.java_websocket.WebSocket;
import java.util.List;
+import java.util.UUID;
import static com.github.theword.queqiao.QueQiao.instance;
@@ -43,6 +44,19 @@ public void handleSendTitleMessage(WebSocket webSocket, CommonSendTitle sendTitl
}
}
+ /**
+ * 私聊消息
+ *
+ * @param webSocket websocket
+ * @param targetPlayerName 目标玩家名称
+ * @param targetPlayerUuid 目标玩家 UUID
+ * @param messageList 消息体
+ */
+ @Override
+ public void handlePrivateMessage(WebSocket webSocket, String targetPlayerName, UUID targetPlayerUuid, List messageList) {
+ webSocket.send("Unsupported API now.");
+ }
+
@Override
public void handleActionBarMessage(WebSocket webSocket, List messageList) {
TextComponent actionTextComponent = parseJsonToEvent.parseMessageToTextComponent(messageList);
@@ -50,4 +64,4 @@ public void handleActionBarMessage(WebSocket webSocket, List
Date: Wed, 14 Aug 2024 01:47:08 +0800
Subject: [PATCH 04/55] (feat: Update QueQiao project to include help section
and link to Wiki)
---
.idea/compiler.xml | 46 ++++++++++++++++++++++++++++++++++++++++------
.idea/misc.xml | 1 +
.idea/modules.xml | 21 +++++++++++++++++++++
3 files changed, 62 insertions(+), 6 deletions(-)
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 77f1f1d..8031c66 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -4,15 +4,47 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -33,6 +65,8 @@
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 384f7cb..034ed60 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -19,6 +19,7 @@
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 6734f07..c045867 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,12 +2,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -28,6 +46,8 @@
+
+
@@ -50,6 +70,7 @@
+
\ No newline at end of file
From bb031288179dbfbd278599467f0e82a4725e5caa Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 01:48:29 +0800
Subject: [PATCH 05/55] (feat: Update QueQiao project to include help section
and link to Wiki)
---
.../queqiao/event/fabric/FabricServerCommandMessageEvent.java | 2 +-
.../event/fabric/FabricServerLivingEntityAfterDeathEvent.java | 2 +-
.../queqiao/event/fabric/FabricServerMessageEvent.java | 2 +-
.../fabric/FabricServerPlayConnectionDisconnectEvent.java | 2 +-
.../event/fabric/FabricServerPlayConnectionJoinEvent.java | 2 +-
.../theword/queqiao/event/fabric/FabricServerPlayer.java | 3 ++-
.../com/github/theword/queqiao/mixin/PlayerManagerMixin.java | 2 +-
.../theword/queqiao/mixin/ServerPlayNetworkHandlerMixin.java | 4 ++--
.../github/theword/queqiao/mixin/ServerPlayerEntityMixin.java | 4 ++--
.../java/com/github/theword/queqiao/utils/FabricTool.java | 4 ++--
.../main/java/com/github/theword/queqiao/EventProcessor.java | 2 +-
.../github/theword/queqiao/event/forge/ForgeCommandEvent.java | 2 +-
.../theword/queqiao/event/forge/ForgePlayerDeathEvent.java | 2 +-
.../theword/queqiao/event/forge/ForgePlayerLoggedInEvent.java | 2 +-
.../queqiao/event/forge/ForgePlayerLoggedOutEvent.java | 2 +-
.../theword/queqiao/event/forge/ForgeServerChatEvent.java | 2 +-
.../github/theword/queqiao/event/forge/ForgeServerPlayer.java | 2 +-
.../main/java/com/github/theword/queqiao/utils/ForgeTool.java | 4 ++--
.../main/java/com/github/theword/queqiao/EventProcessor.java | 4 ++--
.../queqiao/event/spigot/SpigotAsyncPlayerChatEvent.java | 2 +-
.../com/github/theword/queqiao/event/spigot/SpigotPlayer.java | 2 +-
.../event/spigot/SpigotPlayerCommandPreprocessEvent.java | 2 +-
.../theword/queqiao/event/spigot/SpigotPlayerDeathEvent.java | 2 +-
.../theword/queqiao/event/spigot/SpigotPlayerJoinEvent.java | 2 +-
.../theword/queqiao/event/spigot/SpigotPlayerQuitEvent.java | 2 +-
25 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerCommandMessageEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerCommandMessageEvent.java
index 0c02d64..71ba177 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerCommandMessageEvent.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerCommandMessageEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.fabric;
-import com.github.theword.queqiao.tool.event.BaseCommandEvent;
+import com.github.theword.queqiao.tool.event.base.BaseCommandEvent;
public class FabricServerCommandMessageEvent extends BaseCommandEvent {
public FabricServerCommandMessageEvent(String messageId, FabricServerPlayer player, String message) {
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerLivingEntityAfterDeathEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerLivingEntityAfterDeathEvent.java
index 524dfe3..c9bf86c 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerLivingEntityAfterDeathEvent.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerLivingEntityAfterDeathEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.fabric;
-import com.github.theword.queqiao.tool.event.BasePlayerDeathEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerDeathEvent;
public class FabricServerLivingEntityAfterDeathEvent extends BasePlayerDeathEvent {
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerMessageEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerMessageEvent.java
index 4f40953..cdfe4e3 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerMessageEvent.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerMessageEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.fabric;
-import com.github.theword.queqiao.tool.event.BasePlayerChatEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerChatEvent;
public class FabricServerMessageEvent extends BasePlayerChatEvent {
public FabricServerMessageEvent(String messageId, FabricServerPlayer player, String message) {
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionDisconnectEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionDisconnectEvent.java
index 60812ec..e3eb6e7 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionDisconnectEvent.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionDisconnectEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.fabric;
-import com.github.theword.queqiao.tool.event.BasePlayerQuitEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerQuitEvent;
public class FabricServerPlayConnectionDisconnectEvent extends BasePlayerQuitEvent {
public FabricServerPlayConnectionDisconnectEvent(FabricServerPlayer player) {
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionJoinEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionJoinEvent.java
index 9a25168..08c3418 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionJoinEvent.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayConnectionJoinEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.fabric;
-import com.github.theword.queqiao.tool.event.BasePlayerJoinEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerJoinEvent;
public class FabricServerPlayConnectionJoinEvent extends BasePlayerJoinEvent {
public FabricServerPlayConnectionJoinEvent(FabricServerPlayer player) {
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayer.java b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayer.java
index 7b3be08..4e3f5c4 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayer.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/event/fabric/FabricServerPlayer.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.fabric;
-import com.github.theword.queqiao.tool.event.BasePlayer;
+import com.github.theword.queqiao.tool.event.base.BasePlayer;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -12,6 +12,7 @@
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class FabricServerPlayer extends BasePlayer {
+
private String ip;
@SerializedName("display_name")
private String displayName;
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/PlayerManagerMixin.java b/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/PlayerManagerMixin.java
index 69cfead..5e22904 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/PlayerManagerMixin.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/PlayerManagerMixin.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.mixin;
-import com.github.theword.queqiao.tool.event.fabric.FabricServerPlayConnectionJoinEvent;
+import com.github.theword.queqiao.event.fabric.FabricServerPlayConnectionJoinEvent;
import net.minecraft.network.ClientConnection;
import net.minecraft.server.PlayerManager;
// IF fabric-1.21
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayNetworkHandlerMixin.java b/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayNetworkHandlerMixin.java
index c73c89f..8ea30e0 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayNetworkHandlerMixin.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayNetworkHandlerMixin.java
@@ -1,8 +1,8 @@
package com.github.theword.queqiao.mixin;
import com.github.theword.queqiao.tool.constant.BaseConstant;
-import com.github.theword.queqiao.tool.event.fabric.FabricServerCommandMessageEvent;
-import com.github.theword.queqiao.tool.event.fabric.FabricServerMessageEvent;
+import com.github.theword.queqiao.event.fabric.FabricServerCommandMessageEvent;
+import com.github.theword.queqiao.event.fabric.FabricServerMessageEvent;
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
// IF > fabric-1.18.2
//import net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket;
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayerEntityMixin.java b/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayerEntityMixin.java
index 537064c..1c59e54 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayerEntityMixin.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayerEntityMixin.java
@@ -1,7 +1,7 @@
package com.github.theword.queqiao.mixin;
-import com.github.theword.queqiao.tool.event.fabric.FabricServerLivingEntityAfterDeathEvent;
-import com.github.theword.queqiao.tool.event.fabric.FabricServerPlayConnectionDisconnectEvent;
+import com.github.theword.queqiao.event.fabric.FabricServerLivingEntityAfterDeathEvent;
+import com.github.theword.queqiao.event.fabric.FabricServerPlayConnectionDisconnectEvent;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.server.network.ServerPlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/utils/FabricTool.java b/fabric/origin/src/main/java/com/github/theword/queqiao/utils/FabricTool.java
index eeb7d6d..3a96bc3 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/utils/FabricTool.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/utils/FabricTool.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.utils;
-import com.github.theword.queqiao.tool.event.fabric.FabricServerPlayer;
+import com.github.theword.queqiao.event.fabric.FabricServerPlayer;
import net.minecraft.server.network.ServerPlayerEntity;
public class FabricTool {
@@ -9,7 +9,7 @@ public static FabricServerPlayer getFabricPlayer(ServerPlayerEntity player) {
FabricServerPlayer fabricServerPlayer = new FabricServerPlayer();
fabricServerPlayer.setNickname(player.getName().getString());
- fabricServerPlayer.setUuid(player.getUuidAsString());
+ fabricServerPlayer.setUuid(player.getUuid());
fabricServerPlayer.setIp(player.getIp());
fabricServerPlayer.setDisplayName(player.getDisplayName().getString());
fabricServerPlayer.setMovementSpeed(player.getMovementSpeed());
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java b/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
index 81c41b4..336a987 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
@@ -2,7 +2,7 @@
import com.github.theword.queqiao.tool.constant.BaseConstant;
-import com.github.theword.queqiao.tool.event.forge.*;
+import com.github.theword.queqiao.event.forge.*;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
// IF > forge-1.16.5
//import net.minecraft.server.level.ServerPlayer;
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeCommandEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeCommandEvent.java
index 0c474b2..14e4a8e 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeCommandEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeCommandEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.forge;
-import com.github.theword.queqiao.tool.event.BaseCommandEvent;
+import com.github.theword.queqiao.tool.event.base.BaseCommandEvent;
public class ForgeCommandEvent extends BaseCommandEvent {
public ForgeCommandEvent(String messageId, ForgeServerPlayer player, String command) {
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerDeathEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerDeathEvent.java
index 1e091a6..82565b5 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerDeathEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerDeathEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.forge;
-import com.github.theword.queqiao.tool.event.BasePlayerDeathEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerDeathEvent;
public class ForgePlayerDeathEvent extends BasePlayerDeathEvent {
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedInEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedInEvent.java
index 2aaf58e..dfacb28 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedInEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedInEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.forge;
-import com.github.theword.queqiao.tool.event.BasePlayerJoinEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerJoinEvent;
public final class ForgePlayerLoggedInEvent extends BasePlayerJoinEvent {
public ForgePlayerLoggedInEvent(ForgeServerPlayer player) {
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedOutEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedOutEvent.java
index 6f0fc29..ffcc7f9 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedOutEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgePlayerLoggedOutEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.forge;
-import com.github.theword.queqiao.tool.event.BasePlayerQuitEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerQuitEvent;
public final class ForgePlayerLoggedOutEvent extends BasePlayerQuitEvent {
public ForgePlayerLoggedOutEvent(ForgeServerPlayer player) {
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerChatEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerChatEvent.java
index 31aa1d6..8ab8cdf 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerChatEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerChatEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.forge;
-import com.github.theword.queqiao.tool.event.BasePlayerChatEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerChatEvent;
public final class ForgeServerChatEvent extends BasePlayerChatEvent {
public ForgeServerChatEvent(String messageId, ForgeServerPlayer player, String message) {
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerPlayer.java b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerPlayer.java
index e2c222b..f63bb12 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerPlayer.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/event/forge/ForgeServerPlayer.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.forge;
-import com.github.theword.queqiao.tool.event.BasePlayer;
+import com.github.theword.queqiao.tool.event.base.BasePlayer;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Data;
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ForgeTool.java b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ForgeTool.java
index c7e88b5..41d98bb 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ForgeTool.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ForgeTool.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.utils;
-import com.github.theword.queqiao.tool.event.forge.ForgeServerPlayer;
+import com.github.theword.queqiao.event.forge.ForgeServerPlayer;
// IF > forge-1.16.5
//import net.minecraft.server.level.ServerPlayer;
// ELSE
@@ -17,7 +17,7 @@ public class ForgeTool {
forgeServerPlayer.setNickname(player.getName().getString());
forgeServerPlayer.setDisplayName(player.getDisplayName().getString());
- forgeServerPlayer.setUuid(player.getUUID().toString());
+ forgeServerPlayer.setUuid(player.getUUID());
forgeServerPlayer.setIpAddress(player.getIpAddress());
forgeServerPlayer.setSpeed(player.getSpeed());
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java b/spigot/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
index 7a0ec00..8e01278 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao;
-import com.github.theword.queqiao.tool.event.spigot.*;
+import com.github.theword.queqiao.event.spigot.*;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@@ -99,7 +99,7 @@ void onPlayerCommand(PlayerCommandPreprocessEvent event) {
*/
SpigotPlayer getSpigotPlayer(Player player) {
SpigotPlayer spigotPlayer = new SpigotPlayer();
- spigotPlayer.setUuid(player.getUniqueId().toString());
+ spigotPlayer.setUuid(player.getUniqueId());
spigotPlayer.setNickname(player.getName());
spigotPlayer.setDisplayName(player.getDisplayName());
spigotPlayer.setPlayerListName(player.getDisplayName());
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotAsyncPlayerChatEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotAsyncPlayerChatEvent.java
index c306f6f..f098e46 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotAsyncPlayerChatEvent.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotAsyncPlayerChatEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.spigot;
-import com.github.theword.queqiao.tool.event.BasePlayerChatEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerChatEvent;
public class SpigotAsyncPlayerChatEvent extends BasePlayerChatEvent {
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayer.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayer.java
index 0bce464..d0bdcba 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayer.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayer.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.spigot;
-import com.github.theword.queqiao.tool.event.BasePlayer;
+import com.github.theword.queqiao.tool.event.base.BasePlayer;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Data;
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerCommandPreprocessEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerCommandPreprocessEvent.java
index faf21b0..87b4ec3 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerCommandPreprocessEvent.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerCommandPreprocessEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.spigot;
-import com.github.theword.queqiao.tool.event.BaseCommandEvent;
+import com.github.theword.queqiao.tool.event.base.BaseCommandEvent;
public class SpigotPlayerCommandPreprocessEvent extends BaseCommandEvent {
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerDeathEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerDeathEvent.java
index 186709c..b407c6a 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerDeathEvent.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerDeathEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.spigot;
-import com.github.theword.queqiao.tool.event.BasePlayerDeathEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerDeathEvent;
public class SpigotPlayerDeathEvent extends BasePlayerDeathEvent {
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerJoinEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerJoinEvent.java
index 6f60c71..01b722d 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerJoinEvent.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerJoinEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.spigot;
-import com.github.theword.queqiao.tool.event.BasePlayerJoinEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerJoinEvent;
public class SpigotPlayerJoinEvent extends BasePlayerJoinEvent {
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerQuitEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerQuitEvent.java
index f9810ed..7374fac 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerQuitEvent.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/event/spigot/SpigotPlayerQuitEvent.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.event.spigot;
-import com.github.theword.queqiao.tool.event.BasePlayerQuitEvent;
+import com.github.theword.queqiao.tool.event.base.BasePlayerQuitEvent;
public class SpigotPlayerQuitEvent extends BasePlayerQuitEvent {
From 4940ee63251b2c00c9a4110acd1a95addffad864 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 01:48:52 +0800
Subject: [PATCH 06/55] :arrow_up: Upgrade tool version
---
tool_version.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tool_version.txt b/tool_version.txt
index 6812f81..05b19b1 100644
--- a/tool_version.txt
+++ b/tool_version.txt
@@ -1 +1 @@
-0.0.3
\ No newline at end of file
+0.0.4
\ No newline at end of file
From 4243b0e408814e63ed67da8b6ebde1b25af58d21 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 01:49:16 +0800
Subject: [PATCH 07/55] (feat: Remove unused Velocity event classes and update
imports)
---
.../theword/queqiao/EventProcessor.java | 8 ++---
.../event/VelocityCommandExecuteEvent.java | 9 ------
.../event/VelocityDisconnectEvent.java | 9 ------
.../queqiao/event/VelocityLoginEvent.java | 9 ------
.../theword/queqiao/event/VelocityPlayer.java | 31 -------------------
.../event/VelocityPlayerChatEvent.java | 9 ------
.../theword/queqiao/utils/VelocityTool.java | 2 +-
7 files changed, 5 insertions(+), 72 deletions(-)
delete mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityCommandExecuteEvent.java
delete mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityDisconnectEvent.java
delete mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityLoginEvent.java
delete mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityPlayer.java
delete mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityPlayerChatEvent.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/EventProcessor.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/EventProcessor.java
index cb9bdd0..57e17b2 100644
--- a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/EventProcessor.java
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/EventProcessor.java
@@ -1,9 +1,9 @@
package com.github.theword.queqiao;
-import com.github.theword.queqiao.event.VelocityDisconnectEvent;
-import com.github.theword.queqiao.event.VelocityLoginEvent;
-import com.github.theword.queqiao.event.VelocityPlayer;
-import com.github.theword.queqiao.event.VelocityPlayerChatEvent;
+import com.github.theword.queqiao.event.velocity.VelocityDisconnectEvent;
+import com.github.theword.queqiao.event.velocity.VelocityLoginEvent;
+import com.github.theword.queqiao.event.velocity.VelocityPlayer;
+import com.github.theword.queqiao.event.velocity.VelocityPlayerChatEvent;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.command.CommandExecuteEvent;
import com.velocitypowered.api.event.connection.DisconnectEvent;
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityCommandExecuteEvent.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityCommandExecuteEvent.java
deleted file mode 100644
index b2427a5..0000000
--- a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityCommandExecuteEvent.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.github.theword.queqiao.event;
-
-import com.github.theword.queqiao.tool.event.base.BaseCommandEvent;
-
-public class VelocityCommandExecuteEvent extends BaseCommandEvent {
- public VelocityCommandExecuteEvent(VelocityPlayer player, String command) {
- super("VelocityCommandExecuteEvent", "", player, command);
- }
-}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityDisconnectEvent.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityDisconnectEvent.java
deleted file mode 100644
index da1da95..0000000
--- a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityDisconnectEvent.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.github.theword.queqiao.event;
-
-import com.github.theword.queqiao.tool.event.base.BasePlayerQuitEvent;
-
-public class VelocityDisconnectEvent extends BasePlayerQuitEvent {
- public VelocityDisconnectEvent(VelocityPlayer player) {
- super("VelocityDisconnectEvent", player);
- }
-}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityLoginEvent.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityLoginEvent.java
deleted file mode 100644
index 630d515..0000000
--- a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityLoginEvent.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.github.theword.queqiao.event;
-
-import com.github.theword.queqiao.tool.event.base.BasePlayerJoinEvent;
-
-public class VelocityLoginEvent extends BasePlayerJoinEvent {
- public VelocityLoginEvent(VelocityPlayer player) {
- super("VelocityLoginEvent", player);
- }
-}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityPlayer.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityPlayer.java
deleted file mode 100644
index 80288df..0000000
--- a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityPlayer.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.github.theword.queqiao.event;
-
-import com.github.theword.queqiao.tool.event.base.BasePlayer;
-import com.google.gson.Gson;
-import com.google.gson.annotations.SerializedName;
-import com.velocitypowered.api.proxy.player.PlayerSettings;
-import com.velocitypowered.api.util.GameProfile;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.net.InetSocketAddress;
-import java.util.UUID;
-
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class VelocityPlayer extends BasePlayer {
- private UUID uuid;
- private long ping;
- @SerializedName("online_mode")
- private boolean onlineMode;
- @SerializedName("game_profile")
- private GameProfile gameProfile;
- @SerializedName("remote_address")
- private InetSocketAddress remoteAddress;
- @SerializedName("player_settings")
- private PlayerSettings playerSettings;
-
- public String getJson() {
- return new Gson().toJson(this);
- }
-}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityPlayerChatEvent.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityPlayerChatEvent.java
deleted file mode 100644
index 2ec7052..0000000
--- a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/VelocityPlayerChatEvent.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.github.theword.queqiao.event;
-
-import com.github.theword.queqiao.tool.event.base.BasePlayerChatEvent;
-
-public class VelocityPlayerChatEvent extends BasePlayerChatEvent {
- public VelocityPlayerChatEvent(VelocityPlayer player, String message){
- super("VelocityPlayerChatEvent", "", player, message);
- }
-}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/VelocityTool.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/VelocityTool.java
index f2d8437..402db29 100644
--- a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/VelocityTool.java
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/VelocityTool.java
@@ -1,6 +1,6 @@
package com.github.theword.queqiao.utils;
-import com.github.theword.queqiao.event.VelocityPlayer;
+import com.github.theword.queqiao.event.velocity.VelocityPlayer;
import com.velocitypowered.api.proxy.Player;
public class VelocityTool {
From 453a57ee134778312be22a0496af6737e4733888 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 01:56:01 +0800
Subject: [PATCH 08/55] (feat: Refactor event processing to centralize
register/login command detection)
---
.../mixin/ServerPlayNetworkHandlerMixin.java | 19 ++++++++++---------
.../theword/queqiao/EventProcessor.java | 9 ++++-----
.../theword/queqiao/EventProcessor.java | 14 ++++----------
3 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayNetworkHandlerMixin.java b/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayNetworkHandlerMixin.java
index 8ea30e0..b58983e 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayNetworkHandlerMixin.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayNetworkHandlerMixin.java
@@ -17,9 +17,8 @@
import java.util.Objects;
+import static com.github.theword.queqiao.tool.utils.Tool.*;
import static com.github.theword.queqiao.utils.FabricTool.getFabricPlayer;
-import static com.github.theword.queqiao.tool.utils.Tool.config;
-import static com.github.theword.queqiao.tool.utils.Tool.sendWebsocketMessage;
@Mixin(ServerPlayNetworkHandler.class)
public class ServerPlayNetworkHandlerMixin {
@@ -27,7 +26,7 @@ public class ServerPlayNetworkHandlerMixin {
public ServerPlayerEntity player;
// IF > fabric-1.16.5
-// @Inject(method = "onChatMessage", at = @At("HEAD"))
+// @Inject(method = "onChatMessage", at = @At("HEAD"))
// ELSE
// @Inject(method = "onGameMessage", at = @At("HEAD"))
// END IF
@@ -51,18 +50,20 @@ private void onChatMessage(ChatMessageC2SPacket packet, CallbackInfo info) {
// @Inject(method = "onCommandExecution", at = @At("HEAD"))
// private void onCommandExecution(CommandExecutionC2SPacket packet, CallbackInfo ci) {
// String input = packet.command();
- // ELSE IF fabric-1.18.2
+ // ELSE IF fabric-1.18.2
// @Inject(method = "executeCommand", at = @At("HEAD"))
// private void executeCommand(String input, CallbackInfo ci) {
- // ELSE
+ // ELSE
// @Inject(method = "executeCommand", at = @At("HEAD"))
// private void executeCommand(String input, CallbackInfo ci) {
// END IF
if (!config.getSubscribe_event().isPlayer_command()) return;
- if (!(input.startsWith("/l ") || input.startsWith("/login ") || input.startsWith("/register ") || input.startsWith("/reg ") || input.startsWith("/" + BaseConstant.COMMAND_HEADER + " "))) {
- FabricServerCommandMessageEvent event = new FabricServerCommandMessageEvent("", getFabricPlayer(Objects.requireNonNull(player)), input);
- sendWebsocketMessage(event);
- }
+ String registerOrLoginCommand = isRegisterOrLoginCommand(input);
+
+ if (registerOrLoginCommand.isEmpty()) return;
+
+ FabricServerCommandMessageEvent event = new FabricServerCommandMessageEvent("", getFabricPlayer(Objects.requireNonNull(player)), registerOrLoginCommand);
+ sendWebsocketMessage(event);
}
}
\ No newline at end of file
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java b/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
index 336a987..8bdf9e6 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
@@ -20,8 +20,7 @@
import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
-import static com.github.theword.queqiao.tool.utils.Tool.config;
-import static com.github.theword.queqiao.tool.utils.Tool.sendWebsocketMessage;
+import static com.github.theword.queqiao.tool.utils.Tool.*;
import static com.github.theword.queqiao.utils.ForgeTool.getForgePlayer;
public class EventProcessor {
@@ -82,10 +81,10 @@ public void onPlayerCommand(CommandEvent event) {
// if (!(event.getParseResults().getContext().getSource().getEntity() instanceof ServerPlayerEntity)) return;
// END IF
- String command = event.getParseResults().getReader().getString();
+ String command = isRegisterOrLoginCommand(event.getParseResults().getReader().getString());
- if (command.startsWith("l ") || command.startsWith("login ") || command.startsWith("register ") || command.startsWith("reg ") || command.startsWith(BaseConstant.COMMAND_HEADER + " "))
- return;
+ if (command.isEmpty()) return;
+
ForgeServerPlayer player;
try {
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java b/spigot/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
index 8e01278..6d0beb5 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
@@ -12,8 +12,7 @@
import java.util.Objects;
-import static com.github.theword.queqiao.tool.utils.Tool.config;
-import static com.github.theword.queqiao.tool.utils.Tool.sendWebsocketMessage;
+import static com.github.theword.queqiao.tool.utils.Tool.*;
class EventProcessor implements Listener {
@@ -67,7 +66,6 @@ void onPlayerQuit(PlayerQuitEvent event) {
SpigotPlayerQuitEvent spigotPlayerQuitEvent = new SpigotPlayerQuitEvent(getSpigotPlayer(event.getPlayer()));
sendWebsocketMessage(spigotPlayerQuitEvent);
-
}
/**
@@ -79,16 +77,12 @@ void onPlayerQuit(PlayerQuitEvent event) {
void onPlayerCommand(PlayerCommandPreprocessEvent event) {
if (!config.getSubscribe_event().isPlayer_command()) return;
- String command = event.getMessage();
-
- if (command.startsWith("/l ") || command.startsWith("/login ") || command.startsWith("/register ") || command.startsWith("/reg ") || command.startsWith("mcqq "))
- return;
+ String command = isRegisterOrLoginCommand(event.getMessage());
- command = command.replaceFirst("/", "");
+ if (command.isEmpty()) return;
+
SpigotPlayerCommandPreprocessEvent spigotPlayerCommandPreprocessEvent = new SpigotPlayerCommandPreprocessEvent(getSpigotPlayer(event.getPlayer()), command);
sendWebsocketMessage(spigotPlayerCommandPreprocessEvent);
-
-
}
/**
From 9222d7013bd54901bc90d1894c35cd7c0634cec3 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 01:57:06 +0800
Subject: [PATCH 09/55] :arrow_up: Upgrade tool version and refactor velocity
event processing
---
.gitignore | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index c359a87..8c2966a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,12 +22,12 @@ QueQiao-jar/
forge/forge-*/
fabric/fabric-*/
spigot/spigot-*/
-velocity/velocity-*/
+#velocity/velocity-*/
!fabric/fabric-*/gradle/
!forge/forge-*/gradle/
!spigot/spigot-*/gradle/
-!velocity/velocity-*/gradle/
+#!velocity/velocity-*/gradle/
!fabric/fabric-*/gradlew
!fabric/fabric-*/gradlew.bat
@@ -35,8 +35,8 @@ velocity/velocity-*/
!forge/forge-*/gradlew.bat
!spigot/spigot-*/gradlew
!spigot/spigot-*/gradlew.bat
-!velocity/velocity-*/gradlew
-!velocity/velocity-*/gradlew.bat
+#!velocity/velocity-*/gradlew
+#!velocity/velocity-*/gradlew.bat
!tool/
From 9a19e55e59d055f570e5e4692e57b6c9aa8ac3c9 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 01:57:32 +0800
Subject: [PATCH 10/55] :sparkles: Add velocity events
---
.../velocity/VelocityCommandExecuteEvent.java | 9 +++++++
.../velocity/VelocityDisconnectEvent.java | 9 +++++++
.../event/velocity/VelocityLoginEvent.java | 9 +++++++
.../event/velocity/VelocityPlayer.java | 27 +++++++++++++++++++
.../velocity/VelocityPlayerChatEvent.java | 9 +++++++
5 files changed, 63 insertions(+)
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityCommandExecuteEvent.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityDisconnectEvent.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityLoginEvent.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayer.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayerChatEvent.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityCommandExecuteEvent.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityCommandExecuteEvent.java
new file mode 100644
index 0000000..4052c23
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityCommandExecuteEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.velocity;
+
+import com.github.theword.queqiao.tool.event.base.BaseCommandEvent;
+
+public class VelocityCommandExecuteEvent extends BaseCommandEvent {
+ public VelocityCommandExecuteEvent(VelocityPlayer player, String command) {
+ super("VelocityCommandExecuteEvent", "", player, command);
+ }
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityDisconnectEvent.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityDisconnectEvent.java
new file mode 100644
index 0000000..7f7f455
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityDisconnectEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.velocity;
+
+import com.github.theword.queqiao.tool.event.base.BasePlayerQuitEvent;
+
+public class VelocityDisconnectEvent extends BasePlayerQuitEvent {
+ public VelocityDisconnectEvent(VelocityPlayer player) {
+ super("VelocityDisconnectEvent", player);
+ }
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityLoginEvent.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityLoginEvent.java
new file mode 100644
index 0000000..ca0091c
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityLoginEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.velocity;
+
+import com.github.theword.queqiao.tool.event.base.BasePlayerJoinEvent;
+
+public class VelocityLoginEvent extends BasePlayerJoinEvent {
+ public VelocityLoginEvent(VelocityPlayer player) {
+ super("VelocityLoginEvent", player);
+ }
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayer.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayer.java
new file mode 100644
index 0000000..50405bf
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayer.java
@@ -0,0 +1,27 @@
+package com.github.theword.queqiao.event.velocity;
+
+import com.github.theword.queqiao.tool.event.base.BasePlayer;
+import com.google.gson.annotations.SerializedName;
+import com.velocitypowered.api.proxy.player.PlayerSettings;
+import com.velocitypowered.api.util.GameProfile;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.net.InetSocketAddress;
+
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class VelocityPlayer extends BasePlayer {
+
+ private long ping;
+ @SerializedName("online_mode")
+ private boolean onlineMode;
+ @SerializedName("game_profile")
+ private GameProfile gameProfile;
+ @SerializedName("remote_address")
+ private InetSocketAddress remoteAddress;
+ @SerializedName("player_settings")
+ private PlayerSettings playerSettings;
+
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayerChatEvent.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayerChatEvent.java
new file mode 100644
index 0000000..9cdf8a0
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayerChatEvent.java
@@ -0,0 +1,9 @@
+package com.github.theword.queqiao.event.velocity;
+
+import com.github.theword.queqiao.tool.event.base.BasePlayerChatEvent;
+
+public class VelocityPlayerChatEvent extends BasePlayerChatEvent {
+ public VelocityPlayerChatEvent(VelocityPlayer player, String message){
+ super("VelocityPlayerChatEvent", "", player, message);
+ }
+}
From 9bd0aaa644831e94425f4f667b7734c03a913a81 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 01:59:52 +0800
Subject: [PATCH 11/55] (feat: Update QueQiao project to build on main branch
with new workflow conditions)
---
.github/workflows/build.yml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c46bb0b..8f3b456 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,6 +1,9 @@
name: Build Plugin and Mod
on:
+ push:
+ branches:
+ - main
workflow_dispatch:
permissions:
@@ -11,6 +14,7 @@ env:
jobs:
create-release:
+ if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -98,10 +102,12 @@ jobs:
cd ../..
- uses: actions/upload-artifact@v4
+ if: ${{ github.event_name == 'push' }}
with:
name: QueQiao-${{ matrix.config.mc-loader }}+${{ matrix.config.mc-version }}-${{ env.MOD_VERSION }}.jar
path: QueQiao-jar/${{ env.MOD_VERSION }}/QueQiao-${{ matrix.config.mc-loader }}+${{ matrix.config.mc-version }}-${{ env.MOD_VERSION }}.jar
- name: Upload to Release
+ if: ${{ github.event_name == 'push' }}
run: |
gh release upload v${{ env.MOD_VERSION }} QueQiao-jar/${{ env.MOD_VERSION }}/QueQiao-${{ matrix.config.mc-loader }}+${{ matrix.config.mc-version }}-${{ env.MOD_VERSION }}.jar
\ No newline at end of file
From 1f4ae4fac89d0ea42072f0eb55847381bf7bb8aa Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 02:01:48 +0800
Subject: [PATCH 12/55] (feat: Update QueQiao project to build on main branch
with new workflow conditions)
---
.github/workflows/build.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8f3b456..c134d08 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -68,7 +68,6 @@ jobs:
build:
runs-on: windows-latest
needs:
- - create-release
- generate-matrix
strategy:
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
From 2085974bb9f9f368af3aa06d00daa6e5b71a2a99 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 02:34:07 +0800
Subject: [PATCH 13/55] (feat: Add new classes and methods for message handling
in velocity)
---
.../com/github/theword/queqiao/QueQiao.java | 19 +++++-
.../queqiao/handle/HandleApiService.java | 58 +++++++++++++++++++
.../HandleCommandReturnMessageService.java | 10 ++++
.../queqiao/utils/ParseJsonToEvent.java | 24 ++++++++
4 files changed, 108 insertions(+), 3 deletions(-)
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/QueQiao.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/QueQiao.java
index fd94da9..2394f0d 100644
--- a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/QueQiao.java
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/QueQiao.java
@@ -1,26 +1,39 @@
package com.github.theword.queqiao;
+import com.github.theword.queqiao.handle.HandleApiService;
+import com.github.theword.queqiao.handle.HandleCommandReturnMessageService;
import com.github.theword.queqiao.tool.constant.BaseConstant;
import com.google.inject.Inject;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.Subscribe;
+import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.proxy.ProxyServer;
import org.slf4j.Logger;
+import static com.github.theword.queqiao.tool.utils.Tool.initTool;
+import static com.github.theword.queqiao.tool.utils.Tool.websocketManager;
+
@Plugin(id = BaseConstant.MOD_ID, name = BaseConstant.MODULE_NAME, version = BuildConstants.VERSION)
public class QueQiao {
- private final ProxyServer minecraftServer;
+ public static ProxyServer minecraftServer;
@Inject
- public QueQiao(ProxyServer server, Logger logger) {
- this.minecraftServer = server;
+ public QueQiao(ProxyServer server) {
+ minecraftServer = server;
}
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
+ initTool(true, new HandleApiService(), new HandleCommandReturnMessageService());
+ websocketManager.startWebsocket(null);
+ minecraftServer.getEventManager().register(this, new EventProcessor());
+ }
+ @Subscribe
+ public void onProxyShutdown(ProxyShutdownEvent event) {
+ websocketManager.stopWebsocketByServerClose();
}
}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
new file mode 100644
index 0000000..6ebc06b
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
@@ -0,0 +1,58 @@
+package com.github.theword.queqiao.handle;
+
+import com.github.theword.queqiao.tool.handle.HandleApi;
+import com.github.theword.queqiao.tool.payload.modle.CommonBaseComponent;
+import com.github.theword.queqiao.tool.payload.modle.CommonSendTitle;
+import com.github.theword.queqiao.tool.payload.modle.CommonTextComponent;
+import com.github.theword.queqiao.tool.utils.Tool;
+import com.github.theword.queqiao.utils.ParseJsonToEvent;
+import com.velocitypowered.api.proxy.Player;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.title.TitlePart;
+import org.java_websocket.WebSocket;
+
+import java.util.List;
+import java.util.UUID;
+
+import static com.github.theword.queqiao.QueQiao.minecraftServer;
+
+public class HandleApiService implements HandleApi {
+
+ private final ParseJsonToEvent parseJsonToEvent = new ParseJsonToEvent();
+
+ @Override
+ public void handleBroadcastMessage(WebSocket webSocket, List messageList) {
+ Component component = parseJsonToEvent.parsePerMessageToMultiText(Tool.getPrefixComponent());
+ Component append = component.append(parseJsonToEvent.parseMessage(messageList));
+ minecraftServer.sendMessage(append);
+ }
+
+ @Override
+ public void handleSendTitleMessage(WebSocket webSocket, CommonSendTitle commonSendTitle) {
+ Component title = parseJsonToEvent.parseMessage(commonSendTitle.getTitle());
+ minecraftServer.sendTitlePart(TitlePart.TITLE, title);
+ if (commonSendTitle.getSubtitle() != null) {
+ Component subtitle = parseJsonToEvent.parseMessage(commonSendTitle.getSubtitle());
+ minecraftServer.sendTitlePart(TitlePart.SUBTITLE, subtitle);
+ }
+ }
+
+ @Override
+ public void handleActionBarMessage(WebSocket webSocket, List messageList) {
+ Component component = parseJsonToEvent.parsePerMessageToMultiText(Tool.getPrefixComponent());
+ minecraftServer.sendActionBar(component);
+ }
+
+ @Override
+ public void handlePrivateMessage(WebSocket webSocket, String targetPlayerName, UUID targetPlayerUuid, List messageList) {
+ for (Player player : minecraftServer.getAllPlayers()) {
+ if ((targetPlayerUuid != null && targetPlayerUuid.equals(player.getUniqueId())) || (targetPlayerName != null && targetPlayerName.equals(player.getUsername()))) {
+ Component component = parseJsonToEvent.parsePerMessageToMultiText(Tool.getPrefixComponent());
+ minecraftServer.sendMessage(component);
+ webSocket.send("{ \"result\": 200, \"message\": \"Message sent\" }");
+ break;
+ }
+ }
+ webSocket.send("{ \"result\": 404, \"message\": \"Player not found\" }");
+ }
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java
new file mode 100644
index 0000000..0f78ea9
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java
@@ -0,0 +1,10 @@
+package com.github.theword.queqiao.handle;
+
+import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessage;
+
+public class HandleCommandReturnMessageService implements HandleCommandReturnMessage {
+ @Override
+ public void handleCommandReturnMessage(Object o, String s) {
+ // TODO implement me
+ }
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
new file mode 100644
index 0000000..576395f
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -0,0 +1,24 @@
+package com.github.theword.queqiao.utils;
+
+import com.github.theword.queqiao.tool.payload.modle.CommonBaseComponent;
+import net.kyori.adventure.text.Component;
+
+
+import java.util.List;
+
+public class ParseJsonToEvent {
+
+ public Component parseMessage(List extends CommonBaseComponent> commonBaseComponentList) {
+ Component component = Component.empty();
+ for (CommonBaseComponent commonBaseComponent : commonBaseComponentList) {
+ component = component.append(Component.text(commonBaseComponent.getText()));
+ }
+ return component;
+ }
+
+ public Component parsePerMessageToMultiText(CommonBaseComponent commonBaseComponent) {
+ Component component = Component.text(commonBaseComponent.getText());
+ return component;
+ }
+
+}
From a241e92d2abdd6957a5559a139e7b2b63eb50dc6 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:02:29 +0800
Subject: [PATCH 14/55] (feat: Implement new velocity commands for server
management)
---
.../queqiao/command/CommandExecutor.java | 42 +++++++++++++++++++
.../queqiao/command/CommandManager.java | 22 ++++++++++
.../queqiao/command/VelocitySubCommand.java | 11 +++++
.../command/subCommand/HelpCommand.java | 24 +++++++++++
.../command/subCommand/ReloadCommand.java | 17 ++++++++
.../client/ReconnectAllCommand.java | 17 ++++++++
.../subCommand/client/ReconnectCommand.java | 17 ++++++++
7 files changed, 150 insertions(+)
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandManager.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/VelocitySubCommand.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java
create mode 100644 velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java
new file mode 100644
index 0000000..6e139f1
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java
@@ -0,0 +1,42 @@
+package com.github.theword.queqiao.command;
+
+import com.github.theword.queqiao.command.subCommand.HelpCommand;
+import com.github.theword.queqiao.command.subCommand.ReloadCommand;
+import com.github.theword.queqiao.command.subCommand.client.ReconnectAllCommand;
+import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
+import com.github.theword.queqiao.tool.constant.BaseConstant;
+import com.mojang.brigadier.Command;
+import com.mojang.brigadier.builder.LiteralArgumentBuilder;
+import com.mojang.brigadier.tree.LiteralCommandNode;
+import com.velocitypowered.api.command.BrigadierCommand;
+import com.velocitypowered.api.command.CommandSource;
+import com.velocitypowered.api.proxy.ProxyServer;
+import net.kyori.adventure.text.Component;
+
+public class CommandExecutor {
+
+ public static BrigadierCommand createBrigadierCommand(final ProxyServer proxy) {
+ LiteralCommandNode helloNode = BrigadierCommand.literalArgumentBuilder(BaseConstant.COMMAND_HEADER)
+ .requires(source -> source.hasPermission("queqiao.admin"))
+ .executes(context -> new HelpCommand().onCommand(context))
+ .then(LiteralArgumentBuilder.literal("help")
+ .executes(context -> new HelpCommand().onCommand(context)))
+ .then(LiteralArgumentBuilder.literal("reload")
+ .executes(context -> new ReloadCommand().onCommand(context)))
+ .then(LiteralArgumentBuilder.literal("server")
+ .executes(context -> {
+ context.getSource().sendMessage(Component.text("Server command not supported."));
+ return Command.SINGLE_SUCCESS;
+ }))
+ .then(LiteralArgumentBuilder.literal("client")
+ .then(LiteralArgumentBuilder.literal("reconnect")
+ .executes(context -> new ReconnectCommand().onCommand(context))
+ .then(LiteralArgumentBuilder.literal("all")
+ .executes(context -> new ReconnectAllCommand().onCommand(context)
+ )
+ )
+ )
+ ).build();
+ return new BrigadierCommand(helloNode);
+ }
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandManager.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandManager.java
new file mode 100644
index 0000000..0164299
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandManager.java
@@ -0,0 +1,22 @@
+package com.github.theword.queqiao.command;
+
+
+import com.github.theword.queqiao.command.subCommand.HelpCommand;
+import com.github.theword.queqiao.command.subCommand.ReloadCommand;
+import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Getter
+public class CommandManager {
+ List subCommandList = new ArrayList<>();
+
+
+ public CommandManager() {
+ subCommandList.add(new HelpCommand());
+ subCommandList.add(new ReloadCommand());
+ subCommandList.add(new ReconnectCommand());
+ }
+}
\ No newline at end of file
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/VelocitySubCommand.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/VelocitySubCommand.java
new file mode 100644
index 0000000..5066efc
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/VelocitySubCommand.java
@@ -0,0 +1,11 @@
+package com.github.theword.queqiao.command;
+
+import com.github.theword.queqiao.tool.command.SubCommand;
+import com.mojang.brigadier.context.CommandContext;
+import com.velocitypowered.api.command.CommandSource;
+
+public interface VelocitySubCommand extends SubCommand {
+
+ int onCommand(CommandContext context);
+
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java
new file mode 100644
index 0000000..b42ea8e
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java
@@ -0,0 +1,24 @@
+package com.github.theword.queqiao.command.subCommand;
+
+import com.github.theword.queqiao.command.CommandManager;
+import com.github.theword.queqiao.command.VelocitySubCommand;
+import com.github.theword.queqiao.tool.command.subCommand.HelpCommandAbstract;
+import com.mojang.brigadier.Command;
+import com.mojang.brigadier.context.CommandContext;
+import com.velocitypowered.api.command.CommandSource;
+
+import static com.github.theword.queqiao.tool.utils.Tool.handleCommandReturnMessage;
+
+public class HelpCommand extends HelpCommandAbstract implements VelocitySubCommand {
+
+
+ @Override
+ public int onCommand(CommandContext context) {
+ handleCommandReturnMessage.handleCommandReturnMessage(context, "-------------------");
+ for (VelocitySubCommand forgeSubCommand : new CommandManager().getSubCommandList()) {
+ handleCommandReturnMessage.handleCommandReturnMessage(context, forgeSubCommand.getUsage() + "---" + forgeSubCommand.getDescription());
+ }
+ handleCommandReturnMessage.handleCommandReturnMessage(context, "-------------------");
+ return Command.SINGLE_SUCCESS;
+ }
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java
new file mode 100644
index 0000000..40e1f07
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java
@@ -0,0 +1,17 @@
+package com.github.theword.queqiao.command.subCommand;
+
+import com.github.theword.queqiao.command.VelocitySubCommand;
+import com.github.theword.queqiao.tool.command.subCommand.ReloadCommandAbstract;
+import com.mojang.brigadier.Command;
+import com.mojang.brigadier.context.CommandContext;
+import com.velocitypowered.api.command.CommandSource;
+
+import static com.github.theword.queqiao.tool.utils.Tool.websocketManager;
+
+public class ReloadCommand extends ReloadCommandAbstract implements VelocitySubCommand {
+ @Override
+ public int onCommand(CommandContext context) {
+ websocketManager.reloadWebsocket(true, context);
+ return Command.SINGLE_SUCCESS;
+ }
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java
new file mode 100644
index 0000000..369c35f
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java
@@ -0,0 +1,17 @@
+package com.github.theword.queqiao.command.subCommand.client;
+
+import com.github.theword.queqiao.command.VelocitySubCommand;
+import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
+import com.mojang.brigadier.Command;
+import com.mojang.brigadier.context.CommandContext;
+import com.velocitypowered.api.command.CommandSource;
+
+import static com.github.theword.queqiao.tool.utils.Tool.websocketManager;
+
+public class ReconnectAllCommand extends ReconnectCommandAbstract implements VelocitySubCommand {
+ @Override
+ public int onCommand(CommandContext context) {
+ websocketManager.reconnectWebsocketClients(true, context);
+ return Command.SINGLE_SUCCESS;
+ }
+}
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java
new file mode 100644
index 0000000..5a617a6
--- /dev/null
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java
@@ -0,0 +1,17 @@
+package com.github.theword.queqiao.command.subCommand.client;
+
+import com.github.theword.queqiao.command.VelocitySubCommand;
+import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
+import com.mojang.brigadier.Command;
+import com.mojang.brigadier.context.CommandContext;
+import com.velocitypowered.api.command.CommandSource;
+
+import static com.github.theword.queqiao.tool.utils.Tool.websocketManager;
+
+public class ReconnectCommand extends ReconnectCommandAbstract implements VelocitySubCommand {
+ @Override
+ public int onCommand(CommandContext context) {
+ websocketManager.reconnectWebsocketClients(false, context);
+ return Command.SINGLE_SUCCESS;
+ }
+}
From d1aecb25ec06539e8cf2044681bd889c07d53eb2 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:03:35 +0800
Subject: [PATCH 15/55] (feat: Implement message sending in
HandleCommandReturnMessageService)
---
.../queqiao/handle/HandleCommandReturnMessageService.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java
index 0f78ea9..5d222f5 100644
--- a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java
@@ -1,10 +1,15 @@
package com.github.theword.queqiao.handle;
import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessage;
+import com.mojang.brigadier.context.CommandContext;
+import com.velocitypowered.api.command.CommandSource;
+import net.kyori.adventure.text.Component;
public class HandleCommandReturnMessageService implements HandleCommandReturnMessage {
@Override
+ @SuppressWarnings("unchecked")
public void handleCommandReturnMessage(Object o, String s) {
- // TODO implement me
+ CommandContext context = (CommandContext) o;
+ context.getSource().sendMessage(Component.text(s));
}
}
From eaf808f07e4233b8e7d5b415da119662b479f9da Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:03:48 +0800
Subject: [PATCH 16/55] (feat: Update velocity dependencies and refactor build
configuration)
---
velocity/velocity-3.3.0/build.gradle | 22 ++++++++++++++++++++--
velocity/velocity-3.3.0/gradle.properties | 2 +-
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/velocity/velocity-3.3.0/build.gradle b/velocity/velocity-3.3.0/build.gradle
index 926b97a..c187de8 100644
--- a/velocity/velocity-3.3.0/build.gradle
+++ b/velocity/velocity-3.3.0/build.gradle
@@ -2,6 +2,7 @@ plugins {
id 'java'
id 'eclipse'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.8'
+ id 'com.github.johnrengelman.shadow' version '8.1.1'
}
def getVersionFromFile() {
@@ -49,8 +50,8 @@ repositories {
}
dependencies {
- compileOnly "com.velocitypowered:velocity-api:${project.velocity_api_version}"
- annotationProcessor "com.velocitypowered:velocity-api:${project.velocity_api_version}"
+ compileOnly "com.velocitypowered:velocity-api:${project.api_version}-SNAPSHOT"
+ annotationProcessor "com.velocitypowered:velocity-api:${project.api_version}-SNAPSHOT"
annotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
compileOnly "org.projectlombok:lombok:${project.lombok_version}"
@@ -85,3 +86,20 @@ sourceSets.main.java.srcDir(generateTemplates.map { it.outputs })
project.idea.project.settings.taskTriggers.afterSync generateTemplates
project.eclipse.synchronizationTasks(generateTemplates)
+
+shadowJar {
+ archiveBaseName.set("${mod_name}-velocity+${api_version}")
+ archiveClassifier.set("")
+ destinationDirectory.set(file("../../QueQiao-jar/${version}"))
+ dependencies {
+ include(dependency("com.github.theword.queqiao:queqiao-tool:${tool_version}"))
+ include(dependency("org.java-websocket:Java-WebSocket:${java_websocket_version}"))
+ include(dependency("org.yaml:snakeyaml:${snakeyaml_version}"))
+ }
+
+ mergeServiceFiles()
+}
+
+tasks.build {
+ dependsOn shadowJar
+}
diff --git a/velocity/velocity-3.3.0/gradle.properties b/velocity/velocity-3.3.0/gradle.properties
index b74254d..bf9dc6d 100644
--- a/velocity/velocity-3.3.0/gradle.properties
+++ b/velocity/velocity-3.3.0/gradle.properties
@@ -18,4 +18,4 @@ maven_repository_url=https://maven.pkg.github.com/17TheWord/QueQiaoTool
# JDK Version
java_version=17
# Api Version
-velocity_api_version=3.3.0-SNAPSHOT
+api_version=3.3.0
From 3ed2d058c780ed904cfb6da8550f218d448aa6db Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:09:30 +0800
Subject: [PATCH 17/55] (feat: Update velocity dependencies and refactor build
configuration)
---
.gitignore | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index 8c2966a..d9bda3e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,12 +22,12 @@ QueQiao-jar/
forge/forge-*/
fabric/fabric-*/
spigot/spigot-*/
-#velocity/velocity-*/
+velocity/velocity-*/
!fabric/fabric-*/gradle/
!forge/forge-*/gradle/
!spigot/spigot-*/gradle/
-#!velocity/velocity-*/gradle/
+!velocity/velocity-*/gradle/
!fabric/fabric-*/gradlew
!fabric/fabric-*/gradlew.bat
@@ -35,8 +35,10 @@ spigot/spigot-*/
!forge/forge-*/gradlew.bat
!spigot/spigot-*/gradlew
!spigot/spigot-*/gradlew.bat
-#!velocity/velocity-*/gradlew
-#!velocity/velocity-*/gradlew.bat
+!velocity/velocity-*/gradlew
+!velocity/velocity-*/gradlew.bat
+
+!velocity/velocity-*/build/generated/sources/tamplates/
!tool/
From 474d0ccb70d65b6c4eae5d07300edd73089127a3 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:10:45 +0800
Subject: [PATCH 18/55] (feat: Remove unused import statement in QueQiao.java)
---
.../src/main/java/com/github/theword/queqiao/QueQiao.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/QueQiao.java b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/QueQiao.java
index 2394f0d..297c963 100644
--- a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/QueQiao.java
+++ b/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/QueQiao.java
@@ -9,7 +9,6 @@
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.proxy.ProxyServer;
-import org.slf4j.Logger;
import static com.github.theword.queqiao.tool.utils.Tool.initTool;
import static com.github.theword.queqiao.tool.utils.Tool.websocketManager;
From 0fffeb8a7bca425220e80ca07435963fab805f41 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:16:15 +0800
Subject: [PATCH 19/55] :sparkles: Support velocity, but no test
---
velocity/{velocity-3.3.0 => origin}/build.gradle | 0
.../templates/com/github/theword/queqiao/BuildConstants.java | 2 +-
velocity/{velocity-3.3.0 => origin}/gradle.properties | 0
.../main/java/com/github/theword/queqiao/EventProcessor.java | 0
.../src/main/java/com/github/theword/queqiao/QueQiao.java | 0
.../com/github/theword/queqiao/command/CommandExecutor.java | 0
.../java/com/github/theword/queqiao/command/CommandManager.java | 0
.../com/github/theword/queqiao/command/VelocitySubCommand.java | 0
.../github/theword/queqiao/command/subCommand/HelpCommand.java | 0
.../theword/queqiao/command/subCommand/ReloadCommand.java | 0
.../queqiao/command/subCommand/client/ReconnectAllCommand.java | 0
.../queqiao/command/subCommand/client/ReconnectCommand.java | 0
.../queqiao/event/velocity/VelocityCommandExecuteEvent.java | 0
.../theword/queqiao/event/velocity/VelocityDisconnectEvent.java | 0
.../theword/queqiao/event/velocity/VelocityLoginEvent.java | 0
.../github/theword/queqiao/event/velocity/VelocityPlayer.java | 0
.../theword/queqiao/event/velocity/VelocityPlayerChatEvent.java | 0
.../com/github/theword/queqiao/handle/HandleApiService.java | 0
.../queqiao/handle/HandleCommandReturnMessageService.java | 0
.../java/com/github/theword/queqiao/utils/ParseJsonToEvent.java | 0
.../java/com/github/theword/queqiao/utils/VelocityTool.java | 0
.../templates/com/github/theword/queqiao/BuildConstants.java | 0
22 files changed, 1 insertion(+), 1 deletion(-)
rename velocity/{velocity-3.3.0 => origin}/build.gradle (100%)
rename velocity/{velocity-3.3.0 => origin}/build/generated/sources/templates/com/github/theword/queqiao/BuildConstants.java (98%)
rename velocity/{velocity-3.3.0 => origin}/gradle.properties (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/EventProcessor.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/QueQiao.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/command/CommandManager.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/command/VelocitySubCommand.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/event/velocity/VelocityCommandExecuteEvent.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/event/velocity/VelocityDisconnectEvent.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/event/velocity/VelocityLoginEvent.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayer.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayerChatEvent.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/java/com/github/theword/queqiao/utils/VelocityTool.java (100%)
rename velocity/{velocity-3.3.0 => origin}/src/main/templates/com/github/theword/queqiao/BuildConstants.java (100%)
diff --git a/velocity/velocity-3.3.0/build.gradle b/velocity/origin/build.gradle
similarity index 100%
rename from velocity/velocity-3.3.0/build.gradle
rename to velocity/origin/build.gradle
diff --git a/velocity/velocity-3.3.0/build/generated/sources/templates/com/github/theword/queqiao/BuildConstants.java b/velocity/origin/build/generated/sources/templates/com/github/theword/queqiao/BuildConstants.java
similarity index 98%
rename from velocity/velocity-3.3.0/build/generated/sources/templates/com/github/theword/queqiao/BuildConstants.java
rename to velocity/origin/build/generated/sources/templates/com/github/theword/queqiao/BuildConstants.java
index 7b3d6fe..b9a6e0c 100644
--- a/velocity/velocity-3.3.0/build/generated/sources/templates/com/github/theword/queqiao/BuildConstants.java
+++ b/velocity/origin/build/generated/sources/templates/com/github/theword/queqiao/BuildConstants.java
@@ -4,4 +4,4 @@
public class BuildConstants {
public static final String VERSION = "0.0.1";
-}
+}
\ No newline at end of file
diff --git a/velocity/velocity-3.3.0/gradle.properties b/velocity/origin/gradle.properties
similarity index 100%
rename from velocity/velocity-3.3.0/gradle.properties
rename to velocity/origin/gradle.properties
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/EventProcessor.java b/velocity/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/EventProcessor.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/QueQiao.java b/velocity/origin/src/main/java/com/github/theword/queqiao/QueQiao.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/QueQiao.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/QueQiao.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java b/velocity/origin/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandManager.java b/velocity/origin/src/main/java/com/github/theword/queqiao/command/CommandManager.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/CommandManager.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/command/CommandManager.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/VelocitySubCommand.java b/velocity/origin/src/main/java/com/github/theword/queqiao/command/VelocitySubCommand.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/VelocitySubCommand.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/command/VelocitySubCommand.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java b/velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java b/velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java b/velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java b/velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityCommandExecuteEvent.java b/velocity/origin/src/main/java/com/github/theword/queqiao/event/velocity/VelocityCommandExecuteEvent.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityCommandExecuteEvent.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/event/velocity/VelocityCommandExecuteEvent.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityDisconnectEvent.java b/velocity/origin/src/main/java/com/github/theword/queqiao/event/velocity/VelocityDisconnectEvent.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityDisconnectEvent.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/event/velocity/VelocityDisconnectEvent.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityLoginEvent.java b/velocity/origin/src/main/java/com/github/theword/queqiao/event/velocity/VelocityLoginEvent.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityLoginEvent.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/event/velocity/VelocityLoginEvent.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayer.java b/velocity/origin/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayer.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayer.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayer.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayerChatEvent.java b/velocity/origin/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayerChatEvent.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayerChatEvent.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/event/velocity/VelocityPlayerChatEvent.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java b/velocity/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java b/velocity/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageService.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
diff --git a/velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/VelocityTool.java b/velocity/origin/src/main/java/com/github/theword/queqiao/utils/VelocityTool.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/java/com/github/theword/queqiao/utils/VelocityTool.java
rename to velocity/origin/src/main/java/com/github/theword/queqiao/utils/VelocityTool.java
diff --git a/velocity/velocity-3.3.0/src/main/templates/com/github/theword/queqiao/BuildConstants.java b/velocity/origin/src/main/templates/com/github/theword/queqiao/BuildConstants.java
similarity index 100%
rename from velocity/velocity-3.3.0/src/main/templates/com/github/theword/queqiao/BuildConstants.java
rename to velocity/origin/src/main/templates/com/github/theword/queqiao/BuildConstants.java
From 61beccd46dfb05e4d98ae37bb8eadf5e89405644 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:16:34 +0800
Subject: [PATCH 20/55] :sparkles: Support velocity, but no test
---
.idea/ModMultiLoaders.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.idea/ModMultiLoaders.xml b/.idea/ModMultiLoaders.xml
index b6f561f..2a419f1 100644
--- a/.idea/ModMultiLoaders.xml
+++ b/.idea/ModMultiLoaders.xml
@@ -8,6 +8,7 @@
+
From 05ec3195b73915105da738bd3150de47fd35bec6 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:22:27 +0800
Subject: [PATCH 21/55] :construction_worker: Move part of release to
release.yml
---
.github/workflows/build.yml | 40 ---------------------------
.github/workflows/release.yml | 51 +++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 40 deletions(-)
create mode 100644 .github/workflows/release.yml
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c134d08..54f3431 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -13,46 +13,6 @@ env:
GH_TOKEN: ${{ github.token }}
jobs:
- create-release:
- if: ${{ github.event_name == 'push' }}
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Read version.txt and save to variable
- shell: pwsh
- run: |
- $mod_version = Get-Content version.txt
- Write-Host "Version: $mod_version"
- echo "MOD_VERSION=$mod_version" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_ENV
-
- - name: Check if Release exists
- id: check-release
- run: |
- # Check if the release exists
- RESPONSE=$(gh release view v${{ env.MOD_VERSION }} -R ${{ github.repository }} 2>&1 || true)
- if echo "$RESPONSE" | grep -q "Not Found"; then
- echo "Release v${{ env.MOD_VERSION }} does not exist. Skipping deletion."
- echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
- else
- echo "Release v${{ env.MOD_VERSION }} exists."
- echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
- fi
-
- - name: Delete Release if exists
- if: env.RELEASE_EXISTS == 'true'
- run: |
- # Try to delete the release and handle errors gracefully
- set +e
- gh release delete v${{ env.MOD_VERSION }} -R ${{ github.repository }} -y --cleanup-tag
- if [ $? -eq 0 ]; then
- echo "Release v${{ env.MOD_VERSION }} deleted successfully."
- else
- echo "Failed to delete release v${{ env.MOD_VERSION }}. It might not exist or there might be another issue."
- fi
-
- - name: Create Release with temp note
- run: gh release create v${{ env.MOD_VERSION }} --generate-notes
-
generate-matrix:
runs-on: windows-latest
outputs:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..a7a7195
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,51 @@
+name: Create Release
+
+on:
+ push:
+ branches:
+ - main
+
+permissions:
+ contents: write
+
+env:
+ GH_TOKEN: ${{ github.token }}
+
+jobs:
+ create-release:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Read version.txt and save to variable
+ shell: pwsh
+ run: |
+ $mod_version = Get-Content version.txt
+ Write-Host "Version: $mod_version"
+ echo "MOD_VERSION=$mod_version" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_ENV
+
+ - name: Check if Release exists
+ id: check-release
+ run: |
+ # Check if the release exists
+ RESPONSE=$(gh release view v${{ env.MOD_VERSION }} -R ${{ github.repository }} 2>&1 || true)
+ if echo "$RESPONSE" | grep -q "Not Found"; then
+ echo "Release v${{ env.MOD_VERSION }} does not exist. Skipping deletion."
+ echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
+ else
+ echo "Release v${{ env.MOD_VERSION }} exists."
+ echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
+ fi
+
+ - name: Delete Release if exists
+ run: |
+ # Try to delete the release and handle errors gracefully
+ set +e
+ gh release delete v${{ env.MOD_VERSION }} -R ${{ github.repository }} -y --cleanup-tag
+ if [ $? -eq 0 ]; then
+ echo "Release v${{ env.MOD_VERSION }} deleted successfully."
+ else
+ echo "Failed to delete release v${{ env.MOD_VERSION }}. It might not exist or there might be another issue."
+ fi
+
+ - name: Create Release with temp note
+ run: gh release create v${{ env.MOD_VERSION }} --generate-notes
\ No newline at end of file
From 6ca4aefcb3d6d5a1eab85567bad3bf2b9eb613ff Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:22:44 +0800
Subject: [PATCH 22/55] :sparkles: Add velocity jobs
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 54f3431..5204637 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -23,7 +23,7 @@ jobs:
id: set-matrix
shell: pwsh
run: |
- .\matrix.ps1 -path "fabric","forge","spigot"
+ .\matrix.ps1 -path "fabric","forge","spigot","velocity"
build:
runs-on: windows-latest
From 9be235fe098bea8e815af3e2a3633dc9f8c3a5fa Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:32:10 +0800
Subject: [PATCH 23/55] (feat: Update Java version configuration in
build.gradle)
---
velocity/origin/build.gradle | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/velocity/origin/build.gradle b/velocity/origin/build.gradle
index c187de8..eedd53b 100644
--- a/velocity/origin/build.gradle
+++ b/velocity/origin/build.gradle
@@ -63,7 +63,11 @@ dependencies {
def targetJavaVersion = Integer.parseInt(project.java_version)
java {
- toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
+ def javaVersion = JavaVersion.toVersion(targetJavaVersion)
+ sourceCompatibility = javaVersion
+ targetCompatibility = javaVersion
+ if (JavaVersion.current() < javaVersion)
+ toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
tasks.withType(JavaCompile).configureEach {
@@ -102,4 +106,4 @@ shadowJar {
tasks.build {
dependsOn shadowJar
-}
+}
\ No newline at end of file
From b888ae557a935ac8d24c6662efd9c3fad54d661c Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:32:47 +0800
Subject: [PATCH 24/55] (feat: Update velocity project configuration and
dependencies)
---
.idea/compiler.xml | 6 +++---
.idea/gradle.xml | 8 ++++++++
.idea/jarRepositories.xml | 5 +++++
.idea/modules.xml | 2 +-
4 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 8031c66..445ff4b 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -44,7 +44,7 @@
-
+
@@ -65,8 +65,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index af924a8..4bd2044 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -103,6 +103,14 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index f4abeec..5a9e971 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -126,5 +126,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index c045867..f81a2f0 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -70,7 +70,7 @@
-
+
\ No newline at end of file
From 884732e37a6f1333bfba2611149d0a8bbc988299 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Wed, 14 Aug 2024 14:42:02 +0800
Subject: [PATCH 25/55] =?UTF-8?q?"=E4=B8=BAIntelliJ=20IDEA=E7=9A=84Minecra?=
=?UTF-8?q?ft=E6=8F=92=E4=BB=B6=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=94=AF=E6=8C=81=E7=9A=84=E5=B9=B3=E5=8F=B0?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
本次提交为IntelliJ IDEA的Minecraft插件项目配置添加了不同的平台类型支持。这包括Spigot、Fabric、Forge、MCP、Mixin和Velocity等平台。此举旨在通过明确指定项目所使用的平台类型,从而提高项目的兼容性和IntelliJ IDEA的自动检测能力。
---
.idea/modules/IDEA.QueQiao.fabric-1.16.5.test.iml | 15 +++++++++++++++
.idea/modules/IDEA.QueQiao.fabric-1.18.2.test.iml | 15 +++++++++++++++
.idea/modules/IDEA.QueQiao.fabric-1.19.2.test.iml | 15 +++++++++++++++
.idea/modules/IDEA.QueQiao.fabric-1.20.1.test.iml | 15 +++++++++++++++
.idea/modules/IDEA.QueQiao.fabric-1.21.test.iml | 15 +++++++++++++++
.idea/modules/QueQiao.fabric-1.18.2.main.iml | 15 +++++++++++++++
.idea/modules/QueQiao.fabric-1.19.2.main.iml | 15 +++++++++++++++
.idea/modules/QueQiao.fabric-1.21.main.iml | 15 +++++++++++++++
.idea/modules/QueQiao.forge-1.16.5.main.iml | 15 +++++++++++++++
.idea/modules/QueQiao.forge-1.16.5.test.iml | 15 +++++++++++++++
.idea/modules/QueQiao.forge-1.18.2.main.iml | 15 +++++++++++++++
.idea/modules/QueQiao.forge-1.18.2.test.iml | 15 +++++++++++++++
.idea/modules/QueQiao.forge-1.19.2.main.iml | 15 +++++++++++++++
.idea/modules/QueQiao.forge-1.19.2.test.iml | 15 +++++++++++++++
.idea/modules/QueQiao.forge-1.20.1.main.iml | 15 +++++++++++++++
.idea/modules/QueQiao.forge-1.20.1.test.iml | 15 +++++++++++++++
.idea/modules/QueQiao.forge-1.21.main.iml | 15 +++++++++++++++
.idea/modules/QueQiao.forge-1.21.test.iml | 15 +++++++++++++++
....github.theword.queqiao.spigot-1.12.2.main.iml | 13 +++++++++++++
...om.github.theword.queqiao.spigot-1.13.main.iml | 13 +++++++++++++
.idea/modules/velocity-3.3.0.main.iml | 14 ++++++++++++++
21 files changed, 310 insertions(+)
create mode 100644 .idea/modules/IDEA.QueQiao.fabric-1.16.5.test.iml
create mode 100644 .idea/modules/IDEA.QueQiao.fabric-1.18.2.test.iml
create mode 100644 .idea/modules/IDEA.QueQiao.fabric-1.19.2.test.iml
create mode 100644 .idea/modules/IDEA.QueQiao.fabric-1.20.1.test.iml
create mode 100644 .idea/modules/IDEA.QueQiao.fabric-1.21.test.iml
create mode 100644 .idea/modules/QueQiao.fabric-1.18.2.main.iml
create mode 100644 .idea/modules/QueQiao.fabric-1.19.2.main.iml
create mode 100644 .idea/modules/QueQiao.fabric-1.21.main.iml
create mode 100644 .idea/modules/QueQiao.forge-1.16.5.main.iml
create mode 100644 .idea/modules/QueQiao.forge-1.16.5.test.iml
create mode 100644 .idea/modules/QueQiao.forge-1.18.2.main.iml
create mode 100644 .idea/modules/QueQiao.forge-1.18.2.test.iml
create mode 100644 .idea/modules/QueQiao.forge-1.19.2.main.iml
create mode 100644 .idea/modules/QueQiao.forge-1.19.2.test.iml
create mode 100644 .idea/modules/QueQiao.forge-1.20.1.main.iml
create mode 100644 .idea/modules/QueQiao.forge-1.20.1.test.iml
create mode 100644 .idea/modules/QueQiao.forge-1.21.main.iml
create mode 100644 .idea/modules/QueQiao.forge-1.21.test.iml
create mode 100644 .idea/modules/com.github.theword.queqiao.spigot-1.12.2.main.iml
create mode 100644 .idea/modules/com.github.theword.queqiao.spigot-1.13.main.iml
create mode 100644 .idea/modules/velocity-3.3.0.main.iml
diff --git a/.idea/modules/IDEA.QueQiao.fabric-1.16.5.test.iml b/.idea/modules/IDEA.QueQiao.fabric-1.16.5.test.iml
new file mode 100644
index 0000000..40e75b3
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.fabric-1.16.5.test.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MIXIN
+ MCP
+ FABRIC
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.fabric-1.18.2.test.iml b/.idea/modules/IDEA.QueQiao.fabric-1.18.2.test.iml
new file mode 100644
index 0000000..40e75b3
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.fabric-1.18.2.test.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MIXIN
+ MCP
+ FABRIC
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.fabric-1.19.2.test.iml b/.idea/modules/IDEA.QueQiao.fabric-1.19.2.test.iml
new file mode 100644
index 0000000..40e75b3
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.fabric-1.19.2.test.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MIXIN
+ MCP
+ FABRIC
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.fabric-1.20.1.test.iml b/.idea/modules/IDEA.QueQiao.fabric-1.20.1.test.iml
new file mode 100644
index 0000000..40e75b3
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.fabric-1.20.1.test.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MIXIN
+ MCP
+ FABRIC
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.fabric-1.21.test.iml b/.idea/modules/IDEA.QueQiao.fabric-1.21.test.iml
new file mode 100644
index 0000000..40e75b3
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.fabric-1.21.test.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MIXIN
+ MCP
+ FABRIC
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.18.2.main.iml b/.idea/modules/QueQiao.fabric-1.18.2.main.iml
new file mode 100644
index 0000000..40e75b3
--- /dev/null
+++ b/.idea/modules/QueQiao.fabric-1.18.2.main.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MIXIN
+ MCP
+ FABRIC
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.19.2.main.iml b/.idea/modules/QueQiao.fabric-1.19.2.main.iml
new file mode 100644
index 0000000..40e75b3
--- /dev/null
+++ b/.idea/modules/QueQiao.fabric-1.19.2.main.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MIXIN
+ MCP
+ FABRIC
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.21.main.iml b/.idea/modules/QueQiao.fabric-1.21.main.iml
new file mode 100644
index 0000000..40e75b3
--- /dev/null
+++ b/.idea/modules/QueQiao.fabric-1.21.main.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MIXIN
+ MCP
+ FABRIC
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.16.5.main.iml b/.idea/modules/QueQiao.forge-1.16.5.main.iml
new file mode 100644
index 0000000..6c4a51c
--- /dev/null
+++ b/.idea/modules/QueQiao.forge-1.16.5.main.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ FORGE
+ MCP
+ MIXIN
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.16.5.test.iml b/.idea/modules/QueQiao.forge-1.16.5.test.iml
new file mode 100644
index 0000000..6c4a51c
--- /dev/null
+++ b/.idea/modules/QueQiao.forge-1.16.5.test.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ FORGE
+ MCP
+ MIXIN
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.18.2.main.iml b/.idea/modules/QueQiao.forge-1.18.2.main.iml
new file mode 100644
index 0000000..18447fe
--- /dev/null
+++ b/.idea/modules/QueQiao.forge-1.18.2.main.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.18.2.test.iml b/.idea/modules/QueQiao.forge-1.18.2.test.iml
new file mode 100644
index 0000000..18447fe
--- /dev/null
+++ b/.idea/modules/QueQiao.forge-1.18.2.test.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.19.2.main.iml b/.idea/modules/QueQiao.forge-1.19.2.main.iml
new file mode 100644
index 0000000..18447fe
--- /dev/null
+++ b/.idea/modules/QueQiao.forge-1.19.2.main.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.19.2.test.iml b/.idea/modules/QueQiao.forge-1.19.2.test.iml
new file mode 100644
index 0000000..18447fe
--- /dev/null
+++ b/.idea/modules/QueQiao.forge-1.19.2.test.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.20.1.main.iml b/.idea/modules/QueQiao.forge-1.20.1.main.iml
new file mode 100644
index 0000000..18447fe
--- /dev/null
+++ b/.idea/modules/QueQiao.forge-1.20.1.main.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.20.1.test.iml b/.idea/modules/QueQiao.forge-1.20.1.test.iml
new file mode 100644
index 0000000..18447fe
--- /dev/null
+++ b/.idea/modules/QueQiao.forge-1.20.1.test.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.21.main.iml b/.idea/modules/QueQiao.forge-1.21.main.iml
new file mode 100644
index 0000000..18447fe
--- /dev/null
+++ b/.idea/modules/QueQiao.forge-1.21.main.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.21.test.iml b/.idea/modules/QueQiao.forge-1.21.test.iml
new file mode 100644
index 0000000..18447fe
--- /dev/null
+++ b/.idea/modules/QueQiao.forge-1.21.test.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.spigot-1.12.2.main.iml b/.idea/modules/com.github.theword.queqiao.spigot-1.12.2.main.iml
new file mode 100644
index 0000000..a589521
--- /dev/null
+++ b/.idea/modules/com.github.theword.queqiao.spigot-1.12.2.main.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ SPIGOT
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.spigot-1.13.main.iml b/.idea/modules/com.github.theword.queqiao.spigot-1.13.main.iml
new file mode 100644
index 0000000..a589521
--- /dev/null
+++ b/.idea/modules/com.github.theword.queqiao.spigot-1.13.main.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ SPIGOT
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/velocity-3.3.0.main.iml b/.idea/modules/velocity-3.3.0.main.iml
new file mode 100644
index 0000000..a587e97
--- /dev/null
+++ b/.idea/modules/velocity-3.3.0.main.iml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ VELOCITY
+ ADVENTURE
+
+ 1
+
+
+
+
\ No newline at end of file
From 94300d67c2dcc22c635e6fc5211ea2d9a40b49e0 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Thu, 15 Aug 2024 22:47:11 +0800
Subject: [PATCH 26/55] feat: Add support for different server types and update
open source license info
---
README.md | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 77ebb57..bd6fd84 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,22 @@
- 可以通过 [`nonebot-adapter-minecraft`](https://github.com/17TheWord/nonebot-adapter-minecraft)
连接至 [`nonebot2`](https://github.com/nonebot/nonebot2) 的 `Minecraft` 服务端 `plugin/mod`。
+## 支持的服务端列表
+
+- [`Spigot`](https://www.spigotmc.org/)
+- [`Fabric`](https://fabricmc.net/)
+- [`Forge`](https://files.minecraftforge.net/)
+- [`Velocity`](https://papermc.io/software/velocity)(Demo)
+
+## 对接
+
+- [`@17TheWord/nonebot-plugin-mcqq`](https://github.com/17TheWord/nonebot-plugin-mcqq):NoneBot2插件,与Minecraft互通聊天
+- [`@CikeyQi/mc-plugin`](https://github.com/CikeyQi/mc-plugin):云崽插件,与Minecraft互通聊天
+
+## 兼容
+
+- [`@kitUIN/ChatImage`](https://github.com/kitUIN/ChatImage):在Minecraft聊天栏中显示图片
+
## 使用帮助
- 前往 [`Wiki`](https://github.com/17TheWord/QueQiao/wiki)
@@ -55,4 +71,4 @@
## 开源许可
-本项目使用 [MIT](./LICENSE) 作为开源许可证。
+本项目使用 [MIT](https://github.com/17TheWord/QueQiao/blob/main/LICENSE) 作为开源许可证。
From 66a41c4edc7e26af81e176dc08c587ece0d6a848 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Thu, 15 Aug 2024 22:48:52 +0800
Subject: [PATCH 27/55] feat: Add support for different server types and update
open source license info
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index bd6fd84..bf258c5 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,7 @@
## 对接
+- [`@17TheWord/nonebot-adapter-minecraft`](https://github.com/17TheWord/nonebot-adapter-minecraft):NoneBot2适配器,与本模组连接
- [`@17TheWord/nonebot-plugin-mcqq`](https://github.com/17TheWord/nonebot-plugin-mcqq):NoneBot2插件,与Minecraft互通聊天
- [`@CikeyQi/mc-plugin`](https://github.com/CikeyQi/mc-plugin):云崽插件,与Minecraft互通聊天
From e07992d9b97e4f3db7fd8f7eb4cdea149af1d95e Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Thu, 15 Aug 2024 23:20:01 +0800
Subject: [PATCH 28/55] (feat: Update velocity project configuration and
dependencies)
---
velocity/origin/build.gradle | 2 ++
velocity/origin/gradle.properties | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/velocity/origin/build.gradle b/velocity/origin/build.gradle
index eedd53b..72e90aa 100644
--- a/velocity/origin/build.gradle
+++ b/velocity/origin/build.gradle
@@ -57,6 +57,7 @@ dependencies {
compileOnly "org.projectlombok:lombok:${project.lombok_version}"
implementation "com.github.theword.queqiao:queqiao-tool:${tool_version}"
+ implementation "commons-io:commons-io:${project.commons_io_version}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${project.junit_jupiter_version}"
}
@@ -97,6 +98,7 @@ shadowJar {
destinationDirectory.set(file("../../QueQiao-jar/${version}"))
dependencies {
include(dependency("com.github.theword.queqiao:queqiao-tool:${tool_version}"))
+ include(dependency("commons-io:commons-io:${commons_io_version}"))
include(dependency("org.java-websocket:Java-WebSocket:${java_websocket_version}"))
include(dependency("org.yaml:snakeyaml:${snakeyaml_version}"))
}
diff --git a/velocity/origin/gradle.properties b/velocity/origin/gradle.properties
index bf9dc6d..a6f2e8c 100644
--- a/velocity/origin/gradle.properties
+++ b/velocity/origin/gradle.properties
@@ -11,6 +11,7 @@ mod_description=Connect to nonebot2.
lombok_version=1.18.30
slf4j_version=1.7.36
snakeyaml_version=2.2
+commons_io_version=2.15.1
junit_jupiter_version=5.10.0
java_websocket_version=1.5.3
jetbrains_annotations_version=24.0.0
@@ -18,4 +19,4 @@ maven_repository_url=https://maven.pkg.github.com/17TheWord/QueQiaoTool
# JDK Version
java_version=17
# Api Version
-api_version=3.3.0
+api_version=3.3.0
\ No newline at end of file
From 3ed067eb141e3f6534e57d4a611561623cd16a4c Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Fri, 16 Aug 2024 12:11:01 +0800
Subject: [PATCH 29/55] feat: Update Minecraft plugin project configuration and
dependencies
---
README.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/README.md b/README.md
index bf258c5..c1a2d94 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,7 @@
## 介绍
-- 可以通过 [`nonebot-adapter-minecraft`](https://github.com/17TheWord/nonebot-adapter-minecraft)
- 连接至 [`nonebot2`](https://github.com/nonebot/nonebot2) 的 `Minecraft` 服务端 `plugin/mod`。
+- 将 `Minecraft` 服务端玩家事件以 `Json` 格式通过 `Websocket` 分发的服务端 `plugin/mod`。
## 支持的服务端列表
From fbaef764d301553c8bce2bdd4be1bbc16e3845f1 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Fri, 16 Aug 2024 14:25:52 +0800
Subject: [PATCH 30/55] :money_with_wings: Add afdian
---
.github/FUNDING.yml | 1 +
1 file changed, 1 insertion(+)
create mode 100644 .github/FUNDING.yml
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000..52b7e8c
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+custom: ["https://afdian.com/a/17TheWord"]
From 0404a370ba810b8a990f1b705a7970d1e709128a Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Fri, 16 Aug 2024 14:58:37 +0800
Subject: [PATCH 31/55] =?UTF-8?q?fix(spigot):=20=E7=A1=AE=E4=BF=9D?=
=?UTF-8?q?=E5=9C=A8hover=E5=92=8C=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6?=
=?UTF-8?q?=E4=B8=AD=E6=AD=A3=E7=A1=AE=E4=BD=BF=E7=94=A8=E6=9E=9A=E4=B8=BE?=
=?UTF-8?q?=E5=8A=A8=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
由于minecraft命令中的动作值可能不是全部大写,因此在获取HoverEvent和ClickEvent动作时强制转换为大写。这保证了即使在spigot版本1.12.2中与CommonTextComponent一起使用时,也能正确解析hover和点击事件的动作值。
---
.../theword/queqiao/utils/ParseJsonToEvent.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 2cc1848..f56810f 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -70,25 +70,25 @@ public TextComponent parsePerMessageToTextComponent(CommonBaseComponent myBaseCo
* @return HoverEvent
*/
private HoverEvent getHoverEvent(CommonTextComponent myTextComponent) {
- HoverEvent.Action action = HoverEvent.Action.valueOf(myTextComponent.getHoverEvent().getAction());
+ HoverEvent.Action action = HoverEvent.Action.valueOf(myTextComponent.getHoverEvent().getAction().toUpperCase());
// IF spigot-1.12.2
// TextComponent textComponent = parseMessageToTextComponent(myTextComponent.getHoverEvent().getBaseComponentList());
// return new HoverEvent(action, new TextComponent[]{textComponent});
// ELSE
// HoverEvent hoverEvent = null;
-// switch (myTextComponent.getHoverEvent().getAction()) {
-// case "show_text":
+// switch (action) {
+// case SHOW_TEXT:
// TextComponent textComponent = parseMessageToTextComponent(myTextComponent.getHoverEvent().getBaseComponentList());
// BaseComponent[] baseComponent = new BaseComponent[]{textComponent};
// hoverEvent = new HoverEvent(action, new Text(baseComponent));
// break;
-// case "show_item":
+// case SHOW_ITEM:
// CommonHoverItem myHoverItem = myTextComponent.getHoverEvent().getItem();
// ItemTag itemTag = ItemTag.ofNbt(myHoverItem.getTag());
// Item item = new Item(String.valueOf(myHoverItem.getId()), myHoverItem.getCount(), itemTag);
// hoverEvent = new HoverEvent(action, item);
// break;
-// case "show_entity":
+// case SHOW_ENTITY:
// CommonHoverEntity myHoverEntity = myTextComponent.getHoverEvent().getEntity();
// TextComponent nameComponent = parseMessageToTextComponent(myHoverEntity.getName());
// Entity entity = new Entity(myHoverEntity.getType(), myHoverEntity.getId(), nameComponent);
@@ -108,7 +108,7 @@ private HoverEvent getHoverEvent(CommonTextComponent myTextComponent) {
* @return ClickEvent
*/
private ClickEvent getClickEvent(CommonTextComponent myTextComponent) {
- ClickEvent.Action action = ClickEvent.Action.valueOf(myTextComponent.getClickEvent().getAction());
+ ClickEvent.Action action = ClickEvent.Action.valueOf(myTextComponent.getClickEvent().getAction().toUpperCase());
return new ClickEvent(action, myTextComponent.getClickEvent().getValue());
}
From e320d16ef89fc4a9a6a6fba649a2f8c79e82aa1d Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Fri, 16 Aug 2024 17:28:08 +0800
Subject: [PATCH 32/55] =?UTF-8?q?fix(ParseJsonToEvent):=E7=A1=AE=E4=BF=9Dh?=
=?UTF-8?q?over=E4=BA=8B=E4=BB=B6=E6=AD=A3=E7=A1=AE=E5=A4=84=E7=90=86null?=
=?UTF-8?q?=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修复了ParseJsonToEvent类中处理hover事件时忽略null值的问题。现在在添加hover事件到样式时检查null值,防止应用程序崩溃。
另外,重构了事件处理代码,使其更加清晰,并与Mojang的最新API对齐。这包括对点击和hover事件的条件检查,以及对文本样式的处理。
更改基于Mojang在1.19版本中的API更新。
---
.../queqiao/utils/ParseJsonToEvent.java | 91 +++++++++----------
1 file changed, 44 insertions(+), 47 deletions(-)
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index de59b02..6d7fdb6 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -17,7 +17,6 @@
//import net.minecraft.world.entity.EntityType;
//import net.minecraft.world.item.Item;
//import net.minecraft.world.item.ItemStack;
-//import java.util.Optional;
// ELSE
//import net.minecraft.entity.EntityType;
//import net.minecraft.item.ItemStack;
@@ -38,12 +37,12 @@ public class ParseJsonToEvent {
// IF > forge-1.16.5
// public MutableComponent parseMessages(List extends CommonBaseComponent> myBaseComponentList) {
- // ELSE
+ // ELSE
// public StringTextComponent parseMessages(List extends CommonBaseComponent> myBaseComponentList) {
// END IF
// IF >= forge-1.19
-//MutableComponent mutableComponent = MutableComponent.create(new LiteralContents(""));
+// MutableComponent mutableComponent = MutableComponent.create(new LiteralContents(""));
// ELSE IF >= forge-1.18 && < forge-1.19
// MutableComponent mutableComponent = new TextComponent("");
// ELSE
@@ -61,11 +60,9 @@ public class ParseJsonToEvent {
}
-
-
// IF > forge-1.16.5
// public MutableComponent parsePerMessageToMultiText(CommonBaseComponent myBaseComponent) {
- // ELSE
+ // ELSE
// public StringTextComponent parsePerMessageToMultiText(CommonBaseComponent myBaseComponent) {
// END IF
@@ -81,8 +78,11 @@ public class ParseJsonToEvent {
if (myBaseComponent instanceof CommonTextComponent) {
CommonTextComponent myTextComponent = (CommonTextComponent) myBaseComponent;
- style = style.withClickEvent(getClickEventFromBaseComponent(myTextComponent));
- style = style.withHoverEvent(getHoverEventFromBaseComponent(myTextComponent));
+ if (myTextComponent.getClickEvent() != null)
+ style = style.withClickEvent(getClickEventFromBaseComponent(myTextComponent));
+ if (myTextComponent.getHoverEvent() != null)
+ style = style.withHoverEvent(getHoverEventFromBaseComponent(myTextComponent));
+
}
// IF >= forge-1.19
@@ -108,12 +108,16 @@ private Style getStyleFromBaseComponent(CommonBaseComponent myBaseComponent) {
Style style = Style.EMPTY
.withBold(myBaseComponent.isBold())
.withItalic(myBaseComponent.isItalic())
- .withUnderlined(myBaseComponent.isUnderlined())
.withInsertion(myBaseComponent.getInsertion())
.withFont(font)
// IF > forge-1.16.5
+// .withUnderlined(myBaseComponent.isUnderlined())
// .withStrikethrough(myBaseComponent.isStrikethrough())
// .withObfuscated(myBaseComponent.isObfuscated())
+ // ELSE
+// .setUnderlined(myBaseComponent.isUnderlined())
+// .setStrikethrough(myBaseComponent.isStrikethrough())
+// .setObfuscated(myBaseComponent.isObfuscated())
// END IF
;
// IF >= forge-1.21
@@ -127,7 +131,7 @@ private Style getStyleFromBaseComponent(CommonBaseComponent myBaseComponent) {
// else style = style.withColor(TextColor.parseColor("white"));
// ELSE
// if (myBaseComponent.getColor() != null && !myBaseComponent.getColor().isEmpty())
-// style.withColor(Color.parseColor(myBaseComponent.getColor()));
+// style.withColor(Color.fromLegacyFormat(TextFormatting.valueOf(myBaseComponent.getColor().toUpperCase())));
// else style.withColor(Color.fromLegacyFormat(TextFormatting.WHITE));
// END IF
return style;
@@ -138,7 +142,7 @@ private ClickEvent getClickEventFromBaseComponent(CommonTextComponent myTextComp
// IF >= forge-1.21
// ClickEvent.Action tempAction = ClickEvent.Action.valueOf(myTextComponent.getClickEvent().getAction());
// ELSE
-// ClickEvent.Action tempAction = ClickEvent.Action.getByName(myTextComponent.getClickEvent().getAction());
+// ClickEvent.Action tempAction = ClickEvent.Action.getByName(myTextComponent.getClickEvent().getAction().toLowerCase());
// END IF
return new ClickEvent(tempAction, myTextComponent.getClickEvent().getValue());
}
@@ -146,47 +150,40 @@ private ClickEvent getClickEventFromBaseComponent(CommonTextComponent myTextComp
}
public HoverEvent getHoverEventFromBaseComponent(CommonTextComponent myTextComponent) {
- if (myTextComponent.getHoverEvent() != null) {
- HoverEvent hoverEvent = null;
- switch (myTextComponent.getHoverEvent().getAction()) {
- case "show_text":
- if (myTextComponent.getHoverEvent().getBaseComponentList() != null && !myTextComponent.getHoverEvent().getBaseComponentList().isEmpty()) {
- // IF > forge-1.16.5
-// MutableComponent textComponent = parseMessages(myTextComponent.getHoverEvent().getBaseComponentList());
- // ELSE
+ HoverEvent hoverEvent = null;
+ HoverEvent.Action> action = HoverEvent.Action.getByName(myTextComponent.getHoverEvent().getAction().toLowerCase());
+ assert action != null;
+ if (action.equals(HoverEvent.Action.SHOW_TEXT)) {
+ if (myTextComponent.getHoverEvent().getBaseComponentList() != null && !myTextComponent.getHoverEvent().getBaseComponentList().isEmpty()) {
+ // IF > forge-1.16.5
+// MutableComponent textComponent = parseMessages(myTextComponent.getHoverEvent().getBaseComponentList());
+ // ELSE
// StringTextComponent textComponent = parseMessages(myTextComponent.getHoverEvent().getBaseComponentList());
- // END IF
- hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, textComponent);
- }
- break;
- case "show_item":
- CommonHoverItem myHoverItem = myTextComponent.getHoverEvent().getItem();
- Item item = Item.byId(myHoverItem.getId());
- ItemStack itemStack = new ItemStack(item, myHoverItem.getCount());
- // IF > forge-1.16.5
-// HoverEvent.ItemStackInfo itemHover = new HoverEvent.ItemStackInfo(itemStack);
- // ELSE
+ // END IF
+ hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, textComponent);
+ }
+ } else if (action.equals(HoverEvent.Action.SHOW_ITEM)) {
+ CommonHoverItem myHoverItem = myTextComponent.getHoverEvent().getItem();
+ Item item = Item.byId(myHoverItem.getId());
+ ItemStack itemStack = new ItemStack(item, myHoverItem.getCount());
+ // IF > forge-1.16.5
+// HoverEvent.ItemStackInfo itemHover = new HoverEvent.ItemStackInfo(itemStack);
+ // ELSE
// HoverEvent.ItemHover itemHover = new HoverEvent.ItemHover(itemStack);
// END IF
- hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_ITEM, itemHover);
- break;
- case "show_entity":
- CommonHoverEntity myHoverEntity = myTextComponent.getHoverEvent().getEntity();
- Optional> entityType = EntityType.byString(myHoverEntity.getType());
- if (entityType.isPresent()) {
- // IF > forge-1.16.5
-// HoverEvent.EntityTooltipInfo entityTooltipInfo = new HoverEvent.EntityTooltipInfo(entityType.get(), UUID.randomUUID(), parseMessages(myHoverEntity.getName()));
- // ELSE
+ hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_ITEM, itemHover);
+ } else if (action.equals(HoverEvent.Action.SHOW_ENTITY)) {
+ CommonHoverEntity myHoverEntity = myTextComponent.getHoverEvent().getEntity();
+ Optional> entityType = EntityType.byString(myHoverEntity.getType());
+ if (entityType.isPresent()) {
+ // IF > forge-1.16.5
+// HoverEvent.EntityTooltipInfo entityTooltipInfo = new HoverEvent.EntityTooltipInfo(entityType.get(), UUID.randomUUID(), parseMessages(myHoverEntity.getName()));
+ // ELSE
// HoverEvent.EntityHover entityTooltipInfo = new HoverEvent.EntityHover(entityType.get(), UUID.randomUUID(), parseMessages(myHoverEntity.getName()));
- // END IF
- hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_ENTITY, entityTooltipInfo);
- }
- break;
- default:
- break;
+ // END IF
+ hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_ENTITY, entityTooltipInfo);
}
- return hoverEvent;
}
- return null;
+ return hoverEvent;
}
}
\ No newline at end of file
From eb6af925b7958a8e019e979af61ed3b4df85d3d6 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Fri, 16 Aug 2024 17:29:13 +0800
Subject: [PATCH 33/55] feat: Remove unnecessary import statement in
EventProcessor.java
---
.../main/java/com/github/theword/queqiao/EventProcessor.java | 2 --
1 file changed, 2 deletions(-)
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java b/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
index 8bdf9e6..b7315dd 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java
@@ -1,7 +1,5 @@
package com.github.theword.queqiao;
-
-import com.github.theword.queqiao.tool.constant.BaseConstant;
import com.github.theword.queqiao.event.forge.*;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
// IF > forge-1.16.5
From 497133576a23f40af6b13eb43958356c8a04cbf7 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Fri, 16 Aug 2024 17:29:52 +0800
Subject: [PATCH 34/55] feat: Update forge version in gradle.properties to
36.2.34
---
forge/origin/gradle.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/forge/origin/gradle.properties b/forge/origin/gradle.properties
index d3c65b3..e49aced 100644
--- a/forge/origin/gradle.properties
+++ b/forge/origin/gradle.properties
@@ -28,7 +28,7 @@ mapping_channel=official
#mapping_version=1.16.5
#forge_version_range=[36,)
#minecraft_version_range=[1.16.5,1.17)
-#forge_version=36.2.0
+#forge_version=36.2.34
#slf4j_version=1.7.36
# ELSE IF forge-1.18.2
#minecraft_version=1.18.2
From 8db358296c7d37487dc4989ab0b803ebb97b06a3 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Fri, 16 Aug 2024 17:36:06 +0800
Subject: [PATCH 35/55] feat: Update forge project configuration and
dependencies for version 36.2.34
---
forge/origin/build.gradle | 46 ++++++++++++++++++++++-----------------
1 file changed, 26 insertions(+), 20 deletions(-)
diff --git a/forge/origin/build.gradle b/forge/origin/build.gradle
index 37996a8..2af774f 100644
--- a/forge/origin/build.gradle
+++ b/forge/origin/build.gradle
@@ -86,11 +86,13 @@ repositories {
}
}
-jarJar.enable()
-tasks.named ('jarJar') {
- archiveClassifier.set('')
- destinationDirectory = file("../../QueQiao-jar/${mod_version}")
-}
+// IF > forge-1.12.2
+//jarJar.enable()
+//tasks.named('jarJar') {
+// archiveClassifier.set('')
+// destinationDirectory = file("../../QueQiao-jar/${mod_version}")
+//}
+// END IF
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
@@ -101,24 +103,26 @@ dependencies {
minecraftLibrary("com.github.theword.queqiao:queqiao-tool:${tool_version}") {
exclude group: 'org.slf4j', module: 'slf4j-api'
}
- jarJar("com.github.theword.queqiao:queqiao-tool:${tool_version}") {
- jarJar.ranged(it, "[${tool_version},)")
- exclude group: 'org.slf4j', module: 'slf4j-api'
- }
-
- jarJar("org.java-websocket:Java-WebSocket:${project.java_websocket_version}") {
- exclude group: 'org.slf4j', module: 'slf4j-api'
- jarJar.ranged(it, "[${project.java_websocket_version},2.0.0)")
- }
- jarJar("org.yaml:snakeyaml:${project.snakeyaml_version}") {
- jarJar.ranged(it, "[${project.snakeyaml_version},3.0)")
- }
implementation "org.java-websocket:Java-WebSocket:${project.java_websocket_version}"
implementation "org.yaml:snakeyaml:${project.snakeyaml_version}"
- // IF forge-1.16.5
-// implementation "org.slf4j:slf4j-api:${slf4j_version}"
-// implementation "org.slf4j:slf4j-simple:${slf4j_version}"
+ // IF > forge-1.16.5
+// jarJar("com.github.theword.queqiao:queqiao-tool:${tool_version}") {
+// jarJar.ranged(it, "[${tool_version},)")
+// exclude group: 'org.slf4j', module: 'slf4j-api'
+// }
+//
+// jarJar("org.java-websocket:Java-WebSocket:${project.java_websocket_version}") {
+// exclude group: 'org.slf4j', module: 'slf4j-api'
+// jarJar.ranged(it, "[${project.java_websocket_version},2.0.0)")
+// }
+//
+// jarJar("org.yaml:snakeyaml:${project.snakeyaml_version}") {
+// jarJar.ranged(it, "[${project.snakeyaml_version},3.0)")
+// }
+ // ELSE
+//implementation "org.slf4j:slf4j-api:${slf4j_version}"
+//implementation "org.slf4j:slf4j-simple:${slf4j_version}"
// END IF
}
@@ -151,6 +155,8 @@ tasks.named('jar', Jar).configure {
// zipTree(it)
// }
// }
+// duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+// destinationDirectory = file("../../QueQiao-jar/${mod_version}")
// END IF
manifest {
attributes([
From eee53588616de4890c9b3121df20edb99d107740 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Fri, 16 Aug 2024 21:17:06 +0800
Subject: [PATCH 36/55] (feat: Update project configurations and dependencies
for different server types)
---
.idea/compiler.xml | 39 +------------------
.idea/modules.xml | 15 ++++++-
.../IDEA.QueQiao.fabric-1.16.5.test.iml | 13 +------
.../IDEA.QueQiao.fabric-1.18.2.test.iml | 13 +------
.../IDEA.QueQiao.fabric-1.19.2.test.iml | 13 +------
.../IDEA.QueQiao.fabric-1.20.1.test.iml | 13 +------
.../modules/IDEA.QueQiao.fabric-1.21.test.iml | 13 +------
...iml => IDEA.QueQiao.forge-1.16.5.main.iml} | 7 +++-
...iml => IDEA.QueQiao.forge-1.16.5.test.iml} | 7 +++-
...iml => IDEA.QueQiao.forge-1.18.2.main.iml} | 11 ++----
...iml => IDEA.QueQiao.forge-1.18.2.test.iml} | 11 ++----
.../IDEA.QueQiao.forge-1.19.2.main.iml | 18 +++++++++
.../IDEA.QueQiao.forge-1.19.2.test.iml | 18 +++++++++
.../IDEA.QueQiao.forge-1.20.1.main.iml | 18 +++++++++
.../IDEA.QueQiao.forge-1.20.1.test.iml | 18 +++++++++
.../modules/IDEA.QueQiao.forge-1.21.main.iml | 18 +++++++++
.../modules/IDEA.QueQiao.forge-1.21.test.iml | 18 +++++++++
.idea/modules/QueQiao.fabric-1.16.5.test.iml | 14 +------
.idea/modules/QueQiao.fabric-1.18.2.main.iml | 13 +------
.idea/modules/QueQiao.fabric-1.18.2.test.iml | 14 +------
.idea/modules/QueQiao.fabric-1.19.2.main.iml | 13 +------
.idea/modules/QueQiao.fabric-1.19.2.test.iml | 14 +------
.idea/modules/QueQiao.fabric-1.20.1.test.iml | 14 +------
.idea/modules/QueQiao.fabric-1.21.main.iml | 13 +------
.idea/modules/QueQiao.fabric-1.21.test.iml | 14 +------
.idea/modules/QueQiao.forge-1.16.5.main.iml | 13 +------
.idea/modules/QueQiao.forge-1.16.5.test.iml | 13 +------
.idea/modules/QueQiao.forge-1.18.2.main.iml | 13 +------
.idea/modules/QueQiao.forge-1.18.2.test.iml | 13 +------
.idea/modules/QueQiao.forge-1.19.2.main.iml | 13 +------
.idea/modules/QueQiao.forge-1.19.2.test.iml | 13 +------
.idea/modules/QueQiao.forge-1.20.1.main.iml | 13 +------
.idea/modules/QueQiao.forge-1.20.1.test.iml | 13 +------
.idea/modules/QueQiao.forge-1.21.main.iml | 13 +------
.idea/modules/QueQiao.forge-1.21.test.iml | 13 +------
...ain.iml => QueQiao.spigot-1.12.2.main.iml} | 0
....main.iml => QueQiao.spigot-1.13.main.iml} | 0
...hub.theword.queqiao.fabric-1.16.5.test.iml | 14 +------
...hub.theword.queqiao.fabric-1.18.2.main.iml | 14 +------
...hub.theword.queqiao.fabric-1.18.2.test.iml | 14 +------
...hub.theword.queqiao.fabric-1.19.2.main.iml | 14 +------
...hub.theword.queqiao.fabric-1.19.2.test.iml | 14 +------
...hub.theword.queqiao.fabric-1.20.1.test.iml | 14 +------
...ithub.theword.queqiao.fabric-1.21.main.iml | 14 +------
...ithub.theword.queqiao.fabric-1.21.test.iml | 14 +------
...thub.theword.queqiao.forge-1.16.5.main.iml | 18 +--------
...thub.theword.queqiao.forge-1.16.5.test.iml | 18 +--------
...thub.theword.queqiao.forge-1.18.2.main.iml | 18 +--------
...thub.theword.queqiao.forge-1.18.2.test.iml | 18 +--------
...thub.theword.queqiao.forge-1.19.2.main.iml | 18 +--------
...thub.theword.queqiao.forge-1.19.2.test.iml | 18 +--------
...thub.theword.queqiao.forge-1.20.1.main.iml | 18 +--------
...thub.theword.queqiao.forge-1.20.1.test.iml | 18 +--------
...github.theword.queqiao.forge-1.21.main.iml | 18 +--------
...github.theword.queqiao.forge-1.21.test.iml | 18 +--------
...b.theword.queqiao.velocity-3.3.0.main.iml} | 0
.idea/modules/fabric-1.16.5.main.iml | 10 -----
.idea/modules/fabric-1.16.5.test.iml | 6 ---
.idea/modules/fabric-1.18.2.main.iml | 10 -----
.idea/modules/fabric-1.18.2.test.iml | 6 ---
.idea/modules/fabric-1.19.2.iml | 6 ---
.idea/modules/fabric-1.19.2.main.iml | 10 -----
.idea/modules/fabric-1.19.2.test.iml | 6 ---
.idea/modules/fabric-1.20.1.iml | 6 ---
.idea/modules/fabric-1.20.1.main.iml | 10 -----
.idea/modules/fabric-1.20.1.test.iml | 6 ---
.idea/modules/fabric-1.21.main.iml | 7 ----
.idea/modules/forge-1.16.5.main.iml | 22 +----------
.idea/modules/forge-1.16.5.test.iml | 18 +--------
.idea/modules/forge-1.18.2.main.iml | 22 +----------
.idea/modules/forge-1.18.2.test.iml | 18 +--------
.idea/modules/forge-1.19.2.main.iml | 22 +----------
.idea/modules/forge-1.19.2.test.iml | 18 +--------
.idea/modules/forge-1.20.1.main.iml | 22 +----------
.idea/modules/forge-1.20.1.test.iml | 18 +--------
.idea/modules/forge-1.21.main.iml | 22 +----------
.idea/modules/forge-1.21.test.iml | 18 +--------
.idea/modules/spigot-1.13.iml | 6 ---
78 files changed, 209 insertions(+), 874 deletions(-)
rename .idea/modules/{spigot-1.12.2.main.iml => IDEA.QueQiao.forge-1.16.5.main.iml} (59%)
rename .idea/modules/{spigot-1.13.main.iml => IDEA.QueQiao.forge-1.16.5.test.iml} (59%)
rename .idea/modules/{com.github.theword.queqiao.fabric-1.16.5.main.iml => IDEA.QueQiao.forge-1.18.2.main.iml} (50%)
rename .idea/modules/{com.github.theword.queqiao.fabric-1.20.1.main.iml => IDEA.QueQiao.forge-1.18.2.test.iml} (50%)
create mode 100644 .idea/modules/IDEA.QueQiao.forge-1.19.2.main.iml
create mode 100644 .idea/modules/IDEA.QueQiao.forge-1.19.2.test.iml
create mode 100644 .idea/modules/IDEA.QueQiao.forge-1.20.1.main.iml
create mode 100644 .idea/modules/IDEA.QueQiao.forge-1.20.1.test.iml
create mode 100644 .idea/modules/IDEA.QueQiao.forge-1.21.main.iml
create mode 100644 .idea/modules/IDEA.QueQiao.forge-1.21.test.iml
rename .idea/modules/{com.github.theword.queqiao.spigot-1.12.2.main.iml => QueQiao.spigot-1.12.2.main.iml} (100%)
rename .idea/modules/{com.github.theword.queqiao.spigot-1.13.main.iml => QueQiao.spigot-1.13.main.iml} (100%)
rename .idea/modules/{velocity-3.3.0.main.iml => com.github.theword.queqiao.velocity-3.3.0.main.iml} (100%)
delete mode 100644 .idea/modules/fabric-1.16.5.main.iml
delete mode 100644 .idea/modules/fabric-1.16.5.test.iml
delete mode 100644 .idea/modules/fabric-1.18.2.main.iml
delete mode 100644 .idea/modules/fabric-1.18.2.test.iml
delete mode 100644 .idea/modules/fabric-1.19.2.iml
delete mode 100644 .idea/modules/fabric-1.19.2.main.iml
delete mode 100644 .idea/modules/fabric-1.19.2.test.iml
delete mode 100644 .idea/modules/fabric-1.20.1.iml
delete mode 100644 .idea/modules/fabric-1.20.1.main.iml
delete mode 100644 .idea/modules/fabric-1.20.1.test.iml
delete mode 100644 .idea/modules/fabric-1.21.main.iml
delete mode 100644 .idea/modules/spigot-1.13.iml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 445ff4b..ad9d3ed 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -5,46 +5,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
index f81a2f0..fde1159 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -7,6 +7,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -26,13 +36,13 @@
-
+
+
-
@@ -48,6 +58,7 @@
+
diff --git a/.idea/modules/IDEA.QueQiao.fabric-1.16.5.test.iml b/.idea/modules/IDEA.QueQiao.fabric-1.16.5.test.iml
index 40e75b3..c0e03ea 100644
--- a/.idea/modules/IDEA.QueQiao.fabric-1.16.5.test.iml
+++ b/.idea/modules/IDEA.QueQiao.fabric-1.16.5.test.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MIXIN
- MCP
- FABRIC
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.fabric-1.18.2.test.iml b/.idea/modules/IDEA.QueQiao.fabric-1.18.2.test.iml
index 40e75b3..c0e03ea 100644
--- a/.idea/modules/IDEA.QueQiao.fabric-1.18.2.test.iml
+++ b/.idea/modules/IDEA.QueQiao.fabric-1.18.2.test.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MIXIN
- MCP
- FABRIC
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.fabric-1.19.2.test.iml b/.idea/modules/IDEA.QueQiao.fabric-1.19.2.test.iml
index 40e75b3..c0e03ea 100644
--- a/.idea/modules/IDEA.QueQiao.fabric-1.19.2.test.iml
+++ b/.idea/modules/IDEA.QueQiao.fabric-1.19.2.test.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MIXIN
- MCP
- FABRIC
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.fabric-1.20.1.test.iml b/.idea/modules/IDEA.QueQiao.fabric-1.20.1.test.iml
index 40e75b3..c0e03ea 100644
--- a/.idea/modules/IDEA.QueQiao.fabric-1.20.1.test.iml
+++ b/.idea/modules/IDEA.QueQiao.fabric-1.20.1.test.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MIXIN
- MCP
- FABRIC
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.fabric-1.21.test.iml b/.idea/modules/IDEA.QueQiao.fabric-1.21.test.iml
index 40e75b3..c0e03ea 100644
--- a/.idea/modules/IDEA.QueQiao.fabric-1.21.test.iml
+++ b/.idea/modules/IDEA.QueQiao.fabric-1.21.test.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MIXIN
- MCP
- FABRIC
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/spigot-1.12.2.main.iml b/.idea/modules/IDEA.QueQiao.forge-1.16.5.main.iml
similarity index 59%
rename from .idea/modules/spigot-1.12.2.main.iml
rename to .idea/modules/IDEA.QueQiao.forge-1.16.5.main.iml
index a589521..c348ead 100644
--- a/.idea/modules/spigot-1.12.2.main.iml
+++ b/.idea/modules/IDEA.QueQiao.forge-1.16.5.main.iml
@@ -4,10 +4,15 @@
- SPIGOT
+ FORGE
+ MCP
+ MIXIN
1
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/spigot-1.13.main.iml b/.idea/modules/IDEA.QueQiao.forge-1.16.5.test.iml
similarity index 59%
rename from .idea/modules/spigot-1.13.main.iml
rename to .idea/modules/IDEA.QueQiao.forge-1.16.5.test.iml
index a589521..c348ead 100644
--- a/.idea/modules/spigot-1.13.main.iml
+++ b/.idea/modules/IDEA.QueQiao.forge-1.16.5.test.iml
@@ -4,10 +4,15 @@
- SPIGOT
+ FORGE
+ MCP
+ MIXIN
1
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.fabric-1.16.5.main.iml b/.idea/modules/IDEA.QueQiao.forge-1.18.2.main.iml
similarity index 50%
rename from .idea/modules/com.github.theword.queqiao.fabric-1.16.5.main.iml
rename to .idea/modules/IDEA.QueQiao.forge-1.18.2.main.iml
index ef79d3e..3aa864a 100644
--- a/.idea/modules/com.github.theword.queqiao.fabric-1.16.5.main.iml
+++ b/.idea/modules/IDEA.QueQiao.forge-1.18.2.main.iml
@@ -1,23 +1,18 @@
-
-
-
-
-
- FABRIC
- MIXIN
MCP
+ MIXIN
+ FORGE
1
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.fabric-1.20.1.main.iml b/.idea/modules/IDEA.QueQiao.forge-1.18.2.test.iml
similarity index 50%
rename from .idea/modules/com.github.theword.queqiao.fabric-1.20.1.main.iml
rename to .idea/modules/IDEA.QueQiao.forge-1.18.2.test.iml
index ea4379a..3aa864a 100644
--- a/.idea/modules/com.github.theword.queqiao.fabric-1.20.1.main.iml
+++ b/.idea/modules/IDEA.QueQiao.forge-1.18.2.test.iml
@@ -1,23 +1,18 @@
-
-
-
-
-
- FABRIC
- MIXIN
MCP
+ MIXIN
+ FORGE
1
-
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.forge-1.19.2.main.iml b/.idea/modules/IDEA.QueQiao.forge-1.19.2.main.iml
new file mode 100644
index 0000000..3aa864a
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.forge-1.19.2.main.iml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.forge-1.19.2.test.iml b/.idea/modules/IDEA.QueQiao.forge-1.19.2.test.iml
new file mode 100644
index 0000000..3aa864a
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.forge-1.19.2.test.iml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.forge-1.20.1.main.iml b/.idea/modules/IDEA.QueQiao.forge-1.20.1.main.iml
new file mode 100644
index 0000000..3aa864a
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.forge-1.20.1.main.iml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.forge-1.20.1.test.iml b/.idea/modules/IDEA.QueQiao.forge-1.20.1.test.iml
new file mode 100644
index 0000000..3aa864a
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.forge-1.20.1.test.iml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.forge-1.21.main.iml b/.idea/modules/IDEA.QueQiao.forge-1.21.main.iml
new file mode 100644
index 0000000..3aa864a
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.forge-1.21.main.iml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/IDEA.QueQiao.forge-1.21.test.iml b/.idea/modules/IDEA.QueQiao.forge-1.21.test.iml
new file mode 100644
index 0000000..3aa864a
--- /dev/null
+++ b/.idea/modules/IDEA.QueQiao.forge-1.21.test.iml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ MCP
+ MIXIN
+ FORGE
+
+ 1
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.16.5.test.iml b/.idea/modules/QueQiao.fabric-1.16.5.test.iml
index 002c861..c0e03ea 100644
--- a/.idea/modules/QueQiao.fabric-1.16.5.test.iml
+++ b/.idea/modules/QueQiao.fabric-1.16.5.test.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.18.2.main.iml b/.idea/modules/QueQiao.fabric-1.18.2.main.iml
index 40e75b3..c0e03ea 100644
--- a/.idea/modules/QueQiao.fabric-1.18.2.main.iml
+++ b/.idea/modules/QueQiao.fabric-1.18.2.main.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MIXIN
- MCP
- FABRIC
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.18.2.test.iml b/.idea/modules/QueQiao.fabric-1.18.2.test.iml
index 41c99cc..c0e03ea 100644
--- a/.idea/modules/QueQiao.fabric-1.18.2.test.iml
+++ b/.idea/modules/QueQiao.fabric-1.18.2.test.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.19.2.main.iml b/.idea/modules/QueQiao.fabric-1.19.2.main.iml
index 40e75b3..c0e03ea 100644
--- a/.idea/modules/QueQiao.fabric-1.19.2.main.iml
+++ b/.idea/modules/QueQiao.fabric-1.19.2.main.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MIXIN
- MCP
- FABRIC
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.19.2.test.iml b/.idea/modules/QueQiao.fabric-1.19.2.test.iml
index 5945ef3..c0e03ea 100644
--- a/.idea/modules/QueQiao.fabric-1.19.2.test.iml
+++ b/.idea/modules/QueQiao.fabric-1.19.2.test.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.20.1.test.iml b/.idea/modules/QueQiao.fabric-1.20.1.test.iml
index 0075bd9..c0e03ea 100644
--- a/.idea/modules/QueQiao.fabric-1.20.1.test.iml
+++ b/.idea/modules/QueQiao.fabric-1.20.1.test.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.21.main.iml b/.idea/modules/QueQiao.fabric-1.21.main.iml
index 40e75b3..c0e03ea 100644
--- a/.idea/modules/QueQiao.fabric-1.21.main.iml
+++ b/.idea/modules/QueQiao.fabric-1.21.main.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MIXIN
- MCP
- FABRIC
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.fabric-1.21.test.iml b/.idea/modules/QueQiao.fabric-1.21.test.iml
index 01580e3..c0e03ea 100644
--- a/.idea/modules/QueQiao.fabric-1.21.test.iml
+++ b/.idea/modules/QueQiao.fabric-1.21.test.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.16.5.main.iml b/.idea/modules/QueQiao.forge-1.16.5.main.iml
index 6c4a51c..c0e03ea 100644
--- a/.idea/modules/QueQiao.forge-1.16.5.main.iml
+++ b/.idea/modules/QueQiao.forge-1.16.5.main.iml
@@ -1,15 +1,6 @@
-
-
-
-
- FORGE
- MCP
- MIXIN
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.16.5.test.iml b/.idea/modules/QueQiao.forge-1.16.5.test.iml
index 6c4a51c..c0e03ea 100644
--- a/.idea/modules/QueQiao.forge-1.16.5.test.iml
+++ b/.idea/modules/QueQiao.forge-1.16.5.test.iml
@@ -1,15 +1,6 @@
-
-
-
-
- FORGE
- MCP
- MIXIN
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.18.2.main.iml b/.idea/modules/QueQiao.forge-1.18.2.main.iml
index 18447fe..c0e03ea 100644
--- a/.idea/modules/QueQiao.forge-1.18.2.main.iml
+++ b/.idea/modules/QueQiao.forge-1.18.2.main.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MCP
- MIXIN
- FORGE
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.18.2.test.iml b/.idea/modules/QueQiao.forge-1.18.2.test.iml
index 18447fe..c0e03ea 100644
--- a/.idea/modules/QueQiao.forge-1.18.2.test.iml
+++ b/.idea/modules/QueQiao.forge-1.18.2.test.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MCP
- MIXIN
- FORGE
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.19.2.main.iml b/.idea/modules/QueQiao.forge-1.19.2.main.iml
index 18447fe..c0e03ea 100644
--- a/.idea/modules/QueQiao.forge-1.19.2.main.iml
+++ b/.idea/modules/QueQiao.forge-1.19.2.main.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MCP
- MIXIN
- FORGE
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.19.2.test.iml b/.idea/modules/QueQiao.forge-1.19.2.test.iml
index 18447fe..c0e03ea 100644
--- a/.idea/modules/QueQiao.forge-1.19.2.test.iml
+++ b/.idea/modules/QueQiao.forge-1.19.2.test.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MCP
- MIXIN
- FORGE
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.20.1.main.iml b/.idea/modules/QueQiao.forge-1.20.1.main.iml
index 18447fe..c0e03ea 100644
--- a/.idea/modules/QueQiao.forge-1.20.1.main.iml
+++ b/.idea/modules/QueQiao.forge-1.20.1.main.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MCP
- MIXIN
- FORGE
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.20.1.test.iml b/.idea/modules/QueQiao.forge-1.20.1.test.iml
index 18447fe..c0e03ea 100644
--- a/.idea/modules/QueQiao.forge-1.20.1.test.iml
+++ b/.idea/modules/QueQiao.forge-1.20.1.test.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MCP
- MIXIN
- FORGE
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.21.main.iml b/.idea/modules/QueQiao.forge-1.21.main.iml
index 18447fe..c0e03ea 100644
--- a/.idea/modules/QueQiao.forge-1.21.main.iml
+++ b/.idea/modules/QueQiao.forge-1.21.main.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MCP
- MIXIN
- FORGE
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/QueQiao.forge-1.21.test.iml b/.idea/modules/QueQiao.forge-1.21.test.iml
index 18447fe..c0e03ea 100644
--- a/.idea/modules/QueQiao.forge-1.21.test.iml
+++ b/.idea/modules/QueQiao.forge-1.21.test.iml
@@ -1,15 +1,6 @@
-
-
-
-
- MCP
- MIXIN
- FORGE
-
- 1
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.spigot-1.12.2.main.iml b/.idea/modules/QueQiao.spigot-1.12.2.main.iml
similarity index 100%
rename from .idea/modules/com.github.theword.queqiao.spigot-1.12.2.main.iml
rename to .idea/modules/QueQiao.spigot-1.12.2.main.iml
diff --git a/.idea/modules/com.github.theword.queqiao.spigot-1.13.main.iml b/.idea/modules/QueQiao.spigot-1.13.main.iml
similarity index 100%
rename from .idea/modules/com.github.theword.queqiao.spigot-1.13.main.iml
rename to .idea/modules/QueQiao.spigot-1.13.main.iml
diff --git a/.idea/modules/com.github.theword.queqiao.fabric-1.16.5.test.iml b/.idea/modules/com.github.theword.queqiao.fabric-1.16.5.test.iml
index 002c861..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.fabric-1.16.5.test.iml
+++ b/.idea/modules/com.github.theword.queqiao.fabric-1.16.5.test.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.fabric-1.18.2.main.iml b/.idea/modules/com.github.theword.queqiao.fabric-1.18.2.main.iml
index 41c99cc..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.fabric-1.18.2.main.iml
+++ b/.idea/modules/com.github.theword.queqiao.fabric-1.18.2.main.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.fabric-1.18.2.test.iml b/.idea/modules/com.github.theword.queqiao.fabric-1.18.2.test.iml
index 41c99cc..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.fabric-1.18.2.test.iml
+++ b/.idea/modules/com.github.theword.queqiao.fabric-1.18.2.test.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.fabric-1.19.2.main.iml b/.idea/modules/com.github.theword.queqiao.fabric-1.19.2.main.iml
index 5945ef3..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.fabric-1.19.2.main.iml
+++ b/.idea/modules/com.github.theword.queqiao.fabric-1.19.2.main.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.fabric-1.19.2.test.iml b/.idea/modules/com.github.theword.queqiao.fabric-1.19.2.test.iml
index 5945ef3..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.fabric-1.19.2.test.iml
+++ b/.idea/modules/com.github.theword.queqiao.fabric-1.19.2.test.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.fabric-1.20.1.test.iml b/.idea/modules/com.github.theword.queqiao.fabric-1.20.1.test.iml
index 0075bd9..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.fabric-1.20.1.test.iml
+++ b/.idea/modules/com.github.theword.queqiao.fabric-1.20.1.test.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.fabric-1.21.main.iml b/.idea/modules/com.github.theword.queqiao.fabric-1.21.main.iml
index 01580e3..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.fabric-1.21.main.iml
+++ b/.idea/modules/com.github.theword.queqiao.fabric-1.21.main.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.fabric-1.21.test.iml b/.idea/modules/com.github.theword.queqiao.fabric-1.21.test.iml
index 01580e3..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.fabric-1.21.test.iml
+++ b/.idea/modules/com.github.theword.queqiao.fabric-1.21.test.iml
@@ -1,18 +1,6 @@
-
-
-
-
- FABRIC
- MIXIN
- MCP
-
- 1
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.forge-1.16.5.main.iml b/.idea/modules/com.github.theword.queqiao.forge-1.16.5.main.iml
index 0240347..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.forge-1.16.5.main.iml
+++ b/.idea/modules/com.github.theword.queqiao.forge-1.16.5.main.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.forge-1.16.5.test.iml b/.idea/modules/com.github.theword.queqiao.forge-1.16.5.test.iml
index 0240347..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.forge-1.16.5.test.iml
+++ b/.idea/modules/com.github.theword.queqiao.forge-1.16.5.test.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.forge-1.18.2.main.iml b/.idea/modules/com.github.theword.queqiao.forge-1.18.2.main.iml
index bc0c90a..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.forge-1.18.2.main.iml
+++ b/.idea/modules/com.github.theword.queqiao.forge-1.18.2.main.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.forge-1.18.2.test.iml b/.idea/modules/com.github.theword.queqiao.forge-1.18.2.test.iml
index bc0c90a..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.forge-1.18.2.test.iml
+++ b/.idea/modules/com.github.theword.queqiao.forge-1.18.2.test.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.forge-1.19.2.main.iml b/.idea/modules/com.github.theword.queqiao.forge-1.19.2.main.iml
index 7fedb93..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.forge-1.19.2.main.iml
+++ b/.idea/modules/com.github.theword.queqiao.forge-1.19.2.main.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.forge-1.19.2.test.iml b/.idea/modules/com.github.theword.queqiao.forge-1.19.2.test.iml
index 7fedb93..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.forge-1.19.2.test.iml
+++ b/.idea/modules/com.github.theword.queqiao.forge-1.19.2.test.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.forge-1.20.1.main.iml b/.idea/modules/com.github.theword.queqiao.forge-1.20.1.main.iml
index 1355cdf..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.forge-1.20.1.main.iml
+++ b/.idea/modules/com.github.theword.queqiao.forge-1.20.1.main.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.forge-1.20.1.test.iml b/.idea/modules/com.github.theword.queqiao.forge-1.20.1.test.iml
index 1355cdf..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.forge-1.20.1.test.iml
+++ b/.idea/modules/com.github.theword.queqiao.forge-1.20.1.test.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.forge-1.21.main.iml b/.idea/modules/com.github.theword.queqiao.forge-1.21.main.iml
index b55a96b..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.forge-1.21.main.iml
+++ b/.idea/modules/com.github.theword.queqiao.forge-1.21.main.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/com.github.theword.queqiao.forge-1.21.test.iml b/.idea/modules/com.github.theword.queqiao.forge-1.21.test.iml
index b55a96b..c0e03ea 100644
--- a/.idea/modules/com.github.theword.queqiao.forge-1.21.test.iml
+++ b/.idea/modules/com.github.theword.queqiao.forge-1.21.test.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/velocity-3.3.0.main.iml b/.idea/modules/com.github.theword.queqiao.velocity-3.3.0.main.iml
similarity index 100%
rename from .idea/modules/velocity-3.3.0.main.iml
rename to .idea/modules/com.github.theword.queqiao.velocity-3.3.0.main.iml
diff --git a/.idea/modules/fabric-1.16.5.main.iml b/.idea/modules/fabric-1.16.5.main.iml
deleted file mode 100644
index aa4e38c..0000000
--- a/.idea/modules/fabric-1.16.5.main.iml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/fabric-1.16.5.test.iml b/.idea/modules/fabric-1.16.5.test.iml
deleted file mode 100644
index c0e03ea..0000000
--- a/.idea/modules/fabric-1.16.5.test.iml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/fabric-1.18.2.main.iml b/.idea/modules/fabric-1.18.2.main.iml
deleted file mode 100644
index aa4e38c..0000000
--- a/.idea/modules/fabric-1.18.2.main.iml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/fabric-1.18.2.test.iml b/.idea/modules/fabric-1.18.2.test.iml
deleted file mode 100644
index c0e03ea..0000000
--- a/.idea/modules/fabric-1.18.2.test.iml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/fabric-1.19.2.iml b/.idea/modules/fabric-1.19.2.iml
deleted file mode 100644
index 9e3449c..0000000
--- a/.idea/modules/fabric-1.19.2.iml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/fabric-1.19.2.main.iml b/.idea/modules/fabric-1.19.2.main.iml
deleted file mode 100644
index aa4e38c..0000000
--- a/.idea/modules/fabric-1.19.2.main.iml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/fabric-1.19.2.test.iml b/.idea/modules/fabric-1.19.2.test.iml
deleted file mode 100644
index c0e03ea..0000000
--- a/.idea/modules/fabric-1.19.2.test.iml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/fabric-1.20.1.iml b/.idea/modules/fabric-1.20.1.iml
deleted file mode 100644
index 9e3449c..0000000
--- a/.idea/modules/fabric-1.20.1.iml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/fabric-1.20.1.main.iml b/.idea/modules/fabric-1.20.1.main.iml
deleted file mode 100644
index aa4e38c..0000000
--- a/.idea/modules/fabric-1.20.1.main.iml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/fabric-1.20.1.test.iml b/.idea/modules/fabric-1.20.1.test.iml
deleted file mode 100644
index c0e03ea..0000000
--- a/.idea/modules/fabric-1.20.1.test.iml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/fabric-1.21.main.iml b/.idea/modules/fabric-1.21.main.iml
deleted file mode 100644
index f4cd67e..0000000
--- a/.idea/modules/fabric-1.21.main.iml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/forge-1.16.5.main.iml b/.idea/modules/forge-1.16.5.main.iml
index bbaaae5..c0e03ea 100644
--- a/.idea/modules/forge-1.16.5.main.iml
+++ b/.idea/modules/forge-1.16.5.main.iml
@@ -1,26 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/forge-1.16.5.test.iml b/.idea/modules/forge-1.16.5.test.iml
index 9cec013..c0e03ea 100644
--- a/.idea/modules/forge-1.16.5.test.iml
+++ b/.idea/modules/forge-1.16.5.test.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/forge-1.18.2.main.iml b/.idea/modules/forge-1.18.2.main.iml
index cd5b682..c0e03ea 100644
--- a/.idea/modules/forge-1.18.2.main.iml
+++ b/.idea/modules/forge-1.18.2.main.iml
@@ -1,26 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/forge-1.18.2.test.iml b/.idea/modules/forge-1.18.2.test.iml
index c3267ab..c0e03ea 100644
--- a/.idea/modules/forge-1.18.2.test.iml
+++ b/.idea/modules/forge-1.18.2.test.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/forge-1.19.2.main.iml b/.idea/modules/forge-1.19.2.main.iml
index 889cad4..c0e03ea 100644
--- a/.idea/modules/forge-1.19.2.main.iml
+++ b/.idea/modules/forge-1.19.2.main.iml
@@ -1,26 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/forge-1.19.2.test.iml b/.idea/modules/forge-1.19.2.test.iml
index 753ae68..c0e03ea 100644
--- a/.idea/modules/forge-1.19.2.test.iml
+++ b/.idea/modules/forge-1.19.2.test.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/forge-1.20.1.main.iml b/.idea/modules/forge-1.20.1.main.iml
index 59d86fe..c0e03ea 100644
--- a/.idea/modules/forge-1.20.1.main.iml
+++ b/.idea/modules/forge-1.20.1.main.iml
@@ -1,26 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/forge-1.20.1.test.iml b/.idea/modules/forge-1.20.1.test.iml
index ec15cdd..c0e03ea 100644
--- a/.idea/modules/forge-1.20.1.test.iml
+++ b/.idea/modules/forge-1.20.1.test.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/forge-1.21.main.iml b/.idea/modules/forge-1.21.main.iml
index 2f9ad0c..c0e03ea 100644
--- a/.idea/modules/forge-1.21.main.iml
+++ b/.idea/modules/forge-1.21.main.iml
@@ -1,26 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/forge-1.21.test.iml b/.idea/modules/forge-1.21.test.iml
index 00fd9c2..c0e03ea 100644
--- a/.idea/modules/forge-1.21.test.iml
+++ b/.idea/modules/forge-1.21.test.iml
@@ -1,22 +1,6 @@
-
-
-
-
- FORGE
- MIXIN
- MCP
-
- 1
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules/spigot-1.13.iml b/.idea/modules/spigot-1.13.iml
deleted file mode 100644
index 9e3449c..0000000
--- a/.idea/modules/spigot-1.13.iml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
From f392a02f87f8654d1f42daa71eaf3dda67bace32 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 15:58:55 +0800
Subject: [PATCH 37/55] :bug: Init with plugin configuration instead of mod
---
.../src/main/java/com/github/theword/queqiao/QueQiao.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/velocity/origin/src/main/java/com/github/theword/queqiao/QueQiao.java b/velocity/origin/src/main/java/com/github/theword/queqiao/QueQiao.java
index 297c963..01540e6 100644
--- a/velocity/origin/src/main/java/com/github/theword/queqiao/QueQiao.java
+++ b/velocity/origin/src/main/java/com/github/theword/queqiao/QueQiao.java
@@ -25,7 +25,7 @@ public QueQiao(ProxyServer server) {
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
- initTool(true, new HandleApiService(), new HandleCommandReturnMessageService());
+ initTool(false, new HandleApiService(), new HandleCommandReturnMessageService());
websocketManager.startWebsocket(null);
minecraftServer.getEventManager().register(this, new EventProcessor());
}
@@ -35,4 +35,4 @@ public void onProxyShutdown(ProxyShutdownEvent event) {
websocketManager.stopWebsocketByServerClose();
}
-}
+}
\ No newline at end of file
From 4c59b143ba75694a3ee74a5fc51249321345d629 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 15:59:26 +0800
Subject: [PATCH 38/55] :memo: Add English readme file
---
README_EN.md | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 96 insertions(+)
create mode 100644 README_EN.md
diff --git a/README_EN.md b/README_EN.md
new file mode 100644
index 0000000..e9e34eb
--- /dev/null
+++ b/README_EN.md
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# QueQiao
+
+- Mean: A bridge for connecting to the `Minecraft` server.
+
+## Introduction
+
+- A server `plugin/mod` that distributes **player events** from `Minecraft` server in `Json` format via `Websocket`.
+ - Implemented [`events`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+ - [`Player Chat`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+ - [`Player Commands`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+ - [`Player Death`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B) (`Velocity` not yet available)
+ - [`Player Join`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+ - [`Player Logout`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+- Receives `Json` messages via `Websocket` and forwards them to the game players.
+ - Implemented interfaces
+ - [`Broadcast`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+ - [`Title & SubTitle`](https://github.com/17TheWord/QueQiao/wiki/5.-API#title--subtitle)
+ - [`ActionBar`](https://github.com/17TheWord/QueQiao/wiki/5.-API#actionbar)
+ - [`Private`](https://github.com/17TheWord/QueQiao/wiki/5.-API#private) (Demo)
+
+## Quick Start
+
+1. Install the corresponding `plugin/mod` for the server.
+2. Configure `websocket_server` in `config.yml`
+ - `enable: true` # Enable
+ - `host: "127.0.0.1"` # WebSocket Server address
+ - `port: 8080` # WebSocket Server port
+3. Start the server and wait for the `Websocket Server` to start.
+4. Use [`ApiFox`](https://apifox.com/) or other API testing tools, or connect to [integration](#integration) projects.
+ - Configure global `Request Header`
+ ```json5
+ {
+ "x-self-name": "TestServer",
+ // Required
+ // Server name, must match 'server_name' in config.yml
+ "Authorization": "Bearer 123",
+ // Optional
+ // Authorization, must match 'access_token' in config.yml, if 'access_token' in config.yml is empty, this item can be omitted
+ "x-client-origin": "apifox"
+ // Required
+ // Client origin, if the origin is 'minecraft', it indicates that the request is from a Minecraft Websocket Client and will be rejected by the Minecraft server's Websocket Server
+ }
+ ```
+5. Start the game and join the server.
+
+## Integration
+
+- [`@17TheWord/nonebot-adapter-minecraft`](https://github.com/17TheWord/nonebot-adapter-minecraft): `NoneBot2` adapter, connects to this mod
+- [`@17TheWord/nonebot-plugin-mcqq`](https://github.com/17TheWord/nonebot-plugin-mcqq): `NoneBot2` plugin, enables chat communication with `Minecraft`
+- [`@CikeyQi/mc-plugin`](https://github.com/CikeyQi/mc-plugin): Cloud plugin, enables chat communication with `Minecraft`
+
+## Compatibility
+
+- [`@kitUIN/ChatImage`](https://github.com/kitUIN/ChatImage): Display images in the `Minecraft` chat window
+
+## Special Thanks
+
+- [`@kitUIN`](https://github.com/kitUIN): Provided help with code and build tools
+- [`@kitUIN/ModMultiVersion`](https://github.com/kitUIN/ModMultiVersion): `IDEA` multi-version `MOD` plugin
+- [`@kitUIN/ModMultiVersionTool`](https://github.com/kitUIN/ModMultiVersionTool): Multi-version `MOD` build tool
+
+## Contribution and Support
+
+- If you find it useful, please give this project a `Star` or support me on [`Afdian`](https://afdian.com/a/17TheWord).
+
+- Any feedback or suggestions are welcome, and you can submit [`Issues`](https://github.com/17TheWord/QueQiao/issues) and [`Pull requests`](https://github.com/17TheWord/QueQiao/pulls).
+
+## Open Source License
+
+This project uses the [`MIT`](https://github.com/17TheWord/QueQiao/blob/main/LICENSE) open-source license.
From 74c0f3e4201e7ec4f20d2a603e83c3a1a4c407a8 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 15:59:35 +0800
Subject: [PATCH 39/55] :memo: Update readme file
---
README.md | 141 +++++++++++++++++++++++++++++++++---------------------
1 file changed, 87 insertions(+), 54 deletions(-)
diff --git a/README.md b/README.md
index c1a2d94..10925db 100644
--- a/README.md
+++ b/README.md
@@ -1,74 +1,107 @@
-# 鹊桥
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 📖Docs
+ ·
+ 🐛Submit Suggestion/Bug
+
-## 介绍
+# 鹊桥
-- 将 `Minecraft` 服务端玩家事件以 `Json` 格式通过 `Websocket` 分发的服务端 `plugin/mod`。
+- 寓意:与 `Minecraft` 服务端建立连接的桥梁。
-## 支持的服务端列表
+## 介绍
-- [`Spigot`](https://www.spigotmc.org/)
-- [`Fabric`](https://fabricmc.net/)
-- [`Forge`](https://files.minecraftforge.net/)
-- [`Velocity`](https://papermc.io/software/velocity)(Demo)
+- 将 `Minecraft` 服务端**玩家事件**以 `Json` 格式通过 `Websocket` 分发的服务端 `plugin/mod`。
+ - 已实现的 [`事件`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+ - [`玩家聊天`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+ - [`玩家命令`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+ - [`玩家死亡`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B) (`Velocity`
+ 暂无)
+ - [`玩家加入`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+ - [`玩家登出`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+- 通过 `Websocket` 接收 `Json` 消息,并转发至游戏玩家。
+ - 已实现的接口
+ - [`Broadcast`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
+ - [`Title & SubTitle`](https://github.com/17TheWord/QueQiao/wiki/5.-API#title--subtitle)
+ - [`ActionBar`](https://github.com/17TheWord/QueQiao/wiki/5.-API#actionbar)
+ - [`Private`](https://github.com/17TheWord/QueQiao/wiki/5.-API#private) (Demo)
+
+## 快速开始
+
+1. 安装服务端对应的 `插件/Mod`
+2. 配置 `config.yml` 中的 `websocket_server`
+ - `enable: true` # 是否启用
+ - `host: "127.0.0.1"` # WebSocket Server 地址
+ - `port: 8080` # WebSocket Server 端口
+3. 启动服务器,等待开启 `Websocket Server`
+4. 使用 [`ApiFox`](https://apifox.com/) 或其他API测试工具,或连接 [对接](#对接) 项目
+ - 配置全局 `Request Header`
+ ```json5
+ {
+ "x-self-name": "TestServer",
+ // 必填
+ // 服务器名称,必须与 config.yml 中的 'server_name' 一致
+ "Authorization": "Bearer 123",
+ // 选填
+ // 鉴权,必须与 config.yml 中的 'access_token' 一致,如果 config.yml 中的 'auth_token' 为空,则可不设置此项
+ "x-client-origin": "apifox"
+ // 必填
+ // 客户端来源,如果来源为 'minecraft',则表示来自 Minecraft 的 Websocket Client,且会被 Minecraft 端的 Websocket Server 拒绝
+ }
+ ```
+5. 开始游戏,加入服务器
## 对接
-- [`@17TheWord/nonebot-adapter-minecraft`](https://github.com/17TheWord/nonebot-adapter-minecraft):NoneBot2适配器,与本模组连接
-- [`@17TheWord/nonebot-plugin-mcqq`](https://github.com/17TheWord/nonebot-plugin-mcqq):NoneBot2插件,与Minecraft互通聊天
-- [`@CikeyQi/mc-plugin`](https://github.com/CikeyQi/mc-plugin):云崽插件,与Minecraft互通聊天
+- [`@17TheWord/nonebot-adapter-minecraft`](https://github.com/17TheWord/nonebot-adapter-minecraft):`NoneBot2` 适配器,与本模组连接
+- [`@17TheWord/nonebot-plugin-mcqq`](https://github.com/17TheWord/nonebot-plugin-mcqq):`NoneBot2` 插件,与 `Minecraft`
+ 互通聊天
+- [`@CikeyQi/mc-plugin`](https://github.com/CikeyQi/mc-plugin):云崽插件,与 `Minecraft` 互通聊天
## 兼容
-- [`@kitUIN/ChatImage`](https://github.com/kitUIN/ChatImage):在Minecraft聊天栏中显示图片
-
-## 使用帮助
-
-- 前往 [`Wiki`](https://github.com/17TheWord/QueQiao/wiki)
-
-## 自行构建
-
-1. 克隆项目
-
- ```shell
- git clone https://github.com/17TheWord/QueQiao.git
- ```
-
-2. 配置工具包仓库的个人访问令牌
-
- - 各服务端插件/模组的共用部分已被移至 [`鹊桥工具包`](https://github.com/17TheWord/QueQiaoTool)
- - 访问 `GitHub Maven Packages` 需要配置个人访问令牌
- - 需要配置 `只读` 的 `Package Token`
- - 参考 [GitHub Packages 文档](https://docs.github.com/zh/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#%E5%90%91-github-packages-%E9%AA%8C%E8%AF%81)
- - 该项目使用的环境变量名
- - 必填
- - `USERNAME`:GitHub 用户名
- - `PACKAGE_READ_ONLY_TOKEN`:GitHub 个人访问令牌
-
-3. IDEA 加载项目
- - 运行 `init.ps1` 将各服务端插件/模组代码复制至各个版本模块内
- - 加载 `Gradle` 项目等待项目配置完毕
-
-4. 构建插件/模组
- - 在右侧面的 `Gradle` 面板运行所需版本模块的 `Tasks` -> `build` -> `build`
- - 或
- - 命令移至对应的版本模块内运行构建命令
- ```shell
- ./gradlew build
- ```
+- [`@kitUIN/ChatImage`](https://github.com/kitUIN/ChatImage):在 `Minecraft` 聊天栏中显示图片
## 特别感谢
-- [@kitUIN](https://github.com/kitUIN):提供代码上的帮助以及构建工具
-- [@kitUIN/ModMultiVersion](https://github.com/kitUIN/ModMultiVersion):IDEA多版本MOD插件
-- [@kitUIN/ModMultiVersionTool](https://github.com/kitUIN/ModMultiVersionTool):多版本MOD构建工具
+- [`@kitUIN`](https://github.com/kitUIN):提供代码上的帮助以及构建工具
+- [`@kitUIN/ModMultiVersion`](https://github.com/kitUIN/ModMultiVersion):`IDEA` 多版本 `MOD` 插件
+- [`@kitUIN/ModMultiVersionTool`](https://github.com/kitUIN/ModMultiVersionTool):多版本 `MOD` 构建工具
## 贡献与支持
-- 觉得好用可以给这个项目点个 `Star` 或者去 [爱发电](https://afdian.com/a/17TheWord) 投喂我。
+- 觉得好用可以给这个项目点个 `Star` 或者去 [`爱发电`](https://afdian.com/a/17TheWord) 投喂我。
-- 有意见或者建议也欢迎提交 [Issues](https://github.com/17TheWord/QueQiao/issues)
- 和 [Pull requests](https://github.com/17TheWord/QueQiao/pulls) 。
+- 有意见或者建议也欢迎提交 [`Issues`](https://github.com/17TheWord/QueQiao/issues)
+ 和 [`Pull requests`](https://github.com/17TheWord/QueQiao/pulls) 。
## 开源许可
-本项目使用 [MIT](https://github.com/17TheWord/QueQiao/blob/main/LICENSE) 作为开源许可证。
+本项目使用 [`MIT`](https://github.com/17TheWord/QueQiao/blob/main/LICENSE) 作为开源许可证。
From 6a7de06f7cc6c86964a92f5a4bd8d21f6fbcd5ab Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 17:33:10 +0800
Subject: [PATCH 40/55] =?UTF-8?q?fix(ParseJsonToEvent):=20=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6=E6=93=8D=E4=BD=9C?=
=?UTF-8?q?=E7=9A=84=E6=9E=9A=E4=B8=BE=E8=A7=A3=E6=9E=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
在尝试从基组件解析点击事件时,由于未正确转换为小写,导致找不到枚举值。此修复确保了枚举名称的小写转换,
使点击事件操作的解析正常工作,防止在运行时出现NullPointerException。
更改被应用在ParseJsonToEvent.java文件中,修改了getClickEventFromBaseComponent方法内的枚举解析逻辑。
---
.../java/com/github/theword/queqiao/utils/ParseJsonToEvent.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 6d7fdb6..e621560 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -140,7 +140,7 @@ private Style getStyleFromBaseComponent(CommonBaseComponent myBaseComponent) {
private ClickEvent getClickEventFromBaseComponent(CommonTextComponent myTextComponent) {
if (myTextComponent.getClickEvent() != null) {
// IF >= forge-1.21
-// ClickEvent.Action tempAction = ClickEvent.Action.valueOf(myTextComponent.getClickEvent().getAction());
+// ClickEvent.Action tempAction = ClickEvent.Action.valueOf(myTextComponent.getClickEvent().getAction().toLowerCase());
// ELSE
// ClickEvent.Action tempAction = ClickEvent.Action.getByName(myTextComponent.getClickEvent().getAction().toLowerCase());
// END IF
From 9058234ff02b42515ca437ffededb3a344c59ecb Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 17:33:23 +0800
Subject: [PATCH 41/55] =?UTF-8?q?```java=20refactor(utils):=20=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0ParseJsonToEvent.java=E4=BB=A5=E6=94=AF=E6=8C=81?=
=?UTF-8?q?=E6=96=87=E6=9C=AC=E6=A0=B7=E5=BC=8F=E5=92=8C=E4=BA=8B=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
重构ParseJsonToEvent类以包含对文本样式的处理和点击/悬停事件。此更改引入了对新冒险文本API的引用,移除了未使用的导入,并实现了将JSON消息转换为带有样式的文本组件的新逻辑。为点击和悬停事件添加了单独的方法,以支持更广泛的交互可能性。
BREAKING CHANGE: 内部文本处理机制已更新,可能影响依赖于之前文本组件行为的客户端代码。
```
---
.../queqiao/utils/ParseJsonToEvent.java | 91 ++++++++++++++++++-
1 file changed, 90 insertions(+), 1 deletion(-)
diff --git a/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 576395f..0573168 100644
--- a/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -1,7 +1,15 @@
package com.github.theword.queqiao.utils;
import com.github.theword.queqiao.tool.payload.modle.CommonBaseComponent;
+import com.github.theword.queqiao.tool.payload.modle.CommonClickEvent;
+import com.github.theword.queqiao.tool.payload.modle.CommonTextComponent;
+import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.event.ClickEvent;
+import net.kyori.adventure.text.event.HoverEvent;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.format.TextDecoration;
+import org.intellij.lang.annotations.Subst;
import java.util.List;
@@ -18,7 +26,88 @@ public Component parseMessage(List extends CommonBaseComponent> commonBaseComp
public Component parsePerMessageToMultiText(CommonBaseComponent commonBaseComponent) {
Component component = Component.text(commonBaseComponent.getText());
+
+ if (commonBaseComponent.getColor() != null && !commonBaseComponent.getColor().isEmpty())
+ component = component.color(getNamedTextColor(commonBaseComponent.getColor()));
+
+ component = getTextStyle(commonBaseComponent, component);
+
+ if (commonBaseComponent instanceof CommonTextComponent commonTextComponent) {
+ if (commonTextComponent.getClickEvent() != null)
+ component = component.clickEvent(getClickEvent(commonTextComponent));
+
+ if (commonTextComponent.getHoverEvent() != null)
+ component = component.hoverEvent(getHoverEvent(commonTextComponent));
+ }
+
+
return component;
}
-}
+ private ClickEvent getClickEvent(CommonTextComponent commonTextComponent) {
+ ClickEvent.Action action = ClickEvent.Action.valueOf(commonTextComponent.getClickEvent().getAction().toLowerCase());
+ return ClickEvent.clickEvent(action, commonTextComponent.getClickEvent().getValue());
+ }
+
+ private HoverEvent> getHoverEvent(CommonTextComponent commonTextComponent) {
+ HoverEvent> hoverEvent;
+ switch (commonTextComponent.getClickEvent().getAction()) {
+ case "show_text" -> {
+ hoverEvent = HoverEvent.showText(parseMessage(commonTextComponent.getHoverEvent().getBaseComponentList()));
+ }
+ case "show_item" -> {
+ hoverEvent = HoverEvent.showItem();
+ }
+ case "show_entity" -> {
+ }
+ }
+
+ }
+
+
+ private Component getTextStyle(CommonBaseComponent commonBaseComponent, Component component) {
+ if (commonBaseComponent.isBold())
+ component = component.decorate(TextDecoration.BOLD);
+
+ if (commonBaseComponent.isItalic())
+ component = component.decorate(TextDecoration.ITALIC);
+
+ if (commonBaseComponent.isUnderlined())
+ component = component.decorate(TextDecoration.UNDERLINED);
+
+ if (commonBaseComponent.isStrikethrough())
+ component = component.decorate(TextDecoration.STRIKETHROUGH);
+
+ if (commonBaseComponent.isObfuscated())
+ component = component.decorate(TextDecoration.OBFUSCATED);
+
+ if (commonBaseComponent.getFont() != null && !commonBaseComponent.getFont().isEmpty()) {
+ @Subst("default") String font = commonBaseComponent.getFont();
+ if (Key.parseable(font))
+ component = component.font(Key.key(font));
+ }
+
+ return component;
+ }
+
+ private NamedTextColor getNamedTextColor(String color) {
+ return switch (color.toLowerCase()) {
+ case "black" -> NamedTextColor.BLACK;
+ case "dark_blue" -> NamedTextColor.DARK_BLUE;
+ case "dark_green" -> NamedTextColor.DARK_GREEN;
+ case "dark_aqua" -> NamedTextColor.DARK_AQUA;
+ case "dark_red" -> NamedTextColor.DARK_RED;
+ case "dark_purple" -> NamedTextColor.DARK_PURPLE;
+ case "gold" -> NamedTextColor.GOLD;
+ case "gray" -> NamedTextColor.GRAY;
+ case "dark_gray" -> NamedTextColor.DARK_GRAY;
+ case "blue" -> NamedTextColor.BLUE;
+ case "green" -> NamedTextColor.GREEN;
+ case "aqua" -> NamedTextColor.AQUA;
+ case "red" -> NamedTextColor.RED;
+ case "light_purple" -> NamedTextColor.LIGHT_PURPLE;
+ case "yellow" -> NamedTextColor.YELLOW;
+ default -> NamedTextColor.WHITE;
+ };
+ }
+}
\ No newline at end of file
From d8f27a42fffcda1dc2dda114f41ce242e80ebe26 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 18:03:16 +0800
Subject: [PATCH 42/55] feat: Update project configurations and dependencies
for different server types
---
README.md | 27 ++++++++++++++++-----------
README_EN.md | 31 ++++++++++++++++++++++---------
2 files changed, 38 insertions(+), 20 deletions(-)
diff --git a/README.md b/README.md
index 10925db..58d55fc 100644
--- a/README.md
+++ b/README.md
@@ -6,36 +6,41 @@
+
+
+# 鹊桥
+
+✨ 连接 Minecraft 服务器的桥梁 ✨
+
+
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
+
📖Docs
·
🐛Submit Suggestion/Bug
-# 鹊桥
-
-- 寓意:与 `Minecraft` 服务端建立连接的桥梁。
-
## 介绍
- 将 `Minecraft` 服务端**玩家事件**以 `Json` 格式通过 `Websocket` 分发的服务端 `plugin/mod`。
diff --git a/README_EN.md b/README_EN.md
index e9e34eb..b300f5b 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -6,27 +6,40 @@
+
+
+# QueQiao
+
+✨ A bridge for connecting to the `Minecraft` server ✨
+
+
+
-
+
-
-
+
+
-
+
-
+
-
+
+
+
+
-# QueQiao
-
-- Mean: A bridge for connecting to the `Minecraft` server.
+
+ 📖Docs
+ ·
+ 🐛Submit Suggestion/Bug
+
## Introduction
From be601f4aa89b005817448c7d2b8c0ba56fa307f2 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 18:51:05 +0800
Subject: [PATCH 43/55] =?UTF-8?q?refactor(ParseJsonToEvent):=20=E7=A7=BB?=
=?UTF-8?q?=E9=99=A4=E4=BA=86=E6=9C=AA=E4=BD=BF=E7=94=A8=E7=9A=84=E7=82=B9?=
=?UTF-8?q?=E5=87=BB=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
在ParseJsonToEvent.java文件中,移除了未使用的点击事件处理逻辑,以简化代码并避免可能的混淆。
---
.../com/github/theword/queqiao/utils/ParseJsonToEvent.java | 6 ------
1 file changed, 6 deletions(-)
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 1d3dbdc..ac4d00b 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -66,12 +66,6 @@ public MutableText parsePerMessageToMultiText(CommonBaseComponent myBaseComponen
// ELSE
// style.withColor(TextColor.parse(myBaseComponent.getColor()));
// END IF
- } else {
- // IF fabric-1.21
-// style.withColor(TextColor.fromFormatting(Formatting.WHITE));
- // ELSE
-// style.withColor(TextColor.fromFormatting(Formatting.WHITE));
- // END IF
}
// 配置 TextComponent 额外属性
From 92f6c0dec758149e76a93c52fbcf72f66d616801 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 18:51:23 +0800
Subject: [PATCH 44/55] =?UTF-8?q?refactor(ParseJsonToEvent):=20=E7=A7=BB?=
=?UTF-8?q?=E9=99=A4=E4=BA=86=E6=9C=AA=E4=BD=BF=E7=94=A8=E7=9A=84=E7=82=B9?=
=?UTF-8?q?=E5=87=BB=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
在ParseJsonToEvent.java文件中,移除了未使用的点击事件处理逻辑,以简化代码并避免可能的混淆。
---
.../com/github/theword/queqiao/utils/ParseJsonToEvent.java | 3 ---
1 file changed, 3 deletions(-)
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index e621560..547fb8a 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -123,16 +123,13 @@ private Style getStyleFromBaseComponent(CommonBaseComponent myBaseComponent) {
// IF >= forge-1.21
// if (myBaseComponent.getColor() != null && !myBaseComponent.getColor().isEmpty())
// style = style.withColor(TextColor.parseColor(myBaseComponent.getColor()).getOrThrow());
-// else style = style.withColor(TextColor.parseColor("white").getOrThrow());
//
// ELSE IF > forge-1.16.5
// if (myBaseComponent.getColor() != null && !myBaseComponent.getColor().isEmpty())
// style = style.withColor(TextColor.parseColor(myBaseComponent.getColor()));
-// else style = style.withColor(TextColor.parseColor("white"));
// ELSE
// if (myBaseComponent.getColor() != null && !myBaseComponent.getColor().isEmpty())
// style.withColor(Color.fromLegacyFormat(TextFormatting.valueOf(myBaseComponent.getColor().toUpperCase())));
-// else style.withColor(Color.fromLegacyFormat(TextFormatting.WHITE));
// END IF
return style;
}
From a8d1dd832492a55f207d9af4611085cd91daf7ee Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 18:52:09 +0800
Subject: [PATCH 45/55] =?UTF-8?q?refactor(ParseJsonToEvent):=20=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E4=BB=A3=E7=A0=81=E4=BB=A5=E6=94=AF=E6=8C=81=E6=96=B0?=
=?UTF-8?q?=E7=9A=84=E6=96=87=E6=9C=AC=E6=A0=B7=E5=BC=8F=E5=92=8C=E4=BA=8B?=
=?UTF-8?q?=E4=BB=B6=E5=A4=84=E7=90=86=E6=9C=BA=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
重构ParseJsonToEvent类,引入了对新文本样式的支持,并改进了事件处理机制。对代码进行了简化,移除了未使用的逻辑,并修复了可能的解析问题。此次更改将提高代码的可读性和稳定性,为将来的功能扩展打下基础。
---
.../queqiao/utils/ParseJsonToEvent.java | 44 ++++---------------
1 file changed, 8 insertions(+), 36 deletions(-)
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index f56810f..63f047b 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -17,6 +17,7 @@
import java.util.List;
+import static com.github.theword.queqiao.tool.utils.Tool.debugLog;
import static com.github.theword.queqiao.tool.utils.Tool.logger;
@@ -39,12 +40,12 @@ public TextComponent parsePerMessageToTextComponent(CommonBaseComponent myBaseCo
// ELSE
// msgComponent.setColor(ChatColor.of(myBaseComponent.getColor().toUpperCase()));
// END IF
- else msgComponent.setColor(ChatColor.WHITE);
- msgComponent.setBold(myBaseComponent.isBold());
- msgComponent.setItalic(myBaseComponent.isItalic());
- msgComponent.setUnderlined(myBaseComponent.isUnderlined());
- msgComponent.setStrikethrough(myBaseComponent.isStrikethrough());
- msgComponent.setObfuscated(myBaseComponent.isObfuscated());
+
+ if (myBaseComponent.isBold()) msgComponent.setBold(true);
+ if (myBaseComponent.isItalic()) msgComponent.setItalic(true);
+ if (myBaseComponent.isUnderlined()) msgComponent.setUnderlined(true);
+ if (myBaseComponent.isStrikethrough()) msgComponent.setStrikethrough(true);
+ if (myBaseComponent.isObfuscated()) msgComponent.setObfuscated(true);
// 配置 TextComponent 额外属性
if (myBaseComponent instanceof CommonTextComponent) {
@@ -127,36 +128,7 @@ public TextComponent parseMessageToTextComponent(List extends CommonBaseCompon
component.addExtra(msgComponent);
msgLogText.append(myBaseComponent.getText());
}
- logger.info(msgLogText.toString());
+ debugLog(msgLogText.toString());
return component;
}
-
- /**
- * 将 CommonBaseComponent 转换为带有游戏文本样式的 String
- *
- * @param myBaseComponentList 消息列表
- * @return String
- */
- public String parseCommonBaseCommentToStringWithStyle(List extends CommonBaseComponent> myBaseComponentList) {
- StringBuilder message = new StringBuilder();
-
- for (CommonBaseComponent myBaseComponent : myBaseComponentList) {
- String tempMessageSeg = "";
- if (myBaseComponent.isBold()) tempMessageSeg += ChatColor.BOLD;
- if (myBaseComponent.isItalic()) tempMessageSeg += ChatColor.ITALIC;
- if (myBaseComponent.isUnderlined()) tempMessageSeg += ChatColor.UNDERLINE;
- if (myBaseComponent.isStrikethrough()) tempMessageSeg += ChatColor.STRIKETHROUGH;
- if (myBaseComponent.isObfuscated()) tempMessageSeg += ChatColor.MAGIC;
- if (myBaseComponent.getColor() != null && !myBaseComponent.getColor().isEmpty())
- // IF spigot-1.12.2
-// tempMessageSeg += ChatColor.valueOf(myBaseComponent.getColor().toUpperCase());
- // ELSE
-// tempMessageSeg += ChatColor.of(myBaseComponent.getColor().toUpperCase());
- // END IF
- else tempMessageSeg += ChatColor.WHITE;
- tempMessageSeg += myBaseComponent.getText();
- message.append(tempMessageSeg);
- }
- return message.toString();
- }
}
\ No newline at end of file
From fd154ebaf66fcfd3f737fe934ce74c3e650f94af Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 18:52:30 +0800
Subject: [PATCH 46/55] =?UTF-8?q?refactor(HandleApiService):=20=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E4=BB=A3=E7=A0=81=E4=BB=A5=E6=94=AF=E6=8C=81=E6=96=B0?=
=?UTF-8?q?=E7=9A=84=E6=96=87=E6=9C=AC=E6=A0=B7=E5=BC=8F=E5=92=8C=E4=BA=8B?=
=?UTF-8?q?=E4=BB=B6=E5=A4=84=E7=90=86=E6=9C=BA=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../github/theword/queqiao/handle/HandleApiService.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java b/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
index 7a43535..ee10d3f 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
@@ -31,12 +31,12 @@ public void handleBroadcastMessage(WebSocket webSocket, List
Date: Mon, 19 Aug 2024 19:41:01 +0800
Subject: [PATCH 47/55] =?UTF-8?q?fix(parse-json-to-event):=20=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3=E8=B7=A8Minecraft=E5=B9=B3=E5=8F=B0=E7=9A=84=E8=A7=A3?=
=?UTF-8?q?=E6=9E=90=E9=97=AE=E9=A2=98-=20=E7=BB=9F=E4=B8=80UUID=E4=BD=BF?=
=?UTF-8?q?=E7=94=A8=EF=BC=8C=E5=A2=9E=E5=BC=BA=E4=BB=A3=E7=A0=81=E5=85=BC?=
=?UTF-8?q?=E5=AE=B9=E6=80=A7=E3=80=82=20-=20=E8=B0=83=E6=95=B4=E7=89=A9?=
=?UTF-8?q?=E5=93=81ID=E8=A7=A3=E6=9E=90=E4=BB=A5=E9=80=82=E5=BA=94?=
=?UTF-8?q?=E4=B8=8D=E5=90=8C=E5=B9=B3=E5=8F=B0=E7=9A=84=E9=9C=80=E6=B1=82?=
=?UTF-8?q?=E3=80=82=20-=20=E6=B7=B8=E7=90=86=E6=9C=AA=E4=BD=BF=E7=94=A8?=
=?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=85=A5=E5=92=8C=E5=8F=98=E9=87=8F=EF=BC=8C?=
=?UTF-8?q?=E6=8F=90=E9=AB=98=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../queqiao/utils/ParseJsonToEvent.java | 18 ++++++++----------
.../queqiao/utils/ParseJsonToEvent.java | 15 +++++++--------
.../queqiao/utils/ParseJsonToEvent.java | 13 ++++++-------
.../queqiao/utils/ParseJsonToEvent.java | 19 +++++++++++++------
4 files changed, 34 insertions(+), 31 deletions(-)
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index ac4d00b..6a73652 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -8,12 +8,10 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.text.*;
-import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import java.util.List;
import java.util.Optional;
-import java.util.UUID;
public class ParseJsonToEvent {
@@ -77,9 +75,9 @@ public MutableText parsePerMessageToMultiText(CommonBaseComponent myBaseComponen
// END IF
if (myTextComponent.getClickEvent() != null) {
// IF fabric-1.21
-// ClickEvent.Action tempAction = ClickEvent.Action.valueOf(myTextComponent.getClickEvent().getAction());
+// ClickEvent.Action tempAction = ClickEvent.Action.valueOf(myTextComponent.getClickEvent().getAction().toLowerCase());
// ELSE
-// ClickEvent.Action tempAction = ClickEvent.Action.byName(myTextComponent.getClickEvent().getAction());
+// ClickEvent.Action tempAction = ClickEvent.Action.byName(myTextComponent.getClickEvent().getAction().toLowerCase());
// END IF
ClickEvent clickEvent = new ClickEvent(tempAction, myTextComponent.getClickEvent().getValue());
style.withClickEvent(clickEvent);
@@ -95,17 +93,17 @@ public MutableText parsePerMessageToMultiText(CommonBaseComponent myBaseComponen
}
break;
case "show_item":
- CommonHoverItem myHoverItem = myTextComponent.getHoverEvent().getItem();
- Item item = Item.byRawId(myHoverItem.getId());
- ItemStack itemStack = new ItemStack(item, myHoverItem.getCount());
+ CommonHoverItem commonHoverItem = myTextComponent.getHoverEvent().getItem();
+ Item item = Item.byRawId(Integer.parseInt(commonHoverItem.getId()));
+ ItemStack itemStack = new ItemStack(item, commonHoverItem.getCount());
HoverEvent.ItemStackContent itemStackContent = new HoverEvent.ItemStackContent(itemStack);
hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_ITEM, itemStackContent);
break;
case "show_entity":
- CommonHoverEntity myHoverEntity = myTextComponent.getHoverEvent().getEntity();
- Optional> entityType = EntityType.get(myHoverEntity.getType());
+ CommonHoverEntity commonHoverEntity = myTextComponent.getHoverEvent().getEntity();
+ Optional> entityType = EntityType.get(commonHoverEntity.getType());
if (entityType.isPresent()) {
- HoverEvent.EntityContent entityTooltipInfo = new HoverEvent.EntityContent(entityType.get(), UUID.randomUUID(), parseMessages(myHoverEntity.getName()));
+ HoverEvent.EntityContent entityTooltipInfo = new HoverEvent.EntityContent(entityType.get(), commonHoverEntity.getUuid(), parseMessages(commonHoverEntity.getName()));
hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_ENTITY, entityTooltipInfo);
}
break;
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 547fb8a..32eaf75 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -31,7 +31,6 @@
// END IF
import java.util.List;
import java.util.Optional;
-import java.util.UUID;
public class ParseJsonToEvent {
@@ -160,9 +159,9 @@ public HoverEvent getHoverEventFromBaseComponent(CommonTextComponent myTextCompo
hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, textComponent);
}
} else if (action.equals(HoverEvent.Action.SHOW_ITEM)) {
- CommonHoverItem myHoverItem = myTextComponent.getHoverEvent().getItem();
- Item item = Item.byId(myHoverItem.getId());
- ItemStack itemStack = new ItemStack(item, myHoverItem.getCount());
+ CommonHoverItem commonHoverItem = myTextComponent.getHoverEvent().getItem();
+ Item item = Item.byId(Integer.parseInt(commonHoverItem.getId()));
+ ItemStack itemStack = new ItemStack(item, commonHoverItem.getCount());
// IF > forge-1.16.5
// HoverEvent.ItemStackInfo itemHover = new HoverEvent.ItemStackInfo(itemStack);
// ELSE
@@ -170,13 +169,13 @@ public HoverEvent getHoverEventFromBaseComponent(CommonTextComponent myTextCompo
// END IF
hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_ITEM, itemHover);
} else if (action.equals(HoverEvent.Action.SHOW_ENTITY)) {
- CommonHoverEntity myHoverEntity = myTextComponent.getHoverEvent().getEntity();
- Optional> entityType = EntityType.byString(myHoverEntity.getType());
+ CommonHoverEntity commonHoverEntity = myTextComponent.getHoverEvent().getEntity();
+ Optional> entityType = EntityType.byString(commonHoverEntity.getType());
if (entityType.isPresent()) {
// IF > forge-1.16.5
-// HoverEvent.EntityTooltipInfo entityTooltipInfo = new HoverEvent.EntityTooltipInfo(entityType.get(), UUID.randomUUID(), parseMessages(myHoverEntity.getName()));
+// HoverEvent.EntityTooltipInfo entityTooltipInfo = new HoverEvent.EntityTooltipInfo(entityType.get(), commonHoverEntity.getUuid(), parseMessages(commonHoverEntity.getName()));
// ELSE
-// HoverEvent.EntityHover entityTooltipInfo = new HoverEvent.EntityHover(entityType.get(), UUID.randomUUID(), parseMessages(myHoverEntity.getName()));
+// HoverEvent.EntityHover entityTooltipInfo = new HoverEvent.EntityHover(entityType.get(), UUID.randomUUID(), parseMessages(commonHoverEntity.getName()));
// END IF
hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_ENTITY, entityTooltipInfo);
}
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 63f047b..4dd8559 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -18,7 +18,6 @@
import java.util.List;
import static com.github.theword.queqiao.tool.utils.Tool.debugLog;
-import static com.github.theword.queqiao.tool.utils.Tool.logger;
public class ParseJsonToEvent {
@@ -84,15 +83,15 @@ private HoverEvent getHoverEvent(CommonTextComponent myTextComponent) {
// hoverEvent = new HoverEvent(action, new Text(baseComponent));
// break;
// case SHOW_ITEM:
-// CommonHoverItem myHoverItem = myTextComponent.getHoverEvent().getItem();
-// ItemTag itemTag = ItemTag.ofNbt(myHoverItem.getTag());
-// Item item = new Item(String.valueOf(myHoverItem.getId()), myHoverItem.getCount(), itemTag);
+// CommonHoverItem commonHoverItem = myTextComponent.getHoverEvent().getItem();
+// ItemTag itemTag = ItemTag.ofNbt(commonHoverItem.getTag());
+// Item item = new Item(commonHoverItem.getId(), commonHoverItem.getCount(), itemTag);
// hoverEvent = new HoverEvent(action, item);
// break;
// case SHOW_ENTITY:
-// CommonHoverEntity myHoverEntity = myTextComponent.getHoverEvent().getEntity();
-// TextComponent nameComponent = parseMessageToTextComponent(myHoverEntity.getName());
-// Entity entity = new Entity(myHoverEntity.getType(), myHoverEntity.getId(), nameComponent);
+// CommonHoverEntity commonHoverEntity = myTextComponent.getHoverEvent().getEntity();
+// TextComponent nameComponent = parseMessageToTextComponent(commonHoverEntity.getName());
+// Entity entity = new Entity(commonHoverEntity.getType(), commonHoverEntity.getId(), nameComponent);
// hoverEvent = new HoverEvent(action, entity);
// break;
// default:
diff --git a/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 0573168..5dfbe4b 100644
--- a/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -1,7 +1,6 @@
package com.github.theword.queqiao.utils;
import com.github.theword.queqiao.tool.payload.modle.CommonBaseComponent;
-import com.github.theword.queqiao.tool.payload.modle.CommonClickEvent;
import com.github.theword.queqiao.tool.payload.modle.CommonTextComponent;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
@@ -50,18 +49,26 @@ private ClickEvent getClickEvent(CommonTextComponent commonTextComponent) {
}
private HoverEvent> getHoverEvent(CommonTextComponent commonTextComponent) {
- HoverEvent> hoverEvent;
- switch (commonTextComponent.getClickEvent().getAction()) {
+ String action = commonTextComponent.getClickEvent().getAction();
+ switch (action) {
case "show_text" -> {
- hoverEvent = HoverEvent.showText(parseMessage(commonTextComponent.getHoverEvent().getBaseComponentList()));
+ return HoverEvent.showText(parseMessage(commonTextComponent.getHoverEvent().getBaseComponentList()));
}
case "show_item" -> {
- hoverEvent = HoverEvent.showItem();
+ return HoverEvent.showItem(
+ Key.key(commonTextComponent.getHoverEvent().getItem().getKey()),
+ commonTextComponent.getHoverEvent().getItem().getCount()
+ );
}
case "show_entity" -> {
+ return HoverEvent.showEntity(
+ Key.key(commonTextComponent.getHoverEvent().getEntity().getKey()),
+ commonTextComponent.getHoverEvent().getEntity().getUuid(),
+ parseMessage(commonTextComponent.getHoverEvent().getEntity().getName())
+ );
}
}
-
+ return null;
}
From 7278bc85a549ed151c646e3791a4035e81dc66a1 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Mon, 19 Aug 2024 19:41:11 +0800
Subject: [PATCH 48/55] =?UTF-8?q?```chore(release):=E5=8D=87=E7=BA=A7?=
=?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=89=88=E6=9C=AC=E8=87=B30.0.6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
将工具版本从0.0.4升级到0.0.6,反映在tool_version.txt中。
```
---
tool_version.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tool_version.txt b/tool_version.txt
index 05b19b1..99d85ec 100644
--- a/tool_version.txt
+++ b/tool_version.txt
@@ -1 +1 @@
-0.0.4
\ No newline at end of file
+0.0.6
\ No newline at end of file
From aac83037be876c1eb3fad8e9d56ea8d3727ade74 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Tue, 20 Aug 2024 00:18:39 +0800
Subject: [PATCH 49/55] =?UTF-8?q?feat(HandleApiService):=20=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E7=A7=81=E8=81=8A=E6=B6=88=E6=81=AF=E5=A4=84=E7=90=86?=
=?UTF-8?q?=E6=9C=BA=E5=88=B6=E4=BB=A5=E6=94=AF=E6=8C=81=E4=B8=8D=E5=90=8C?=
=?UTF-8?q?=E5=B9=B3=E5=8F=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
针对不同平台更新了私聊消息处理机制,优化了目标玩家查找逻辑,并改进了消息发送方式。代码重用性提高,同时保证了跨平台兼容性。
---
.../queqiao/handle/HandleApiService.java | 30 +++++++++++--
.../queqiao/handle/HandleApiService.java | 45 +++++++++++++++++--
.../queqiao/handle/HandleApiService.java | 25 ++++++++++-
.../queqiao/handle/HandleApiService.java | 2 +-
4 files changed, 93 insertions(+), 9 deletions(-)
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java b/fabric/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
index e79e8b6..6c3d3f5 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
@@ -92,14 +92,38 @@ public void handleActionBarMessage(WebSocket webSocket, List messageList) {
- webSocket.send("Unsupported API now.");
+ ServerPlayerEntity serverPlayerEntity;
+ if (targetPlayerUuid != null)
+ serverPlayerEntity = minecraftServer.getPlayerManager().getPlayer(targetPlayerUuid);
+ else if (targetPlayerName != null && !targetPlayerName.isEmpty())
+ serverPlayerEntity = minecraftServer.getPlayerManager().getPlayer(targetPlayerName);
+ else {
+ webSocket.send("{\"code\":400,\"message\":\"Target player not found.\"}");
+ return;
+ }
+
+ if (serverPlayerEntity == null) {
+ webSocket.send("{\"code\":400,\"message\":\"Target player is null.\"}");
+ return;
+ }
+
+ if (serverPlayerEntity.isDisconnected()) {
+ webSocket.send("{\"code\":400,\"message\":\"Target player is disconnected.\"}");
+ return;
+ }
+ // IF >= fabric-1.19
+// serverPlayerEntity.sendMessage(parseJsonToEvent.parseMessages(messageList));
+ // ELSE
+// serverPlayerEntity.sendMessage(parseJsonToEvent.parseMessages(messageList), false);
+ // END IF
+ webSocket.send("{\"code\":200,\"message\":\"Private message sent.\"}");
}
private void sendPacket(Packet> packet) {
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java b/forge/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
index f8f2327..faf53f5 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
@@ -67,7 +67,7 @@ public void handleBroadcastMessage(WebSocket webSocket, List= forge-1.19
// serverPlayer.sendSystemMessage(mutableComponent);
// ELSE
-// serverPlayer.sendMessage(mutableComponent,uuid);
+// serverPlayer.sendMessage(mutableComponent, uuid);
// END IF
}
}
@@ -111,14 +111,51 @@ public void handleActionBarMessage(WebSocket webSocket, List messageList) {
- webSocket.send("Unsupported API now.");
+ // IF > forge-1.16.5
+// ServerPlayer targetPlayer;
+ // ELSE
+// ServerPlayerEntity targetPlayer;
+ // END IF
+ if (targetPlayerUuid != null)
+ targetPlayer = minecraftServer.getPlayerList().getPlayer(targetPlayerUuid);
+ else if (targetPlayerName != null && !targetPlayerName.isEmpty())
+ targetPlayer = minecraftServer.getPlayerList().getPlayerByName(targetPlayerName);
+ else {
+ webSocket.send("{\"code\":400,\"message\":\"Target player not found.\"}");
+ return;
+ }
+
+ if (targetPlayer == null) {
+ webSocket.send("{\"code\":400,\"message\":\"Target player is null.\"}");
+ return;
+ }
+
+ if (targetPlayer.hasDisconnected()) {
+ webSocket.send("{\"code\":400,\"message\":\"Target player is disconnected.\"}");
+ return;
+ }
+ // IF > forge-1.16.5
+// MutableComponent mutableComponent = parseJsonToEvent.parsePerMessageToMultiText(Tool.getPrefixComponent());
+// mutableComponent.append(parseJsonToEvent.parseMessages(messageList));
+ // ELSE
+// StringTextComponent mutableComponent = parseJsonToEvent.parsePerMessageToMultiText(Tool.getPrefixComponent());
+// mutableComponent.append(parseJsonToEvent.parseMessages(messageList));
+ // END IF
+
+ // IF >= forge-1.19
+// targetPlayer.sendSystemMessage(mutableComponent);
+ // ELSE
+// targetPlayer.sendMessage(mutableComponent, UUID.randomUUID());
+ // END IF
+
+ webSocket.send("{\"code\":200,\"message\":\"Private message sent.\"}");
}
// IF > forge-1.16.5
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java b/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
index ee10d3f..0b1d1bb 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
@@ -54,7 +54,30 @@ public void handleSendTitleMessage(WebSocket webSocket, CommonSendTitle sendTitl
*/
@Override
public void handlePrivateMessage(WebSocket webSocket, String targetPlayerName, UUID targetPlayerUuid, List messageList) {
- webSocket.send("Unsupported API now.");
+ Player targetPlayer;
+ if (targetPlayerUuid != null)
+ targetPlayer = instance.getServer().getPlayer(targetPlayerUuid);
+ else if (targetPlayerName != null && !targetPlayerName.isEmpty())
+ targetPlayer = instance.getServer().getPlayer(targetPlayerName);
+ else {
+ webSocket.send("{\"code\":400,\"message\":\"Target player not found.\"}");
+ return;
+ }
+
+ if (targetPlayer == null) {
+ webSocket.send("{\"code\":400,\"message\":\"Target player is null.\"}");
+ return;
+ }
+
+ if (!targetPlayer.isOnline()) {
+ webSocket.send("{\"code\":400,\"message\":\"Target player is offline.\"}");
+ return;
+ }
+
+ TextComponent textComponent = parseJsonToEvent.parsePerMessageToTextComponent(Tool.getPrefixComponent());
+ textComponent.addExtra(parseJsonToEvent.parseMessageToTextComponent(messageList));
+ targetPlayer.sendMessage(textComponent.toLegacyText());
+ webSocket.send("{\"code\":200,\"message\":\"Private message sent.\"}");
}
@Override
diff --git a/velocity/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java b/velocity/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
index 6ebc06b..40575a7 100644
--- a/velocity/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
+++ b/velocity/origin/src/main/java/com/github/theword/queqiao/handle/HandleApiService.java
@@ -55,4 +55,4 @@ public void handlePrivateMessage(WebSocket webSocket, String targetPlayerName, U
}
webSocket.send("{ \"result\": 404, \"message\": \"Player not found\" }");
}
-}
+}
\ No newline at end of file
From 5a922c22616d359bf44d9564766603e2ab0a57d2 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Tue, 20 Aug 2024 00:18:51 +0800
Subject: [PATCH 50/55] =?UTF-8?q?feat(ParseJsonToEvent):=20=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E8=A7=A3=E6=9E=90=E9=80=BB=E8=BE=91=E4=BB=A5=E6=94=AF?=
=?UTF-8?q?=E6=8C=81=E4=B8=8D=E5=90=8C=E5=B9=B3=E5=8F=B0=E5=92=8C=E6=96=87?=
=?UTF-8?q?=E6=9C=AC=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
引入了对新文本样式的支持,并改进了事件处理机制,以提高代码的可读性和稳定性。调整物品ID解析以适应不同平台的需求,并统一了UUID的使用,增强了代码兼容性。
---
.../queqiao/utils/ParseJsonToEvent.java | 10 +++---
.../queqiao/utils/ParseJsonToEvent.java | 25 ++++++++++-----
.../queqiao/utils/ParseJsonToEvent.java | 31 ++++++++++---------
.../queqiao/utils/ParseJsonToEvent.java | 5 +--
4 files changed, 42 insertions(+), 29 deletions(-)
diff --git a/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 6a73652..b90b3d4 100644
--- a/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/fabric/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -8,10 +8,12 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.text.*;
+import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import java.util.List;
import java.util.Optional;
+import java.util.UUID;
public class ParseJsonToEvent {
@@ -64,7 +66,7 @@ public MutableText parsePerMessageToMultiText(CommonBaseComponent myBaseComponen
// ELSE
// style.withColor(TextColor.parse(myBaseComponent.getColor()));
// END IF
- }
+ } else style.withColor(TextColor.fromFormatting(Formatting.WHITE));
// 配置 TextComponent 额外属性
// IF > fabric-1.16.5
@@ -75,9 +77,9 @@ public MutableText parsePerMessageToMultiText(CommonBaseComponent myBaseComponen
// END IF
if (myTextComponent.getClickEvent() != null) {
// IF fabric-1.21
-// ClickEvent.Action tempAction = ClickEvent.Action.valueOf(myTextComponent.getClickEvent().getAction().toLowerCase());
+// ClickEvent.Action tempAction = ClickEvent.Action.valueOf(myTextComponent.getClickEvent().getAction());
// ELSE
-// ClickEvent.Action tempAction = ClickEvent.Action.byName(myTextComponent.getClickEvent().getAction().toLowerCase());
+// ClickEvent.Action tempAction = ClickEvent.Action.byName(myTextComponent.getClickEvent().getAction());
// END IF
ClickEvent clickEvent = new ClickEvent(tempAction, myTextComponent.getClickEvent().getValue());
style.withClickEvent(clickEvent);
@@ -103,7 +105,7 @@ public MutableText parsePerMessageToMultiText(CommonBaseComponent myBaseComponen
CommonHoverEntity commonHoverEntity = myTextComponent.getHoverEvent().getEntity();
Optional> entityType = EntityType.get(commonHoverEntity.getType());
if (entityType.isPresent()) {
- HoverEvent.EntityContent entityTooltipInfo = new HoverEvent.EntityContent(entityType.get(), commonHoverEntity.getUuid(), parseMessages(commonHoverEntity.getName()));
+ HoverEvent.EntityContent entityTooltipInfo = new HoverEvent.EntityContent(entityType.get(), UUID.randomUUID(), parseMessages(commonHoverEntity.getName()));
hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_ENTITY, entityTooltipInfo);
}
break;
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 32eaf75..36e1410 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -5,8 +5,10 @@
import com.github.theword.queqiao.tool.payload.modle.CommonHoverItem;
import com.github.theword.queqiao.tool.payload.modle.CommonTextComponent;
// IF >= forge-1.21
+//import net.minecraft.ChatFormatting;
//import net.minecraft.network.chat.contents.PlainTextContents.LiteralContents;
// ELSE IF >= forge-1.19
+//import net.minecraft.ChatFormatting;
//import net.minecraft.network.chat.contents.LiteralContents;
// ELSE >= forge-1.18
// END IF
@@ -31,6 +33,7 @@
// END IF
import java.util.List;
import java.util.Optional;
+import java.util.UUID;
public class ParseJsonToEvent {
@@ -61,17 +64,17 @@ public class ParseJsonToEvent {
// IF > forge-1.16.5
// public MutableComponent parsePerMessageToMultiText(CommonBaseComponent myBaseComponent) {
- // ELSE
+// ELSE
// public StringTextComponent parsePerMessageToMultiText(CommonBaseComponent myBaseComponent) {
- // END IF
+// END IF
- // IF >= forge-1.19
+// IF >= forge-1.19
// LiteralContents tempMutableComponent = new LiteralContents(myBaseComponent.getText());
// ELSE IF >= forge-1.18 && < forge-1.19
// TextComponent tempMutableComponent = new TextComponent(myBaseComponent.getText());
- // ELSE
+// ELSE
// StringTextComponent tempMutableComponent = new StringTextComponent(myBaseComponent.getText());
- // END IF
+// END IF
Style style = getStyleFromBaseComponent(myBaseComponent);
@@ -122,13 +125,15 @@ private Style getStyleFromBaseComponent(CommonBaseComponent myBaseComponent) {
// IF >= forge-1.21
// if (myBaseComponent.getColor() != null && !myBaseComponent.getColor().isEmpty())
// style = style.withColor(TextColor.parseColor(myBaseComponent.getColor()).getOrThrow());
-//
+// else style = style.withColor(TextColor.fromLegacyFormat(ChatFormatting.WHITE));
// ELSE IF > forge-1.16.5
// if (myBaseComponent.getColor() != null && !myBaseComponent.getColor().isEmpty())
// style = style.withColor(TextColor.parseColor(myBaseComponent.getColor()));
+// else style = style.withColor(TextColor.fromLegacyFormat(ChatFormatting.WHITE));
// ELSE
// if (myBaseComponent.getColor() != null && !myBaseComponent.getColor().isEmpty())
// style.withColor(Color.fromLegacyFormat(TextFormatting.valueOf(myBaseComponent.getColor().toUpperCase())));
+// else style.withColor(Color.fromLegacyFormat(TextFormatting.WHITE));
// END IF
return style;
}
@@ -147,7 +152,11 @@ private ClickEvent getClickEventFromBaseComponent(CommonTextComponent myTextComp
public HoverEvent getHoverEventFromBaseComponent(CommonTextComponent myTextComponent) {
HoverEvent hoverEvent = null;
- HoverEvent.Action> action = HoverEvent.Action.getByName(myTextComponent.getHoverEvent().getAction().toLowerCase());
+ // IF >= forge-1.21
+// HoverEvent.Action> action = HoverEvent.Action.SHOW_TEXT;
+ // ELSE
+// HoverEvent.Action> action = HoverEvent.Action.getByName(myTextComponent.getHoverEvent().getAction().toLowerCase());
+ // END IF
assert action != null;
if (action.equals(HoverEvent.Action.SHOW_TEXT)) {
if (myTextComponent.getHoverEvent().getBaseComponentList() != null && !myTextComponent.getHoverEvent().getBaseComponentList().isEmpty()) {
@@ -173,7 +182,7 @@ public HoverEvent getHoverEventFromBaseComponent(CommonTextComponent myTextCompo
Optional> entityType = EntityType.byString(commonHoverEntity.getType());
if (entityType.isPresent()) {
// IF > forge-1.16.5
-// HoverEvent.EntityTooltipInfo entityTooltipInfo = new HoverEvent.EntityTooltipInfo(entityType.get(), commonHoverEntity.getUuid(), parseMessages(commonHoverEntity.getName()));
+// HoverEvent.EntityTooltipInfo entityTooltipInfo = new HoverEvent.EntityTooltipInfo(entityType.get(), UUID.randomUUID(), parseMessages(commonHoverEntity.getName()));
// ELSE
// HoverEvent.EntityHover entityTooltipInfo = new HoverEvent.EntityHover(entityType.get(), UUID.randomUUID(), parseMessages(commonHoverEntity.getName()));
// END IF
diff --git a/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 4dd8559..80ea3ac 100644
--- a/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/spigot/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -18,6 +18,7 @@
import java.util.List;
import static com.github.theword.queqiao.tool.utils.Tool.debugLog;
+import static com.github.theword.queqiao.tool.utils.Tool.logger;
public class ParseJsonToEvent {
@@ -34,17 +35,17 @@ public TextComponent parsePerMessageToTextComponent(CommonBaseComponent myBaseCo
// 配置 BaseComponent 基本属性
msgComponent.setText(myBaseComponent.getText());
if (myBaseComponent.getColor() != null && !myBaseComponent.getColor().isEmpty())
- // IF spigot-1.12.2
+ // IF spigot-1.12.2
// msgComponent.setColor(ChatColor.valueOf(myBaseComponent.getColor()));
- // ELSE
+ // ELSE
// msgComponent.setColor(ChatColor.of(myBaseComponent.getColor().toUpperCase()));
- // END IF
-
- if (myBaseComponent.isBold()) msgComponent.setBold(true);
- if (myBaseComponent.isItalic()) msgComponent.setItalic(true);
- if (myBaseComponent.isUnderlined()) msgComponent.setUnderlined(true);
- if (myBaseComponent.isStrikethrough()) msgComponent.setStrikethrough(true);
- if (myBaseComponent.isObfuscated()) msgComponent.setObfuscated(true);
+ // END IF
+ else msgComponent.setColor(ChatColor.WHITE);
+ msgComponent.setBold(myBaseComponent.isBold());
+ msgComponent.setItalic(myBaseComponent.isItalic());
+ msgComponent.setUnderlined(myBaseComponent.isUnderlined());
+ msgComponent.setStrikethrough(myBaseComponent.isStrikethrough());
+ msgComponent.setObfuscated(myBaseComponent.isObfuscated());
// 配置 TextComponent 额外属性
if (myBaseComponent instanceof CommonTextComponent) {
@@ -83,15 +84,15 @@ private HoverEvent getHoverEvent(CommonTextComponent myTextComponent) {
// hoverEvent = new HoverEvent(action, new Text(baseComponent));
// break;
// case SHOW_ITEM:
-// CommonHoverItem commonHoverItem = myTextComponent.getHoverEvent().getItem();
-// ItemTag itemTag = ItemTag.ofNbt(commonHoverItem.getTag());
-// Item item = new Item(commonHoverItem.getId(), commonHoverItem.getCount(), itemTag);
+// CommonHoverItem myHoverItem = myTextComponent.getHoverEvent().getItem();
+// ItemTag itemTag = ItemTag.ofNbt(myHoverItem.getTag());
+// Item item = new Item(String.valueOf(myHoverItem.getId()), myHoverItem.getCount(), itemTag);
// hoverEvent = new HoverEvent(action, item);
// break;
// case SHOW_ENTITY:
-// CommonHoverEntity commonHoverEntity = myTextComponent.getHoverEvent().getEntity();
-// TextComponent nameComponent = parseMessageToTextComponent(commonHoverEntity.getName());
-// Entity entity = new Entity(commonHoverEntity.getType(), commonHoverEntity.getId(), nameComponent);
+// CommonHoverEntity myHoverEntity = myTextComponent.getHoverEvent().getEntity();
+// TextComponent nameComponent = parseMessageToTextComponent(myHoverEntity.getName());
+// Entity entity = new Entity(myHoverEntity.getType(), myHoverEntity.getId(), nameComponent);
// hoverEvent = new HoverEvent(action, entity);
// break;
// default:
diff --git a/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 5dfbe4b..dfc52aa 100644
--- a/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/velocity/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -4,6 +4,7 @@
import com.github.theword.queqiao.tool.payload.modle.CommonTextComponent;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.format.NamedTextColor;
@@ -26,8 +27,9 @@ public Component parseMessage(List extends CommonBaseComponent> commonBaseComp
public Component parsePerMessageToMultiText(CommonBaseComponent commonBaseComponent) {
Component component = Component.text(commonBaseComponent.getText());
- if (commonBaseComponent.getColor() != null && !commonBaseComponent.getColor().isEmpty())
+ if (commonBaseComponent.getColor() != null)
component = component.color(getNamedTextColor(commonBaseComponent.getColor()));
+ else component = component.color(NamedTextColor.WHITE);
component = getTextStyle(commonBaseComponent, component);
@@ -39,7 +41,6 @@ public Component parsePerMessageToMultiText(CommonBaseComponent commonBaseCompon
component = component.hoverEvent(getHoverEvent(commonTextComponent));
}
-
return component;
}
From 8ea6c32c81fbc452571cfe059b1149ef920f6fe9 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Tue, 20 Aug 2024 00:19:18 +0800
Subject: [PATCH 51/55] :bookmark: Bump version 0.0.2
---
version.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version.txt b/version.txt
index 8a9ecc2..7bcd0e3 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-0.0.1
\ No newline at end of file
+0.0.2
\ No newline at end of file
From bc5ab6dd111615aeaa3dfd426d6473931e1634ca Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Tue, 20 Aug 2024 00:21:27 +0800
Subject: [PATCH 52/55] =?UTF-8?q?refactor(build.yml):=20=E7=A7=BB=E9=99=A4?=
=?UTF-8?q?=E4=BA=86=E5=9C=A8'push'=E4=BA=8B=E4=BB=B6=E4=B8=AD=E4=B8=8A?=
=?UTF-8?q?=E4=BC=A0=E6=9E=84=E5=BB=BA=20artifact=20=E7=9A=84=E6=9D=A1?=
=?UTF-8?q?=E4=BB=B6=E9=99=90=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/build.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 5204637..f443694 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -61,7 +61,6 @@ jobs:
cd ../..
- uses: actions/upload-artifact@v4
- if: ${{ github.event_name == 'push' }}
with:
name: QueQiao-${{ matrix.config.mc-loader }}+${{ matrix.config.mc-version }}-${{ env.MOD_VERSION }}.jar
path: QueQiao-jar/${{ env.MOD_VERSION }}/QueQiao-${{ matrix.config.mc-loader }}+${{ matrix.config.mc-version }}-${{ env.MOD_VERSION }}.jar
From 7d29d0e67e24470b2313ad43e23ebdd8a0b271c0 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Tue, 20 Aug 2024 00:28:20 +0800
Subject: [PATCH 53/55] :bug: Fix build with 1.16.5
---
forge/origin/build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/forge/origin/build.gradle b/forge/origin/build.gradle
index 2af774f..0d1766a 100644
--- a/forge/origin/build.gradle
+++ b/forge/origin/build.gradle
@@ -86,7 +86,7 @@ repositories {
}
}
-// IF > forge-1.12.2
+// IF > forge-1.16.5
//jarJar.enable()
//tasks.named('jarJar') {
// archiveClassifier.set('')
From 2264d8f04adb3bc2108f31bd327efc9807615061 Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Tue, 20 Aug 2024 00:28:32 +0800
Subject: [PATCH 54/55] :bug: Fix Color import with 1.18.2
---
.../java/com/github/theword/queqiao/utils/ParseJsonToEvent.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
index 36e1410..0634239 100644
--- a/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
+++ b/forge/origin/src/main/java/com/github/theword/queqiao/utils/ParseJsonToEvent.java
@@ -14,6 +14,7 @@
// END IF
// IF > forge-1.16.5
+//import net.minecraft.ChatFormatting;
//import net.minecraft.network.chat.*;
//import net.minecraft.resources.ResourceLocation;
//import net.minecraft.world.entity.EntityType;
From 708256feecbb28f83a97dc67f0f2a8bdffc8c36d Mon Sep 17 00:00:00 2001
From: 17TheWord <17theword@gmail.com>
Date: Tue, 20 Aug 2024 00:59:14 +0800
Subject: [PATCH 55/55] :memo: Remove '(Demo)' tag from 'Private' API
documentation
---
README.md | 2 +-
README_EN.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 58d55fc..7a3a110 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@
- [`Broadcast`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
- [`Title & SubTitle`](https://github.com/17TheWord/QueQiao/wiki/5.-API#title--subtitle)
- [`ActionBar`](https://github.com/17TheWord/QueQiao/wiki/5.-API#actionbar)
- - [`Private`](https://github.com/17TheWord/QueQiao/wiki/5.-API#private) (Demo)
+ - [`Private`](https://github.com/17TheWord/QueQiao/wiki/5.-API#private)
## 快速开始
diff --git a/README_EN.md b/README_EN.md
index b300f5b..95b4624 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -55,7 +55,7 @@
- [`Broadcast`](https://github.com/17TheWord/QueQiao/wiki/4.-%E5%9F%BA%E6%9C%AC%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B)
- [`Title & SubTitle`](https://github.com/17TheWord/QueQiao/wiki/5.-API#title--subtitle)
- [`ActionBar`](https://github.com/17TheWord/QueQiao/wiki/5.-API#actionbar)
- - [`Private`](https://github.com/17TheWord/QueQiao/wiki/5.-API#private) (Demo)
+ - [`Private`](https://github.com/17TheWord/QueQiao/wiki/5.-API#private)
## Quick Start