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:
parent
e93580bea9
commit
72dc1af903
|
|
@ -75,7 +75,7 @@ public class CreateTeam extends SubCommand {
|
||||||
|
|
||||||
int highestId = gameManager.getMaxTeamId();
|
int highestId = gameManager.getMaxTeamId();
|
||||||
Team team = new Team(MiniMessage.miniMessage().deserialize(String.format("<color:%s>%s</color>", color, name)),
|
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);
|
return consumer.apply(team);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,8 +160,8 @@ public class Flag implements Runnable {
|
||||||
spawnFlag();
|
spawnFlag();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double distance = winningTeam.getSpawnLocation().distance(flagCarrier.getLocation());
|
double distance = winningTeam.getFlagTurnInLocation().distance(flagCarrier.getLocation());
|
||||||
if (distance > 5) {
|
if (distance > 2) {
|
||||||
Location location = flagCarrier.getLocation();
|
Location location = flagCarrier.getLocation();
|
||||||
location.setY(location.getY() + 1);
|
location.setY(location.getY() + 1);
|
||||||
particleTrail.add(location);
|
particleTrail.add(location);
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,10 @@ public class Team {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Getter
|
@Getter
|
||||||
private Location worldBorderCenter; // https://github.com/yannicklamprecht/WorldBorderAPI/blob/main/how-to-use.md
|
private Location worldBorderCenter; // https://github.com/yannicklamprecht/WorldBorderAPI/blob/main/how-to-use.md
|
||||||
|
@JsonProperty("flagTurnInLocation")
|
||||||
|
@NotNull
|
||||||
|
@Getter
|
||||||
|
private Location flagTurnInLocation;
|
||||||
@JsonProperty("teamColor")
|
@JsonProperty("teamColor")
|
||||||
@NotNull
|
@NotNull
|
||||||
@Getter
|
@Getter
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
#Sat Feb 08 20:41:32 CET 2025
|
#Sat Feb 08 21:02:07 CET 2025
|
||||||
buildNumber=18
|
buildNumber=19
|
||||||
version=0.1
|
version=0.1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user