Only requires sneaking when destroying permission signs in creative
This commit is contained in:
parent
e32e37b246
commit
c9d0907b2f
@ -4,6 +4,7 @@ import net.knarcraft.permissionsigns.PermissionSigns;
|
|||||||
import net.knarcraft.permissionsigns.formatting.StringFormatter;
|
import net.knarcraft.permissionsigns.formatting.StringFormatter;
|
||||||
import net.knarcraft.permissionsigns.formatting.TranslatableMessage;
|
import net.knarcraft.permissionsigns.formatting.TranslatableMessage;
|
||||||
import net.knarcraft.permissionsigns.manager.SignManager;
|
import net.knarcraft.permissionsigns.manager.SignManager;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Tag;
|
import org.bukkit.Tag;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -190,7 +191,7 @@ public class BlockListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
player.sendMessage(StringFormatter.getTranslatedErrorMessage(TranslatableMessage.PERMISSION_SIGN_DESTROY_DENY));
|
player.sendMessage(StringFormatter.getTranslatedErrorMessage(TranslatableMessage.PERMISSION_SIGN_DESTROY_DENY));
|
||||||
} else {
|
} else {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking() && player.getGameMode() == GameMode.CREATIVE) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
player.sendMessage(StringFormatter.getTranslatedErrorMessage(TranslatableMessage.PERMISSION_SIGN_DESTROY_SNEAK));
|
player.sendMessage(StringFormatter.getTranslatedErrorMessage(TranslatableMessage.PERMISSION_SIGN_DESTROY_SNEAK));
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user