diff --git a/src/de/steamwar/lobby/LobbySystem.properties b/src/de/steamwar/lobby/LobbySystem.properties index 241c96d..887e90d 100644 --- a/src/de/steamwar/lobby/LobbySystem.properties +++ b/src/de/steamwar/lobby/LobbySystem.properties @@ -17,6 +17,7 @@ PARTICLE_DESELECT = §8Keine Partikel PARTICLE_LOCKED = {0} §8- §c§lGesperrt PARTICLE_UNLOCKED_BY_TEAM = §eTeam Beitritt +PARTICLE_UNLOCKED_BY_EVENT = §eEvent teilnahme PARTICLE_UNLOCKED_BY_SERVER_TEAM = §eServer Team PARTICLE_ATTRIBUTE_CIRCLE = §8-§f Ring diff --git a/src/de/steamwar/lobby/particle/ParticleInventory.java b/src/de/steamwar/lobby/particle/ParticleInventory.java index 2db6cc1..551e6db 100644 --- a/src/de/steamwar/lobby/particle/ParticleInventory.java +++ b/src/de/steamwar/lobby/particle/ParticleInventory.java @@ -64,6 +64,9 @@ public class ParticleInventory { } Set events = steamwarUser.getTeam() == 0 ? new HashSet<>() : TeamTeilnahme.getEvents(steamwarUser.getTeam()).stream().map(Event::getEventID).collect(Collectors.toSet()); + if (!events.isEmpty()) { + calculateParticles(EventParticle.particles, player, particleList); + } for (EventParticlePlacement particle : EventParticlePlacement.particles) { boolean clickable = userGroup.isTeamGroup(); clickable |= (steamwarUser.getTeam() != 0 && contains(particle.getPlacementTeams(), steamwarUser.getTeam())); diff --git a/src/de/steamwar/lobby/particle/particles/EventParticle.java b/src/de/steamwar/lobby/particle/particles/EventParticle.java new file mode 100644 index 0000000..016ac02 --- /dev/null +++ b/src/de/steamwar/lobby/particle/particles/EventParticle.java @@ -0,0 +1,46 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2022 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 . + */ + +package de.steamwar.lobby.particle.particles; + +import de.steamwar.lobby.particle.BaseParticle; +import de.steamwar.lobby.particle.ParticleItem; +import de.steamwar.lobby.particle.SimpleParticle; +import de.steamwar.lobby.particle.decorator.CircleParticle; +import de.steamwar.lobby.particle.decorator.NonFloorParticle; +import de.steamwar.lobby.particle.decorator.TickParticle; +import de.steamwar.lobby.particle.mutator.LocationParticleMutator; +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.bukkit.Material; +import org.bukkit.Particle; + +import static org.bukkit.Material.*; + +@AllArgsConstructor +public enum EventParticle implements ParticleEnum { + + WATER(new TickParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(WATER_BUCKET, "PARTICLE_WATER", "PARTICLE_UNLOCKED_BY_EVENT"), Particle.DRIP_WATER), location -> location.add(0, 1.1, 0))))), + LAVA(new TickParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(LAVA_BUCKET, "PARTICLE_FIRE", "PARTICLE_UNLOCKED_BY_EVENT"), Particle.DRIP_LAVA), location -> location.add(0, 1.1, 0))))), + ; + public static ParticleEnum[] particles = values(); + + @Getter + private BaseParticle particle; +}