-
Notifications
You must be signed in to change notification settings - Fork 4
fix: if you type /bp now, the latest applied filters are still there (menu doesn't reset anymore) #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: build
Are you sure you want to change the base?
fix: if you type /bp now, the latest applied filters are still there (menu doesn't reset anymore) #73
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,18 @@ | ||
| package net.buildtheearth.buildteamtools.modules; | ||
| package net.buildtheearth.modules; | ||
|
|
||
| import com.alpsbte.alpslib.utils.ChatHelper; | ||
| import lombok.Getter; | ||
| import net.buildtheearth.buildteamtools.BuildTeamTools; | ||
| import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; | ||
| import net.buildtheearth.BuildTeamTools; | ||
| import net.buildtheearth.utils.ChatHelper; | ||
| import net.buildtheearth.utils.io.ConfigPaths; | ||
| import org.bukkit.Bukkit; | ||
| import org.bukkit.ChatColor; | ||
| import org.bukkit.command.CommandSender; | ||
| import org.jetbrains.annotations.NotNull; | ||
| import org.jetbrains.annotations.Nullable; | ||
|
|
||
| import javax.annotation.Nullable; | ||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
|
|
||
| /** | ||
| * @author Noah Husby | ||
|
|
@@ -44,8 +45,11 @@ public void registerModule(Module module) { | |
| * @param modules {@link Module} | ||
| */ | ||
| public void registerModules(Module @NotNull ... modules) { | ||
| for (Module m : modules) | ||
| registerModule(m); | ||
| for (Module m : modules) { | ||
| if (!Objects.requireNonNull(BuildTeamTools.getInstance().getConfig().getList(ConfigPaths.DISABLED_MODULES)).contains(m.getModuleName())) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert this change, it's unrelated |
||
| registerModule(m); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -60,31 +64,24 @@ public boolean enable(@NotNull Module module, @Nullable CommandSender executor) | |
| if (m.getModuleName().equals(module.getModuleName()) && m.isEnabled()) | ||
| return false; | ||
|
|
||
| if (!module.getModuleName().equals("Common") && BuildTeamTools.getInstance().getConfig() | ||
| .getStringList(ConfigPaths.DISABLED_MODULES).stream().anyMatch(module.getModuleName()::equalsIgnoreCase)) { | ||
| module.shutdown("This module is disabled in the config."); | ||
| } else { | ||
| boolean containsDisabledDependencyModule = false; | ||
| for (Module m : module.getDependsOnModules()) | ||
| if (!m.isEnabled()) { | ||
| module.checkForModuleDependencies(); | ||
| containsDisabledDependencyModule = true; | ||
| } | ||
|
|
||
| try { | ||
| if (!containsDisabledDependencyModule) | ||
| module.enable(); | ||
| } catch (Exception ex) { | ||
| if (BuildTeamTools.getInstance().isDebug()) { | ||
| ChatHelper.logError("An error occurred while enabling the %s Module: %s", ex, module.getModuleName(), | ||
| ex.getMessage()); | ||
| } | ||
|
|
||
| module.shutdown(ex.getMessage()); | ||
| boolean containsDisabledDependencyModule = false; | ||
| for (Module m : module.getDependsOnModules()) | ||
| if (!m.isEnabled()) { | ||
| module.checkForModuleDependencies(); | ||
| containsDisabledDependencyModule = true; | ||
| } | ||
| } | ||
|
|
||
| try { | ||
| if (!containsDisabledDependencyModule) | ||
| module.enable(); | ||
| } catch (Exception ex) { | ||
| if (BuildTeamTools.getInstance().isDebug()) { | ||
| ChatHelper.logError("An error occurred while enabling the %s Module: %s", ex, module.getModuleName(), | ||
| ex.getMessage()); | ||
| } | ||
|
|
||
| module.shutdown(ex.getMessage()); | ||
| } | ||
|
|
||
| if (executor != null) { | ||
| if (module.isEnabled() && BuildTeamTools.getInstance().isDebug()) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| name: BuildTeamTools | ||
| main: net.buildtheearth.buildteamtools.BuildTeamTools | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert this change. Else it will not work at all |
||
| main: net.buildtheearth.BuildTeamTools | ||
| api-version: 1.13 | ||
| version: ${version} | ||
| description: ${description} | ||
|
Comment on lines
-4
to
-5
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert your changes here too, we want to use the version from the build script |
||
| version: 0.1.3-alpha | ||
| author: MineFact, frikandelworst, George112n, ELgamer, SirJodelstein, Zoriot | ||
| softdepend: [WorldEdit, HeadDatabase, PlotSystem-Terra] | ||
|
|
||
|
|
@@ -22,15 +21,26 @@ commands: | |
| warp: | ||
| description: Command for managing warps. | ||
| usage: /warp <subcommand> | ||
| aliases: [ warps, wp ] | ||
| warpbt: | ||
| aliases: [warps] | ||
| warpsbt: | ||
| description: Opens the warp menu for the specified BuildTeam | ||
| usage: /warpsbt <team> | ||
| aliases: [ wbt, wpt, warpsbuildteam, warpsbt ] | ||
| aliases: [ wbt ] | ||
| kml: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why have this changes been made? Revert them pls |
||
| description: kml pasting and parsing | ||
| usage: /kml | ||
| aliases: [geopoints, geopath, georing, geosurface] | ||
| createplot: | ||
| description: Creates a new plot for the PlotSystem. | ||
| usage: /createplot | ||
| permission: plotsystem.createplot | ||
| pasteplot: | ||
| description: Pastes a plot manually with specific ID | ||
| usage: /pasteplot <ID> | ||
| permission: plotsystem.pasteplot | ||
| plotsystemterra: | ||
| description: Sends info about the plugin | ||
| usage: /plotsystemterra | ||
|
Comment on lines
+33
to
+43
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't read this commands, plot system module is currently disabled/no there and we should not register any cmds |
||
| blockpalette: | ||
| description: Opens the block palette menu. | ||
| usage: /blockpalette [filter|menu|filter <filter1> <filter2> ...] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, structure change to include the btt namespace so revert this lines
Also fix the imports under that