Add Region.initSessions
Dieser Commit ist enthalten in:
Ursprung
ba3ee30385
Commit
25111c62be
@ -27,6 +27,7 @@ import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
|||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
import de.steamwar.bausystem.region.utils.RegionType;
|
||||||
import de.steamwar.bausystem.shared.SizedStack;
|
import de.steamwar.bausystem.shared.SizedStack;
|
||||||
import de.steamwar.sql.Schematic;
|
import de.steamwar.sql.Schematic;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -90,7 +91,10 @@ public class Region {
|
|||||||
|
|
||||||
private FlagStorage flagStorage;
|
private FlagStorage flagStorage;
|
||||||
|
|
||||||
|
@Getter(AccessLevel.PRIVATE)
|
||||||
private SizedStack<EditSession> undoSessions;
|
private SizedStack<EditSession> undoSessions;
|
||||||
|
|
||||||
|
@Getter(AccessLevel.PRIVATE)
|
||||||
private SizedStack<EditSession> redoSessions;
|
private SizedStack<EditSession> redoSessions;
|
||||||
|
|
||||||
public Region(String name, Prototype prototype, YAPIONObject regionConfig, FlagStorage flagStorage, YAPIONObject regionData) {
|
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) {
|
public boolean inRegion(Location location, RegionType regionType, RegionExtensionType regionExtensionType) {
|
||||||
if (!hasType(regionType)) {
|
if (!hasType(regionType)) {
|
||||||
return false;
|
return false;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren