Add EnumDisplay
Add Loader.Stage.chatValue
Dieser Commit ist enthalten in:
Ursprung
686263327e
Commit
dea1fa0651
@ -25,7 +25,9 @@ import de.steamwar.bausystem.config.ColorConfig;
|
||||
import de.steamwar.bausystem.features.loader.activations.AbstractLoaderActivation;
|
||||
import de.steamwar.bausystem.features.loader.activations.BlockPlaceLoaderActivation;
|
||||
import de.steamwar.bausystem.features.loader.activations.InteractionActivation;
|
||||
import de.steamwar.bausystem.shared.EnumDisplay;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -204,10 +206,14 @@ public class Loader implements Listener {
|
||||
stop();
|
||||
}
|
||||
|
||||
public enum Stage {
|
||||
SETUP,
|
||||
RUNNING,
|
||||
PAUSE,
|
||||
END
|
||||
@AllArgsConstructor
|
||||
public enum Stage implements EnumDisplay {
|
||||
SETUP("§esetup"),
|
||||
RUNNING("§arunning"),
|
||||
PAUSE("§7pause"),
|
||||
END("§8finished");
|
||||
|
||||
@Getter
|
||||
private String chatValue;
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class BauScoreboard implements Listener {
|
||||
strings.add("§eFire§8: " + region.get(Flag.FIRE).getChatValue());
|
||||
strings.add("§eTrace§8: " + RecordStateMachine.getRecordStatus().getName());
|
||||
Loader loader = Loader.getLoader(p);
|
||||
strings.add("§eLoader§8: " + (loader != null ? ("§a" + loader.getStage().name().toLowerCase()) : "§caus"));
|
||||
strings.add("§eLoader§8: " + (loader != null ? ("§a" + loader.getStage().getChatValue()) : "§caus"));
|
||||
if (region.getFloorLevel() != 0) {
|
||||
strings.add("§eProtect§8: " + region.get(Flag.PROTECT).getChatValue());
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ package de.steamwar.bausystem.region.flags;
|
||||
import de.steamwar.bausystem.region.flags.flagvalues.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import de.steamwar.bausystem.shared.EnumDisplay;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@ -59,7 +61,7 @@ public enum Flag {
|
||||
return this.name().toLowerCase();
|
||||
}
|
||||
|
||||
public interface Value<T extends Enum<T> & Value<T>> {
|
||||
public interface Value<T extends Enum<T> & Value<T>> extends EnumDisplay {
|
||||
|
||||
T getValue();
|
||||
|
||||
@ -67,8 +69,6 @@ public enum Flag {
|
||||
|
||||
T[] getValues();
|
||||
|
||||
String getChatValue();
|
||||
|
||||
default String getName() {
|
||||
return this.getValue().name().toLowerCase();
|
||||
}
|
||||
|
5
BauSystem_Main/src/de/steamwar/bausystem/shared/EnumDisplay.java
Normale Datei
5
BauSystem_Main/src/de/steamwar/bausystem/shared/EnumDisplay.java
Normale Datei
@ -0,0 +1,5 @@
|
||||
package de.steamwar.bausystem.shared;
|
||||
|
||||
public interface EnumDisplay {
|
||||
String getChatValue();
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren