
crazykid080
Members-
Posts
13 -
Joined
-
Last visited
Everything posted by crazykid080
-
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
I still need help with getting the command to fire, there is no errors being shown package com.crazykid080.ClearChat.client.handler; import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.GuiNewChat; import com.crazykid080.ClearChat.client.settings.Keybindings; import com.crazykid080.ClearChat.reference.Key; import com.crazykid080.ClearChat.utility.LogHelper; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.InputEvent; public class KeyInputEventHandler { private static Key getPressedKeyBinding(){ if (Keybindings.clear.isPressed()){ return Key.CLEAR; }else{ return null; } } @SubscribeEvent public void handleKeyInputEvent(InputEvent.KeyInputEvent event){ Key pressedKey = getPressedKeyBinding(); LogHelper.debug(pressedKey); if (pressedKey != null){ if(pressedKey.equals(Key.CLEAR)){ deleteChatLine(1); LogHelper.info("fired"); }else{ } } } private void deleteChatLine(int p_146242_1_2) { } } -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
You never did a nullpointer check seeing whether there was not any buttons being pressed. my dad helped me with that -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
well I have fixed it, but now I need to find out how to get the code working I have it like this package com.crazykid080.ClearChat.client.handler; import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.GuiNewChat; import com.crazykid080.ClearChat.client.settings.Keybindings; import com.crazykid080.ClearChat.reference.Key; import com.crazykid080.ClearChat.utility.LogHelper; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.InputEvent; public class KeyInputEventHandler { private static Key getPressedKeyBinding(){ if (Keybindings.clear.isPressed()){ return Key.CLEAR; }else{ return null; } } int field_146253_i = 1; int p_146242_1_ = 1; @SubscribeEvent public void handleKeyInputEvent(InputEvent.KeyInputEvent event){ Key pressedKey = getPressedKeyBinding(); LogHelper.info(pressedKey); if (pressedKey != null){ if(pressedKey.equals(Key.CLEAR)){ LogHelper.fatal("IT WORKED"); GuiIngame gui = getChatGUI(); GuiNewChat newChat = gui.getChatGUI(); newChat.deleteChatLine(p_146242_1_); }else{ } } } private GuiIngame getChatGUI() { return null; } } -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
removed anything not an error report/stack trace -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
ok, realized that the if statement wasn't firing, so after I changed it, it crashed me, am I doing something wrong in the code? package com.crazykid080.ClearChat.client.handler; import net.minecraft.client.gui.GuiNewChat; import com.crazykid080.ClearChat.client.settings.Keybindings; import com.crazykid080.ClearChat.reference.Key; import com.crazykid080.ClearChat.utility.LogHelper; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.InputEvent; public class KeyInputEventHandler { private static Key getPressedKeyBinding(){ if (Keybindings.clear.isPressed()){ return Key.CLEAR; }else{ return null; } } public int field_146253_i = 1; public int p_146242_1_ = 1; void deleteChatLine(){ } void clearChatMessages(){ } @SubscribeEvent public void handleKeyInputEvent(InputEvent.KeyInputEvent event){ LogHelper.info(getPressedKeyBinding()); if(getPressedKeyBinding().equals(Key.CLEAR)){ LogHelper.fatal("IT WORKED"); //deleteChatLine(); //clearChatMessages(); }else{ } } } -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
Well I figured out how to implement it non-statically, but now I'm having trouble checking if its the correct keybinding and why it's not being called code: private static Key getPressedKeyBinding(){ if (Keybindings.clear.isPressed()){ return Key.CLEAR; }else{ return null; } } public int field_146253_i = 1; public int p_146242_1_ = 1; void deleteChatLine(){ } @SubscribeEvent public void handleKeyInputEvent(InputEvent.KeyInputEvent event){ LogHelper.debug(getPressedKeyBinding()); if(getPressedKeyBinding() != null){ deleteChatLine(); }else{ } } } -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
ok, then how do I fix it? -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
how so? I see no relevant static declarations for that method -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
that did help and I found a better method for what I want but after I implemented the method it needed, it still said that I am implementing a static reference, the declaration for this method is: public void deleteChatLine(int p_146242_1_) { Iterator iterator = this.field_146253_i.iterator(); ChatLine chatline; while (iterator.hasNext()) { chatline = (ChatLine)iterator.next(); if (chatline.getChatLineID() == p_146242_1_) { iterator.remove(); } } and I have my code set up like this: private static Key getPressedKeyBinding(){ if (Keybindings.clear.isPressed()){ return Key.CLEAR; }else{ return null; } } @SubscribeEvent public void handleKeyInputEvent(InputEvent.KeyInputEvent event){ LogHelper.info(getPressedKeyBinding()); if(Keybindings.clear.isPressed()){ GuiNewChat.deleteChatLine(1); } } } -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
ok, how am I supposed to set up the instance? I looked at the class where the declaration is and I am confused, I tried multiple ways of setting up the instance but none seem to work -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
having trouble with the GuiNewChat, It is saying that I'm making a static reference to a non static method Here is how my key input event handler is set up right now public class KeyInputEventHandler { private static Key getPressedKeyBinding(){ if (Keybindings.clear.isPressed()){ return Key.CLEAR; }else{ return null; } } @SubscribeEvent public void handleKeyInputEvent(InputEvent.KeyInputEvent event){ LogHelper.info(getPressedKeyBinding()); if(Keybindings.clear.isPressed()){ GuiNewChat.refreshChat(); } } } -
[1.7.10] Removing a line of chat from the client
crazykid080 replied to crazykid080's topic in Modder Support
What the hell dude... of course he can. Take a look at GuiNewChat, it has methods to remove from text. As for KeyBindings... there are enough tutorials. ok, thanks, I'll try it -
I'm making a mod for removing the most recent line in chat from the client, what I don't know is: 1 where to execute the full command for the key binding 2 what the code is to remove the most recent line of code