Compare commits
2 Commits
400032a94c
...
4f0a4eff6f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f0a4eff6f | ||
|
|
c02bda6ea7 |
|
|
@ -11,7 +11,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
import net.kyori.adventure.title.Title;
|
||||
import org.bukkit.*;
|
||||
|
|
@ -22,6 +21,8 @@ import org.bukkit.boss.KeyedBossBar;
|
|||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
|
@ -83,6 +84,7 @@ public class Flag implements Runnable {
|
|||
player.getInventory().setItem(EquipmentSlot.HEAD, new ItemStack(teamPlayer.getTeam().getFlagMaterial()));
|
||||
Bukkit.getScheduler().runTask(main, () -> flagLocation.getBlock().setType(Material.AIR));
|
||||
flagCarrier = player;
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, PotionEffect.INFINITE_DURATION, 0, false, false));
|
||||
notifyAboutCapture();
|
||||
resetFlag();
|
||||
}
|
||||
|
|
@ -142,7 +144,10 @@ public class Flag implements Runnable {
|
|||
} else {
|
||||
winningTeam = optionalTeam.get();
|
||||
spawnFlag(winningTeam.getFlagMaterial());
|
||||
//TODO stop capture and let ppl know they can now capture the flag
|
||||
updateDisplay();
|
||||
Title title = Title.title(MiniMessage.miniMessage().deserialize("Team <team> can capture the flag",
|
||||
Placeholder.component("team", winningTeam.getName())), Component.empty());
|
||||
Bukkit.getOnlinePlayers().forEach(player -> player.showTitle(title));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -351,6 +356,8 @@ public class Flag implements Runnable {
|
|||
}
|
||||
|
||||
public void resetFlagCarrier() {
|
||||
final Player player = flagCarrier;
|
||||
Bukkit.getScheduler().runTask(main, player::clearActivePotionEffects);
|
||||
flagCarrier = null;
|
||||
winningTeam = null;
|
||||
particleTrail.clear();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
#Sat Feb 15 03:47:20 CET 2025
|
||||
buildNumber=50
|
||||
#Sat Feb 15 04:08:38 CET 2025
|
||||
buildNumber=55
|
||||
version=0.1
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user