Fix Player.Spigot#sendMessage
This commit is contained in:
parent
6bb2d703ee
commit
7023a576e6
|
@ -1,18 +0,0 @@
|
|||
package io.izzel.arclight.common.mixin.bukkit;
|
||||
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import org.bukkit.craftbukkit.v.command.BukkitCommandWrapper;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(BukkitCommandWrapper.class)
|
||||
public class BukkitCommandWrapperMixin {
|
||||
|
||||
@Redirect(method = "run", remap = false, at = @At(value = "INVOKE", target = "Lcom/mojang/brigadier/context/CommandContext;getInput()Ljava/lang/String;"))
|
||||
public String arclight$removeSlash(CommandContext<?> context) {
|
||||
String input = context.getInput();
|
||||
if (input.startsWith("/")) return input.substring(1);
|
||||
return input;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package io.izzel.arclight.common.mixin.core.network.protocol.game;
|
||||
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.chat.ComponentSerializer;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.game.ClientboundSystemChatPacket;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(ClientboundSystemChatPacket.class)
|
||||
public class ClientboundSystemChatPacketMixin {
|
||||
|
||||
public void arclight$constructor(Component content, boolean overlay) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
public void arclight$constructor(String content, boolean overlay) {
|
||||
arclight$constructor(Component.Serializer.fromJson(content), overlay);
|
||||
}
|
||||
|
||||
public void arclight$constructor(BaseComponent[] content, boolean overlay) {
|
||||
arclight$constructor(ComponentSerializer.toString(content), overlay);
|
||||
}
|
||||
}
|
|
@ -126,6 +126,7 @@ public class ArclightMixinPlugin implements IMixinConfigPlugin {
|
|||
.add("net.minecraft.network.chat.TextColor")
|
||||
.add("net.minecraft.commands.Commands")
|
||||
.add("net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess")
|
||||
.add("net.minecraft.network.protocol.game.ClientboundSystemChatPacket")
|
||||
.build();
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
},
|
||||
"compatibilityLevel": "JAVA_11",
|
||||
"mixins": [
|
||||
"BukkitCommandWrapperMixin",
|
||||
"ColouredConsoleSenderMixin",
|
||||
"CraftAbstractVillagerMixin",
|
||||
"CraftBlockMixin",
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
"network.chat.TextColorMixin",
|
||||
"network.protocol.PacketThreadUtilMixin",
|
||||
"network.protocol.game.CCloseWindowPacketMixin",
|
||||
"network.protocol.game.ClientboundSystemChatPacketMixin",
|
||||
"network.protocol.game.CPlayerTryUseItemOnBlockPacketMixin",
|
||||
"network.protocol.game.CPlayerTryUseItemPacketMixin",
|
||||
"network.protocol.game.SWorldBorderPacketMixin",
|
||||
|
|
Loading…
Reference in New Issue
Block a user