mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-26 02:34:42 +02:00
feature: implement road flags as widely as seems reasonable
- Closes #3047 - Any further road flag implementations would be very specific from what I can gather, and thus the gist of #3047 is now implemented
This commit is contained in:
@ -46,6 +46,7 @@ import com.plotsquared.core.plot.flag.FlagParseException;
|
||||
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||
import com.plotsquared.core.queue.QueueCoordinator;
|
||||
import com.plotsquared.core.util.MathMan;
|
||||
@ -1242,6 +1243,18 @@ public abstract class PlotArea {
|
||||
return this.roadFlagContainer.getFlag(flagClass).getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the value of a {@link BooleanFlag} matches the given boolean. If
|
||||
* road flags are disabled, returns false.
|
||||
*
|
||||
* @param flagClass boolean flag to get value of
|
||||
* @param value boolean value to check flag value against
|
||||
* @return Flag value or false if road flags disabled
|
||||
*/
|
||||
public boolean isRoadFlagsAndFlagEquals(final Class<? extends BooleanFlag<?>> flagClass, boolean value) {
|
||||
return this.roadFlags && (getRoadFlag(flagClass) == value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value associated with the specified road flag. This will look at
|
||||
* the default values stored in {@link GlobalFlagContainer}.
|
||||
|
Reference in New Issue
Block a user