diff --git a/gradle.properties b/gradle.properties index b658df5..9721ce3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G loader_version=0.8.8+build.202 # Mod Properties - mod_version = 1.0.1-1.16-rc1 + mod_version = 1.0.0-1.16-rc1 maven_group = com.raxdiam archives_base_name = teamperms diff --git a/src/main/java/com/raxdiam/teamperms/TeamPerms.java b/src/main/java/com/raxdiam/teamperms/TeamPerms.java index 0c2c3d6..66cf554 100644 --- a/src/main/java/com/raxdiam/teamperms/TeamPerms.java +++ b/src/main/java/com/raxdiam/teamperms/TeamPerms.java @@ -34,7 +34,7 @@ private void onServerStart(MinecraftServer minecraftServer) { COMMAND_MANAGER = minecraftServer.getCommandManager(); PLAYER_MANAGER = minecraftServer.getPlayerManager(); var rootNode = COMMAND_MANAGER.getDispatcher().getRoot(); - CONFIG.teamMap.forEach((team, cmds) -> cmds.forEach(cmd -> { + CONFIG.teamCommands.forEach((team, cmds) -> cmds.forEach(cmd -> { CommandNodeHelper.changeRequirement(rootNode, cmd, createTeamPredicate(team)); })); @@ -43,14 +43,6 @@ private void onServerStart(MinecraftServer minecraftServer) { return false; }; - // Didn't realize until now that you can't change the name of a team, so there's no need for this ¯\_(ツ)_/¯ - /*ScoreboardCallbacks.TEAM_UPDATE.register(team -> { - var players = team.getPlayerList(); - for (var playerName : players) { - safeSendCommandTree(playerName, PLAYER_MANAGER, COMMAND_MANAGER); - } - return false; - });*/ ScoreboardCallbacks.TEAM_JOIN.register(leaveJoinCallback); ScoreboardCallbacks.TEAM_LEAVE.register(leaveJoinCallback); ScoreboardCallbacks.TEAM_REMOVE_AFTER.register(team -> { diff --git a/src/main/java/com/raxdiam/teamperms/config/Config.java b/src/main/java/com/raxdiam/teamperms/config/Config.java index 8ff307b..8f088c6 100644 --- a/src/main/java/com/raxdiam/teamperms/config/Config.java +++ b/src/main/java/com/raxdiam/teamperms/config/Config.java @@ -23,13 +23,13 @@ public Config() { private Config(boolean useDefault) { if (useDefault) { - teamMap = createDefaultTeamMap(); + teamCommands = createDefaultTeamMap(); } } public short configVersion = 1; - public LinkedHashMap> teamMap; + public LinkedHashMap> teamCommands; public void save() { save(this); @@ -43,6 +43,7 @@ public static Config load() { var config = GSON.fromJson(fr, Config.class); if (config.configVersion != DEFAULT.configVersion) { file.delete(); + save(config); return load(); } return config;