From 939f8c86c5a0f8df01c1c7234cfd69aac530dbcf Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Sun, 2 Feb 2020 01:05:51 +0100 Subject: [PATCH] bugfixes --- src/de/steamwar/lobby/commands/ShieldCommand.java | 6 +++--- src/de/steamwar/lobby/inventorys/LobbyInventory.java | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/lobby/commands/ShieldCommand.java b/src/de/steamwar/lobby/commands/ShieldCommand.java index 8eb99c6..c81d937 100644 --- a/src/de/steamwar/lobby/commands/ShieldCommand.java +++ b/src/de/steamwar/lobby/commands/ShieldCommand.java @@ -20,9 +20,9 @@ public class ShieldCommand implements CommandExecutor { UserGroup userGroup = steamwarUser.getUserGroup(); if(userGroup != UserGroup.Developer && - userGroup != UserGroup.Moderator && - userGroup != UserGroup.Admin && - userGroup != UserGroup.Youtuber) { + userGroup != UserGroup.Moderator && + userGroup != UserGroup.Admin && + userGroup != UserGroup.Youtuber) { player.sendMessage("§cDu verfügst nicht über die benötigten Rechte!"); return false; } diff --git a/src/de/steamwar/lobby/inventorys/LobbyInventory.java b/src/de/steamwar/lobby/inventorys/LobbyInventory.java index 4ec32d3..18f8a6b 100644 --- a/src/de/steamwar/lobby/inventorys/LobbyInventory.java +++ b/src/de/steamwar/lobby/inventorys/LobbyInventory.java @@ -2,6 +2,8 @@ package de.steamwar.lobby.inventorys; import de.steamwar.lobby.utils.ItemBuilder; import de.steamwar.lobby.utils.LobbyPlayer; +import de.steamwar.sql.SteamwarUser; +import de.steamwar.sql.UserGroup; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -35,6 +37,14 @@ public class LobbyInventory { .removeAllAtributs() .build()); + + UserGroup userGroup = SteamwarUser.get(player.getUniqueId()).getUserGroup(); + if(userGroup != UserGroup.Developer && + userGroup != UserGroup.Moderator && + userGroup != UserGroup.Admin && + userGroup != UserGroup.Youtuber) { + return; + } player.getInventory().setItem(8, new ItemBuilder(SCHILD) .setDisplayName("§bSchild §8| " + (lobbyPlayer.isShield() ? "§aan" : "§caus")) .setUnbreakable(true)