mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 05:36:45 +01:00
Fix rating when no categories are configured
This commit is contained in:
parent
e3cb59f362
commit
a71d5a134b
@ -20,6 +20,7 @@ public class Rating {
|
|||||||
public Rating(int value) {
|
public Rating(int value) {
|
||||||
this.initial = value;
|
this.initial = value;
|
||||||
ratingMap = new HashMap<>();
|
ratingMap = new HashMap<>();
|
||||||
|
if (Settings.RATING_CATEGORIES != null && Settings.RATING_CATEGORIES.size() > 1) {
|
||||||
if (value < 10) {
|
if (value < 10) {
|
||||||
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
|
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
|
||||||
ratingMap.put(Settings.RATING_CATEGORIES.get(i), value);
|
ratingMap.put(Settings.RATING_CATEGORIES.get(i), value);
|
||||||
@ -27,7 +28,6 @@ public class Rating {
|
|||||||
changed = true;
|
changed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Settings.RATING_CATEGORIES != null && Settings.RATING_CATEGORIES.size() > 1) {
|
|
||||||
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
|
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
|
||||||
ratingMap.put(Settings.RATING_CATEGORIES.get(i), (value % 10) - 1);
|
ratingMap.put(Settings.RATING_CATEGORIES.get(i), (value % 10) - 1);
|
||||||
value /= 10;
|
value /= 10;
|
||||||
|
Loading…
Reference in New Issue
Block a user