package wtf.opal.utility.misc;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

@Environment(EnvType.CLIENT)
public final class StringUtility {
   private StringUtility() {
   }

   public static String rotate(int shift, String str) {
      StringBuilder var2 = new StringBuilder();
      shift %= 26;

      for (int var3 = 0; var3 < str.length(); var3++) {
         char var4 = str.charAt(var3);
         if (var4 >= 'a' && var4 <= 'z') {
            var4 = (char)(97 + (var4 - 'a' + shift + 26) % 26);
         } else if (var4 >= 'A' && var4 <= 'Z') {
            var4 = (char)(65 + (var4 - 'A' + shift + 26) % 26);
         }

         var2.append(var4);
      }

      return var2.toString();
   }
}
