Optimize Region.getRegion
Dieser Commit ist enthalten in:
Ursprung
9fb66faa20
Commit
fcba3e3296
@ -48,17 +48,10 @@ public class Region {
|
|||||||
private static final List<Region> REGION_LIST = new ArrayList<>();
|
private static final List<Region> REGION_LIST = new ArrayList<>();
|
||||||
|
|
||||||
public static Region getRegion(Location location) {
|
public static Region getRegion(Location location) {
|
||||||
String s = Thread.currentThread().getStackTrace()[2].toString();
|
return REGION_LIST.stream()
|
||||||
if (!s.contains("sidebar")) {
|
.filter(r -> r.inRegion(location, r.minPoint, r.maxPoint))
|
||||||
System.out.println(s + " " + location);
|
.findFirst()
|
||||||
}
|
.orElse(GlobalRegion.instance);
|
||||||
/*for (Region region : REGION_LIST) {
|
|
||||||
if (region.inRegion(location, region.minPoint, region.maxPoint)) {
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return GlobalRegion.instance;*/
|
|
||||||
return REGION_LIST.stream().filter(r -> r.inRegion(location, r.minPoint, r.maxPoint)).findFirst().orElse(GlobalRegion.instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setGlobal(Flag flagType, Flag.Value<?> value) {
|
public static void setGlobal(Flag flagType, Flag.Value<?> value) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren