Fix ProtectCommand
Fix FlagStorage
Dieser Commit ist enthalten in:
Ursprung
34344dadae
Commit
1b06f4ca13
@ -9,13 +9,8 @@ import de.steamwar.bausystem.region.RegionUtils;
|
||||
import de.steamwar.bausystem.region.flags.Flag;
|
||||
import de.steamwar.bausystem.region.flags.flagvalues.ProtectMode;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.sql.Schematic;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@Linked(LinkageType.COMMAND)
|
||||
public class ProtectCommand extends SWCommand {
|
||||
|
||||
@ -42,7 +37,7 @@ public class ProtectCommand extends SWCommand {
|
||||
default:
|
||||
case INACTIVE:
|
||||
region.set(Flag.PROTECT, ProtectMode.ACTIVE);
|
||||
RegionUtils.actionBar(region, "§cBoden Schutz aufgehoben");
|
||||
RegionUtils.actionBar(region, "§aBoden geschützt");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ import java.util.Map;
|
||||
@YAPIONData
|
||||
public class FlagStorage {
|
||||
|
||||
protected final Map<Flag, Flag.Value<?>> flags;
|
||||
protected Map<Flag, Flag.Value<?>> flags;
|
||||
|
||||
public FlagStorage() {
|
||||
flags = new EnumMap<>(Flag.class);
|
||||
@ -38,6 +38,7 @@ public class FlagStorage {
|
||||
|
||||
@YAPIONPreDeserialization
|
||||
private void preDeserializer() {
|
||||
flags = new EnumMap<>(Flag.class);
|
||||
readKeys();
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@ package de.steamwar.bausystem.region;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import de.steamwar.bausystem.region.flags.Flag;
|
||||
import de.steamwar.bausystem.region.loader.RegionLoader;
|
||||
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
||||
import de.steamwar.bausystem.region.utils.RegionType;
|
||||
import de.steamwar.bausystem.shared.SizedStack;
|
||||
@ -226,6 +227,7 @@ public class Region {
|
||||
public void set(Flag flagType, Flag.Value<?> value) {
|
||||
if (flagStorage.set(flagType, value)) {
|
||||
regionData.add("flagStorage", YAPIONSerializer.serialize(flagStorage));
|
||||
RegionLoader.save();
|
||||
}
|
||||
setLinkedRegion(region -> region.set(flagType, value));
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren