2024-02-22 11:33:50 +01:00
|
|
|
package fr.maxlego08.koth;
|
|
|
|
|
|
|
|
import fr.maxlego08.koth.api.Koth;
|
2024-02-22 11:44:35 +01:00
|
|
|
import fr.maxlego08.koth.api.KothType;
|
2024-02-22 12:00:18 +01:00
|
|
|
import fr.maxlego08.koth.api.utils.ScoreboardConfiguration;
|
2024-02-22 11:33:50 +01:00
|
|
|
import fr.maxlego08.koth.zcore.utils.Cuboid;
|
|
|
|
import org.bukkit.Location;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public class ZKoth implements Koth {
|
|
|
|
|
|
|
|
private final String fileName;
|
2024-02-22 11:44:35 +01:00
|
|
|
private final KothType kothType;
|
2024-02-22 12:00:18 +01:00
|
|
|
private final ScoreboardConfiguration cooldownScoreboard;
|
|
|
|
private final ScoreboardConfiguration startScoreboard;
|
2024-02-22 11:33:50 +01:00
|
|
|
private String name;
|
|
|
|
private int captureSeconds;
|
|
|
|
private Location minLocation;
|
|
|
|
private Location maxLocation;
|
|
|
|
private List<String> startCommands = new ArrayList<>();
|
|
|
|
private List<String> endCommands = new ArrayList<>();
|
|
|
|
|
2024-02-22 12:00:18 +01:00
|
|
|
public ZKoth(String fileName, KothType kothType, String name, int captureSeconds, Location minLocation, Location maxLocation, List<String> startCommands, List<String> endCommands, ScoreboardConfiguration cooldownScoreboard, ScoreboardConfiguration startScoreboard) {
|
2024-02-22 11:33:50 +01:00
|
|
|
this.fileName = fileName;
|
2024-02-22 11:44:35 +01:00
|
|
|
this.kothType = kothType;
|
2024-02-22 11:33:50 +01:00
|
|
|
this.name = name;
|
|
|
|
this.captureSeconds = captureSeconds;
|
|
|
|
this.minLocation = minLocation;
|
|
|
|
this.maxLocation = maxLocation;
|
|
|
|
this.startCommands = startCommands;
|
|
|
|
this.endCommands = endCommands;
|
2024-02-22 12:00:18 +01:00
|
|
|
this.startScoreboard = startScoreboard;
|
|
|
|
this.cooldownScoreboard = cooldownScoreboard;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ZKoth(String fileName, KothType kothType, String name, int captureSeconds, Location minLocation, Location maxLocation) {
|
|
|
|
this.fileName = fileName;
|
|
|
|
this.kothType = kothType;
|
|
|
|
this.name = name;
|
|
|
|
this.captureSeconds = captureSeconds;
|
|
|
|
this.minLocation = minLocation;
|
|
|
|
this.maxLocation = maxLocation;
|
|
|
|
this.startScoreboard = new ScoreboardConfiguration();
|
|
|
|
this.cooldownScoreboard = new ScoreboardConfiguration();
|
2024-02-22 11:33:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getFileName() {
|
|
|
|
return this.fileName;
|
|
|
|
}
|
|
|
|
|
2024-02-22 11:44:35 +01:00
|
|
|
@Override
|
|
|
|
public KothType getKothType() {
|
|
|
|
return this.kothType;
|
|
|
|
}
|
|
|
|
|
2024-02-22 11:33:50 +01:00
|
|
|
@Override
|
|
|
|
public String getName() {
|
|
|
|
return this.name;
|
|
|
|
}
|
|
|
|
|
2024-02-22 11:44:35 +01:00
|
|
|
@Override
|
|
|
|
public void setName(String name) {
|
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
2024-02-22 11:33:50 +01:00
|
|
|
@Override
|
|
|
|
public Location getMinLocation() {
|
|
|
|
return this.minLocation;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Location getMaxLocation() {
|
|
|
|
return this.maxLocation;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Cuboid getCuboid() {
|
|
|
|
return new Cuboid(this.maxLocation, this.minLocation);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Location getCenter() {
|
|
|
|
Cuboid cuboid = getCuboid();
|
|
|
|
return cuboid.getCenter();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<String> getStartCommands() {
|
|
|
|
return this.startCommands;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<String> getEndCommands() {
|
|
|
|
return this.endCommands;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void move(Location minLocation, Location maxLocation) {
|
|
|
|
this.minLocation = minLocation;
|
|
|
|
this.maxLocation = maxLocation;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2024-02-22 11:44:35 +01:00
|
|
|
public int getCaptureSeconds() {
|
|
|
|
return captureSeconds;
|
2024-02-22 11:33:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setCaptureSeconds(int captureSeconds) {
|
|
|
|
this.captureSeconds = captureSeconds;
|
|
|
|
}
|
2024-02-22 12:00:18 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public ScoreboardConfiguration getCooldownScoreboard() {
|
|
|
|
return this.cooldownScoreboard;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ScoreboardConfiguration getStartScoreboard() {
|
|
|
|
return this.startScoreboard;
|
|
|
|
}
|
2024-02-22 11:33:50 +01:00
|
|
|
}
|