mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-03 22:15:24 +00:00
style(commands): variable name change
This commit is contained in:
1 file changed
+7
-7
@@ -223,12 +223,12 @@ public class WarCommands {
|
|||||||
@Nullable Nation nation = res.hasNation() ? res.getNationOrNull() : TownyAPI.getInstance().getNation(targetString);
|
@Nullable Nation nation = res.hasNation() ? res.getNationOrNull() : TownyAPI.getInstance().getNation(targetString);
|
||||||
@Nullable Town town = res.hasTown() ? res.getTownOrNull() : TownyAPI.getInstance().getTown(targetString);
|
@Nullable Town town = res.hasTown() ? res.getTownOrNull() : TownyAPI.getInstance().getTown(targetString);
|
||||||
|
|
||||||
final boolean isNation = nation != null;
|
final boolean isArgNation = nation != null;
|
||||||
final boolean isTown = town != null;
|
final boolean isArgTown = town != null;
|
||||||
final boolean isPlayer = targetPlayer != null;
|
final boolean isArgPlayer = targetPlayer != null;
|
||||||
|
|
||||||
// If no valid targets
|
// If no valid targets
|
||||||
if ((!isNation && !isTown && !isPlayer))
|
if ((!isArgNation && !isArgTown && !isArgPlayer))
|
||||||
throw CommandAPIBukkit.failWithAdventureComponent(ColorParser.of("<red>Invalid target.").build());
|
throw CommandAPIBukkit.failWithAdventureComponent(ColorParser.of("<red>Invalid target.").build());
|
||||||
|
|
||||||
// Check if player can validly join or not
|
// Check if player can validly join or not
|
||||||
@@ -237,7 +237,7 @@ public class WarCommands {
|
|||||||
|
|
||||||
if (!war.isEvent()) {
|
if (!war.isEvent()) {
|
||||||
// Join nation into war
|
// Join nation into war
|
||||||
if (isNation && nation != null && !war.isNationInWar(nation) && (asAdmin || canKingJoin)) {
|
if (isArgNation && nation != null && !war.isNationInWar(nation) && (asAdmin || canKingJoin)) {
|
||||||
side.addNation(nation);
|
side.addNation(nation);
|
||||||
nation.getResidents().stream().filter(Resident::isOnline).map(Resident::getPlayer).toList().forEach(PlayerJoinListener::checkPlayer);
|
nation.getResidents().stream().filter(Resident::isOnline).map(Resident::getPlayer).toList().forEach(PlayerJoinListener::checkPlayer);
|
||||||
Bukkit.broadcast(
|
Bukkit.broadcast(
|
||||||
@@ -270,7 +270,7 @@ public class WarCommands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Join town into war
|
// Join town into war
|
||||||
if (isTown && town != null && !war.isTownInWar(town) && (asAdmin || canMayorJoin)) {
|
if (isArgTown && town != null && !war.isTownInWar(town) && (asAdmin || canMayorJoin)) {
|
||||||
side.addTown(town);
|
side.addTown(town);
|
||||||
town.getResidents().stream().filter(Resident::isOnline).map(Resident::getPlayer).toList().forEach(PlayerJoinListener::checkPlayer);
|
town.getResidents().stream().filter(Resident::isOnline).map(Resident::getPlayer).toList().forEach(PlayerJoinListener::checkPlayer);
|
||||||
Bukkit.broadcast(
|
Bukkit.broadcast(
|
||||||
@@ -304,7 +304,7 @@ public class WarCommands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Join player into war
|
// Join player into war
|
||||||
if (isPlayer && targetPlayer != null && !war.isPlayerInWar(targetPlayer) && asAdmin) {
|
if (isArgPlayer && targetPlayer != null && !war.isPlayerInWar(targetPlayer) && asAdmin) {
|
||||||
targetPlayer.sendMessage(ColorParser.of(UtilsChat.getPrefix() + "You have joined the war.").build());
|
targetPlayer.sendMessage(ColorParser.of(UtilsChat.getPrefix() + "You have joined the war.").build());
|
||||||
side.addPlayer(targetPlayer);
|
side.addPlayer(targetPlayer);
|
||||||
PlayerJoinListener.checkPlayer(targetPlayer);
|
PlayerJoinListener.checkPlayer(targetPlayer);
|
||||||
|
|||||||
Reference in new issue
Block a user