Skip to content

Commit

Permalink
1.18.2及以下版本移除控制台与Discord聊天的功能
Browse files Browse the repository at this point in the history
Fixes #197
  • Loading branch information
Xujiayao committed Dec 15, 2023
1 parent dd887f8 commit 00daa7e
Showing 1 changed file with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
//$$ import net.minecraft.server.filter.FilteredMessage;
//#endif
import net.minecraft.server.network.ServerPlayerEntity;
//#if MC < 11900
//$$ import net.minecraft.text.Text;
//#endif
import okhttp3.MediaType;
import okhttp3.Request;
import okhttp3.RequestBody;
Expand All @@ -32,10 +29,6 @@
import top.xujiayao.mcdiscordchat.utils.Translations;
import top.xujiayao.mcdiscordchat.utils.Utils;

//#if MC < 11900
//$$ import java.util.UUID;
//#endif

//#if MC == 11900
//$$ import java.util.Objects;
//#endif
Expand Down Expand Up @@ -69,22 +62,8 @@ private void broadcast(SignedMessage message, ServerCommandSource source, Messag
//$$ private void broadcast(FilteredMessage<SignedMessage> message, ServerCommandSource source, RegistryKey<MessageType> typeKey, CallbackInfo ci) {
//$$ sendMessage(Objects.requireNonNull(message.filtered()).signedContent().getString(), source.getName());
//$$ }
//#elseif MC >= 11800
//$$ @Inject(method = "broadcast", at = @At("RETURN"))
//$$ private void broadcast(Text message, MessageType type, UUID sender, CallbackInfo ci) {
//$$ sendMessage(message.getString(), "Server");
//$$ }
//#elseif MC >= 11600
//$$ @Inject(method = "broadcastChatMessage", at = @At("RETURN"))
//$$ private void broadcastChatMessage(Text message, MessageType type, UUID sender, CallbackInfo ci) {
//$$ sendMessage(message.getString(), "Server");
//$$ }
//#else
//$$ @Inject(method = "sendToAll(Lnet/minecraft/text/Text;)V", at = @At("RETURN"))
//$$ private void sendToAll(Text text, CallbackInfo ci) {
//$$ sendMessage(text.getString(), "Server");
//$$ }
//#endif
// This feature has been removed in versions 1.18.2 and below due to compatibility issues

private void sendMessage(String content, String username) {
if (CONFIG.generic.broadcastChatMessages) {
Expand Down

0 comments on commit 00daa7e

Please sign in to comment.