forked from ChomeNS/chipmunkmod
sexy
This commit is contained in:
parent
d1dc686c4a
commit
536fcdf62d
1 changed files with 10 additions and 0 deletions
|
@ -1,15 +1,20 @@
|
||||||
package land.chipmunk.chipmunkmod.mixin;
|
package land.chipmunk.chipmunkmod.mixin;
|
||||||
|
|
||||||
import land.chipmunk.chipmunkmod.modules.CustomChat;
|
import land.chipmunk.chipmunkmod.modules.CustomChat;
|
||||||
|
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import land.chipmunk.chipmunkmod.command.CommandManager;
|
import land.chipmunk.chipmunkmod.command.CommandManager;
|
||||||
|
|
||||||
@Mixin(net.minecraft.client.gui.screen.ChatScreen.class)
|
@Mixin(net.minecraft.client.gui.screen.ChatScreen.class)
|
||||||
public class ChatScreenMixin {
|
public class ChatScreenMixin {
|
||||||
|
@Shadow protected TextFieldWidget chatField;
|
||||||
|
|
||||||
@Inject(at = @At("HEAD"), method = "sendMessage", cancellable = true)
|
@Inject(at = @At("HEAD"), method = "sendMessage", cancellable = true)
|
||||||
public void sendMessage(String chatText, boolean addToHistory, CallbackInfoReturnable<Boolean> cir) {
|
public void sendMessage(String chatText, boolean addToHistory, CallbackInfoReturnable<Boolean> cir) {
|
||||||
if (chatText.startsWith(CommandManager.prefix)) {
|
if (chatText.startsWith(CommandManager.prefix)) {
|
||||||
|
@ -26,4 +31,9 @@ public class ChatScreenMixin {
|
||||||
cir.setReturnValue(true);
|
cir.setReturnValue(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;setMaxLength(I)V"), method = "init")
|
||||||
|
public void init (CallbackInfo ci) {
|
||||||
|
chatField.setMaxLength(Integer.MAX_VALUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue