1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00

Changed Script Rating System

This commit is contained in:
TheBusyBiscuit 2019-04-10 18:45:14 +02:00 committed by GitHub
parent 090471167c
commit 506c54149e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1251,7 +1251,9 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
}
public float getScriptRating(Config script) {
return Math.round(((getScriptRating(script, true) * 100.0f) / getScriptRating(script, true) + getScriptRating(script, false)) * 100.0f) / 100.0f;
int positive = getScriptRating(script, true) + 1;
int negative = getScriptRating(script, false);
return Math.round((positive / (positive + negative)) * 100.0f) / 100.0f;
}
private int getScriptRating(Config script, boolean positive) {