Add BauSystem module
Fix ci java version Fix LinkageProcessor
@@ -0,0 +1,76 @@
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class ParticleData {
|
||||
|
||||
private final Material material;
|
||||
private final String name;
|
||||
private final List<String> attributes = new ArrayList<>();
|
||||
|
||||
@Getter
|
||||
private final ParticleRequirement requirement;
|
||||
|
||||
@Getter
|
||||
private final ParticleElement particleElement;
|
||||
|
||||
public ParticleData(Material material, String name, ParticleElement particleElement) {
|
||||
this.material = material;
|
||||
this.name = name;
|
||||
this.requirement = ParticleRequirement.NO_REQUIRMENT;
|
||||
this.particleElement = particleElement;
|
||||
particleElement.aggregateAttributes(this);
|
||||
}
|
||||
|
||||
public ParticleData(Material material, String name, ParticleRequirement requirement, ParticleElement particleElement) {
|
||||
this.material = material;
|
||||
this.name = name;
|
||||
this.requirement = requirement;
|
||||
this.particleElement = particleElement;
|
||||
particleElement.aggregateAttributes(this);
|
||||
}
|
||||
|
||||
public ParticleData add(String attribute) {
|
||||
attributes.add(attribute);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SWItem toSWItem(Player player, SteamwarUser user, Set<Integer> eventTeilnahme, String eggHuntConfig) {
|
||||
String translatedName;
|
||||
try {
|
||||
translatedName = LobbySystem.getMessage().parse(name, player);
|
||||
} catch (Exception e) {
|
||||
translatedName = name;
|
||||
}
|
||||
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add("");
|
||||
if (!attributes.isEmpty()) {
|
||||
lore.add(LobbySystem.getMessage().parse("PARTICLE_ATTRIBUTE", player));
|
||||
attributes.forEach(attribute -> lore.add(LobbySystem.getMessage().parse(attribute, player)));
|
||||
lore.add("");
|
||||
}
|
||||
|
||||
String unlockedBy = requirement.getRequirementName(player);
|
||||
if (unlockedBy != null) {
|
||||
lore.add(LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY", player));
|
||||
lore.add(unlockedBy);
|
||||
lore.add("");
|
||||
}
|
||||
if (requirement.test(user, eventTeilnahme, eggHuntConfig)) {
|
||||
lore.add(LobbySystem.getMessage().parse("PARTICLE_SELECT", player));
|
||||
} else {
|
||||
lore.add(LobbySystem.getMessage().parse("PARTICLE_LOCKED", player));
|
||||
}
|
||||
return new SWItem(material, translatedName, lore, false, clickType -> {});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public interface ParticleElement {
|
||||
Random RANDOM = new Random();
|
||||
|
||||
default Color randomColor() {
|
||||
return Color.fromRGB(RANDOM.nextInt(255), RANDOM.nextInt(255), RANDOM.nextInt(255));
|
||||
}
|
||||
|
||||
default float randomSize() {
|
||||
return RANDOM.nextFloat() / 2 + 1;
|
||||
}
|
||||
|
||||
default Particle.DustOptions randomParticleDust() {
|
||||
return new Particle.DustOptions(randomColor(), randomSize());
|
||||
}
|
||||
|
||||
default void display(Location location, Player root, boolean onlySelf, boolean onlyOther, Consumer<Player> 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
default void aggregateAttributes(ParticleData particleData) {
|
||||
}
|
||||
|
||||
default ParticleTickType tickType() {
|
||||
return ParticleTickType.MOVE;
|
||||
}
|
||||
|
||||
void tick(ParticleTickData particleTickData);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
public interface ParticleEnum {
|
||||
ParticleData getParticle();
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.inventory.SWListInv;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.particle.particles.*;
|
||||
import de.steamwar.lobby.particle.particles.custom.CustomEasterParticle;
|
||||
import de.steamwar.lobby.particle.particles.custom.CustomPlayerParticle;
|
||||
import de.steamwar.lobby.particle.particles.custom.CustomTeamParticle;
|
||||
import de.steamwar.lobby.special.easter.EggHunt;
|
||||
import de.steamwar.lobby.util.LobbyPlayer;
|
||||
import de.steamwar.sql.*;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@UtilityClass
|
||||
public class ParticleInventory {
|
||||
|
||||
private final Class<?>[] PARTICLES = {
|
||||
PlayerParticle.class,
|
||||
CustomPlayerParticle.class,
|
||||
TeamParticle.class,
|
||||
CustomTeamParticle.class,
|
||||
RainCloudParticle.class,
|
||||
ServerTeamParticle.class,
|
||||
EventParticle.class,
|
||||
EventParticlePlacement.class,
|
||||
EventParticleParticipation.class,
|
||||
EasterParticle.class,
|
||||
CustomEasterParticle.class,
|
||||
};
|
||||
|
||||
public String convertToString(ParticleEnum particleEnum) {
|
||||
return particleEnum.getClass().getSimpleName() + "@" + ((Enum<?>)particleEnum).name();
|
||||
}
|
||||
|
||||
public ParticleEnum convertFromString(String string) {
|
||||
String[] split = string.split("@");
|
||||
Class<?> clazz = null;
|
||||
for (Class<?> aClass : PARTICLES) {
|
||||
if (aClass.getSimpleName().equals(split[0])) {
|
||||
clazz = aClass;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (clazz != null) {
|
||||
try {
|
||||
return (ParticleEnum) Enum.valueOf((Class<? extends Enum>) clazz, split[1]);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void openInventory(Player player, boolean onlyUnlocked) {
|
||||
LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player.getUniqueId());
|
||||
|
||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
||||
Set<Integer> events = user.getTeam() == 0 ? new HashSet<>() : TeamTeilnahme.getEvents(user.getTeam()).stream().map(Event::getEventID).collect(Collectors.toSet());
|
||||
String eggHuntConfig = UserConfig.getConfig(user.getId(), EggHunt.EGG_HUNT_CONFIG_KEY);
|
||||
|
||||
AtomicBoolean hasOneLocked = new AtomicBoolean(false);
|
||||
List<SWListInv.SWListEntry<ParticleEnum>> particleList = new ArrayList<>();
|
||||
for (Class<?> clazz : PARTICLES) {
|
||||
addParticles(particleList, (ParticleEnum[]) clazz.getEnumConstants(), player, onlyUnlocked, hasOneLocked, user, events, eggHuntConfig);
|
||||
}
|
||||
for (int i = 0; i < particleList.size() % 45; i++) {
|
||||
particleList.add(new SWListInv.SWListEntry<>(new SWItem(Material.BLACK_STAINED_GLASS_PANE, " "), null));
|
||||
}
|
||||
|
||||
SWListInv<ParticleEnum> particleSWListInv = new SWListInv<>(player, LobbySystem.getMessage().parse("PARTICLE_INVENTORY", player), false, particleList, (clickType, particle) -> {
|
||||
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);
|
||||
});
|
||||
if (!hasOneLocked.get()) {
|
||||
particleSWListInv.setItem(50, Material.GRAY_BANNER, LobbySystem.getMessage().parse("PARTICLE_SHOW_HAS_ALL", player), new ArrayList<>(), false, clickType -> {
|
||||
});
|
||||
} else if (onlyUnlocked) {
|
||||
particleSWListInv.setItem(50, Material.LIME_BANNER, LobbySystem.getMessage().parse("PARTICLE_SHOW_ALL", player), new ArrayList<>(), false, clickType -> {
|
||||
openInventory(player, false);
|
||||
});
|
||||
} else {
|
||||
particleSWListInv.setItem(50, Material.RED_BANNER, LobbySystem.getMessage().parse("PARTICLE_SHOW_UNLOCKED", player), new ArrayList<>(), false, clickType -> {
|
||||
openInventory(player, true);
|
||||
});
|
||||
}
|
||||
particleSWListInv.open();
|
||||
}
|
||||
|
||||
private void addParticles(List<SWListInv.SWListEntry<ParticleEnum>> particleList, ParticleEnum[] particleEnums, Player player, boolean onlyUnlocked, AtomicBoolean hasOneLocked, SteamwarUser user, Set<Integer> events, String eggHuntConfig) {
|
||||
for (ParticleEnum particle : particleEnums) {
|
||||
ParticleData particleData = particle.getParticle();
|
||||
SWItem swItem = particleData.toSWItem(player, user, events, eggHuntConfig);
|
||||
if (particleData.getRequirement().test(user, events, eggHuntConfig)) {
|
||||
particleList.add(new SWListInv.SWListEntry<>(swItem, particle));
|
||||
} else {
|
||||
hasOneLocked.set(true);
|
||||
if (!onlyUnlocked) {
|
||||
particleList.add(new SWListInv.SWListEntry<>(swItem, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < particleList.size() % 9; i++) {
|
||||
particleList.add(new SWListInv.SWListEntry<>(new SWItem(Material.BLACK_STAINED_GLASS_PANE, " "), null));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2021 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
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 de.steamwar.sql.UserPerm;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import java.util.HashMap;
|
||||
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;
|
||||
|
||||
private static Map<Player, Integer> movingPlayers = new HashMap<>();
|
||||
|
||||
public ParticleListener() {
|
||||
Bukkit.getScheduler().runTaskTimer(LobbySystem.getPlugin(), () -> {
|
||||
movingPlayers.replaceAll((player, integer) -> integer - 1);
|
||||
movingPlayers.entrySet().removeIf(entry -> entry.getValue() <= 0);
|
||||
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();
|
||||
if (particle == null) return;
|
||||
ParticleData particleData = particle.getParticle();
|
||||
ParticleElement particleElement = particleData.getParticleElement();
|
||||
if (particleElement.tickType() == ParticleTickType.ALWAYS) {
|
||||
particleElement.tick(new ParticleTickData(player.getWorld(), player, deg, movingPlayers.containsKey(player)));
|
||||
}
|
||||
});
|
||||
}, 0, 1);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void handlePlayerInteract(PlayerInteractEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (JumpAndRun.isPlayerInJumpAndRun(player)) return;
|
||||
if (!PlayerSpawn.PARTICLE.equals(event.getItem())) return;
|
||||
event.setCancelled(true);
|
||||
|
||||
ParticleInventory.openInventory(player, true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void handlePlayerMove(PlayerMoveEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (disabled(player)) return;
|
||||
if (JumpAndRun.isPlayerInJumpAndRun(player)) return;
|
||||
LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player.getUniqueId());
|
||||
ParticleEnum particle = lobbyPlayer.getParticle();
|
||||
if (particle == null) return;
|
||||
|
||||
ParticleData particleData = particle.getParticle();
|
||||
ParticleElement particleElement = particleData.getParticleElement();
|
||||
if (particleElement.tickType() == ParticleTickType.MOVE) {
|
||||
particleElement.tick(new ParticleTickData(player.getWorld(), player, deg, true));
|
||||
}
|
||||
if (event.getFrom().getX() != event.getTo().getX() || event.getFrom().getY() != event.getTo().getY() || event.getFrom().getZ() != event.getTo().getZ()) {
|
||||
movingPlayers.put(player, 5);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||
movingPlayers.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
|
||||
if (PlayerSpawn.PARTICLE.equals(event.getPlayer().getInventory().getItemInMainHand())) {
|
||||
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.hasPerm(UserPerm.TEAM);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.special.easter.EggDifficulty;
|
||||
import de.steamwar.lobby.special.easter.EggHunt;
|
||||
import de.steamwar.sql.*;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public interface ParticleRequirement {
|
||||
|
||||
String getRequirementName(Player player);
|
||||
boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig);
|
||||
|
||||
ParticleRequirement SERVER_TEAM = new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_SERVER_TEAM", player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return user.hasPerm(UserPerm.TEAM);
|
||||
}
|
||||
};
|
||||
|
||||
ParticleRequirement NO_REQUIRMENT = new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
ParticleRequirement HAS_TEAM = new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_TEAM", player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return user.getTeam() != 0;
|
||||
}
|
||||
}.or(SERVER_TEAM);
|
||||
ParticleRequirement EVENT_PARTICIPATION = new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_EVENT", player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return !eventTeilname.isEmpty();
|
||||
}
|
||||
}.or(SERVER_TEAM);
|
||||
ParticleRequirement EGG_HUNT_EASY = _easterEggHuntDifficulty(EggDifficulty.EASY);
|
||||
ParticleRequirement EGG_HUNT_MEDIUM = _easterEggHuntDifficulty(EggDifficulty.MEDIUM);
|
||||
ParticleRequirement EGG_HUNT_HARD = _easterEggHuntDifficulty(EggDifficulty.HARD);
|
||||
ParticleRequirement EGG_HUNT_EXTREME = _easterEggHuntDifficulty(EggDifficulty.EXTREME);
|
||||
ParticleRequirement EGG_HUNT_ADVANCED = _easterEggHuntDifficulty(EggDifficulty.ADVANCED);
|
||||
ParticleRequirement EGG_HUNT_FOUND_HALF = new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_EASTER_EGG_HUNT_HALF", player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
if (eggHuntConfig == null) return false;
|
||||
int count = 0;
|
||||
for (int i = 0; i < eggHuntConfig.length(); i++) {
|
||||
if (eggHuntConfig.charAt(i) == '1') {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count >= EggHunt.getEggList().size() / 2;
|
||||
}
|
||||
};
|
||||
|
||||
static ParticleRequirement specificTeam(int teamId) {
|
||||
if (teamId == 0) return NO_REQUIRMENT;
|
||||
String teamKuerzel = Team.get(teamId).getTeamKuerzel();
|
||||
return new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_SPECIFIC_TEAM", player, teamKuerzel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return user.getTeam() == teamId;
|
||||
}
|
||||
}.or(SERVER_TEAM);
|
||||
}
|
||||
|
||||
static ParticleRequirement eventParticipation(int eventId) {
|
||||
String eventName = Event.get(eventId).getEventName();
|
||||
return new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_EVENT_PARTICIPATION", player, eventName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return eventTeilname.contains(eventId);
|
||||
}
|
||||
}.or(SERVER_TEAM);
|
||||
}
|
||||
|
||||
static ParticleRequirement eventPlacement(int eventId, int... placementTeams) {
|
||||
String eventName = Event.get(eventId).getEventName();
|
||||
Set<Integer> teams = new HashSet<>();
|
||||
for (int i : placementTeams) teams.add(i);
|
||||
return new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_EVENT_PLACEMENT", player, eventName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
if (!eventTeilname.contains(eventId)) return false;
|
||||
return teams.contains(user.getTeam());
|
||||
}
|
||||
}.or(SERVER_TEAM);
|
||||
}
|
||||
|
||||
static ParticleRequirement _easterEggHuntDifficulty(EggDifficulty difficulty) {
|
||||
AtomicInteger count = new AtomicInteger();
|
||||
List<Integer> eggs = EggHunt.getEggList()
|
||||
.stream()
|
||||
.map(egg -> {
|
||||
int id = count.getAndIncrement();
|
||||
if (egg.getDifficulty() == difficulty) {
|
||||
return id;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_EASTER_EGG_HUNT_DIFFICULTY", player, LobbySystem.getMessage().parse(difficulty.getMessage(), player));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
if (eggHuntConfig == null) return false;
|
||||
return eggs.stream().allMatch(id -> eggHuntConfig.length() > id && eggHuntConfig.charAt(id) == '1');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static ParticleRequirement specificPlayer(int userId) {
|
||||
String userName = SteamwarUser.get(userId).getUserName();
|
||||
return new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_SPECIFIC_USER", player, userName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return user.getId() == userId;
|
||||
}
|
||||
}.or(SERVER_TEAM);
|
||||
}
|
||||
|
||||
static ParticleRequirement easterEventSpecificPlayer(int userId) {
|
||||
String userName = SteamwarUser.get(userId).getUserName();
|
||||
return new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_SPECIFIC_USER_EASTER", player, userName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return user.getId() == userId;
|
||||
}
|
||||
}.or(SERVER_TEAM);
|
||||
}
|
||||
|
||||
static ParticleRequirement easterEventSpecificTeam(int teamId) {
|
||||
if (teamId == 0) return NO_REQUIRMENT;
|
||||
String teamKuerzel = Team.get(teamId).getTeamKuerzel();
|
||||
return new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return LobbySystem.getMessage().parse("PARTICLE_UNLOCKED_BY_SPECIFIC_TEAM_EASTER", player, teamKuerzel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return user.getTeam() == teamId;
|
||||
}
|
||||
}.or(SERVER_TEAM);
|
||||
}
|
||||
|
||||
default ParticleRequirement or(ParticleRequirement particleRequirement) {
|
||||
return new ParticleRequirement() {
|
||||
@Override
|
||||
public String getRequirementName(Player player) {
|
||||
return ParticleRequirement.this.getRequirementName(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(SteamwarUser user, Set<Integer> eventTeilname, String eggHuntConfig) {
|
||||
return ParticleRequirement.this.test(user, eventTeilname, eggHuntConfig) || particleRequirement.test(user, eventTeilname, eggHuntConfig);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class ParticleTickData {
|
||||
|
||||
private final World world;
|
||||
private final Player player;
|
||||
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();
|
||||
particleTickData.location = location;
|
||||
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();
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
||||
public ParticleTickData copy() {
|
||||
return new ParticleTickData(world, player, location, deg, isMoving, onlySelf, onlyOthers);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
public enum ParticleTickType {
|
||||
|
||||
ALWAYS,
|
||||
MOVE,
|
||||
;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public interface WingDesign {
|
||||
|
||||
@SneakyThrows
|
||||
static Vector[] create(String resource) {
|
||||
List<Vector> vectors = new ArrayList<>();
|
||||
BufferedImage bufferedImage = ImageIO.read(WingDesign.class.getResourceAsStream(resource));
|
||||
for (int x = 0; x < bufferedImage.getWidth(); x++) {
|
||||
for (int y = 0; y < bufferedImage.getHeight(); y++) {
|
||||
int rgb = bufferedImage.getRGB(x, y);
|
||||
if (Color.WHITE.getRGB() != rgb) {
|
||||
vectors.add(new Vector(x - bufferedImage.getWidth() / 2.0, bufferedImage.getHeight() - y - 1.0, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
return vectors.toArray(new Vector[0]);
|
||||
}
|
||||
|
||||
class WingDesignImpl implements WingDesign {
|
||||
private final Vector[] vectors;
|
||||
|
||||
public WingDesignImpl(Vector[] vectors) {
|
||||
this.vectors = vectors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector[] getVectors() {
|
||||
return vectors;
|
||||
}
|
||||
}
|
||||
|
||||
Vector[] getVectors();
|
||||
|
||||
WingDesign SIMPLE = new WingDesignImpl(create("/de/steamwar/lobby/particle/decorator/WingSimple4.png"));
|
||||
WingDesign COMPLEX = new WingDesignImpl(create("/de/steamwar/lobby/particle/decorator/WingSimple2.png"));
|
||||
WingDesign SWORD = new WingDesignImpl(create("/de/steamwar/lobby/particle/decorator/WingSword.png"));
|
||||
WingDesign SW = new WingDesignImpl(create("/de/steamwar/lobby/particle/decorator/WingSW.png"));
|
||||
WingDesign WGS = new WingDesignImpl(create("/de/steamwar/lobby/particle/decorator/WingWGS.png"));
|
||||
WingDesign SWORD_CROSSED = new WingDesignImpl(create("/de/steamwar/lobby/particle/decorator/WingSwordCrossed.png"));
|
||||
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"));
|
||||
|
||||
WingDesign PlompaEasterWings = new WingDesignImpl(create("/de/steamwar/lobby/particle/decorator/ECAL-Logo.png"));
|
||||
}
|
||||
|
After Width: | Height: | Size: 159 B |
|
After Width: | Height: | Size: 177 B |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 140 B |
|
After Width: | Height: | Size: 205 B |
|
After Width: | Height: | Size: 746 B |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 188 B |
|
After Width: | Height: | Size: 855 B |
|
After Width: | Height: | Size: 184 B |
@@ -0,0 +1,27 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import de.steamwar.lobby.particle.ParticleTickType;
|
||||
|
||||
public class Always extends DelegatingParticleElement {
|
||||
|
||||
public Always(ParticleElement particleElement) {
|
||||
super(particleElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_TICK";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleTickType tickType() {
|
||||
return ParticleTickType.ALWAYS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
particleElement.tick(particleTickData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import org.bukkit.Location;
|
||||
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
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_CIRCLE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
Location location = particleTickData.getLocation();
|
||||
|
||||
Vector vector = new Vector(distance, 0, 0);
|
||||
vector.rotateAroundY((particleTickData.getDeg() * speed) % 360);
|
||||
ParticleTickData nParticleTickData = particleTickData.withLocation(location.clone().add(vector));
|
||||
particleElement.tick(nParticleTickData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
public class Cloud extends DelegatingParticleElement {
|
||||
|
||||
public Cloud(ParticleElement particleElement) {
|
||||
super(particleElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_CLOUD";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
if (particleTickData.getWorld().getBlockAt(particleTickData.getPlayer().getLocation().subtract(0, 0.5, 0)).getType() == Material.AIR) {
|
||||
particleTickData.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, 5, 2, false, false, false));
|
||||
} else {
|
||||
particleTickData.getPlayer().removePotionEffect(PotionEffectType.SLOW_FALLING);
|
||||
return;
|
||||
}
|
||||
ParticleTickData nParticleTickData = particleTickData.withLocation(particleTickData.getLocation().subtract(0, -0.2, 0));
|
||||
particleElement.tick(nParticleTickData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
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.PlayerQuitEvent;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class Delayed extends DelegatingParticleElement {
|
||||
|
||||
private DelayedData delayedData = new DelayedData();
|
||||
private int interval;
|
||||
|
||||
private static class DelayedData implements Listener {
|
||||
private Map<Player, Integer> data = new HashMap<>();
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||
data.remove(event.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
public Delayed(ParticleElement particleElement, int interval) {
|
||||
super(particleElement);
|
||||
Bukkit.getPluginManager().registerEvents(delayedData, LobbySystem.getPlugin());
|
||||
this.interval = interval;
|
||||
if (interval <= 0) {
|
||||
throw new IllegalArgumentException("Interval must be greater than 0");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
int currentNumber = delayedData.data.getOrDefault(particleTickData.getPlayer(), 0) % interval;
|
||||
delayedData.data.put(particleTickData.getPlayer(), currentNumber + 1);
|
||||
if (currentNumber != 0) {
|
||||
return;
|
||||
}
|
||||
particleElement.tick(particleTickData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleData;
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickType;
|
||||
|
||||
public abstract class DelegatingParticleElement implements ParticleElement {
|
||||
|
||||
protected final ParticleElement particleElement;
|
||||
|
||||
protected DelegatingParticleElement(ParticleElement particleElement) {
|
||||
this.particleElement = particleElement;
|
||||
}
|
||||
|
||||
public abstract String attribute();
|
||||
|
||||
@Override
|
||||
public void aggregateAttributes(ParticleData particleData) {
|
||||
String attribute = attribute();
|
||||
if (attribute != null) {
|
||||
particleData.add(attribute);
|
||||
}
|
||||
particleElement.aggregateAttributes(particleData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleTickType tickType() {
|
||||
return particleElement.tickType();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import de.steamwar.lobby.particle.ParticleTickType;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
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
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_BI_CIRCLE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleTickType tickType() {
|
||||
if (particleElement.tickType() == second.tickType()) {
|
||||
return particleElement.tickType();
|
||||
}
|
||||
return ParticleTickType.MOVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
Location location = particleTickData.getLocation();
|
||||
|
||||
Vector vector = new Vector(distance, 0, 0);
|
||||
vector.rotateAroundY((particleTickData.getDeg() * speed) % 360);
|
||||
ParticleTickData nParticleTickData = particleTickData.withLocation(location.clone().add(vector));
|
||||
particleElement.tick(nParticleTickData);
|
||||
|
||||
vector.setX(-vector.getX());
|
||||
vector.setZ(-vector.getZ());
|
||||
|
||||
nParticleTickData = particleTickData.withLocation(location.clone().add(vector));
|
||||
second.tick(nParticleTickData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
|
||||
public class DustParticle implements ParticleElement {
|
||||
|
||||
private Particle particle;
|
||||
private float vx = 0.01f;
|
||||
private float vy = 0.01f;
|
||||
private float vz = 0.01f;
|
||||
private double speed = 0.01;
|
||||
private int count = 5;
|
||||
|
||||
public DustParticle(Particle particle) {
|
||||
this.particle = particle;
|
||||
}
|
||||
|
||||
public DustParticle(Particle particle, float vx, float vy, float vz) {
|
||||
this.particle = particle;
|
||||
this.vx = vx;
|
||||
this.vy = vy;
|
||||
this.vz = vz;
|
||||
}
|
||||
|
||||
public DustParticle(Particle particle, float vx, float vy, float vz, double speed, int count) {
|
||||
this.particle = particle;
|
||||
this.vx = vx;
|
||||
this.vy = vy;
|
||||
this.vz = vz;
|
||||
this.speed = speed;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
Location location = particleTickData.getLocation().add(0.0, 0.2, 0.0);
|
||||
display(location, particleTickData.getPlayer(), particleTickData.isOnlySelf(), particleTickData.isOnlyOthers(), player -> {
|
||||
player.spawnParticle(particle, location, count, vx, vy, vz, speed, randomParticleDust());
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
|
||||
public class Floor extends DelegatingParticleElement {
|
||||
|
||||
public Floor(ParticleElement particleElement) {
|
||||
super(particleElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_FLOOR";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
if (!particleTickData.getWorld().getBlockAt(particleTickData.getPlayer().getLocation().subtract(0, 0.5, 0)).getType().isAir()) {
|
||||
particleElement.tick(particleTickData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
|
||||
public class Flying extends DelegatingParticleElement {
|
||||
|
||||
public Flying(ParticleElement particleElement) {
|
||||
super(particleElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_FLYING";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
if (!particleTickData.getPlayer().isGliding()) {
|
||||
return;
|
||||
}
|
||||
particleElement.tick(particleTickData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleData;
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
|
||||
public class Group extends DelegatingParticleElement {
|
||||
|
||||
private final ParticleElement[] rest;
|
||||
|
||||
public Group(ParticleElement particleElement, ParticleElement... rest) {
|
||||
super(particleElement);
|
||||
this.rest = rest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void aggregateAttributes(ParticleData particleData) {
|
||||
particleElement.aggregateAttributes(particleData);
|
||||
for (ParticleElement particleElement : rest) {
|
||||
particleElement.aggregateAttributes(particleData);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
particleElement.tick(particleTickData);
|
||||
for (ParticleElement particleElement : rest) {
|
||||
particleElement.tick(particleTickData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import org.bukkit.Location;
|
||||
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
public class LocationMutator extends DelegatingParticleElement {
|
||||
|
||||
private UnaryOperator<Location> mutator;
|
||||
|
||||
public LocationMutator(ParticleElement particleElement, UnaryOperator<Location> mutator) {
|
||||
super(particleElement);
|
||||
this.mutator = mutator;
|
||||
}
|
||||
|
||||
public LocationMutator(ParticleElement particleElement, double vx, double vy, double vz) {
|
||||
this(particleElement, location -> location.add(vx, vy, vz));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
ParticleTickData nParticleTickData = particleTickData.withLocation(mutator.apply(particleTickData.getLocation()));
|
||||
particleElement.tick(nParticleTickData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
|
||||
public class NonFloor extends DelegatingParticleElement {
|
||||
|
||||
public NonFloor(ParticleElement particleElement) {
|
||||
super(particleElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_NON_FLOOR";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
if (particleTickData.getWorld().getBlockAt(particleTickData.getPlayer().getLocation().subtract(0, 0.5, 0)).getType().isAir()) {
|
||||
particleElement.tick(particleTickData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
|
||||
public class NonFlying extends DelegatingParticleElement {
|
||||
|
||||
public NonFlying(ParticleElement particleElement) {
|
||||
super(particleElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_NON_FLYING";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
if (particleTickData.getPlayer().isGliding()) {
|
||||
return;
|
||||
}
|
||||
particleElement.tick(particleTickData);
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -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<Player, Integer> 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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleData;
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
|
||||
public class Separator implements ParticleElement {
|
||||
|
||||
@Override
|
||||
public void aggregateAttributes(ParticleData particleData) {
|
||||
particleData.add("PARTICLE_ATTRIBUTE_SEPARATOR");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
|
||||
public class SimpleParticle implements ParticleElement {
|
||||
|
||||
private final Particle particle;
|
||||
private boolean customVelocity = false;
|
||||
private float vx;
|
||||
private float vy;
|
||||
private float vz;
|
||||
private double time = 1;
|
||||
private int count = 5;
|
||||
|
||||
public SimpleParticle(Particle particle) {
|
||||
this.particle = particle;
|
||||
}
|
||||
|
||||
public SimpleParticle(Particle particle, float vx, float vy, float vz) {
|
||||
this.particle = particle;
|
||||
this.customVelocity = true;
|
||||
this.vx = vx;
|
||||
this.vy = vy;
|
||||
this.vz = vz;
|
||||
}
|
||||
|
||||
public SimpleParticle(Particle particle, float vx, float vy, float vz, double time) {
|
||||
this.particle = particle;
|
||||
this.customVelocity = true;
|
||||
this.vx = vx;
|
||||
this.vy = vy;
|
||||
this.vz = vz;
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public SimpleParticle(Particle particle, float vx, float vy, float vz, double time, int count) {
|
||||
this.particle = particle;
|
||||
this.customVelocity = true;
|
||||
this.vx = vx;
|
||||
this.vy = vy;
|
||||
this.vz = vz;
|
||||
this.time = time;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public SimpleParticle(Particle particle, double time, int count) {
|
||||
this.particle = particle;
|
||||
this.time = time;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
Location location = particleTickData.getLocation().add(0.0, 0.2, 0.0);
|
||||
display(location, particleTickData.getPlayer(), particleTickData.isOnlySelf(), particleTickData.isOnlyOthers(), player -> {
|
||||
if (customVelocity) {
|
||||
player.spawnParticle(particle, location, count, vx, vy, vz, time);
|
||||
} else {
|
||||
player.spawnParticle(particle, location, count);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
|
||||
public class Sneaking extends DelegatingParticleElement {
|
||||
|
||||
public Sneaking(ParticleElement particleElement) {
|
||||
super(particleElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_SNEAKING";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
if (!particleTickData.getPlayer().isSneaking()) {
|
||||
return;
|
||||
}
|
||||
particleElement.tick(particleTickData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package de.steamwar.lobby.particle.elements;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import de.steamwar.lobby.particle.WingDesign;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class Wing extends DelegatingParticleElement {
|
||||
|
||||
private double size;
|
||||
private WingDesign wingDesign;
|
||||
|
||||
public Wing(ParticleElement particleElement, double size, WingDesign wingDesign) {
|
||||
super(particleElement);
|
||||
this.size = size;
|
||||
this.wingDesign = wingDesign;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_WING";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
for (Vector dVector : wingDesign.getVectors()) {
|
||||
Vector vector = new Vector(dVector.getX() * size, 0.6 + dVector.getY() * size - (particleTickData.getPlayer().isSneaking() ? 0.5 : 0), 0.5);
|
||||
vector.rotateAroundY(Math.toRadians(particleTickData.getPlayer().getLocation().getYaw() * -1));
|
||||
vector.setX(-vector.getX());
|
||||
vector.setZ(-vector.getZ());
|
||||
Location location = particleTickData.getPlayer().getLocation().clone().add(vector);
|
||||
ParticleTickData current = particleTickData.withLocation(location);
|
||||
particleElement.tick(current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
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.Location;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class HearthBeat extends DelegatingParticleElement {
|
||||
|
||||
private double speed;
|
||||
|
||||
private double y(double time) {
|
||||
double d1 = Math.pow(2, -Math.pow(time * 17 - 7.5, 2));
|
||||
double d2 = Math.pow(2, -Math.pow(time * 20 - 11, 2)) * 0.5;
|
||||
double d3 = Math.pow(2, -Math.pow(time * 25 - 17, 2)) * 0.1;
|
||||
return (d1 - d2 + d3) * 0.5;
|
||||
}
|
||||
|
||||
public HearthBeat(ParticleElement particleElement, double speed) {
|
||||
super(particleElement);
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
double time = ((particleTickData.getDeg() * speed) % 360) / 360.0;
|
||||
double y = y(time) * 2;
|
||||
double x = (time - 0.5) * 2;
|
||||
|
||||
Vector vector = new Vector(x, 1.1 + y - (particleTickData.getPlayer().isSneaking() ? 0.5 : 0), 0.7);
|
||||
vector.rotateAroundY(Math.toRadians(particleTickData.getPlayer().getLocation().getYaw() * -1));
|
||||
vector.setX(-vector.getX());
|
||||
vector.setZ(-vector.getZ());
|
||||
Location location = particleTickData.getPlayer().getLocation().clone().add(vector);
|
||||
ParticleTickData current = particleTickData.withLocation(location);
|
||||
particleElement.tick(current);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
|
||||
public class NonMoving extends DelegatingParticleElement {
|
||||
|
||||
public NonMoving(ParticleElement particleElement) {
|
||||
super(particleElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_NON_MOVING";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
if (particleTickData.isMoving()) {
|
||||
return;
|
||||
}
|
||||
particleElement.tick(particleTickData);
|
||||
}
|
||||
}
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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;
|
||||
|
||||
public class YOffset extends DelegatingParticleElement {
|
||||
|
||||
private double multiplication;
|
||||
private double minY;
|
||||
private double maxY;
|
||||
private boolean inverted;
|
||||
|
||||
public YOffset(ParticleElement particleElement, double speed, double minY, double maxY, boolean inverted) {
|
||||
super(particleElement);
|
||||
this.multiplication = speed;
|
||||
this.minY = minY;
|
||||
this.maxY = maxY;
|
||||
this.inverted = inverted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
double value = ((particleTickData.getDeg() * multiplication) % 360) / 180;
|
||||
double y;
|
||||
if (inverted) {
|
||||
if (value <= 1) {
|
||||
y = maxY - (maxY - minY) * value;
|
||||
} else {
|
||||
y = minY + (maxY - minY) * (value - 1);
|
||||
}
|
||||
} else {
|
||||
if (value <= 1) {
|
||||
y = minY + (maxY - minY) * value;
|
||||
} else {
|
||||
y = maxY - (maxY - minY) * (value - 1);
|
||||
}
|
||||
}
|
||||
ParticleTickData current = particleTickData.withLocation(particleTickData.getLocation().clone().add(0, y, 0));
|
||||
particleElement.tick(current);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
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.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@AllArgsConstructor
|
||||
public enum EasterParticle implements ParticleEnum {
|
||||
|
||||
EGG_HUNT_EASY(new ParticleData(Material.LIME_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_EASY", ParticleRequirement.EGG_HUNT_EASY,
|
||||
new Always(new LocationMutator(new SimpleParticle(Particle.FALLING_SPORE_BLOSSOM, 0.5F, 0.1f, 0.5F, 1, 1), 0, 2.2, 0)))
|
||||
),
|
||||
EGG_HUNT_MEDIUM(new ParticleData(Material.YELLOW_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_MEDIUM", ParticleRequirement.EGG_HUNT_MEDIUM,
|
||||
new Always(new Floor(new Sneaking(new SimpleParticle(Particle.GLOW_SQUID_INK, 0.4F, 0.9F, 0.4F, 0.01)))))
|
||||
),
|
||||
EGG_HUNT_HARD(new ParticleData(Material.RED_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_HARD", ParticleRequirement.EGG_HUNT_HARD,
|
||||
new Always(new LocationMutator(new DoubleCircle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0.01, 1), new DustParticle(Particle.REDSTONE, 0, 0, 0, 0.01, 1)), 0, 0.5, 0)))
|
||||
),
|
||||
EGG_HUNT_EXTREME(new ParticleData(Material.PURPLE_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_EXTREME", ParticleRequirement.EGG_HUNT_EXTREME,
|
||||
new Always(new LocationMutator(new SimpleParticle(Particle.FALLING_OBSIDIAN_TEAR, 0.5F, 0.1F, 0.5F, 1, 1), 0, 2.2, 0)))
|
||||
),
|
||||
EGG_HUNT_ADVANCED(new ParticleData(Material.BLACK_CONCRETE_POWDER, "PARTICLE_EGG_HUNT_ADVANCED", ParticleRequirement.EGG_HUNT_ADVANCED,
|
||||
new Always(new Sneaking(new LocationMutator(new Group(
|
||||
new SimpleParticle(Particle.SMOKE_NORMAL, 0.02F, 0, 0.02F, 0.05, 1),
|
||||
new SimpleParticle(Particle.SMOKE_LARGE, 0.02F, 0, 0.02F, 0.05, 1),
|
||||
particleTickData -> {
|
||||
Player player = particleTickData.getPlayer();
|
||||
player.setVelocity(player.getVelocity().add(new Vector(0, 0.1, 0)));
|
||||
}
|
||||
), 0, -0.2, 0))))
|
||||
),
|
||||
EGG_HUNT_HALF(new ParticleData(Material.EGG, "PARTICLE_EGG_HUNT_HALF", ParticleRequirement.EGG_HUNT_FOUND_HALF,
|
||||
new Group(
|
||||
new Always(new Sneaking(new Floor(new LocationMutator(new SimpleParticle(Particle.HEART, 0, 0, 0, 0.01), 0, 1.7, 0)))),
|
||||
new Separator(),
|
||||
new Always(new NonFloor(new NonFlying(new LocationMutator(new Cloud(new Circle(new SimpleParticle(Particle.HEART, 0, 0, 0, 0.01))), 0, 0.5, 0))))
|
||||
))
|
||||
),
|
||||
;
|
||||
public static ParticleEnum[] particles = values();
|
||||
|
||||
@Getter
|
||||
private ParticleData particle;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
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.Circle;
|
||||
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 EventParticle implements ParticleEnum {
|
||||
|
||||
WATER(new ParticleData(Material.WATER_BUCKET, "PARTICLE_WATER", ParticleRequirement.EVENT_PARTICIPATION,
|
||||
new Always(new Circle(new LocationMutator(new SimpleParticle(Particle.DRIP_WATER), 0, 1.1, 0))))
|
||||
),
|
||||
LAVA(new ParticleData(Material.LAVA_BUCKET, "PARTICLE_FIRE", ParticleRequirement.EVENT_PARTICIPATION,
|
||||
new Always(new Circle(new LocationMutator(new SimpleParticle(Particle.DRIP_LAVA), 0, 1.1, 0))))
|
||||
),
|
||||
;
|
||||
public static ParticleEnum[] particles = values();
|
||||
|
||||
@Getter
|
||||
private ParticleData particle;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
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.WingDesign;
|
||||
import de.steamwar.lobby.particle.elements.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
|
||||
@AllArgsConstructor
|
||||
public enum EventParticleParticipation implements ParticleEnum {
|
||||
|
||||
WarGearSeason(new ParticleData(Material.BOOK, "PARTICLE_EVENT_ENCHANTING", ParticleRequirement.eventParticipation(22),
|
||||
new SimpleParticle(Particle.ENCHANTMENT_TABLE))
|
||||
),
|
||||
AirshipEvent(new ParticleData(Material.SNOW_BLOCK, "PARTICLE_EVENT_CLOUD", ParticleRequirement.eventParticipation(26),
|
||||
new SimpleParticle(Particle.CLOUD))
|
||||
),
|
||||
HellsBellsWs(new ParticleData(Material.TNT, "PARTICLE_EVENT_SMOKE", ParticleRequirement.eventParticipation(28),
|
||||
new Circle(new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0, 0, 0, 0.01)))
|
||||
),
|
||||
Underwater(new ParticleData(Material.PRISMARINE_BRICKS, "PARTICLE_EVENT_WATER", ParticleRequirement.eventParticipation(31),
|
||||
new SimpleParticle(Particle.DRIP_WATER))
|
||||
),
|
||||
AdventWarShip(new ParticleData(Material.PRISMARINE_WALL, "PARTICLE_EVENT_WATER", ParticleRequirement.eventParticipation(32),
|
||||
new Group(new SimpleParticle(Particle.DRIP_WATER), new SimpleParticle(Particle.WATER_WAKE, 0.2F, 0.2F, 0.2F, 0.01)))
|
||||
),
|
||||
MiniWarGearLiga(new ParticleData(Material.PRISMARINE_SLAB, "PARTICLE_EVENT_WATER", ParticleRequirement.eventParticipation(33),
|
||||
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 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)))
|
||||
),
|
||||
;
|
||||
public static ParticleEnum[] particles = values();
|
||||
|
||||
@Getter
|
||||
private ParticleData particle;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
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.WingDesign;
|
||||
import de.steamwar.lobby.particle.elements.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
|
||||
@AllArgsConstructor
|
||||
public enum EventParticlePlacement implements ParticleEnum {
|
||||
|
||||
WarGearSeason(new ParticleData(Material.ENCHANTING_TABLE, "PARTICLE_EVENT_ENCHANTING", ParticleRequirement.eventPlacement(22, 12, 285, 54),
|
||||
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01), 0, 1.1, 0)))
|
||||
)),
|
||||
AirshipEvent(new ParticleData(Material.SNOWBALL, "PARTICLE_EVENT_CLOUD", ParticleRequirement.eventPlacement(26, 205, 9, 54, 120, 292),
|
||||
new Circle(new LocationMutator(new SimpleParticle(Particle.CLOUD, 0, 0, 0, 0.01), 0, 2.2, 0))
|
||||
)),
|
||||
HellsBellsWs(new ParticleData(Material.TNT_MINECART, "PARTICLE_EVENT_SMOKE", ParticleRequirement.eventPlacement(28, 205, 9, 11),
|
||||
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0, 0, 0, 0.01), 0, 2.2, 0)))
|
||||
)),
|
||||
Underwater(new ParticleData(Material.PRISMARINE_SHARD, "PARTICLE_EVENT_WATER", ParticleRequirement.eventPlacement(31, 9, 210, 520),
|
||||
new Cloud(new SimpleParticle(Particle.DRIP_WATER)))
|
||||
),
|
||||
AdventWarShip(new ParticleData(Material.PRISMARINE_CRYSTALS, "PARTICLE_EVENT_WATER", ParticleRequirement.eventPlacement(32, 9, 205, 210),
|
||||
new Always(new LocationMutator(new Circle(new Group(new SimpleParticle(Particle.DRIP_WATER), new SimpleParticle(Particle.WATER_WAKE, 0.2F, 0.2F, 0.2F, 0.01))), 0, 1.1, 0)))
|
||||
),
|
||||
MiniWarGearLiga(new ParticleData(Material.IRON_SWORD, "PARTICLE_EVENT_WINGS", ParticleRequirement.eventPlacement(33, 9, 34, 205),
|
||||
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.WATER_WAKE, 0, 0, 0, 0, 1), 0.15, WingDesign.MWGL)), 20)))
|
||||
),
|
||||
Absturz(new ParticleData(Material.FEATHER, "PARTICLE_EVENT_WINGS", ParticleRequirement.eventPlacement(34, 210, 205, 527, 286),
|
||||
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.15, WingDesign.SIMPLE)), 20)))
|
||||
),
|
||||
UnderwaterMWG(new ParticleData(Material.CYAN_CARPET, "PARTICLE_EVENT_RAIN_CLOUD", ParticleRequirement.eventPlacement(35, 9, 210),
|
||||
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.15, WingDesign.SW)), 20)))
|
||||
),
|
||||
WarGearSeason2022(new ParticleData(Material.DIAMOND_HELMET, "PARTICLE_EVENT_WGS", ParticleRequirement.eventPlacement(37, 285, 210, 122),
|
||||
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.FIREWORKS_SPARK, 0, 0, 0, 0, 1), 0.15, WingDesign.WGS)), 20)))
|
||||
),
|
||||
WargearClash(new ParticleData(Material.GOLDEN_SWORD, "PARTICLE_EVENT_WARGEARCLASH", ParticleRequirement.eventPlacement(38, 210, 158, 167, 286),
|
||||
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.1, WingDesign.SWORD_CROSSED)), 20)))
|
||||
),
|
||||
;
|
||||
public static ParticleEnum[] particles = values();
|
||||
|
||||
@Getter
|
||||
private ParticleData particle;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package de.steamwar.lobby.particle.particles;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleData;
|
||||
import de.steamwar.lobby.particle.ParticleEnum;
|
||||
import de.steamwar.lobby.particle.elements.DustParticle;
|
||||
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 PlayerParticle implements ParticleEnum {
|
||||
|
||||
SNEEZE(new ParticleData(Material.SLIME_BLOCK, "PARTICLE_SNEEZE",
|
||||
new SimpleParticle(Particle.SNEEZE, 0.2F, 0.2F, 0.2F, 0.01))
|
||||
),
|
||||
SMOKE(new ParticleData(Material.COBWEB, "PARTICLE_SMOKE",
|
||||
new SimpleParticle(Particle.SMOKE_NORMAL, 0.2F, 0.2F, 0.2F, 0.01))
|
||||
),
|
||||
FIRE(new ParticleData(Material.LAVA_BUCKET, "PARTICLE_FIRE",
|
||||
new SimpleParticle(Particle.DRIP_LAVA))
|
||||
),
|
||||
WATER(new ParticleData(Material.WATER_BUCKET, "PARTICLE_WATER",
|
||||
new SimpleParticle(Particle.DRIP_WATER))
|
||||
),
|
||||
HEARTH(new ParticleData(Material.RED_DYE, "PARTICLE_HEART",
|
||||
new LocationMutator(new SimpleParticle(Particle.HEART), 0, 2.2, 0))
|
||||
),
|
||||
NOTES(new ParticleData(Material.NOTE_BLOCK, "PARTICLE_NOTES",
|
||||
new LocationMutator(new SimpleParticle(Particle.NOTE), 0, 2.2, 0))
|
||||
),
|
||||
NAUTILUS(new ParticleData(Material.NAUTILUS_SHELL, "PARTICLE_NAUTILUS",
|
||||
new SimpleParticle(Particle.NAUTILUS, 0.2F, 0.2F ,0.2F, 0.01))
|
||||
),
|
||||
SNOWBALL(new ParticleData(Material.SNOWBALL, "PARTICLE_SNOWBALL",
|
||||
new SimpleParticle(Particle.SNOWBALL, 0.2F, 0.2F ,0.2F, 0.01))
|
||||
),
|
||||
EFFECT(new ParticleData(Material.GLASS_BOTTLE, "PARTICLE_EFFECT",
|
||||
new DustParticle(Particle.REDSTONE, 0, 0.2F, 0, 0.01, 5))
|
||||
),
|
||||
CAMPFIRE(new ParticleData(Material.CAMPFIRE, "PARTICLE_CAMPFIRE",
|
||||
new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0, 0.2F ,0, 0.01))
|
||||
),
|
||||
MAGIC(new ParticleData(Material.CAULDRON, "PARTICLE_MAGIC",
|
||||
new SimpleParticle(Particle.CRIT_MAGIC, 0.2F, 0.2F, 0.2F, 0.01))
|
||||
),
|
||||
ANGRY(new ParticleData(Material.REDSTONE_BLOCK, "PARTICLE_ANGRY",
|
||||
new SimpleParticle(Particle.VILLAGER_ANGRY, 0.2F, 0.2F, 0.2F, 0.01))
|
||||
),
|
||||
SLIME(new ParticleData(Material.SLIME_BALL, "PARTICLE_SLIME",
|
||||
new SimpleParticle(Particle.SLIME))
|
||||
),
|
||||
MOB(new ParticleData(Material.ZOMBIE_HEAD, "PARTICLE_MOB",
|
||||
new SimpleParticle(Particle.SPELL_MOB))
|
||||
),
|
||||
;
|
||||
public static ParticleEnum[] particles = values();
|
||||
|
||||
@Getter
|
||||
private ParticleData particle;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
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.WingDesign;
|
||||
import de.steamwar.lobby.particle.elements.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
|
||||
@AllArgsConstructor
|
||||
public enum ServerTeamParticle implements ParticleEnum {
|
||||
|
||||
WITCH(new ParticleData(Material.EXPERIENCE_BOTTLE, "PARTICLE_WITCH", ParticleRequirement.SERVER_TEAM,
|
||||
new SimpleParticle(Particle.SPELL_WITCH))
|
||||
),
|
||||
ENCHANTING(new ParticleData(Material.ENCHANTING_TABLE, "PARTICLE_ENCHANTING", ParticleRequirement.SERVER_TEAM,
|
||||
new SimpleParticle(Particle.ENCHANTMENT_TABLE))
|
||||
),
|
||||
HAPPY(new ParticleData(Material.EMERALD_BLOCK, "PARTICLE_HAPPY", ParticleRequirement.SERVER_TEAM,
|
||||
new SimpleParticle(Particle.HEART, 0.2F, 0.2F, 0.2F, 0.01))
|
||||
),
|
||||
FLAME(new ParticleData(Material.FLINT_AND_STEEL, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
|
||||
new SimpleParticle(Particle.FLAME, 0, 0.2F, 0, 0.01))
|
||||
),
|
||||
END_ROD(new ParticleData(Material.END_ROD, "PARTICLE_END_ROD", ParticleRequirement.SERVER_TEAM,
|
||||
new SimpleParticle(Particle.END_ROD, 0.2F, 0.2F, 0.2F, 0.01))
|
||||
),
|
||||
CLOUD(new ParticleData(Material.WHITE_WOOL, "PARTICLE_CLOUD", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new SimpleParticle(Particle.CLOUD)))
|
||||
),
|
||||
TOTEM(new ParticleData(Material.TOTEM_OF_UNDYING, "PARTICLE_TOTEM", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new SimpleParticle(Particle.TOTEM, 0.2F, 0.2F, 0.2F, 0.01)))
|
||||
),
|
||||
ENCHANTING_CLOUD(new ParticleData(Material.WHITE_DYE, "PARTICLE_ENCHANTING", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new SimpleParticle(Particle.ENCHANTMENT_TABLE)))
|
||||
),
|
||||
FLAME_CLOUD(new ParticleData(Material.FIRE_CORAL_BLOCK, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new SimpleParticle(Particle.FLAME)))
|
||||
),
|
||||
SNEEZE_CLOUD(new ParticleData(Material.LIME_SHULKER_BOX, "PARTICLE_SNEEZE", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new SimpleParticle(Particle.SNEEZE)))
|
||||
),
|
||||
SLIME_CLOUD(new ParticleData(Material.GREEN_SHULKER_BOX, "PARTICLE_SLIME", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new SimpleParticle(Particle.SLIME)))
|
||||
),
|
||||
SMOKE_CLOUD(new ParticleData(Material.DEAD_BRAIN_CORAL_BLOCK, "PARTICLE_SMOKE", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new SimpleParticle(Particle.CAMPFIRE_COSY_SMOKE, 0.2F, 0.2F, 0.2F, 0.01)))
|
||||
),
|
||||
TOWN_CLOUD(new ParticleData(Material.FIREWORK_STAR, "PARTICLE_TOWN", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new SimpleParticle(Particle.TOWN_AURA)))
|
||||
),
|
||||
FLAME_CIRCLE(new ParticleData(Material.MAGMA_BLOCK, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
|
||||
new Circle(new LocationMutator(new SimpleParticle(Particle.FLAME, 0, 0, 0, 0.01), 0, 1.1, 0)))
|
||||
),
|
||||
ENCHANTING_CIRCLE(new ParticleData(Material.WHITE_DYE, "PARTICLE_ENCHANTING_CIRCLE", ParticleRequirement.SERVER_TEAM,
|
||||
new Circle(new LocationMutator(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0.2F, 0.2F, 0.2F, 0.01), 0, 1.1, 0)))
|
||||
),
|
||||
NOTES_CIRCLE(new ParticleData(Material.NOTE_BLOCK, "PARTICLE_NOTES", ParticleRequirement.SERVER_TEAM,
|
||||
new Circle(new LocationMutator(new SimpleParticle(Particle.NOTE, 0, 0, 0, 0.01), 0, 2.2, 0)))
|
||||
),
|
||||
WATER_FIRE(new ParticleData(Material.GUARDIAN_SPAWN_EGG, "PARTICLE_WATER_FIRE", ParticleRequirement.SERVER_TEAM,
|
||||
new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.DRIP_WATER, 0, 0, 0, 0.01), new SimpleParticle(Particle.DRIP_LAVA, 0, 0, 0, 0.01)), 0, 1.1, 0))
|
||||
),
|
||||
WATER_FIRE_ALWAYS(new ParticleData(Material.GUARDIAN_SPAWN_EGG, "PARTICLE_WATER_FIRE", ParticleRequirement.SERVER_TEAM,
|
||||
new Always(new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.DRIP_WATER, 0, 0, 0, 0.01), new SimpleParticle(Particle.DRIP_LAVA, 0, 0, 0, 0.01)), 0, 1.1, 0)))
|
||||
),
|
||||
MAGIC_ENCHANTING(new ParticleData(Material.DIAMOND_SWORD, "PARTICLE_MAGIC_ENCHANTING", ParticleRequirement.SERVER_TEAM,
|
||||
new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01), new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01)), 0, 1.1, 0))
|
||||
),
|
||||
MAGIC_ENCHANTING_ALWAYS(new ParticleData(Material.WOODEN_SWORD, "PARTICLE_MAGIC_ENCHANTING", ParticleRequirement.SERVER_TEAM,
|
||||
new Always(new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01), new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01)), 0, 1.1, 0)))
|
||||
),
|
||||
MAGIC_CLOUD_CIRCLE(new ParticleData(Material.GLOWSTONE_DUST, "PARTICLE_MAGIC", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0.01), 0, 1.1, 0))))
|
||||
),
|
||||
FLAME_CLOUD_CIRCLE(new ParticleData(Material.FIRE_CORAL, "PARTICLE_FLAME", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.FLAME, 0, 0, 0, 0.01), 0, 1.1, 0))))
|
||||
),
|
||||
FIREWORK_CLOUD_CIRCLE(new ParticleData(Material.FIREWORK_ROCKET, "PARTICLE_FIREWORK", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.FIREWORKS_SPARK, 0, 0, 0, 0.01), 0, 1.1, 0))))
|
||||
),
|
||||
WATER_CLOUD_CIRCLE(new ParticleData(Material.CYAN_DYE, "PARTICLE_WATER_FIRE", ParticleRequirement.SERVER_TEAM,
|
||||
new Cloud(new Circle(new LocationMutator(new SimpleParticle(Particle.WATER_WAKE, 0, 0, 0, 0.01), 0, 1.1, 0))))
|
||||
),
|
||||
ENCHANTING_DOUBLE_CIRCLE(new ParticleData(Material.BUBBLE_CORAL_BLOCK, "PARTICLE_ENCHANTING", ParticleRequirement.SERVER_TEAM,
|
||||
new Always(new LocationMutator(new DoubleCircle(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01), new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01)), 0, 2.2, 0)))
|
||||
),
|
||||
EVIL_WINGS(new ParticleData(Material.PURPUR_SLAB, "PARTICLE_WINGS_EVIL", ParticleRequirement.SERVER_TEAM,
|
||||
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.SPELL_WITCH, 0, 0, 0, 0, 1), 0.15, WingDesign.SIMPLE)), 20)))
|
||||
),
|
||||
;
|
||||
public static ParticleEnum[] particles = values();
|
||||
|
||||
@Getter
|
||||
private ParticleData particle;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
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.Circle;
|
||||
import de.steamwar.lobby.particle.elements.LocationMutator;
|
||||
import de.steamwar.lobby.particle.elements.NonFloor;
|
||||
import de.steamwar.lobby.particle.elements.SimpleParticle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
|
||||
@AllArgsConstructor
|
||||
public enum TeamParticle implements ParticleEnum {
|
||||
|
||||
SQUID(new ParticleData(Material.INK_SAC, "PARTICLE_SQUID", ParticleRequirement.HAS_TEAM,
|
||||
new SimpleParticle(Particle.SQUID_INK, 0.2F, 0.2F, 0.2F, 0.01))
|
||||
),
|
||||
BUBBLE(new ParticleData(Material.TUBE_CORAL, "PARTICLE_BUBBLE", ParticleRequirement.HAS_TEAM,
|
||||
new SimpleParticle(Particle.BUBBLE_POP, 0.2F, 0.2F, 0.2F, 0.01))
|
||||
),
|
||||
HONEY(new ParticleData(Material.HONEY_BOTTLE, "PARTICLE_HONEY", ParticleRequirement.HAS_TEAM,
|
||||
new SimpleParticle(Particle.DRIPPING_HONEY, 0.2F, 0.2F, 0.2F, 1))
|
||||
),
|
||||
NECTAR(new ParticleData(Material.HONEYCOMB, "PARTICLE_NECTAR", ParticleRequirement.HAS_TEAM,
|
||||
new SimpleParticle(Particle.FALLING_NECTAR, 0.2F, 0.2F, 0.2F, 1))
|
||||
),
|
||||
FIREWORK(new ParticleData(Material.FIRE_CHARGE, "PARTICLE_FIREWORK", ParticleRequirement.HAS_TEAM,
|
||||
new LocationMutator(new NonFloor(new SimpleParticle(Particle.FIREWORKS_SPARK, 0.1F, 0.1F, 0.1F, 0.2, 2)), 0, -0.2, 0))
|
||||
),
|
||||
DRAGON_BREATH(new ParticleData(Material.DRAGON_BREATH, "PARTICLE_DRAGON_BREATH", ParticleRequirement.HAS_TEAM,
|
||||
new SimpleParticle(Particle.DRAGON_BREATH, 1F, 0.2F, 1F, 0.01))
|
||||
),
|
||||
DAMAGE(new ParticleData(Material.SPIDER_EYE, "PARTICLE_DAMAGE", ParticleRequirement.HAS_TEAM,
|
||||
new SimpleParticle(Particle.DAMAGE_INDICATOR, 0.2F, 0, 0.2F, 0.01))
|
||||
),
|
||||
DOLPHIN(new ParticleData(Material.BLUE_DYE, "PARTICLE_DOLPHIN", ParticleRequirement.HAS_TEAM,
|
||||
new SimpleParticle(Particle.DOLPHIN, 0.2F, 0, 0.2F, 0.01))
|
||||
),
|
||||
HEART(new ParticleData(Material.RED_CONCRETE, "PARTICLE_HEART", ParticleRequirement.HAS_TEAM,
|
||||
new Circle(new LocationMutator(new SimpleParticle(Particle.HEART), 0, 2.2, 0)))
|
||||
),
|
||||
;
|
||||
public static ParticleEnum[] particles = values();
|
||||
|
||||
@Getter
|
||||
private ParticleData particle;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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.HearthBeat;
|
||||
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))
|
||||
))))
|
||||
),
|
||||
Plompa(new ParticleData(Material.PUFFERFISH_BUCKET, "PARTICLE_PLAYER_PLOMPA", ParticleRequirement.specificPlayer(64),
|
||||
new Always(new Delayed(new NonFlying(new Wing(new SimpleParticle(Particle.END_ROD, 0, 0, 0, 0, 1), 0.15, WingDesign.PlompaEasterWings)), 80)))
|
||||
),
|
||||
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_EASTER_3(new ParticleData(Material.APPLE, "PARTICLE_TEAM_PULSE_HEART_BEAT", ParticleRequirement.easterEventSpecificTeam(210),
|
||||
new Always(new NonFlying(new HearthBeat(new SimpleParticle(Particle.FLAME, 0, 0, 0, 0, 1), 80))))
|
||||
),
|
||||
;
|
||||
public static ParticleEnum[] particles = values();
|
||||
|
||||
@Getter
|
||||
private ParticleData particle;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
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.elements.*;
|
||||
import de.steamwar.lobby.particle.elements.custom.NonMoving;
|
||||
import de.steamwar.lobby.particle.elements.custom.YOffset;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
|
||||
@AllArgsConstructor
|
||||
public enum CustomPlayerParticle implements ParticleEnum {
|
||||
|
||||
Haylim_(new ParticleData(Material.WHITE_CANDLE, "PARTICLE_PLAYER_HAYLIM_AURA", ParticleRequirement.specificPlayer(9426),
|
||||
new Always(new NonMoving(new NonFlying(new Group(
|
||||
new DoubleCircle(new YOffset(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01, 5), 40, 0, 2, false), new YOffset(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.0,5), 40, 0, 2, true)),
|
||||
new DoubleCircle(new YOffset(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.01, 5), 40, 0, 2, true), new YOffset(new SimpleParticle(Particle.ENCHANTMENT_TABLE, 0, 0, 0, 0.0,5), 40, 0, 2, false))
|
||||
)))))
|
||||
),
|
||||
;
|
||||
public static ParticleEnum[] particles = values();
|
||||
|
||||
@Getter
|
||||
private ParticleData particle;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
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 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.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))))
|
||||
),
|
||||
Pulse_Logo(new ParticleData(Material.ENDER_CHEST, "PARTICLE_TEAM_PULSE_LOGO", ParticleRequirement.specificTeam(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();
|
||||
|
||||
@Getter
|
||||
private ParticleData particle;
|
||||
}
|
||||