Optimize AutostartListener
Dieser Commit ist enthalten in:
Ursprung
2a0dbaa049
Commit
9fb66faa20
@ -79,6 +79,9 @@ public class AutostartListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onEntityExplode(EntityExplodeEvent event) {
|
||||
if (regionStartTime.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
event.blockList().forEach(block -> {
|
||||
Region region = Region.getRegion(block.getLocation());
|
||||
if (!regionStartTime.containsKey(region)) return;
|
||||
|
@ -37,10 +37,7 @@ import yapion.hierarchy.types.YAPIONValue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static de.steamwar.bausystem.region.RegionUtils.paste;
|
||||
@ -53,14 +50,15 @@ public class Region {
|
||||
public static Region getRegion(Location location) {
|
||||
String s = Thread.currentThread().getStackTrace()[2].toString();
|
||||
if (!s.contains("sidebar")) {
|
||||
System.out.println(s +" " + location);
|
||||
System.out.println(s + " " + location);
|
||||
}
|
||||
for (Region region : REGION_LIST) {
|
||||
/*for (Region region : REGION_LIST) {
|
||||
if (region.inRegion(location, region.minPoint, region.maxPoint)) {
|
||||
return region;
|
||||
}
|
||||
}
|
||||
return GlobalRegion.instance;
|
||||
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) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren