SteamWar/BauSystem2.0
Archiviert
12
0

Add Region.initSessions

Dieser Commit ist enthalten in:
yoyosource 2021-04-20 11:03:46 +02:00
Ursprung ba3ee30385
Commit 25111c62be

Datei anzeigen

@ -27,6 +27,7 @@ import de.steamwar.bausystem.region.utils.RegionExtensionType;
import de.steamwar.bausystem.region.utils.RegionType;
import de.steamwar.bausystem.shared.SizedStack;
import de.steamwar.sql.Schematic;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NonNull;
import org.bukkit.Location;
@ -90,7 +91,10 @@ public class Region {
private FlagStorage flagStorage;
@Getter(AccessLevel.PRIVATE)
private SizedStack<EditSession> undoSessions;
@Getter(AccessLevel.PRIVATE)
private SizedStack<EditSession> redoSessions;
public Region(String name, Prototype prototype, YAPIONObject regionConfig, FlagStorage flagStorage, YAPIONObject regionData) {
@ -164,6 +168,13 @@ public class Region {
}
}
private void initSessions() {
if (undoSessions == null) {
undoSessions = new SizedStack<>(20);
redoSessions = new SizedStack<>(20);
}
}
public boolean inRegion(Location location, RegionType regionType, RegionExtensionType regionExtensionType) {
if (!hasType(regionType)) {
return false;