From 06691820c04c7b0dda4b17b2d8abbbe4cc1901be Mon Sep 17 00:00:00 2001 From: FeuSalamander Date: Mon, 30 Jan 2023 18:31:50 +0100 Subject: [PATCH] added the permission check, version update, README update --- README.md | 2 +- src/main/java/me/feusalamander/vmessage/ReloadCommand.java | 2 +- src/main/java/me/feusalamander/vmessage/SendCommand.java | 3 +++ src/main/java/me/feusalamander/vmessage/VMessage.java | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e3b922e..0a6c11a 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,6 @@ - No Setup required, but you can still customize it with the config file - LuckPerms Prefix and Suffix Support - Velocity only -- Reload command: "/vmessage reload", permission: "*" +- Reload command: "/vmessage reload", permission: "vmessage.reload" - Global message command: "/sendall" - You can also check my Bukkit plugin https://github.com/FeuSalamander/MiniWalls diff --git a/src/main/java/me/feusalamander/vmessage/ReloadCommand.java b/src/main/java/me/feusalamander/vmessage/ReloadCommand.java index 28ccab2..eedd4e9 100644 --- a/src/main/java/me/feusalamander/vmessage/ReloadCommand.java +++ b/src/main/java/me/feusalamander/vmessage/ReloadCommand.java @@ -31,7 +31,7 @@ public final class ReloadCommand implements SimpleCommand { @Override public boolean hasPermission(final Invocation invocation) { - return invocation.source().hasPermission("vmessage.command"); + return invocation.source().hasPermission("vmessage.reload"); } private static final List suggestion = List.of("reload"); diff --git a/src/main/java/me/feusalamander/vmessage/SendCommand.java b/src/main/java/me/feusalamander/vmessage/SendCommand.java index b4ff4f1..c3c45e9 100644 --- a/src/main/java/me/feusalamander/vmessage/SendCommand.java +++ b/src/main/java/me/feusalamander/vmessage/SendCommand.java @@ -15,6 +15,9 @@ public final class SendCommand implements SimpleCommand { @Override public void execute(final Invocation invocation) { + if(!hasPermission(invocation)){ + return; + } final CommandSource source = invocation.source(); final String[] args = invocation.arguments(); if (args.length == 0) { diff --git a/src/main/java/me/feusalamander/vmessage/VMessage.java b/src/main/java/me/feusalamander/vmessage/VMessage.java index 4f4657b..8b35ff1 100644 --- a/src/main/java/me/feusalamander/vmessage/VMessage.java +++ b/src/main/java/me/feusalamander/vmessage/VMessage.java @@ -16,7 +16,7 @@ import java.nio.file.Path; @Plugin( id = "vmessage", name = "Vmessage", - version = "1.5", + version = "1.5.1", description = "A velocity plugin that creates a multi server chat for the network", authors = {"FeuSalamander"}, dependencies = { @Dependency(id = "luckperms", optional = true) }