aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/rosegoldaddons/mixins/MixinRenderString.java
diff options
context:
space:
mode:
authorRoseGoldIsntGay <yoavkau@gmail.com>2022-07-27 21:47:43 +0300
committerRoseGoldIsntGay <yoavkau@gmail.com>2022-07-27 21:47:43 +0300
commit170ccfa42e36f04306820fbc3ef8a8ce3cf75010 (patch)
tree6728741f9a9befcb71ce1f27262073c984affe9a /src/main/java/rosegoldaddons/mixins/MixinRenderString.java
parent854c131bf7965cef66d37e80640999242c9e0d65 (diff)
downloadRGA-master.tar.gz
RGA-master.tar.bz2
RGA-master.zip
last update for a whileHEADmaster
imma be real with y'all this is really old changes i never pushed to git so forgive me if the changelog is partial added an autoclicker that probably gets u banned added auto leave limbo added three weirdos auto solver added block size modifiers for dungeons i changed a log of stuff probably bug fixes have fun
Diffstat (limited to 'src/main/java/rosegoldaddons/mixins/MixinRenderString.java')
-rw-r--r--src/main/java/rosegoldaddons/mixins/MixinRenderString.java30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/main/java/rosegoldaddons/mixins/MixinRenderString.java b/src/main/java/rosegoldaddons/mixins/MixinRenderString.java
index b010d84..8484cdf 100644
--- a/src/main/java/rosegoldaddons/mixins/MixinRenderString.java
+++ b/src/main/java/rosegoldaddons/mixins/MixinRenderString.java
@@ -2,24 +2,29 @@ package rosegoldaddons.mixins;
import net.minecraft.client.gui.FontRenderer;
import org.apache.commons.codec.digest.DigestUtils;
+import org.dom4j.util.StringUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import rosegoldaddons.Main;
import rosegoldaddons.utils.ChatUtils;
-@Mixin(FontRenderer.class)
-public abstract class MixinRenderString {
+import java.util.Arrays;
+import java.util.Locale;
- private boolean replacedRank = false;
+@Mixin(value = FontRenderer.class)
+public abstract class MixinRenderString {
+ private static final char[] normal = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM".toCharArray();
+ private static final char[] custom = "qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm".toCharArray();
@ModifyVariable(method = "drawString(Ljava/lang/String;FFIZ)I", at = @At(value = "FIELD"))
private String replaceName(String text) {
if (Main.mc.theWorld == null || Main.mc.thePlayer == null) return text;
- if (Main.pauseCustom) return text;
+ if(Main.configFile.antiRacism == 0 || Main.configFile.antiRacism == 1) text = removeRacism(text);
if (Main.configFile.wydsi && text.contains("727")) {
text = text.replace("727", "726");
}
+ if (Main.pauseCustom) return text;
if (Main.init && Main.configFile.alchsleep != 88 || Main.configFile.skiblock != 263) {
String[] words = removeFormatting(text).replace(":", " ").replace("'", " ").split(" ");
String[] formatteds = text.replace(":", " ").replace("'", " ").split(" ");
@@ -65,6 +70,23 @@ public abstract class MixinRenderString {
return text;
}
+ private String removeRacism(String str) {
+ str = str.replace("ˌ","");
+ for(int i = 0; i < custom.length; i++) {
+ if(str.contains(String.valueOf(custom[i]))) {
+ str = str.replace(custom[i], normal[i]);
+ }
+ }
+ for (String word : Main.blacklist) {
+ if (str.toLowerCase().contains(word.toLowerCase())) {
+ char[] censored = new char[word.length()];
+ Arrays.fill(censored, '*');
+ return str.replaceAll("(?i)"+word, new String(censored));
+ }
+ }
+ return str;
+ }
+
private String getRank(String str, String sub) {
if (!str.contains("[") || !str.contains("]")) return null;
if (sub.contains("[") || sub.contains("]")) return null;