Add Region.undoSessions
Add Region.redoSessions
Dieser Commit ist enthalten in:
Ursprung
1d257efa61
Commit
6c38686d0d
@ -19,9 +19,11 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.region;
|
package de.steamwar.bausystem.region;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.EditSession;
|
||||||
import de.steamwar.bausystem.region.flags.Flag;
|
import de.steamwar.bausystem.region.flags.Flag;
|
||||||
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
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 lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -73,6 +75,9 @@ public class Region {
|
|||||||
|
|
||||||
private FlagStorage flagStorage;
|
private FlagStorage flagStorage;
|
||||||
|
|
||||||
|
private SizedStack<EditSession> undoSessions;
|
||||||
|
private SizedStack<EditSession> redoSessions;
|
||||||
|
|
||||||
public Region(Prototype prototype, YAPIONObject regionConfig, FlagStorage flagStorage, YAPIONObject regionData) {
|
public Region(Prototype prototype, YAPIONObject regionConfig, FlagStorage flagStorage, YAPIONObject regionData) {
|
||||||
this.regionData = regionData;
|
this.regionData = regionData;
|
||||||
if (prototype != null) {
|
if (prototype != null) {
|
||||||
@ -183,4 +188,18 @@ public class Region {
|
|||||||
public <T extends Enum<T> & Flag.Value<T>> Flag.Value<T> get(Flag flagType) {
|
public <T extends Enum<T> & Flag.Value<T>> Flag.Value<T> get(Flag flagType) {
|
||||||
return flagStorage.get(flagType);
|
return flagStorage.get(flagType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reset(RegionType regionType) {
|
||||||
|
if (!hasType(regionType)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch (regionType) {
|
||||||
|
case BUILD:
|
||||||
|
|
||||||
|
case TESTBLOCK:
|
||||||
|
default:
|
||||||
|
case NORMAL:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren