Compare commits
6 Commits
d11cf25fc8
...
a10607092b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a10607092b | ||
|
|
fe39cdf5a1 | ||
|
|
6008378258 | ||
|
|
18b211f681 | ||
|
|
b5c59cf173 | ||
|
|
436b462ffe |
|
|
@ -150,10 +150,10 @@ public class SnowballEvent implements Listener {
|
|||
return;
|
||||
}
|
||||
|
||||
if (teamPlayerHit.get().getTeam().getId() == teamPlayerShooter.get().getTeam().getId()) {
|
||||
if (teamPlayerHit.get().getTeam().getId().equals(teamPlayerShooter.get().getTeam().getId())) {
|
||||
log.debug("The shooter hit a member of their own team");
|
||||
return;
|
||||
}
|
||||
consumer.apply(hitPlayer, shooter, teamPlayerHit.get(), snowball);
|
||||
consumer.apply(hitPlayer, shooter, teamPlayerShooter.get(), snowball);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import org.bukkit.inventory.EquipmentSlot;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
|
@ -80,8 +81,14 @@ public class Flag implements Runnable {
|
|||
if (flagCarrier != null) {
|
||||
return;
|
||||
}
|
||||
//TODO knockback enemies from flag location to create space for person who captured mayb short speed boost and heal?
|
||||
//TODO add de-buffs and enable buffs for others?
|
||||
flagLocation.getNearbyPlayers(5).forEach(nearbyPlayer -> {
|
||||
if (nearbyPlayer.getUniqueId().equals(player.getUniqueId())) {
|
||||
return;
|
||||
}
|
||||
Vector direction = nearbyPlayer.getLocation().toVector().subtract(flagLocation.toVector()).normalize();
|
||||
direction.setY(0.2);
|
||||
nearbyPlayer.setVelocity(direction.multiply(5));
|
||||
});
|
||||
player.getInventory().setItem(EquipmentSlot.HEAD, new ItemStack(teamPlayer.getTeam().getFlagMaterial()));
|
||||
Bukkit.getScheduler().runTask(main, () -> flagLocation.getBlock().setType(Material.AIR));
|
||||
flagCarrier = player;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class MageCreator {
|
|||
@Contract("_ -> new")
|
||||
public static @NotNull GameClass createMage(@NotNull TeamColor teamColor) {
|
||||
return new Mage(getArmor(), getTools(teamColor), getDisplayItem(teamColor),
|
||||
20, 100, 5);
|
||||
20, 100, 1);
|
||||
}
|
||||
|
||||
@Contract(value = " -> new", pure = true)
|
||||
|
|
@ -50,7 +50,7 @@ public class MageCreator {
|
|||
}
|
||||
|
||||
private static @NotNull ItemStack getDisplayItem(@NotNull TeamColor teamColor) {
|
||||
ItemStack itemStack = new ItemStack(Material.IRON_SWORD);
|
||||
ItemStack itemStack = new ItemStack(Material.SNOWBALL);
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.displayName(miniMessage.deserialize(String.format("<color:%s>Mage</color>", teamColor.hex())));
|
||||
itemMeta.lore(List.of(
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ import org.jetbrains.annotations.Contract;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
@Slf4j
|
||||
public class TrapperCreator {
|
||||
|
|
@ -32,17 +34,22 @@ public class TrapperCreator {
|
|||
|
||||
@Contract("_ -> new")
|
||||
private static @NotNull @Unmodifiable List<ItemStack> getTools(TeamColor teamColor) {
|
||||
return (List.of(getShovel(teamColor), getPowderedSnow(teamColor)));
|
||||
List<ItemStack> itemStacks = new ArrayList<>(List.of(getShovel(teamColor)));
|
||||
itemStacks.addAll(getPowderedSnow(teamColor));
|
||||
return itemStacks;
|
||||
}
|
||||
|
||||
private static @NotNull ItemStack getPowderedSnow(@NotNull TeamColor teamColor) {
|
||||
private static @NotNull List<ItemStack> getPowderedSnow(@NotNull TeamColor teamColor) {
|
||||
ItemStack powderedSnow = new ItemStack(Material.POWDER_SNOW_BUCKET);
|
||||
powderedSnow.setAmount(16);
|
||||
ItemMeta itemMeta = powderedSnow.getItemMeta();
|
||||
itemMeta.itemName(MiniMessage.miniMessage().deserialize(
|
||||
String.format("<color:%s>Snow Trap</color>", teamColor.hex())));
|
||||
powderedSnow.setItemMeta(itemMeta);
|
||||
return powderedSnow;
|
||||
List<ItemStack> snowBuckets = new ArrayList<>();
|
||||
for (int i = 0; i < 16; i++) {
|
||||
snowBuckets.add(powderedSnow.clone());
|
||||
}
|
||||
return snowBuckets;
|
||||
}
|
||||
|
||||
private static @NotNull ItemStack getShovel(@NotNull TeamColor teamColor) {
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ public class Mage extends GameClass {
|
|||
|
||||
snowball.setShooter(shooter);
|
||||
|
||||
double velocityChangeX = (Math.random() - 0.5) * 0.2;
|
||||
double velocityChangeY = (Math.random() - 0.5) * 0.2;
|
||||
double velocityChangeZ = (Math.random() - 0.5) * 0.2;
|
||||
double velocityChangeX = (Math.random() - 0.5) * 0.5;
|
||||
double velocityChangeY = (Math.random() - 0.5) * 0.5;
|
||||
double velocityChangeZ = (Math.random() - 0.5) * 0.5;
|
||||
|
||||
Vector newVelocity = velocity.clone().add(new Vector(velocityChangeX, velocityChangeY, velocityChangeZ));
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public final class PlayerStat {
|
|||
case TIME_SPEND_CAPTURING_FLAG -> timeSpendCapturingFlag++;
|
||||
case DEATHS_IN_POWDERED_SNOW -> {
|
||||
if (someoneDiedInPowderedSnow) {
|
||||
deathsInPowderedSnow++; //TODO announce if they are the first person to do this and save they are the first
|
||||
deathsInPowderedSnow++;
|
||||
return;
|
||||
}
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(uuid);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
#Fri Feb 28 23:59:35 CET 2025
|
||||
buildNumber=83
|
||||
#Sat Mar 01 00:39:55 CET 2025
|
||||
buildNumber=91
|
||||
version=0.1
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user