diff --git a/src/de/steamwar/lobby/LobbySystem.properties b/src/de/steamwar/lobby/LobbySystem.properties index 8cc5995..70e0c9c 100644 --- a/src/de/steamwar/lobby/LobbySystem.properties +++ b/src/de/steamwar/lobby/LobbySystem.properties @@ -52,6 +52,7 @@ PARTICLE_ATTRIBUTE_SEPARATOR = §f PARTICLE_SELECT = §eClick to select PARTICLE_LOCKED = §c§lLocked +PARTICLE_DEACTIVATED = §cThere are too many players online, particles are deactivated PARTICLE_SNEEZE = §aSneeze PARTICLE_SMOKE = §7Smoke @@ -89,13 +90,32 @@ PARTICLE_MAGIC_ENCHANTING = §5Magic/Enchantment PARTICLE_WINGS_EVIL = §5Purple wings PARTICLE_PLAYER_HAYLIM_AURA = §fHaylim\'s Aura +PARTICLE_PLAYER_RONGAMER99091_AURA = §7Smoke Granade + +PARTICLE_TEAM_PULSE_AURA_1 = §fPulse Aura §cFlame +PARTICLE_TEAM_PULSE_AURA_2 = §fPulse Aura §7End Rod +PARTICLE_TEAM_PULSE_AURA_3 = §fPulse Aura §fEnchanted +PARTICLE_TEAM_PULSE_LOGO = §fPulse Logo + +PARTICLE_RAINCLOUD_NORMAL = §fRaincloud +PARTICLE_RAINCLOUD_RED = §fLava cloud +PARTICLE_RAINCLOUD_YELLOW = §fNectar cloud +PARTICLE_RAINCLOUD_ORANGE = §fHoney cloud +PARTICLE_RAINCLOUD_GREEN = §fSpore Blossom cloud +PARTICLE_RAINCLOUD_PURPLE = §fObsidian Tears cloud +PARTICLE_RAINCLOUD_NAUTILUS = §fNautilus cloud +PARTICLE_RAINCLOUD_ENCHANTMENT = §fEnchantment cloud +PARTICLE_RAINCLOUD_SLIME = §fSlime cloud +PARTICLE_RAINCLOUD_HAIL = §fHail cloud +PARTICLE_RAINCLOUD_SNOW = §fSnow cloud +PARTICLE_RAINCLOUD_TOTEM = §fTotem cloud PARTICLE_EVENT_ENCHANTING = §cEnchantment PARTICLE_EVENT_CLOUD = §fClouds PARTICLE_EVENT_SMOKE = §7Smoke PARTICLE_EVENT_WATER = §bWater PARTICLE_EVENT_WINGS = §fWings -PARTICLE_EVENT_RAIN_CLOUD = §fRaincloud +PARTICLE_EVENT_RAIN_CLOUD = §fRandom Raincloud PARTICLE_EVENT_WGS = §fWGS PARTICLE_EVENT_WARGEARCLASH = §fClash diff --git a/src/de/steamwar/lobby/LobbySystem_de.properties b/src/de/steamwar/lobby/LobbySystem_de.properties index a836eeb..c5ff141 100644 --- a/src/de/steamwar/lobby/LobbySystem_de.properties +++ b/src/de/steamwar/lobby/LobbySystem_de.properties @@ -51,6 +51,7 @@ PARTICLE_ATTRIBUTE = §eAttribute§7: PARTICLE_SELECT = §eZum Auswählen klicken PARTICLE_LOCKED = §c§lGesperrt +PARTICLE_DEACTIVATED = §cEs sind zu viele Spieler online! Partikel sind deaktiviert. PARTICLE_SNEEZE = §aSneeze PARTICLE_SMOKE = §7Rauch @@ -87,6 +88,21 @@ PARTICLE_WATER_FIRE = §bWasser§7/§cFeuer PARTICLE_MAGIC_ENCHANTING = §5Magie§7/§eZauber PARTICLE_WINGS_EVIL = §5Lila Flügel +PARTICLE_PLAYER_RONGAMER99091_AURA = §7Rauchgranate + +PARTICLE_RAINCLOUD_NORMAL = §fRegenwolke +PARTICLE_RAINCLOUD_RED = §fLavawolke +PARTICLE_RAINCLOUD_YELLOW = §fNektarwolke +PARTICLE_RAINCLOUD_ORANGE = §fHonigwolke +PARTICLE_RAINCLOUD_GREEN = §fSporenwolke +PARTICLE_RAINCLOUD_PURPLE = §fObsidanwolke +PARTICLE_RAINCLOUD_NAUTILUS = §fNautiluswolke +PARTICLE_RAINCLOUD_ENCHANTMENT = §fVerzauberungswolke +PARTICLE_RAINCLOUD_SLIME = §fSchleimwolke +PARTICLE_RAINCLOUD_HAIL = §fHagelwolke +PARTICLE_RAINCLOUD_SNOW = §fSchneewolke +PARTICLE_RAINCLOUD_TOTEM = §fTotemwolke + PARTICLE_EVENT_ENCHANTING = §cVerzaubert PARTICLE_EVENT_CLOUD = §fWolken PARTICLE_EVENT_SMOKE = §7Rauch diff --git a/src/de/steamwar/lobby/particle/ParticleElement.java b/src/de/steamwar/lobby/particle/ParticleElement.java index 3b14c14..c9fac94 100644 --- a/src/de/steamwar/lobby/particle/ParticleElement.java +++ b/src/de/steamwar/lobby/particle/ParticleElement.java @@ -24,8 +24,15 @@ public interface ParticleElement { return new Particle.DustOptions(randomColor(), randomSize()); } - default void display(Location location, Consumer consumer) { + default void display(Location location, Player root, boolean onlySelf, boolean onlyOther, Consumer consumer) { + if (onlySelf) { + consumer.accept(root); + return; + } Bukkit.getOnlinePlayers().forEach(player -> { + if (onlyOther && player == root) { + return; + } int viewDistance = player.getClientViewDistance() * 16; if (location.distanceSquared(player.getLocation()) <= viewDistance * viewDistance) { consumer.accept(player); diff --git a/src/de/steamwar/lobby/particle/ParticleInventory.java b/src/de/steamwar/lobby/particle/ParticleInventory.java index 8762616..86b80ce 100644 --- a/src/de/steamwar/lobby/particle/ParticleInventory.java +++ b/src/de/steamwar/lobby/particle/ParticleInventory.java @@ -32,6 +32,7 @@ public class ParticleInventory { CustomPlayerParticle.class, TeamParticle.class, CustomTeamParticle.class, + RainCloudParticle.class, ServerTeamParticle.class, EventParticle.class, EventParticlePlacement.class, @@ -60,7 +61,6 @@ public class ParticleInventory { return null; } } - // TODO: Add conversion from last version return null; } @@ -84,6 +84,9 @@ public class ParticleInventory { if (particle == null) return; lobbyPlayer.setParticle(particle); player.closeInventory(); + if (ParticleListener.disabled(player)) { + LobbySystem.getMessage().send("PARTICLE_DEACTIVATED", player); + } }); particleSWListInv.setItem(48, Material.BARRIER, LobbySystem.getMessage().parse("PARTICLE_DESELECT", player), new ArrayList<>(), false, clickType -> { lobbyPlayer.setParticle(null); diff --git a/src/de/steamwar/lobby/particle/ParticleListener.java b/src/de/steamwar/lobby/particle/ParticleListener.java index c52ee18..c4000de 100644 --- a/src/de/steamwar/lobby/particle/ParticleListener.java +++ b/src/de/steamwar/lobby/particle/ParticleListener.java @@ -24,6 +24,7 @@ import de.steamwar.lobby.jumpandrun.JumpAndRun; import de.steamwar.lobby.listener.BasicListener; import de.steamwar.lobby.listener.PlayerSpawn; import de.steamwar.lobby.util.LobbyPlayer; +import de.steamwar.sql.SteamwarUser; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -39,6 +40,7 @@ import java.util.Map; public class ParticleListener extends BasicListener { private static final int PLAYER_MAX_SIZE = 20; + private static final int SERVER_TEAM_MAX_SIZE = 40; private static double deg = 0; @@ -48,12 +50,10 @@ public class ParticleListener extends BasicListener { Bukkit.getScheduler().runTaskTimer(LobbySystem.getPlugin(), () -> { movingPlayers.replaceAll((player, integer) -> integer - 1); movingPlayers.entrySet().removeIf(entry -> entry.getValue() <= 0); - if (Bukkit.getOnlinePlayers().size() > PLAYER_MAX_SIZE) { - return; - } deg += 0.1; if (deg > 360) deg = 0; Bukkit.getOnlinePlayers().forEach(player -> { + if (disabled(player)) return; if (JumpAndRun.isPlayerInJumpAndRun(player)) return; LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player.getUniqueId()); ParticleEnum particle = lobbyPlayer.getParticle(); @@ -69,7 +69,6 @@ public class ParticleListener extends BasicListener { @EventHandler(priority = EventPriority.NORMAL) public void handlePlayerInteract(PlayerInteractEvent event) { - if (Bukkit.getOnlinePlayers().size() > PLAYER_MAX_SIZE) return; Player player = event.getPlayer(); if (JumpAndRun.isPlayerInJumpAndRun(player)) return; if (!PlayerSpawn.PARTICLE.equals(event.getItem())) return; @@ -80,8 +79,8 @@ public class ParticleListener extends BasicListener { @EventHandler public void handlePlayerMove(PlayerMoveEvent event) { - if (Bukkit.getOnlinePlayers().size() > PLAYER_MAX_SIZE) return; Player player = event.getPlayer(); + if (disabled(player)) return; if (JumpAndRun.isPlayerInJumpAndRun(player)) return; LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player.getUniqueId()); ParticleEnum particle = lobbyPlayer.getParticle(); @@ -108,4 +107,10 @@ public class ParticleListener extends BasicListener { event.setCancelled(true); } } + + public static boolean disabled(Player player) { + SteamwarUser user = SteamwarUser.get(player.getUniqueId()); + if (Bukkit.getOnlinePlayers().size() > SERVER_TEAM_MAX_SIZE) return true; + return Bukkit.getOnlinePlayers().size() > PLAYER_MAX_SIZE && !user.getUserGroup().isAdminGroup(); + } } diff --git a/src/de/steamwar/lobby/particle/ParticleTickData.java b/src/de/steamwar/lobby/particle/ParticleTickData.java index b85da90..30cac11 100644 --- a/src/de/steamwar/lobby/particle/ParticleTickData.java +++ b/src/de/steamwar/lobby/particle/ParticleTickData.java @@ -17,6 +17,8 @@ public class ParticleTickData { private Location location; private final double deg; private final boolean isMoving; + private boolean onlySelf = false; + private boolean onlyOthers = false; public ParticleTickData withLocation(Location location) { ParticleTickData particleTickData = copy(); @@ -24,6 +26,18 @@ public class ParticleTickData { return particleTickData; } + public ParticleTickData onlySelf() { + ParticleTickData particleTickData = copy(); + particleTickData.onlySelf = true; + return particleTickData; + } + + public ParticleTickData onlyOthers() { + ParticleTickData particleTickData = copy(); + particleTickData.onlyOthers = true; + return particleTickData; + } + public Location getLocation() { if (location == null) { return player.getLocation(); @@ -32,6 +46,6 @@ public class ParticleTickData { } public ParticleTickData copy() { - return new ParticleTickData(world, player, location, deg, isMoving); + return new ParticleTickData(world, player, location, deg, isMoving, onlySelf, onlyOthers); } } diff --git a/src/de/steamwar/lobby/particle/WingDesign.java b/src/de/steamwar/lobby/particle/WingDesign.java index dccb208..3c3358b 100644 --- a/src/de/steamwar/lobby/particle/WingDesign.java +++ b/src/de/steamwar/lobby/particle/WingDesign.java @@ -50,4 +50,5 @@ public interface WingDesign { WingDesign MWGL = new WingDesignImpl(create("/de/steamwar/lobby/particle/decorator/MWGL.png")); WingDesign ECLIPSE = new WingDesignImpl(create("/de/steamwar/lobby/particle/decorator/ECLIPSE-Logo.png")); + WingDesign PL = new WingDesignImpl(create("/de/steamwar/lobby/particle/decorator/PL-Logo.png")); } diff --git a/src/de/steamwar/lobby/particle/decorator/PL-Logo-Old.png b/src/de/steamwar/lobby/particle/decorator/PL-Logo-Old.png new file mode 100644 index 0000000..40c36bc Binary files /dev/null and b/src/de/steamwar/lobby/particle/decorator/PL-Logo-Old.png differ diff --git a/src/de/steamwar/lobby/particle/decorator/PL-Logo.png b/src/de/steamwar/lobby/particle/decorator/PL-Logo.png new file mode 100644 index 0000000..9349444 Binary files /dev/null and b/src/de/steamwar/lobby/particle/decorator/PL-Logo.png differ diff --git a/src/de/steamwar/lobby/particle/elements/Circle.java b/src/de/steamwar/lobby/particle/elements/Circle.java index a086e4a..272886b 100644 --- a/src/de/steamwar/lobby/particle/elements/Circle.java +++ b/src/de/steamwar/lobby/particle/elements/Circle.java @@ -7,8 +7,19 @@ import org.bukkit.util.Vector; public class Circle extends DelegatingParticleElement { + private double distance; + private double speed; + public Circle(ParticleElement particleElement) { super(particleElement); + this.distance = 1; + this.speed = 1; + } + + public Circle(ParticleElement particleElement, double distance, double speed) { + super(particleElement); + this.distance = distance; + this.speed = speed; } @Override @@ -20,8 +31,8 @@ public class Circle extends DelegatingParticleElement { public void tick(ParticleTickData particleTickData) { Location location = particleTickData.getLocation(); - Vector vector = new Vector(1, 0, 0); - vector.rotateAroundY(particleTickData.getDeg()); + Vector vector = new Vector(distance, 0, 0); + vector.rotateAroundY((particleTickData.getDeg() * speed) % 360); ParticleTickData nParticleTickData = particleTickData.withLocation(location.clone().add(vector)); particleElement.tick(nParticleTickData); } diff --git a/src/de/steamwar/lobby/particle/elements/DoubleCircle.java b/src/de/steamwar/lobby/particle/elements/DoubleCircle.java index 926f5f2..3d777c2 100644 --- a/src/de/steamwar/lobby/particle/elements/DoubleCircle.java +++ b/src/de/steamwar/lobby/particle/elements/DoubleCircle.java @@ -10,9 +10,21 @@ public class DoubleCircle extends Circle { private ParticleElement second; + private double distance; + private double speed; + public DoubleCircle(ParticleElement first, ParticleElement second) { super(first); this.second = second; + this.distance = 1; + this.speed = 1; + } + + public DoubleCircle(ParticleElement first, ParticleElement second, double distance, double speed) { + super(first); + this.second = second; + this.distance = distance; + this.speed = speed; } @Override @@ -25,7 +37,6 @@ public class DoubleCircle extends Circle { if (particleElement.tickType() == second.tickType()) { return particleElement.tickType(); } - // TODO: This could be improved but I will not do it return ParticleTickType.MOVE; } @@ -33,8 +44,8 @@ public class DoubleCircle extends Circle { public void tick(ParticleTickData particleTickData) { Location location = particleTickData.getLocation(); - Vector vector = new Vector(1, 0, 0); - vector.rotateAroundY(particleTickData.getDeg()); + Vector vector = new Vector(distance, 0, 0); + vector.rotateAroundY((particleTickData.getDeg() * speed) % 360); ParticleTickData nParticleTickData = particleTickData.withLocation(location.clone().add(vector)); particleElement.tick(nParticleTickData); diff --git a/src/de/steamwar/lobby/particle/elements/DustParticle.java b/src/de/steamwar/lobby/particle/elements/DustParticle.java index 24ef229..9c2f838 100644 --- a/src/de/steamwar/lobby/particle/elements/DustParticle.java +++ b/src/de/steamwar/lobby/particle/elements/DustParticle.java @@ -37,7 +37,7 @@ public class DustParticle implements ParticleElement { @Override public void tick(ParticleTickData particleTickData) { Location location = particleTickData.getLocation().add(0.0, 0.2, 0.0); - display(location, player -> { + display(location, particleTickData.getPlayer(), particleTickData.isOnlySelf(), particleTickData.isOnlyOthers(), player -> { player.spawnParticle(particle, location, count, vx, vy, vz, speed, randomParticleDust()); }); } diff --git a/src/de/steamwar/lobby/particle/elements/OnlyOthers.java b/src/de/steamwar/lobby/particle/elements/OnlyOthers.java new file mode 100644 index 0000000..b9068a3 --- /dev/null +++ b/src/de/steamwar/lobby/particle/elements/OnlyOthers.java @@ -0,0 +1,21 @@ +package de.steamwar.lobby.particle.elements; + +import de.steamwar.lobby.particle.ParticleElement; +import de.steamwar.lobby.particle.ParticleTickData; + +public class OnlyOthers extends DelegatingParticleElement { + + public OnlyOthers(ParticleElement particleElement) { + super(particleElement); + } + + @Override + public String attribute() { + return null; + } + + @Override + public void tick(ParticleTickData particleTickData) { + particleElement.tick(particleTickData.onlyOthers()); + } +} diff --git a/src/de/steamwar/lobby/particle/elements/OnlySelf.java b/src/de/steamwar/lobby/particle/elements/OnlySelf.java new file mode 100644 index 0000000..feb96d0 --- /dev/null +++ b/src/de/steamwar/lobby/particle/elements/OnlySelf.java @@ -0,0 +1,21 @@ +package de.steamwar.lobby.particle.elements; + +import de.steamwar.lobby.particle.ParticleElement; +import de.steamwar.lobby.particle.ParticleTickData; + +public class OnlySelf extends DelegatingParticleElement { + + public OnlySelf(ParticleElement particleElement) { + super(particleElement); + } + + @Override + public String attribute() { + return null; + } + + @Override + public void tick(ParticleTickData particleTickData) { + particleElement.tick(particleTickData.onlySelf()); + } +} diff --git a/src/de/steamwar/lobby/particle/elements/RandomParticle.java b/src/de/steamwar/lobby/particle/elements/RandomParticle.java new file mode 100644 index 0000000..def3cab --- /dev/null +++ b/src/de/steamwar/lobby/particle/elements/RandomParticle.java @@ -0,0 +1,57 @@ +package de.steamwar.lobby.particle.elements; + +import de.steamwar.lobby.LobbySystem; +import de.steamwar.lobby.particle.ParticleElement; +import de.steamwar.lobby.particle.ParticleEnum; +import de.steamwar.lobby.particle.ParticleTickData; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerQuitEvent; + +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + +public class RandomParticle implements ParticleElement { + + private RandomData randomData; + private ParticleEnum[] particleEnums; + + private static class RandomData implements Listener { + private Random random = new Random(); + private int max; + private Map data = new HashMap<>(); + + public RandomData(int max) { + this.max = max; + } + + @EventHandler(ignoreCancelled = true) + public void onPlayerJoin(PlayerJoinEvent event) { + data.put(event.getPlayer(), random.nextInt(max)); + } + + @EventHandler(ignoreCancelled = true) + public void onPlayerQuit(PlayerQuitEvent event) { + data.remove(event.getPlayer()); + } + } + + public RandomParticle(ParticleEnum... particleEnums) { + if (particleEnums.length == 0) { + throw new IllegalArgumentException("ParticleEnums must not be empty"); + } + this.randomData = new RandomData(particleEnums.length); + Bukkit.getPluginManager().registerEvents(randomData, LobbySystem.getPlugin()); + this.particleEnums = particleEnums; + } + + @Override + public void tick(ParticleTickData particleTickData) { + int currentNumber = randomData.data.getOrDefault(particleTickData.getPlayer(), 0); + particleEnums[currentNumber].getParticle().getParticleElement().tick(particleTickData); + } +} diff --git a/src/de/steamwar/lobby/particle/elements/SimpleParticle.java b/src/de/steamwar/lobby/particle/elements/SimpleParticle.java index fc678b0..760f4eb 100644 --- a/src/de/steamwar/lobby/particle/elements/SimpleParticle.java +++ b/src/de/steamwar/lobby/particle/elements/SimpleParticle.java @@ -55,7 +55,7 @@ public class SimpleParticle implements ParticleElement { @Override public void tick(ParticleTickData particleTickData) { Location location = particleTickData.getLocation().add(0.0, 0.2, 0.0); - display(location, player -> { + display(location, particleTickData.getPlayer(), particleTickData.isOnlySelf(), particleTickData.isOnlyOthers(), player -> { if (customVelocity) { player.spawnParticle(particle, location, count, vx, vy, vz, time); } else { diff --git a/src/de/steamwar/lobby/particle/elements/custom/PulseShimmer.java b/src/de/steamwar/lobby/particle/elements/custom/PulseShimmer.java new file mode 100644 index 0000000..f286f14 --- /dev/null +++ b/src/de/steamwar/lobby/particle/elements/custom/PulseShimmer.java @@ -0,0 +1,50 @@ +package de.steamwar.lobby.particle.elements.custom; + +import de.steamwar.lobby.particle.ParticleElement; +import de.steamwar.lobby.particle.ParticleTickData; +import de.steamwar.lobby.particle.elements.DelegatingParticleElement; +import org.bukkit.util.Vector; + +public class PulseShimmer extends DelegatingParticleElement { + + private int speed; + private int rotationSpeed; + + private double x(double time) { + if (time < 0.45) { + return Math.pow(2, -Math.pow((time - 0.45) * 6, 2)) * 0.8; + } else { + return Math.pow(2, -Math.pow((time - 0.45) * 4, 2)) * 0.8; + } + } + + private double y(double time) { + return (8 * Math.pow(time, 2.2) - time) / (6.5 / 3.5) -0.1; + } + + public PulseShimmer(ParticleElement particleElement, int speed, int rotationSpeed) { + super(particleElement); + this.speed = speed; + this.rotationSpeed = rotationSpeed; + } + + @Override + public String attribute() { + return null; + } + + @Override + public void tick(ParticleTickData particleTickData) { + double time = ((particleTickData.getDeg() * speed) % 360) / 360.0; + double x = x(time); + double y = y(time); + Vector vector = new Vector(x, y, 0); + vector.rotateAroundY((particleTickData.getDeg() * rotationSpeed) % 360); + + particleElement.tick(particleTickData.withLocation(particleTickData.getLocation().clone().add(vector))); + vector.rotateAroundY(90); + particleElement.tick(particleTickData.withLocation(particleTickData.getLocation().clone().add(vector))); + vector.rotateAroundY(90); + particleElement.tick(particleTickData.withLocation(particleTickData.getLocation().clone().add(vector))); + } +} diff --git a/src/de/steamwar/lobby/particle/particles/EventParticleParticipation.java b/src/de/steamwar/lobby/particle/particles/EventParticleParticipation.java index a128623..761aeda 100644 --- a/src/de/steamwar/lobby/particle/particles/EventParticleParticipation.java +++ b/src/de/steamwar/lobby/particle/particles/EventParticleParticipation.java @@ -32,7 +32,7 @@ public enum EventParticleParticipation implements ParticleEnum { new Circle(new SimpleParticle(Particle.WATER_WAKE, 0, 0, 0, 0))) ), UnderwaterMWG(new ParticleData(Material.BLUE_CARPET, "PARTICLE_EVENT_RAIN_CLOUD", ParticleRequirement.eventParticipation(35), - new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new SimpleParticle(Particle.WATER_WAKE, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.DRIP_WATER, 0.3F, 0.0F, 0.3F, 0.01), 0, 0.2, 0)), 0, 2.2, 0))) + new Always(new RandomParticle(RainCloudParticle.values()))) ), WarGearSeason2022(new ParticleData(Material.DIAMOND_SWORD, "PARTICLE_EVENT_WINGS", ParticleRequirement.eventParticipation(37), new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.DRAGON_BREATH, 0, 0, 0, 0, 1), 0.15, WingDesign.COMPLEX)), 20))) diff --git a/src/de/steamwar/lobby/particle/particles/RainCloudParticle.java b/src/de/steamwar/lobby/particle/particles/RainCloudParticle.java new file mode 100644 index 0000000..85b495f --- /dev/null +++ b/src/de/steamwar/lobby/particle/particles/RainCloudParticle.java @@ -0,0 +1,59 @@ +package de.steamwar.lobby.particle.particles; + +import de.steamwar.lobby.particle.ParticleData; +import de.steamwar.lobby.particle.ParticleEnum; +import de.steamwar.lobby.particle.ParticleRequirement; +import de.steamwar.lobby.particle.elements.Always; +import de.steamwar.lobby.particle.elements.Group; +import de.steamwar.lobby.particle.elements.LocationMutator; +import de.steamwar.lobby.particle.elements.SimpleParticle; +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.bukkit.Material; +import org.bukkit.Particle; + +@AllArgsConstructor +public enum RainCloudParticle implements ParticleEnum { + + Raincloud(new ParticleData(Material.BLUE_CARPET, "PARTICLE_RAINCLOUD_NORMAL", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new SimpleParticle(Particle.WATER_WAKE, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.DRIP_WATER, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Red_Raincloud(new ParticleData(Material.RED_CARPET, "PARTICLE_RAINCLOUD_RED", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.DRIP_LAVA, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Yellow_Raincloud(new ParticleData(Material.YELLOW_CARPET, "PARTICLE_RAINCLOUD_YELLOW", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.FALLING_NECTAR, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Orange_Raincloud(new ParticleData(Material.ORANGE_CARPET, "PARTICLE_RAINCLOUD_ORANGE", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.FALLING_HONEY, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Green_Raincloud(new ParticleData(Material.LIME_CARPET, "PARTICLE_RAINCLOUD_GREEN", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Purple_Raincloud(new ParticleData(Material.PURPLE_CARPET, "PARTICLE_RAINCLOUD_PURPLE", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.FALLING_OBSIDIAN_TEAR, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Nautilus_Raincloud(new ParticleData(Material.NAUTILUS_SHELL, "PARTICLE_RAINCLOUD_NAUTILUS", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.NAUTILUS, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Enchantment_Raincloud(new ParticleData(Material.ENCHANTED_BOOK, "PARTICLE_RAINCLOUD_ENCHANTMENT", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Slime_Raincloud(new ParticleData(Material.GREEN_CARPET, "PARTICLE_RAINCLOUD_SLIME", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.SLIME, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Hail_Raincloud(new ParticleData(Material.LIGHT_GRAY_CARPET, "PARTICLE_RAINCLOUD_HAIL", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.SNOWBALL, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Snow_Raincloud(new ParticleData(Material.WHITE_CARPET, "PARTICLE_RAINCLOUD_SNOW", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.SNOWFLAKE, 0.3F, 0.0F, 0.3F, 0.01), 0, -0.3, 0)), 0, 2.4, 0))) + ), + Totem_Raincloud(new ParticleData(Material.TOTEM_OF_UNDYING, "PARTICLE_RAINCLOUD_TOTEM", ParticleRequirement.HAS_TEAM, + new Always(new LocationMutator(new Group(new SimpleParticle(Particle.CLOUD, 0.3F, 0.1F, 0.3F, 0.01), new LocationMutator(new SimpleParticle(Particle.TOTEM, 0.3F, 0.0F, 0.3F, 0.01, 2), 0, -0.3, 0)), 0, 2.4, 0))) + ), + ; + public static ParticleEnum[] particles = values(); + + @Getter + private ParticleData particle; +} diff --git a/src/de/steamwar/lobby/particle/particles/custom/CustomEasterParticle.java b/src/de/steamwar/lobby/particle/particles/custom/CustomEasterParticle.java index 456d609..5b73c54 100644 --- a/src/de/steamwar/lobby/particle/particles/custom/CustomEasterParticle.java +++ b/src/de/steamwar/lobby/particle/particles/custom/CustomEasterParticle.java @@ -2,12 +2,38 @@ package de.steamwar.lobby.particle.particles.custom; import de.steamwar.lobby.particle.ParticleData; import de.steamwar.lobby.particle.ParticleEnum; +import de.steamwar.lobby.particle.ParticleRequirement; +import de.steamwar.lobby.particle.WingDesign; +import de.steamwar.lobby.particle.elements.*; +import de.steamwar.lobby.particle.elements.custom.NonMoving; +import de.steamwar.lobby.particle.elements.custom.PulseShimmer; import lombok.AllArgsConstructor; import lombok.Getter; +import org.bukkit.Material; +import org.bukkit.Particle; @AllArgsConstructor public enum CustomEasterParticle implements ParticleEnum { + Lord_Loading(new ParticleData(Material.ENDER_PEARL, "Loading Test", ParticleRequirement.easterEventSpecificPlayer(1063), + new Always(new DoubleCircle(new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1), + new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1), 0.5, 4), + new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1), + new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01, 1), 0.5, 4), 1.5, 1))) + ), + Rongamer99091(new ParticleData(Material.GUNPOWDER, "PARTICLE_PLAYER_RONGAMER99091_AURA", ParticleRequirement.easterEventSpecificPlayer(10697), + new Always(new Sneaking(new Group( + new OnlySelf(new Delayed(new SimpleParticle(Particle.EXPLOSION_HUGE, 0, 0, 0, 0.01, 1), 20)), + new OnlyOthers(new Delayed(new SimpleParticle(Particle.EXPLOSION_HUGE, 0, 0, 0, 0.01, 1), 2)) + )))) + ), + + Pulse_EASTER_1(new ParticleData(Material.RED_CANDLE, "PARTICLE_TEAM_PULSE_AURA_1", ParticleRequirement.easterEventSpecificTeam(210), + new Always(new NonMoving(new PulseShimmer(new SimpleParticle(Particle.FLAME, 0, 0, 0, 0, 1), 80, 2)))) + ), + Pulse_Logo(new ParticleData(Material.ENDER_CHEST, "PARTICLE_TEAM_PULSE_LOGO", ParticleRequirement.easterEventSpecificTeam(210), + new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.END_ROD, 0, 0, 0, 0, 1), 0.15, WingDesign.PL)), 80))) + ), ; public static ParticleEnum[] particles = values(); diff --git a/src/de/steamwar/lobby/particle/particles/custom/CustomTeamParticle.java b/src/de/steamwar/lobby/particle/particles/custom/CustomTeamParticle.java index 37d956c..9af8c58 100644 --- a/src/de/steamwar/lobby/particle/particles/custom/CustomTeamParticle.java +++ b/src/de/steamwar/lobby/particle/particles/custom/CustomTeamParticle.java @@ -5,6 +5,8 @@ import de.steamwar.lobby.particle.ParticleEnum; import de.steamwar.lobby.particle.ParticleRequirement; import de.steamwar.lobby.particle.WingDesign; import de.steamwar.lobby.particle.elements.*; +import de.steamwar.lobby.particle.elements.custom.NonMoving; +import de.steamwar.lobby.particle.elements.custom.PulseShimmer; import lombok.AllArgsConstructor; import lombok.Getter; import org.bukkit.Material; @@ -14,7 +16,13 @@ import org.bukkit.Particle; public enum CustomTeamParticle implements ParticleEnum { Eclipse(new ParticleData(Material.ENDER_CHEST, "PARTICLE_EVENT_ENCHANTING", ParticleRequirement.specificTeam(34), - new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.PORTAL, 0, 0, 0, 0.01), 0.15, WingDesign.ECLIPSE)), 20))) + new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.END_ROD, 0, 0, 0, 0, 1), 0.15, WingDesign.ECLIPSE)), 80))) + ), + Pulse_1(new ParticleData(Material.GRAY_CANDLE, "PARTICLE_TEAM_PULSE_AURA_2", ParticleRequirement.specificTeam(210), + new Always(new NonMoving(new PulseShimmer(new SimpleParticle(Particle.END_ROD, 0, 0, 0, 0, 1), 80, 2)))) + ), + Pulse_2(new ParticleData(Material.WHITE_CANDLE, "PARTICLE_TEAM_PULSE_AURA_3", ParticleRequirement.specificTeam(210), + new Always(new NonMoving(new PulseShimmer(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0, 5), 80, 2)))) ), ; public static ParticleEnum[] particles = values();