mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-04 06:28:51 +00:00
style: quick reformat
This commit is contained in:
13 files changed
+26
-20
No files matched your search
@@ -1,9 +1,9 @@
|
|||||||
package com.github.alathra.AlathranWars;
|
package com.github.alathra.AlathranWars;
|
||||||
|
|
||||||
import com.github.alathra.AlathranWars.commands.CommandManager;
|
import com.github.alathra.AlathranWars.commands.CommandManager;
|
||||||
|
import com.github.alathra.AlathranWars.conflict.WarManager;
|
||||||
import com.github.alathra.AlathranWars.data.ConfigManager;
|
import com.github.alathra.AlathranWars.data.ConfigManager;
|
||||||
import com.github.alathra.AlathranWars.data.DataManager;
|
import com.github.alathra.AlathranWars.data.DataManager;
|
||||||
import com.github.alathra.AlathranWars.conflict.WarManager;
|
|
||||||
import com.github.alathra.AlathranWars.hooks.HookManager;
|
import com.github.alathra.AlathranWars.hooks.HookManager;
|
||||||
import com.github.alathra.AlathranWars.items.WarItemRegistry;
|
import com.github.alathra.AlathranWars.items.WarItemRegistry;
|
||||||
import com.github.alathra.AlathranWars.listeners.ListenerHandler;
|
import com.github.alathra.AlathranWars.listeners.ListenerHandler;
|
||||||
@@ -30,6 +30,7 @@ public class Main extends JavaPlugin {
|
|||||||
public static Main getInstance() {
|
public static Main getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MorePaperLib getPaperLib() {
|
public static MorePaperLib getPaperLib() {
|
||||||
return paperLib;
|
return paperLib;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ public class AdminCommands {
|
|||||||
final @Nullable Component itemName = stack.getItemMeta() == null ? ColorParser.of(stack.toString()).build() : stack.getItemMeta().displayName();
|
final @Nullable Component itemName = stack.getItemMeta() == null ? ColorParser.of(stack.toString()).build() : stack.getItemMeta().displayName();
|
||||||
sender.sendMessage(
|
sender.sendMessage(
|
||||||
ColorParser.of(
|
ColorParser.of(
|
||||||
"<prefix>Gave <amount>x <item> to <player>."
|
"<prefix>Gave <amount>x <item> to <player>."
|
||||||
)
|
)
|
||||||
.parseMinimessagePlaceholder("prefix", UtilsChat.getPrefix())
|
.parseMinimessagePlaceholder("prefix", UtilsChat.getPrefix())
|
||||||
.parseMinimessagePlaceholder("amount", String.valueOf(stack.getAmount()))
|
.parseMinimessagePlaceholder("amount", String.valueOf(stack.getAmount()))
|
||||||
.parseMinimessagePlaceholder("item", itemName)
|
.parseMinimessagePlaceholder("item", itemName)
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package com.github.alathra.AlathranWars.commands;
|
|||||||
import com.github.alathra.AlathranWars.Main;
|
import com.github.alathra.AlathranWars.Main;
|
||||||
import com.github.alathra.AlathranWars.conflict.Side;
|
import com.github.alathra.AlathranWars.conflict.Side;
|
||||||
import com.github.alathra.AlathranWars.conflict.War;
|
import com.github.alathra.AlathranWars.conflict.War;
|
||||||
|
import com.github.alathra.AlathranWars.conflict.WarManager;
|
||||||
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
||||||
import com.github.alathra.AlathranWars.enums.CommandArgsSiege;
|
import com.github.alathra.AlathranWars.enums.CommandArgsSiege;
|
||||||
import com.github.alathra.AlathranWars.enums.CommandArgsWar;
|
import com.github.alathra.AlathranWars.enums.CommandArgsWar;
|
||||||
import com.github.alathra.AlathranWars.conflict.WarManager;
|
|
||||||
import com.github.alathra.AlathranWars.hooks.TownyHook;
|
import com.github.alathra.AlathranWars.hooks.TownyHook;
|
||||||
import com.github.alathra.AlathranWars.items.WarItemRegistry;
|
import com.github.alathra.AlathranWars.items.WarItemRegistry;
|
||||||
import com.github.alathra.AlathranWars.utility.UtilsChat;
|
import com.github.alathra.AlathranWars.utility.UtilsChat;
|
||||||
@@ -624,8 +624,8 @@ public class CommandUtil {
|
|||||||
players.stream()
|
players.stream()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.filter(string -> !inWar.contains(string)) // Remove participants in te war
|
.filter(string -> !inWar.contains(string)) // Remove participants in te war
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package com.github.alathra.AlathranWars.commands;
|
|||||||
import com.github.alathra.AlathranWars.Main;
|
import com.github.alathra.AlathranWars.Main;
|
||||||
import com.github.alathra.AlathranWars.conflict.Side;
|
import com.github.alathra.AlathranWars.conflict.Side;
|
||||||
import com.github.alathra.AlathranWars.conflict.War;
|
import com.github.alathra.AlathranWars.conflict.War;
|
||||||
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
|
||||||
import com.github.alathra.AlathranWars.conflict.WarManager;
|
import com.github.alathra.AlathranWars.conflict.WarManager;
|
||||||
|
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
||||||
import com.github.alathra.AlathranWars.utility.UtilsChat;
|
import com.github.alathra.AlathranWars.utility.UtilsChat;
|
||||||
import com.github.milkdrinkers.colorparser.ColorParser;
|
import com.github.milkdrinkers.colorparser.ColorParser;
|
||||||
import com.palmergames.bukkit.towny.TownyAPI;
|
import com.palmergames.bukkit.towny.TownyAPI;
|
||||||
@@ -192,7 +192,7 @@ public class SiegeCommands {
|
|||||||
ColorParser.of("<prefix>The siege at <town> has been abandoned.")
|
ColorParser.of("<prefix>The siege at <town> has been abandoned.")
|
||||||
.parseMinimessagePlaceholder("prefix", UtilsChat.getPrefix())
|
.parseMinimessagePlaceholder("prefix", UtilsChat.getPrefix())
|
||||||
.parseMinimessagePlaceholder("town", siege.getTown().getName())
|
.parseMinimessagePlaceholder("town", siege.getTown().getName())
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
siege.defendersWin();
|
siege.defendersWin();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,8 +230,8 @@ public class WarCommands {
|
|||||||
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(
|
||||||
ColorParser.of(
|
ColorParser.of(
|
||||||
"<prefix>The town of <town> joined the war of <war> on the side of <side>."
|
"<prefix>The town of <town> joined the war of <war> on the side of <side>."
|
||||||
)
|
)
|
||||||
.parseMinimessagePlaceholder("prefix", UtilsChat.getPrefix())
|
.parseMinimessagePlaceholder("prefix", UtilsChat.getPrefix())
|
||||||
.parseMinimessagePlaceholder("town", town.getName())
|
.parseMinimessagePlaceholder("town", town.getName())
|
||||||
.parseMinimessagePlaceholder("war", war.getLabel())
|
.parseMinimessagePlaceholder("war", war.getLabel())
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import java.util.*;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.*;
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.github.alathra.AlathranWars.listeners;
|
package com.github.alathra.AlathranWars.listeners;
|
||||||
|
|
||||||
import com.github.alathra.AlathranWars.Main;
|
import com.github.alathra.AlathranWars.Main;
|
||||||
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
|
||||||
import com.github.alathra.AlathranWars.conflict.WarManager;
|
import com.github.alathra.AlathranWars.conflict.WarManager;
|
||||||
|
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
||||||
import com.github.alathra.AlathranWars.items.WarItemRegistry;
|
import com.github.alathra.AlathranWars.items.WarItemRegistry;
|
||||||
import com.github.alathra.AlathranWars.utility.UtilsChat;
|
import com.github.alathra.AlathranWars.utility.UtilsChat;
|
||||||
import com.github.milkdrinkers.colorparser.ColorParser;
|
import com.github.milkdrinkers.colorparser.ColorParser;
|
||||||
|
|||||||
+3
-3
@@ -39,7 +39,7 @@ public class PlayerDeathListener implements Listener {
|
|||||||
Player victim = e.getPlayer();
|
Player victim = e.getPlayer();
|
||||||
Player attacker = e.getPlayer().getKiller();
|
Player attacker = e.getPlayer().getKiller();
|
||||||
if (attacker == null) return;
|
if (attacker == null) return;
|
||||||
|
|
||||||
Siege siege = Utils.getClosestSiege(victim, false);
|
Siege siege = Utils.getClosestSiege(victim, false);
|
||||||
if (siege == null) return;
|
if (siege == null) return;
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ public class PlayerDeathListener implements Listener {
|
|||||||
* Damage all gear held by the player (and then send them to spawn?)
|
* Damage all gear held by the player (and then send them to spawn?)
|
||||||
* They don't lose items from death.
|
* They don't lose items from death.
|
||||||
*
|
*
|
||||||
* @param e event
|
* @param e event
|
||||||
*/
|
*/
|
||||||
private void siegeKill(PlayerDeathEvent e) {
|
private void siegeKill(PlayerDeathEvent e) {
|
||||||
// Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "spawn " + victim.getName()); // TODO Re enable?
|
// Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "spawn " + victim.getName()); // TODO Re enable?
|
||||||
@@ -88,7 +88,7 @@ public class PlayerDeathListener implements Listener {
|
|||||||
* Dont damage items held by the player
|
* Dont damage items held by the player
|
||||||
* They don't lose items from death.
|
* They don't lose items from death.
|
||||||
*
|
*
|
||||||
* @param e event
|
* @param e event
|
||||||
*/
|
*/
|
||||||
private void oocKill(PlayerDeathEvent e) {
|
private void oocKill(PlayerDeathEvent e) {
|
||||||
// Bukkit.dispatchCommand((CommandSender)Bukkit.getConsoleSender(), "spawn " + victim.getName()); // TODO Re enable?
|
// Bukkit.dispatchCommand((CommandSender)Bukkit.getConsoleSender(), "spawn " + victim.getName()); // TODO Re enable?
|
||||||
|
|||||||
+1
-1
@@ -1,8 +1,8 @@
|
|||||||
package com.github.alathra.AlathranWars.listeners.siege;
|
package com.github.alathra.AlathranWars.listeners.siege;
|
||||||
|
|
||||||
|
import com.github.alathra.AlathranWars.conflict.WarManager;
|
||||||
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
||||||
import com.github.alathra.AlathranWars.enums.BattleSide;
|
import com.github.alathra.AlathranWars.enums.BattleSide;
|
||||||
import com.github.alathra.AlathranWars.conflict.WarManager;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|||||||
+1
-1
@@ -1,8 +1,8 @@
|
|||||||
package com.github.alathra.AlathranWars.listeners.siege;
|
package com.github.alathra.AlathranWars.listeners.siege;
|
||||||
|
|
||||||
|
import com.github.alathra.AlathranWars.conflict.WarManager;
|
||||||
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
||||||
import com.github.alathra.AlathranWars.enums.BattleSide;
|
import com.github.alathra.AlathranWars.enums.BattleSide;
|
||||||
import com.github.alathra.AlathranWars.conflict.WarManager;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ package com.github.alathra.AlathranWars.utility;
|
|||||||
|
|
||||||
import com.github.alathra.AlathranWars.conflict.Side;
|
import com.github.alathra.AlathranWars.conflict.Side;
|
||||||
import com.github.alathra.AlathranWars.conflict.War;
|
import com.github.alathra.AlathranWars.conflict.War;
|
||||||
|
import com.github.alathra.AlathranWars.conflict.WarManager;
|
||||||
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
||||||
import com.github.alathra.AlathranWars.enums.BattleSide;
|
import com.github.alathra.AlathranWars.enums.BattleSide;
|
||||||
import com.github.alathra.AlathranWars.enums.BattleTeam;
|
import com.github.alathra.AlathranWars.enums.BattleTeam;
|
||||||
import com.github.alathra.AlathranWars.conflict.WarManager;
|
|
||||||
import com.palmergames.bukkit.towny.TownyAPI;
|
import com.palmergames.bukkit.towny.TownyAPI;
|
||||||
import com.palmergames.bukkit.towny.object.Nation;
|
import com.palmergames.bukkit.towny.object.Nation;
|
||||||
import com.palmergames.bukkit.towny.object.Town;
|
import com.palmergames.bukkit.towny.object.Town;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.github.alathra.AlathranWars.utility;
|
package com.github.alathra.AlathranWars.utility;
|
||||||
|
|
||||||
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
|
||||||
import com.github.alathra.AlathranWars.conflict.WarManager;
|
import com.github.alathra.AlathranWars.conflict.WarManager;
|
||||||
|
import com.github.alathra.AlathranWars.conflict.battle.siege.Siege;
|
||||||
import com.palmergames.bukkit.towny.object.WorldCoord;
|
import com.palmergames.bukkit.towny.object.WorldCoord;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|||||||
Reference in new issue
Block a user