From 25111c62be245b2b534cd8f9a702409ec3d84a18 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 20 Apr 2021 11:03:46 +0200 Subject: [PATCH] Add Region.initSessions --- .../src/de/steamwar/bausystem/region/Region.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java index f8b8a767..b48c23f9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java @@ -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 undoSessions; + + @Getter(AccessLevel.PRIVATE) private SizedStack 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;