Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

crazykid080

Members
  • Joined

  • Last visited

Everything posted by crazykid080

  1. 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) { } }
  2. You never did a nullpointer check seeing whether there was not any buttons being pressed. my dad helped me with that
  3. 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; } }
  4. removed anything not an error report/stack trace
  5. 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{ } } }
  6. 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{ } } }
  7. how so? I see no relevant static declarations for that method
  8. 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); } } }
  9. 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
  10. 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(); } } }
  11. 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
  12. 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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.