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)); } }