net.minecraft.client.gui.GuiNewChat Java Examples

The following examples show how to use net.minecraft.client.gui.GuiNewChat. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WrapperGuiNewChat.java    From ClientBase with MIT License 4 votes vote down vote up
public WrapperGuiNewChat(GuiNewChat var1) {
    super(var1);
    this.real = var1;
}
 
Example #2
Source File: WrapperGuiNewChat.java    From ClientBase with MIT License 4 votes vote down vote up
public static int calculateChatboxWidth(float var0) {
    return GuiNewChat.calculateChatboxWidth(var0);
}
 
Example #3
Source File: WrapperGuiNewChat.java    From ClientBase with MIT License 4 votes vote down vote up
public static int calculateChatboxHeight(float var0) {
    return GuiNewChat.calculateChatboxHeight(var0);
}
 
Example #4
Source File: WrapperGuiNewChat.java    From ClientBase with MIT License 4 votes vote down vote up
public GuiNewChat unwrap() {
    return this.real;
}
 
Example #5
Source File: HyperiumGuiNewChat.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
public HyperiumGuiNewChat(GuiNewChat parent) {
    this.parent = parent;
}
 
Example #6
Source File: CompactChat.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Check for when a message comes through
 *
 * @param event called whenever a message is sent through chat
 */
@InvokeEvent(priority = Priority.LOW)
public void onChat(ChatEvent event) {
    // Check for the if the user has it enabled and if the message wasn't cancelled
    if (Settings.COMPACT_CHAT && !event.isCancelled()) {

        // Get the chat instance
        GuiNewChat guiNewChat = Minecraft.getMinecraft().ingameGUI.getChatGUI();

        // If the last message sent is the same as the newly posted message
        if (lastMessage.equals(event.getChat().getUnformattedText())) {

            // Delete the message
            guiNewChat.deleteChatLine(line);

            // Increase the amount of times it's been sent
            amount++;

            // Set the last message to be the newly posted message
            lastMessage = event.getChat().getUnformattedText();

            // Append (amount of times it's been sent) to the last message
            event.getChat().appendText(ChatColor.GRAY + " (" + amount + ")");
        } else {

            // Otherwise it's never been sent
            amount = 1;

            // Set the last message to be the newly posted message
            lastMessage = event.getChat().getUnformattedText();
        }

        // Increase the line the message was on
        line++;

        // Check if the event wasn't cancelled
        if (!event.isCancelled()) {

            // Print the chat message and allow it to be deleted
            guiNewChat.printChatMessageWithOptionalDeletion(event.getChat(), line);
        }

        // If the message has been sent 256 times
        if (line > 256) {

            // Set it to 0 again
            line = 0;
        }

        // Cancel the message
        event.setCancelled(true);
    }
}
 
Example #7
Source File: MixinMinecraft.java    From VanillaFix with MIT License 4 votes vote down vote up
/** @reason Add the F3 + M help message to the F3 + Q debug help menu. */
@Inject(method = "processKeyF3", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;printChatMessage(Lnet/minecraft/util/text/ITextComponent;)V", ordinal = 9), locals = LocalCapture.CAPTURE_FAILHARD)
private void addF3SHelpMessage(int auxKey, CallbackInfoReturnable<Boolean> cir, GuiNewChat chatGui) {
    chatGui.printChatMessage(new TextComponentTranslation("vanillafix.debug.draw_texture_map.help"));
}
 
Example #8
Source File: MixinMinecraft.java    From VanillaFix with MIT License 4 votes vote down vote up
/** @reason Message is sent from screenshot method now. */
@Redirect(method = "dispatchKeypresses", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;printChatMessage(Lnet/minecraft/util/text/ITextComponent;)V", ordinal = 0))
private void sendScreenshotMessage(GuiNewChat guiNewChat, ITextComponent chatComponent) {}
 
Example #9
Source File: MixinMinecraft.java    From VanillaFix with MIT License 4 votes vote down vote up
/** @reason Add the F3 + S help message to the F3 + Q debug help menu. */
@Inject(method = "processKeyF3", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;printChatMessage(Lnet/minecraft/util/text/ITextComponent;)V", ordinal = 9), locals = LocalCapture.CAPTURE_FAILHARD)
private void addF3SHelpMessage(int auxKey, CallbackInfoReturnable<Boolean> cir, GuiNewChat chatGui) {
    chatGui.printChatMessage(new TextComponentTranslation("vanillafix.debug.switch_profiler.help"));
}