mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-28 11:44:42 +02:00
@ -542,6 +542,31 @@ public class Plot {
|
||||
PlotAnalysis.analyzePlot(this, whenDone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a flag for this plot
|
||||
* @param flag
|
||||
* @param value
|
||||
*/
|
||||
public void setFlag(String flag, Object value) {
|
||||
FlagManager.addPlotFlag(this, new Flag(FlagManager.getFlag(flag), value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a flag from this plot
|
||||
* @param flag
|
||||
*/
|
||||
public void removeFlag(String flag) {
|
||||
FlagManager.removePlotFlag(this, flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the flag for a given key
|
||||
* @param flag
|
||||
*/
|
||||
public Flag getFlag(String key) {
|
||||
return FlagManager.getPlotFlag(this, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a plot
|
||||
* @see PS#removePlot(String, PlotId, boolean)
|
||||
|
@ -18,7 +18,15 @@ public class Rating {
|
||||
private int initial;
|
||||
|
||||
public Rating(int value) {
|
||||
this.initial = value;
|
||||
ratingMap = new HashMap<>();
|
||||
if (value < 10) {
|
||||
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
|
||||
ratingMap.put(Settings.RATING_CATEGORIES.get(i), value);
|
||||
}
|
||||
changed = true;
|
||||
return;
|
||||
}
|
||||
if (Settings.RATING_CATEGORIES != null && Settings.RATING_CATEGORIES.size() > 1) {
|
||||
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
|
||||
ratingMap.put(Settings.RATING_CATEGORIES.get(i), (value % 10) - 1);
|
||||
@ -28,7 +36,6 @@ public class Rating {
|
||||
else {
|
||||
ratingMap.put(null, value);
|
||||
}
|
||||
this.initial = value;
|
||||
}
|
||||
|
||||
public List<String> getCategories() {
|
||||
|
Reference in New Issue
Block a user