From d2c6d4d766d3f04fc424bbfd2de418d547008e36 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 9 Oct 2021 15:22:26 +0200 Subject: [PATCH] Update ParticleInventory --- .../lobby/inventories/ParticleInventory.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/de/steamwar/lobby/inventories/ParticleInventory.java b/src/de/steamwar/lobby/inventories/ParticleInventory.java index 2fc2c40..63d6dfe 100644 --- a/src/de/steamwar/lobby/inventories/ParticleInventory.java +++ b/src/de/steamwar/lobby/inventories/ParticleInventory.java @@ -20,6 +20,7 @@ package de.steamwar.lobby.inventories; import de.steamwar.inventory.SWInventory; +import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SWListInv; import de.steamwar.lobby.particle.*; import de.steamwar.lobby.utils.LobbyPlayer; @@ -137,17 +138,25 @@ public class ParticleInventory { particleList = new ArrayList<>(SERVERTEAM_PARTICLES_ENTRIES); } - if (steamwarUser.getTeam() != 0 && !userGroup.isTeamGroup()) { - for (EventParticle eventParticle : EventParticle.eventParticles) { - if (contains(eventParticle.placementTeams, steamwarUser.getTeam())) { - particleList.add(new SWListInv.SWListEntry<>(eventParticle.placementParticle.getItem(), eventParticle.placementParticle)); - } - } - // TODO: Team team = Team.get(steamwarUser.getTeam()); participation fehlt!, wofür 'TeamTeilnahme' im SpigotCore fehlt. - } else if (userGroup.isTeamGroup()) { - for (EventParticle eventParticle : EventParticle.eventParticles) { + for (EventParticle eventParticle : EventParticle.eventParticles) { + boolean clickablePlacement = userGroup.isTeamGroup(); + clickablePlacement |= (steamwarUser.getTeam() != 0 && contains(eventParticle.placementTeams, steamwarUser.getTeam())); + if (clickablePlacement) { particleList.add(new SWListInv.SWListEntry<>(eventParticle.placementParticle.getItem(), eventParticle.placementParticle)); + } else { + SWItem swItem = eventParticle.placementParticle.getItem(); + swItem.setName(swItem.getItemMeta().getDisplayName() + " §8- §c§lGesperrt"); + particleList.add(new SWListInv.SWListEntry<>(swItem, null)); + } + + boolean clickableParticipation = userGroup.isTeamGroup(); + // TODO: Team team = Team.get(steamwarUser.getTeam()); participation fehlt!, wofür 'TeamTeilnahme' im SpigotCore fehlt. + if (clickableParticipation) { particleList.add(new SWListInv.SWListEntry<>(eventParticle.participationParticles.getItem(), eventParticle.participationParticles)); + } else { + SWItem swItem = eventParticle.participationParticles.getItem(); + swItem.setName(swItem.getItemMeta().getDisplayName() + " §8- §c§lGesperrt"); + particleList.add(new SWListInv.SWListEntry<>(swItem, null)); } }