Skip to content

Commit

Permalink
Add option to disable player sync commands
Browse files Browse the repository at this point in the history
  • Loading branch information
rFranzr committed Nov 7, 2023
1 parent 30dd376 commit 5d94f95
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bukkit/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>net.vyhub</groupId>
<artifactId>VyHubMinecraft</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<artifactId>bukkit</artifactId>
Expand Down
1 change: 0 additions & 1 deletion bukkit/src/main/java/net/vyhub/tasks/TAdvert.java
Expand Up @@ -8,7 +8,6 @@
import org.bukkit.ChatColor;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class TAdvert extends AAdvert {
Expand Down
9 changes: 7 additions & 2 deletions bukkit/src/main/java/net/vyhub/tasks/TGroups.java
Expand Up @@ -12,6 +12,7 @@
import net.vyhub.VyHubPlatform;
import net.vyhub.abstractClasses.AGroups;
import net.vyhub.abstractClasses.AUser;
import net.vyhub.config.VyHubConfiguration;
import net.vyhub.entity.VyHubUser;
import net.vyhub.event.VyHubPlayerInitializedEvent;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -120,7 +121,9 @@ public void addPlayerToLuckpermsGroups(List<String> allGroups, UUID playerId) {
if (!currentNodes.contains(node)) {
groupChangeBacklog.add(getBacklogKey(playerID, groupName, "add"));
user.data().add(node);
player.sendMessage(ChatColor.YELLOW + String.format(getPlatform().getI18n().get("groupAdded"), groupName));
if (VyHubConfiguration.enableGroupChangedNotifications()) {
player.sendMessage(ChatColor.YELLOW + String.format(getPlatform().getI18n().get("groupAdded"), groupName));
}
}
}
}
Expand All @@ -131,7 +134,9 @@ public void addPlayerToLuckpermsGroups(List<String> allGroups, UUID playerId) {
String groupName = n.getGroupName();
groupChangeBacklog.add(getBacklogKey(playerID, groupName, "remove"));
user.data().remove(n);
player.sendMessage(ChatColor.YELLOW + String.format(getPlatform().getI18n().get("groupRemoved"), groupName));
if (VyHubConfiguration.enableGroupChangedNotifications()) {
player.sendMessage(ChatColor.YELLOW + String.format(getPlatform().getI18n().get("groupRemoved"), groupName));
}
}
}
api.getUserManager().saveUser(user);
Expand Down
2 changes: 1 addition & 1 deletion bungeeCord/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>net.vyhub</groupId>
<artifactId>VyHubMinecraft</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<artifactId>bungeeCord</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>net.vyhub</groupId>
<artifactId>VyHubMinecraft</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<artifactId>common</artifactId>
Expand Down
9 changes: 9 additions & 0 deletions common/src/main/java/net/vyhub/config/VyHubConfiguration.java
Expand Up @@ -36,6 +36,7 @@ public static Map<String, String> loadConfig() {
config.put("advert_prefix", "[★] ");
config.put("advert_interval", "180");
config.put("locale", "en");
config.put("group_changed_notifications", "true");

configCache.save(config);
} else {
Expand Down Expand Up @@ -77,6 +78,14 @@ public static String getAdvertPrefix() {

public static Boolean getIsBackendServer() { return Boolean.valueOf(config.get("is_backend_server")); }

public static Boolean enableGroupChangedNotifications() {
if (config.containsKey("group_changed_notifications")) {
return Boolean.valueOf(config.get("group_changed_notifications"));
} else {
return true;
}
}

public static void updateCache() {
configCache.save(config);
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -6,7 +6,7 @@

<groupId>net.vyhub</groupId>
<artifactId>VyHubMinecraft</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
<packaging>pom</packaging>
<modules>
<module>bukkit</module>
Expand Down
2 changes: 1 addition & 1 deletion velocity/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>net.vyhub</groupId>
<artifactId>VyHubMinecraft</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<build>
Expand Down
2 changes: 1 addition & 1 deletion velocity/src/main/java/net/vyhub/VyHubPlugin.java
Expand Up @@ -31,7 +31,7 @@
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;

@Plugin(id = "vyhub", name = "vyhub", version = "2.0.0",
@Plugin(id = "vyhub", name = "vyhub", version = "2.0.1",
url = "https://vyhub.net", description = "VyHub plugin to manage and monetize your Minecraft server. You can create your webstore for free with VyHub!", authors = {"VyHub, Matbyte"})
public class VyHubPlugin {
public static VyHubPlugin plugin;
Expand Down

0 comments on commit 5d94f95

Please sign in to comment.