add my super cool rate algorithm to the API

This commit is contained in:
NullClock 2024-05-03 09:54:52 -04:00 committed by GitHub
parent 5b75a2addb
commit 82bda997cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -202,6 +202,18 @@ public class ModAPI {
getModAPI().setCallbackVoidWithDataArg("displayToChat", (BaseData params) -> {
mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(params.getString("msg")));
});
getModAPI().setCallbackStringWithDataArg("rate", (BaseData params) -> {
int hash = 0;
int counterRate = 0;
for (i < params.getString('string').length(); i++) {
hash = (hash << 5) - hash + params.getString('string').codePointAt();
}
String res = (Math.abs(hash) % 100) + 1;
return res;
});
getModAPI().setCallbackStringWithDataArg("uwuify", (BaseData params) -> {
return UwUAPI.uwuify(params.getString("string"));
});