Only requires sneaking when destroying permission signs in creative

This commit is contained in:
Kristian Knarvik 2022-08-05 12:40:53 +02:00
parent e32e37b246
commit c9d0907b2f

View File

@ -4,6 +4,7 @@ import net.knarcraft.permissionsigns.PermissionSigns;
import net.knarcraft.permissionsigns.formatting.StringFormatter;
import net.knarcraft.permissionsigns.formatting.TranslatableMessage;
import net.knarcraft.permissionsigns.manager.SignManager;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.block.Block;
@ -190,7 +191,7 @@ public class BlockListener implements Listener {
event.setCancelled(true);
player.sendMessage(StringFormatter.getTranslatedErrorMessage(TranslatableMessage.PERMISSION_SIGN_DESTROY_DENY));
} else {
if (!player.isSneaking()) {
if (!player.isSneaking() && player.getGameMode() == GameMode.CREATIVE) {
event.setCancelled(true);
player.sendMessage(StringFormatter.getTranslatedErrorMessage(TranslatableMessage.PERMISSION_SIGN_DESTROY_SNEAK));
return;