Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Refactor: Migrate to Mojang Mappings & Utilize Listener for Minecraft Events #216

Merged
merged 36 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2df617c
开始移植到Mojang Mappings
Xujiayao Feb 8, 2024
92d3244
暂时禁用其它MC版本
Xujiayao Feb 8, 2024
889b963
修复服务器TPS显示错误
Xujiayao Feb 8, 2024
b2e30b0
非Minecraft部分重构
Xujiayao Feb 8, 2024
72d1e19
处理 Join & Leave
Xujiayao Feb 8, 2024
603b1af
处理 Die
Xujiayao Feb 8, 2024
d19726f
处理 Advancement
Xujiayao Feb 8, 2024
6a43f83
测试GitHub Actions编译
Xujiayao Feb 8, 2024
9b307ac
移除无用类
Xujiayao Feb 8, 2024
e529721
处理 Message
Xujiayao Feb 8, 2024
91611d8
简化
Xujiayao Feb 8, 2024
13741ef
处理 Command
Xujiayao Feb 8, 2024
b209913
处理 Server /say message
Xujiayao Feb 8, 2024
2183c64
多版本编译要求写全
Xujiayao Feb 8, 2024
dc96afc
CommandOutput -> CommandSource
Xujiayao Feb 9, 2024
d6845a8
使用Carpet法获取TPS和MSPT(1.20.3+)
Xujiayao Feb 9, 2024
e0742e0
删除已完成TODO
Xujiayao Feb 9, 2024
304a7a2
Compat TODO
Xujiayao Feb 9, 2024
04c0f01
兼容1.20.2
Xujiayao Feb 9, 2024
285961e
兼容1.20.1
Xujiayao Feb 9, 2024
5fccf6a
兼容1.19.4
Xujiayao Feb 9, 2024
42f6096
兼容1.19.3(或许不需要?)
Xujiayao Feb 9, 2024
d60baa3
兼容1.19.2
Xujiayao Feb 9, 2024
c870eb0
PLAYER_COMMAND 改为 (player, command)
Xujiayao Feb 9, 2024
b9f301d
兼容1.19
Xujiayao Feb 9, 2024
ed54cf6
PLAYER_COMMAND 传 / 开头的指令字符串
Xujiayao Feb 10, 2024
a28a873
SERVER_MESSAGE 和 PLAYER_MESSAGE 直接传字符串
Xujiayao Feb 10, 2024
2f3fe0c
兼容1.18.2
Xujiayao Feb 10, 2024
e3e97c6
兼容1.17.1(或许不需要?)
Xujiayao Feb 10, 2024
ea5a512
傻了
Xujiayao Feb 10, 2024
26ebc2a
兼容1.16.5
Xujiayao Feb 10, 2024
a138b4f
兼容1.15.2,开始检查各版本Runtime兼容性
Xujiayao Feb 10, 2024
1c8961d
死亡消息优化:更好的多语言支持
Xujiayao Feb 10, 2024
41df66e
Compat
Xujiayao Feb 10, 2024
3fd5fb3
修复各版本Mixin报错
Xujiayao Feb 10, 2024
979f18f
MixinLanguage
Xujiayao Feb 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CommandOutput -> CommandSource
  • Loading branch information
Xujiayao committed Feb 9, 2024
commit dc96afc03a3d69e121d8691cfcf0fde51ed42fa3
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
/**
* @author Xujiayao
*/
public class DiscordCommandOutput implements CommandSource {
public class DiscordCommandSource implements CommandSource {

private final SlashCommandInteractionEvent e;
private StringBuilder output = new StringBuilder("```\n");
private long lastOutputMillis = 0;

public DiscordCommandOutput(SlashCommandInteractionEvent e) {
public DiscordCommandSource(SlashCommandInteractionEvent e) {
this.e = e;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void onSlashCommandInteraction(SlashCommandInteractionEvent e) {
e.getHook().sendMessage(Translations.translate("discord.deListener.oscInteraction.executingCommand"))
.submit()
.whenComplete((v, ex) -> {
CommandSourceStack source = new CommandSourceStack(new DiscordCommandOutput(e), Vec3.ZERO, Vec2.ZERO, SERVER.overworld(), 4, "MC-Discord-Chat", Component.literal("MC-Discord-Chat"), SERVER, null);
CommandSourceStack source = new CommandSourceStack(new DiscordCommandSource(e), Vec3.ZERO, Vec2.ZERO, SERVER.overworld(), 4, "MC-Discord-Chat", Component.literal("MC-Discord-Chat"), SERVER, null);
ParseResults<CommandSourceStack> results = SERVER.getCommands().getDispatcher().parse(command, source);
SERVER.getCommands().performCommand(results, command);
});
Expand Down