forked from SteamWar/SteamWar
Improve Flag.COLOR
This commit is contained in:
+2
-5
@@ -119,11 +119,8 @@ public class BauScoreboard implements Listener {
|
|||||||
@Override
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
Region region = Region.getRegion(player.getLocation());
|
Region region = Region.getRegion(player.getLocation());
|
||||||
if (region.getType().isGlobal()) return "§eSteam§8War";
|
if (region.getRegionData().has(Flag.COLOR).notVisibleInScoreboard()) return "§eSteam§8War";
|
||||||
String colorCode = "§e";
|
String colorCode = "§" + region.getRegionData().get(Flag.COLOR).getWithDefault().getColorCode();
|
||||||
if (region.getRegionData().has(Flag.COLOR).isReadable()) {
|
|
||||||
colorCode = "§" + region.getRegionData().get(Flag.COLOR).getWithDefault().getColorCode();
|
|
||||||
}
|
|
||||||
return colorCode + "■ §eSteam§8War " + colorCode + "■"; // ■
|
return colorCode + "■ §eSteam§8War " + colorCode + "■"; // ■
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import org.bukkit.scheduler.BukkitRunnable;
|
|||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Linked
|
@Linked
|
||||||
public class BackupScheduler implements Enable {
|
public class BackupScheduler implements Enable {
|
||||||
@@ -43,6 +44,7 @@ public class BackupScheduler implements Enable {
|
|||||||
Iterator<Region> regionsToBackup = RegionSystem.INSTANCE.getRegions()
|
Iterator<Region> regionsToBackup = RegionSystem.INSTANCE.getRegions()
|
||||||
.filter(region -> region.getRegionData().has(Flag.CHANGED).isReadable())
|
.filter(region -> region.getRegionData().has(Flag.CHANGED).isReadable())
|
||||||
.filter(region -> region.getRegionData().get(Flag.CHANGED).isWithDefault(ChangedMode.HAS_CHANGE))
|
.filter(region -> region.getRegionData().get(Flag.CHANGED).isWithDefault(ChangedMode.HAS_CHANGE))
|
||||||
|
.collect(Collectors.toList())
|
||||||
.iterator();
|
.iterator();
|
||||||
if (!regionsToBackup.hasNext()) return;
|
if (!regionsToBackup.hasNext()) return;
|
||||||
doBackup(regionsToBackup);
|
doBackup(regionsToBackup);
|
||||||
|
|||||||
Reference in New Issue
Block a user