Add flag turn-in location to team functionality

Introduced a new `flagTurnInLocation` property to the `Team` class, used to determine where players return flags. Updated relevant logic in `Flag` and `CreateTeam` to utilize this new property, including reducing the required distance for flag turn-in.
This commit is contained in:
Teriuihi 2025-02-08 21:03:01 +01:00
parent e93580bea9
commit 72dc1af903
4 changed files with 9 additions and 5 deletions

View File

@ -75,7 +75,7 @@ public class CreateTeam extends SubCommand {
int highestId = gameManager.getMaxTeamId();
Team team = new Team(MiniMessage.miniMessage().deserialize(String.format("<color:%s>%s</color>", color, name)),
highestId + 1, player.getLocation(), player.getLocation(), teamColor);
highestId + 1, player.getLocation(), player.getLocation(), player.getLocation(), teamColor);
return consumer.apply(team);
}

View File

@ -160,8 +160,8 @@ public class Flag implements Runnable {
spawnFlag();
return;
}
double distance = winningTeam.getSpawnLocation().distance(flagCarrier.getLocation());
if (distance > 5) {
double distance = winningTeam.getFlagTurnInLocation().distance(flagCarrier.getLocation());
if (distance > 2) {
Location location = flagCarrier.getLocation();
location.setY(location.getY() + 1);
particleTrail.add(location);

View File

@ -34,6 +34,10 @@ public class Team {
@NotNull
@Getter
private Location worldBorderCenter; // https://github.com/yannicklamprecht/WorldBorderAPI/blob/main/how-to-use.md
@JsonProperty("flagTurnInLocation")
@NotNull
@Getter
private Location flagTurnInLocation;
@JsonProperty("teamColor")
@NotNull
@Getter

View File

@ -1,3 +1,3 @@
#Sat Feb 08 20:41:32 CET 2025
buildNumber=18
#Sat Feb 08 21:02:07 CET 2025
buildNumber=19
version=0.1