From 28f4c89d32a3d53e9e8fd40564229c945489926a Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 25 Apr 2022 14:32:42 +0200 Subject: [PATCH] Hotfix ParticleInventory --- .../lobby/particle/ParticleInventory.java | 2 +- src/de/steamwar/lobby/util/LobbyPlayer.java | 54 ++++++++++--------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/src/de/steamwar/lobby/particle/ParticleInventory.java b/src/de/steamwar/lobby/particle/ParticleInventory.java index 4cac6d4..cfc4d6c 100644 --- a/src/de/steamwar/lobby/particle/ParticleInventory.java +++ b/src/de/steamwar/lobby/particle/ParticleInventory.java @@ -78,7 +78,7 @@ public class ParticleInventory { addParticle(particleList, particle, clickable, player); } for (SpecialTeamParticle particle : SpecialTeamParticle.particles) { - if (particle.getTeamId() == 0 || steamwarUser.getTeam() == particle.getTeamId()) { + if (particle.getTeamId() == 0 || steamwarUser.getTeam() == particle.getTeamId() || steamwarUser.getUserGroup() != UserGroup.Member) { addParticle(particleList, particle, true, player); } } diff --git a/src/de/steamwar/lobby/util/LobbyPlayer.java b/src/de/steamwar/lobby/util/LobbyPlayer.java index 53a03c7..adbda25 100644 --- a/src/de/steamwar/lobby/util/LobbyPlayer.java +++ b/src/de/steamwar/lobby/util/LobbyPlayer.java @@ -43,31 +43,35 @@ public class LobbyPlayer { particle = null; String saved = UserConfig.getConfig(userId, "lobby-particle"); if (saved != null) { - String[] strings = saved.split("@"); - switch (strings[0]) { - case "PlayerParticle": - particle = PlayerParticle.valueOf(strings[1]); - break; - case "TeamParticle": - particle = TeamParticle.valueOf(strings[1]); - break; - case "ServerTeamParticle": - particle = ServerTeamParticle.valueOf(strings[1]); - break; - case "EventParticle": - particle = EventParticle.valueOf(strings[1]); - break; - case "EventParticleParticipation": - particle = EventParticleParticipation.valueOf(strings[1]); - break; - case "EventParticlePlacement": - particle = EventParticlePlacement.valueOf(strings[1]); - break; - case "SpecialParticle": - particle = SpecialTeamParticle.valueOf(strings[1]); - break; - default: - break; + try { + String[] strings = saved.split("@"); + switch (strings[0]) { + case "PlayerParticle": + particle = PlayerParticle.valueOf(strings[1]); + break; + case "TeamParticle": + particle = TeamParticle.valueOf(strings[1]); + break; + case "ServerTeamParticle": + particle = ServerTeamParticle.valueOf(strings[1]); + break; + case "EventParticle": + particle = EventParticle.valueOf(strings[1]); + break; + case "EventParticleParticipation": + particle = EventParticleParticipation.valueOf(strings[1]); + break; + case "EventParticlePlacement": + particle = EventParticlePlacement.valueOf(strings[1]); + break; + case "SpecialParticle": + particle = SpecialTeamParticle.valueOf(strings[1]); + break; + default: + break; + } + } catch (Exception e) { + setParticle(null); } } }