From 28d84f436f5883dfb89e612d78c093d420f47bd3 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 25 Mar 2022 10:44:37 +0100 Subject: [PATCH] Fix ServerTeamParticle and add 2 new ones --- src/de/steamwar/lobby/LobbySystem.properties | 22 +++++++++---------- .../lobby/listener/ParticleListener.java | 1 + .../particles/ServerTeamParticle.java | 11 ++++++---- src/de/steamwar/lobby/util/LobbyPlayer.java | 2 ++ 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/de/steamwar/lobby/LobbySystem.properties b/src/de/steamwar/lobby/LobbySystem.properties index 887e90d..7b10d12 100644 --- a/src/de/steamwar/lobby/LobbySystem.properties +++ b/src/de/steamwar/lobby/LobbySystem.properties @@ -16,9 +16,9 @@ PARTICLE_INVENTORY = §6Partikel 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_UNLOCKED_BY_TEAM = §fTeam Beitritt +PARTICLE_UNLOCKED_BY_EVENT = §fEvent teilnahme +PARTICLE_UNLOCKED_BY_SERVER_TEAM = §fServer Team PARTICLE_ATTRIBUTE_CIRCLE = §8-§f Ring PARTICLE_ATTRIBUTE_BI_CIRCLE = §8-§f Doppel Ring @@ -65,14 +65,14 @@ PARTICLE_ENCHANTING_CIRCLE = §fEnchanted PARTICLE_WATER_FIRE = §bWater§7/§cFire PARTICLE_MAGIC_ENCHANTING = §5Magic§7/§eZauber -PARTICLE_UNLOCKED_BY_WGS_PLACEMENT = WarGearSeason 1., 2. oder 3. Platz -PARTICLE_UNLOCKED_BY_WGS = WarGearSeason -PARTICLE_UNLOCKED_BY_AIRSHIPEVENT_PLACEMENT = AirshipEvent 1., 2. oder 3. Platz -PARTICLE_UNLOCKED_BY_AIRSHIPEVENT = AirshipEvent -PARTICLE_UNLOCKED_BY_HELLSBELLS_PLACEMENT = HellsBells 1., 2. oder 3. Platz -PARTICLE_UNLOCKED_BY_HELLSBELLS = HellsBells -PARTICLE_UNLOCKED_BY_UNDERWATER_PLACEMENT = Underwater 1., 2. oder 3. Platz -PARTICLE_UNLOCKED_BY_UNDERWATER = Underwater +PARTICLE_UNLOCKED_BY_WGS_PLACEMENT = §fWarGearSeason 1., 2. oder 3. Platz +PARTICLE_UNLOCKED_BY_WGS = §fWarGearSeason +PARTICLE_UNLOCKED_BY_AIRSHIPEVENT_PLACEMENT = §fAirshipEvent 1., 2. oder 3. Platz +PARTICLE_UNLOCKED_BY_AIRSHIPEVENT = §fAirshipEvent +PARTICLE_UNLOCKED_BY_HELLSBELLS_PLACEMENT = §fHellsBells 1., 2. oder 3. Platz +PARTICLE_UNLOCKED_BY_HELLSBELLS = §fHellsBells +PARTICLE_UNLOCKED_BY_UNDERWATER_PLACEMENT = §fUnderwater 1., 2. oder 3. Platz +PARTICLE_UNLOCKED_BY_UNDERWATER = §fUnderwater PARTICLE_EVENT_ENCHANTING = §cVerzaubert PARTICLE_EVENT_CLOUD = §fCloud diff --git a/src/de/steamwar/lobby/listener/ParticleListener.java b/src/de/steamwar/lobby/listener/ParticleListener.java index 3236610..c504f74 100644 --- a/src/de/steamwar/lobby/listener/ParticleListener.java +++ b/src/de/steamwar/lobby/listener/ParticleListener.java @@ -68,6 +68,7 @@ public class ParticleListener extends BasicListener { if (particle == null) return; BaseParticle baseParticle = particle.getParticle(); + if (baseParticle.needsTick()) return; baseParticle.particle(new ParticleData(player.getWorld(), player, deg)); } } diff --git a/src/de/steamwar/lobby/particle/particles/ServerTeamParticle.java b/src/de/steamwar/lobby/particle/particles/ServerTeamParticle.java index ce0d6c0..4a0214a 100644 --- a/src/de/steamwar/lobby/particle/particles/ServerTeamParticle.java +++ b/src/de/steamwar/lobby/particle/particles/ServerTeamParticle.java @@ -24,6 +24,7 @@ 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.CloudParticle; +import de.steamwar.lobby.particle.decorator.TickParticle; import de.steamwar.lobby.particle.mutator.LocationParticleMutator; import lombok.AllArgsConstructor; import lombok.Getter; @@ -52,11 +53,13 @@ public enum ServerTeamParticle implements ParticleEnum { ENCHANTING_CIRCLE(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(WHITE_DYE, "PARTICLE_ENCHANTING_CIRCLE", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.ENCHANTMENT_TABLE, 0F, 0F, 0F, 0.01), location -> location.add(0, 1.1, 0)))), NOTES_CIRCLE(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(NOTE_BLOCK, "PARTICLE_NOTES", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.NOTE, 0F, 0F, 0F, 0.01), location -> location.add(0, 2.2, 0)))), WATER_FIRE(new LocationParticleMutator(new CircleParticle(new ParticleItem(GUARDIAN_SPAWN_EGG, "PARTICLE_WATER_FIRE", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), new SimpleParticle(null, Particle.DRIP_WATER, 0.0F, 0.0F, 0.0F, 0.01), new SimpleParticle(null, Particle.DRIP_LAVA, 0.0F, 0.0F, 0.0F, 0.01)), location -> location.add(0, 1.1, 0))), + WATER_FIRE_ALWAYS(new TickParticle(new LocationParticleMutator(new CircleParticle(new ParticleItem(MAGMA_CUBE_SPAWN_EGG, "PARTICLE_WATER_FIRE", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), new SimpleParticle(null,Particle.DRIP_WATER, 0.0F, 0.0F, 0.0F, 0.01), new SimpleParticle(null,Particle.DRIP_LAVA, 0.0F, 0.0F, 0.0F, 0.01)), location -> location.add(0, 1.1, 0)))), MAGIC_ENCHANTING(new LocationParticleMutator(new CircleParticle(new ParticleItem(DIAMOND_SWORD, "PARTICLE_MAGIC_ENCHANTING", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), new SimpleParticle(null, Particle.CRIT_MAGIC, 0.0F, 0.0F, 0.0F, 0.01), new SimpleParticle(null, Particle.ENCHANTMENT_TABLE, 0.0F, 0.0F, 0.0F, 0.01)), location -> location.add(0, 1.1, 0))), - MAGIC_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(GLOWSTONE_DUST, "PARTICLE_MAGIC", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.CRIT_MAGIC), location -> location.add(0, 1.1, 0))))), - FLAME_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(FIRE_CORAL, "PARTICLE_FLAME", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.FLAME), location -> location.add(0, 1.1, 0))))), - FIREWORK_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(FIREWORK_ROCKET, "PARTICLE_FIREWORK", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.FIREWORKS_SPARK), location -> location.add(0, 1.1, 0))))), - WATER_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(CYAN_DYE, "PARTICLE_WATER", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.WATER_WAKE), location -> location.add(0, 1.1, 0))))), + MAGIC_ENCHANTING_ALWAYS(new TickParticle(new LocationParticleMutator(new CircleParticle(new ParticleItem(WOODEN_SWORD, "PARTICLE_MAGIC_ENCHANTING", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), new SimpleParticle(null, Particle.CRIT_MAGIC, 0.0F, 0.0F, 0.0F, 0.01), new SimpleParticle(null, Particle.ENCHANTMENT_TABLE, 0.0F, 0.0F, 0.0F, 0.01)), location -> location.add(0, 1.1, 0)))), + MAGIC_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(GLOWSTONE_DUST, "PARTICLE_MAGIC", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.CRIT_MAGIC, 0.0F, 0.0F, 0.0F, 0.01), location -> location.add(0, 1.1, 0))))), + FLAME_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(FIRE_CORAL, "PARTICLE_FLAME", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.FLAME, 0.0F, 0.0F, 0.0F, 0.01), location -> location.add(0, 1.1, 0))))), + FIREWORK_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(FIREWORK_ROCKET, "PARTICLE_FIREWORK", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.FIREWORKS_SPARK, 0.0F, 0.0F, 0.0F, 0.01), location -> location.add(0, 1.1, 0))))), + WATER_CLOUD_CIRCLE(new CloudParticle(new CircleParticle(new LocationParticleMutator(new SimpleParticle(new ParticleItem(CYAN_DYE, "PARTICLE_WATER", "PARTICLE_UNLOCKED_BY_SERVER_TEAM"), Particle.WATER_WAKE, 0.0F, 0.0F, 0.0F, 0.01), location -> location.add(0, 1.1, 0))))), ; public static ParticleEnum[] particles = values(); diff --git a/src/de/steamwar/lobby/util/LobbyPlayer.java b/src/de/steamwar/lobby/util/LobbyPlayer.java index d7a441e..03927ba 100644 --- a/src/de/steamwar/lobby/util/LobbyPlayer.java +++ b/src/de/steamwar/lobby/util/LobbyPlayer.java @@ -54,6 +54,8 @@ public class LobbyPlayer { case "ServerTeamParticle": particle = ServerTeamParticle.valueOf(strings[1]); break; + case "EventParticle": + particle = EventParticle.valueOf(strings[1]); case "EventParticleParticipation": particle = EventParticleParticipation.valueOf(strings[1]); break;