This repository was archived by the owner on Oct 20, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
java/me/ultrablacklinux/fixgg
resources/assets/fixmygg/lang Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ minecraft_version=1.16.5
66yarn_mappings =1.16.5+build.4
77loader_version =0.11.1
88# Mod Properties
9- mod_version =1 .0
9+ mod_version =2 .0
1010maven_group =me.UltraBlackLinux
1111archives_base_name =FixGG
1212# Dependencies
Original file line number Diff line number Diff line change @@ -27,9 +27,11 @@ public static FixGGConfig get() {
2727 @ Config (name = "general" )
2828 public static class General implements ConfigData {
2929 @ Comment ("Words to check for typos. They mustn't contain themselves." )
30- public String words = "gg gf gp" ;
30+ public String words = "gg;gf; gp" ;
3131 @ Comment ("Max amount of characters to be in front of the words." )
3232 public int index = 3 ;
33+ @ Comment ("Max amount of characters in the message part." )
34+ public int length = 6 ;
3335 @ Comment ("Toggle the notification" )
3436 public boolean message = true ;
3537 }
Original file line number Diff line number Diff line change @@ -23,20 +23,17 @@ public abstract class PlayerMixin {
2323
2424 @ Inject (method = "sendChatMessage" , at = @ At ("HEAD" ), cancellable = true )
2525 private void onChatMessage (String fmsg , CallbackInfo info ) {
26- //important values
27- //String[] words = new String[] {"gf", "gg", "gp"};
28- String [] words = FixGGConfig .get ().general .words .split (" " );
26+ String [] words = FixGGConfig .get ().general .words .split (";" );
2927 boolean showMessage = FixGGConfig .get ().general .message ;
3028 int maxIndex = FixGGConfig .get ().general .index ;
31- //important values
32-
29+ int maxLength = FixGGConfig .get ().general .length ;
3330 String [] msg = fmsg .split (" " );
3431 Boolean changed = false ;
3532
3633 for (String checkWord : words ) { //check, if word exists
3734 for (int currentLocation = 0 ; currentLocation < msg .length ; currentLocation ++) {
3835 if (msg [currentLocation ].toLowerCase ().contains (checkWord ) && !msg [currentLocation ].toLowerCase ().matches (checkWord )) {
39- if (msg [currentLocation ].length ( ) <= maxIndex ) {
36+ if (msg [currentLocation ].indexOf ( checkWord ) <= maxIndex + 1 && msg [ currentLocation ]. length () <= maxLength ) {
4037 changed = true ;
4138 if (msg [currentLocation ].contains (checkWord .toUpperCase ())) {
4239 msg [currentLocation ] = checkWord .toUpperCase ();
Original file line number Diff line number Diff line change 22 "text.autoconfig.fixmygg.title" : " FixMyGG Config" ,
33 "text.autoconfig.fixmygg.option.general.words" : " Words" ,
44 "text.autoconfig.fixmygg.option.general.index" : " Index" ,
5+ "text.autoconfig.fixmygg.option.general.length" : " Length" ,
56 "text.autoconfig.fixmygg.option.general.message" : " Notification"
67}
You can’t perform that action at this time.
0 commit comments