Autocorrect Mod 1.4.5

Joined
Jul 2, 2012
Messages
1,080
Reaction score
950
Points
0
Redid a few things, made it easier to update, next time I will make it so you can add your own corrections.

For those who are interested, the source:
Code:
package net.minecraft.src;
 
import java.util.*;
 
import net.minecraft.client.Minecraft;
 
import org.lwjgl.input.Keyboard;
public class CorrectChat {
 
public static String chatMessage;
static List<String> replacementList = new ArrayList<String>();
static String[] subList;
public static String correctedMessage;
public static boolean showGui = false;
private static boolean[] keyStates = new boolean[256];
public static boolean autoCorrect;
 
public static boolean checkKey(int i, Minecraft mc)
    {
        if(mc.currentScreen !=null) {
                return false;
        }
        if(Keyboard.isKeyDown(i) != keyStates[i]) {
                return keyStates[i] = !keyStates[i];
        } else {
                return false;
        }
    }
 
public static void keyBinds(Minecraft mc) {
   
   if (checkKey(Keyboard.KEY_ESCAPE, mc)) {showGui = false;}
   if (checkKey(Keyboard.KEY_GRAVE, mc)) {showGui = true;}
   
    }
 
public static void onUpdate(Minecraft mc)
{
keyBinds(mc);
if(showGui) {mc.displayGuiScreen(new AutoCorrectGUI());}
}
 
public static void Main()
{
establishCorrections();
changeToLowerCase(chatMessage);
correctUserInput(chatMessage);
capitalise(chatMessage);
correctedMessage = chatMessage;
}
 
public static void establishCorrections()
{
addToCorrections("fuck", "fudge");
addToCorrections(" baba ", " hoe ");
addToCorrections(" teh ", " the ");
addToCorrections(" waht ", " what ");
addToCorrections(" u ", " you ");
}
 
public static void changeToLowerCase(String par1Str)
{
chatMessage = par1Str.toLowerCase();
}
 
public static void capitalise(String par1Str)
{
chatMessage = chatMessage.substring(0, 1).toUpperCase() + chatMessage.substring(1).toLowerCase();
replace(" i ", " I ");
replace(" im ", " I'm ");
replace(" i'm ", " I'm ");
replace(" Im ", " I'm ");
}
 
public static void addToCorrections(String par1Str, String par2Str)
{
replacementList.add(par1Str + ":" + par2Str);
}
 
public static void recieveChatMessageFromOriginalClass(String chatMessageX)
{
chatMessage = chatMessageX;
Main();
}
 
public static void replace(String par1Str, String par2Str)
{
chatMessage = chatMessage.replaceAll(par1Str, par2Str);
}
 
public static void correctUserInput(String par1Str)
{
String regex = ":";
for(String z: replacementList)
{
subList = z.split(regex);
replace(subList[0], subList[1]);
}
}
}
Code:
package net.minecraft.src;
 
import net.minecraft.src.GuiButton;
 
 
public class AutoCorrectGUI extends GuiScreen {
 
public void initGui()
{
controlList.clear();
controlList.add(new GuiButton(1, 70, 5, 20, 20, ""));
 
}
public void drawScreen(int i, int j, float f) 
{
drawRect(2, 2, 100, 30, 0x80808080);
//Toggles
if(CorrectChat.autoCorrect) {mc.fontRenderer.drawString("Auto Correct", 3, 12, 0x00FF00);}
else {mc.fontRenderer.drawString("Auto Correct", 3, 12, 0xFF0000);}
super.drawScreen(i, j, f);
}
 
 
public void actionPerformed(GuiButton guiButton)
{switch (guiButton.id) 
{
case 1: 
CorrectChat.autoCorrect = !CorrectChat.autoCorrect;
break;
}
}
}

How to use:
To enable autocorrect hit the ~ key (above tab), and click autocorrect to toggle. Hit escape to exit the gui. It will only correct a few common things, capitalise your sentence, etc.

Download:
AutoCorrect.rar

Installation instructions:
How to install:
1. Open start menu
2. Type %appdata% in the search bar and hit enter
3. .Minecraft>bin
4. Right click on minecraft.jar and select open with> WinRAR or 7zip
5. Delete META-INF
6. Drag the paste files into your minecraft.jar which you have open in WinRAR.

If you want to add any corrections, lemme know.
 
I once wanted to make an anti-swear/caps mod, then realized the server wasn't going to make everybody to download it. >:)
 
You did this? It doesn't earn a 'Like' unless you did it ALL[DOUBLEPOST=1354930997][/DOUBLEPOST]I'm testing it, if it does grammatical errors, it definitely receives a like
 
Well then.

There are so many grammatical errors, I can't possibly do them all. If you want to suggest a ton of them to add, do so in the following format:

addToCorrections(" WhatYouWantToReplace ", " WhatYouWantToReplaceItWith ");
 
I added changing the f word to "fudge", but that was really for my own self moderation, tbh.
Edit: The forums changed the word in my code to ****, not me, if you're wondering.
 
Im gonna download this and do alot of word changes myself when i get to install the modding thingys :P
 
Going on Eclipse to make a mod similar to what Illogical did, except I'm that I'm changing almost everything you say to either "I use Nodus." or various Aimbot commands that I've seen scattered around the Internet. I'm also going to leave all swears as normal.
 
Just realized that. :( So you won't give me all of the code to run it? :P[DOUBLEPOST=1354935063][/DOUBLEPOST]I wasn't even copying and pasting it; I was typing it by hand. Got about half of it done. :)
 
Lol, half the members are banned before the mods catch on.....
 
Copied and pasted everything on the gui and autocorrect.class
now i need to know what to do with ayk.class : /
 
*Sigh*
Everyone, please stop trying to edit this with notepad, it won't work, and I'm not in the mood to explain why it won't work. As you have probably noticed when you open it in notepad it's just a ton of weird symbols. If you want me to add something, just tell me what you would like me to add.
 
i use eclipse[DOUBLEPOST=1354936630][/DOUBLEPOST]have made a armor/weapon mod before.. but didn't release it