Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c5274c1
feat(common): ♻️ allow btt commands via console and simplify bt infos…
Zoriot Jul 6, 2025
0635a21
build: 👷📝 update canvas & add myself as a contributor + update readme
Zoriot Jul 12, 2025
dbd26fc
fix(network): 🐛 change from nominatim to photon api for osm data
Zoriot Jul 12, 2025
c9eeb84
feat(navigation): ♻️ refactor config access and add player transfer h…
Zoriot Jul 13, 2025
96ed902
feat(nav/warps): 🐛 open warpeditmenu on main thread
Zoriot Jul 26, 2025
9a8d5a6
[WIP] feat(navigator/tpll): ✨ use cookie for server-transfer-tpll's
Zoriot Jul 30, 2025
f67777b
[WIP] feat(network/api): ✨ add local buildteam api
Zoriot Jul 30, 2025
a3c712b
fix(navigator/tpll): 🩹 handle empty tpll the right way
Zoriot Jul 30, 2025
3f70108
feat(navigator): ✨ streamline team switching logic and improve comman…
Zoriot Aug 17, 2025
2dd1dfa
feat(navigator): ✨ add buildteam command for team switching and enhan…
Zoriot Aug 17, 2025
7744efd
fix(navigator): ✨ add sorting mode and implement auto slot recalculat…
Zoriot Aug 20, 2025
c7d625b
feat(navigator): ✨ enhance command tab completion and improve coordin…
Zoriot Aug 20, 2025
aed4c12
feat(navigator): ✨ add warp menu access for regions with warp groups …
Zoriot Sep 8, 2025
73d6363
feat(navigator): ✨ enhance navigator configuration and improve warp h…
Zoriot Sep 17, 2025
e2e4506
chore(nav): refactor slots and correct logic for it
Zoriot Sep 24, 2025
f68eb22
chore(nav): fix the osm lookup
Zoriot Sep 24, 2025
3e4efcf
fix(navigator): correct area conversion and improve player transfer d…
Zoriot Sep 27, 2025
acf0b2a
refactor(item): ♻️ improve type safety by replacing ArrayList with Li…
Zoriot Oct 18, 2025
dfe4e24
feat(navigator): ✨ implement warps command for build teams and enhanc…
Zoriot Oct 18, 2025
9fa7689
feat(navigator): ✨ enhance warp menu functionality by allowing custom…
Zoriot Nov 8, 2025
7fe5962
Merge branch 'master' into improveNavigator
Zoriot Nov 8, 2025
31f31b5
fix(navigator): ✨ fix waro group back item
Zoriot Nov 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<p align="center">
<b>An easy to use toolset for Build Teams in the BuildTheEarth project.</b>
<br/>
<a href="https://github.com/BuildTheEarth/BuildTeamTools/wiki/"><strong>WIKI »</strong></a>
<a href="https://resources.buildtheearth.net/s/btt"><strong>WIKI »</strong></a>
<br/><br/>
</p>

Expand Down Expand Up @@ -69,15 +69,15 @@ The **\*** symbol shows that this feature is still being developed or under main
🚩 **How to install:**
1. Download BuildTeamTools [here](https://www.spigotmc.org/resources/buildteamtools.101854/).
2. Place the downloaded plugin in your server's **../plugins** folder.
3. *(Optional)* Some of the modules require intial configuration or dependencies to run:
3. *(Optional)* Some of the modules require initial configuration or dependencies to run:
> - To activate the **Navigation Module**, please configure an **API Key** in the config.yml file.
> - To activate the **Network Module**, please configure an **API Key** in the config.yml file.
> - To activate the **Generator Module**, please install the [WorldEdit](https://dev.bukkit.org/projects/worldedit) or [AsyncWorldEdit](https://www.spigotmc.org/resources/asyncworldedit.327/) plugin.
> - To activate the **Generator Module**, please install the [FastAsyncWorldEdit](https://modrinth.com/plugin/fastasyncworldedit/versions/) plugin.
> - To activate the **Tree Generator Component**, install the [SchematicBrush 0.5.2](https://dev.bukkit.org/projects/schematicbrush) plugin.
4. Restart your server.
5. Done!

**For more help, please see the [wiki](https://github.com/BuildTheEarth/BuildTeamTools/wiki/Installation).**
**For more help, please see the [wiki](https://resources.buildtheearth.net/s/btt).**

## Contributors
Thank you to the following developers for contributing towards the plugin:
Expand All @@ -88,20 +88,21 @@ Thank you to the following developers for contributing towards the plugin:
- **v4siv**
- **Adam**
- **Noah Husby**
- **Zoriot**


## Index
Click the links below for more information, or see the [wiki](https://github.com/BuildTheEarth/BuildTeamTools/wiki).

- [Generators](https://github.com/BuildTheEarth/BuildTeamTools/wiki/Generators)
- [Houses](https://github.com/BuildTheEarth/BuildTeamTools/wiki/House-Command)
- [Roads](https://github.com/BuildTheEarth/BuildTeamTools/wiki/Road-Command)
- [Railways](https://github.com/BuildTheEarth/BuildTeamTools/wiki/Rail-Command)
- [Trees](https://github.com/BuildTheEarth/BuildTeamTools/wiki/Tree-Command)
- [Fields](https://github.com/BuildTheEarth/BuildTeamTools/wiki/Field-Command)
- [Sledgehammer](https://github.com/noahhusby/Sledgehammer) (PLANNED)
- Statistics (PLANNED)
- Plot System (PLANNED)
- Tutorials (PLANNED)
Click the links below for more information, or see the [wiki](https://resources.buildtheearth.net/s/btt).

- [Generators](https://resources.buildtheearth.net/s/btt/doc/generator-module-13zqgI4yFA)
- [Houses](https://resources.buildtheearth.net/s/btt/doc/house-generator-YKQunon6Bp)
- [Roads](https://resources.buildtheearth.net/s/btt/doc/road-generator-QqKBBP0nqO)
- [Railways](https://resources.buildtheearth.net/s/btt/doc/rail-generator-EfgKXdBvk1)
- [Trees](https://resources.buildtheearth.net/s/btt/doc/tree-generator-pnDmYC9hzW)
- [Fields](https://resources.buildtheearth.net/s/btt/doc/field-generator-OqIN2BrZT7)
- [Sledgehammer](https://resources.buildtheearth.net/s/btt/doc/sledgehammer-module-T7I0PWPsTD)
- [Statistics](https://resources.buildtheearth.net/s/btt/doc/statistics-module-iM7IfoKroF) (PLANNED)
- [Plot System](https://resources.buildtheearth.net/s/btt/doc/plot-system-module-kkcH00jpcQ) (PLANNED)
- [Tutorials](https://resources.buildtheearth.net/s/btt/doc/tutorials-module-lkc3LaOrql) (PLANNED)
- Miscellaneous (PLANNED)
- Security (PLANNED)
- [Security](https://resources.buildtheearth.net/s/btt/doc/security-module-iOmxV0djrW) (PLANNED)
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>13.3.3</version>
<version>13.4.0</version>
<scope>compile</scope>
</dependency>

Expand All @@ -289,7 +289,7 @@
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.10.7-SNAPSHOT</version>
<version>1.10.8-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/buildtheearth/BuildTeamTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void onEnable() {
StatsModule.getInstance(),
MiscModule.getInstance()
);
ModuleHandler.getInstance().enableAll(null, true);
ModuleHandler.getInstance().enableAll(null);
}

@Override
Expand Down
37 changes: 18 additions & 19 deletions src/main/java/net/buildtheearth/modules/ModuleHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import net.buildtheearth.utils.ChatHelper;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nullable;
import java.util.ArrayList;
Expand Down Expand Up @@ -50,11 +51,10 @@ public void registerModules(Module... modules) {
* Enables a specific module
*
* @param module {@link Module}
* @param executor the player that executed the command. If null, the command was executed by the system.
* @param isStarting if the server is starting
* @param executor the sender, if it's triggered via command, else null, when it's called by btt on plugin start.
* @return True if successfully enabled, false if not
*/
public boolean enable(Module module, Player executor, boolean isStarting) {
public boolean enable(@NotNull Module module, @Nullable CommandSender executor) {
for (Module m : modules)
if (m.getModuleName().equals(module.getModuleName()) && m.isEnabled())
return false;
Expand All @@ -71,14 +71,14 @@ public boolean enable(Module module, Player executor, boolean isStarting) {
module.enable();
} catch (Exception ex) {
if (BuildTeamTools.getInstance().isDebug()) {
ChatHelper.logError("An error occurred while enabling the %s Module: %s", module.getModuleName(), ex.getMessage());
ex.printStackTrace();
ChatHelper.logError("An error occurred while enabling the %s Module: %s", ex, module.getModuleName(),
ex.getMessage());
}

module.shutdown(ex.getMessage());
}

if (!isStarting) {
if (executor != null) {
if (module.isEnabled() && BuildTeamTools.getInstance().isDebug())
ChatHelper.log("Successfully enabled %s Module", module.getModuleName());
else {
Expand Down Expand Up @@ -112,10 +112,10 @@ public boolean enable(Module module, Player executor, boolean isStarting) {
* Disables a specific module
*
* @param module {@link Module}
* @param executor the player that executed the command. If null, the command was executed by the system.
* @param executor the sender, if it's triggered via command, else null - when it's called by btt on plugin stop).
* @return True if successfully disabled, false if not
*/
public boolean disable(Module module, Player executor) {
public boolean disable(@NotNull Module module, @Nullable CommandSender executor) {
boolean contains = false;
for(Module m : modules)
if (m.getModuleName().equals(module.getModuleName())) {
Expand All @@ -131,7 +131,7 @@ public boolean disable(Module module, Player executor) {
if (!module.isEnabled()) {
if(BuildTeamTools.getInstance().isDebug())
ChatHelper.log("Successfully disabled %s Module", module.getModuleName());
}else {
} else {
String reason = "";

if(module.getError() != null && !module.getError().isEmpty())
Expand All @@ -158,23 +158,22 @@ public boolean disable(Module module, Player executor) {

/** Enables all modules
*
* @param executor the player that executed the command. If null, the command was executed by the system.
* @param isStarting if the server is starting
* @param executor the player, if it's triggered via command, else null (when it's called by btt on plugin start).
*/
public void enableAll(@Nullable Player executor, boolean isStarting) {
public void enableAll(@Nullable CommandSender executor) {
for (Module module : new ArrayList<>(modules))
if (!module.isEnabled())
enable(module, executor, isStarting);
enable(module, executor);

if(isStarting)
if (executor == null)
sendBuildTeamToolsConsoleStartupMessage();
}

/** Disables all modules
*
* @param executor the player that executed the command. If null, the command was executed by the system.
* @param executor the player, if it's triggered via command, else null (when it's called by btt on plugin stop).
*/
public void disableAll(@Nullable Player executor) {
public void disableAll(@Nullable CommandSender executor) {
for (Module module : new ArrayList<>(modules))
if (module.isEnabled())
disable(module, executor);
Expand All @@ -183,9 +182,9 @@ public void disableAll(@Nullable Player executor) {
/**
* Reloads all modules
*/
public void reloadAll(Player executor) {
public void reloadAll(@Nullable CommandSender executor) {
disableAll(executor);
enableAll(executor, false);
enableAll(executor);
}

private void sendBuildTeamToolsConsoleStartupMessage(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void enable() {

@Override
public void registerCommands() {
registerCommand("buildteam", new BuildTeamToolsCommand());
registerCommand("buildteamtools", new BuildTeamToolsCommand());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.buildtheearth.modules.common.commands;

import com.google.gson.Gson;
import net.buildtheearth.BuildTeamTools;
import net.buildtheearth.modules.Module;
import net.buildtheearth.modules.ModuleHandler;
Expand All @@ -17,30 +18,23 @@
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

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

public class BuildTeamToolsCommand implements CommandExecutor, TabCompleter {

public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, String @NotNull [] args) {

if(!(sender instanceof Player)){
sender.sendMessage("§cYou need to be a player to execute this command.");
return true;
}
Player player = (Player) sender;

if(!player.hasPermission(Permissions.BUILD_TEAM_TOOLS)){
if(!sender.hasPermission(Permissions.BUILD_TEAM_TOOLS)){
sender.sendMessage("§cYou don't have permission to execute this command.");
return true;
}


if(args.length == 0){
sendBuildTeamToolsInfo(sender);
return true;
Expand All @@ -58,9 +52,8 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
return true;
}


if(args[0].equalsIgnoreCase("communicators")) {
if(!player.hasPermission(Permissions.BUILD_TEAM_TOOLS_COMMUNICATORS)){
if(!sender.hasPermission(Permissions.BUILD_TEAM_TOOLS_COMMUNICATORS)){
sender.sendMessage("§cYou don't have permission to execute this command.");
return true;
}
Expand All @@ -73,7 +66,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
}

if (args[0].equalsIgnoreCase("cache")) {
if(!player.hasPermission(Permissions.BUILD_TEAM_TOOLS_CACHE)){
if(!sender.hasPermission(Permissions.BUILD_TEAM_TOOLS_CACHE)){
sender.sendMessage("§cYou don't have permission to execute this command.");
return true;
}
Expand All @@ -90,15 +83,13 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
return true;
}



if (args[0].equalsIgnoreCase("debug")) {
if(!player.hasPermission(Permissions.BUILD_TEAM_TOOLS_DEBUG)){
if(!sender.hasPermission(Permissions.BUILD_TEAM_TOOLS_DEBUG)){
sender.sendMessage("§cYou don't have permission to execute this command.");
return true;
}

if(!(args.length > 1)) {
if(args.length <= 1) {
sender.sendMessage("§cYou need to add a value: true/false");
return true;
}
Expand All @@ -111,12 +102,12 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
boolean debug = Boolean.parseBoolean(args[1]);

BuildTeamTools.getInstance().setDebug(debug);
player.sendMessage(ChatHelper.getStandardString("§7Debug Mode was set to: %s", debug));
sender.sendMessage(ChatHelper.getStandardString("§7Debug Mode was set to: %s", debug));
return true;
}

if (args[0].equalsIgnoreCase("checkForUpdates")) {
if(!player.hasPermission(Permissions.BUILD_TEAM_TOOLS_CHECK_FOR_UPDATES)){
if(!sender.hasPermission(Permissions.BUILD_TEAM_TOOLS_CHECK_FOR_UPDATES)){
sender.sendMessage("§cYou don't have permission to execute this command.");
return true;
}
Expand All @@ -131,23 +122,21 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
}

if(args[0].equalsIgnoreCase("reload")) {
if(!player.hasPermission(Permissions.BUILD_TEAM_TOOLS_RELOAD)){
if(!sender.hasPermission(Permissions.BUILD_TEAM_TOOLS_RELOAD)){
sender.sendMessage("§cYou don't have permission to execute this command.");
return true;
}

sender.sendMessage(ChatHelper.getStandardString("§7Reloading all modules..."));
ModuleHandler.getInstance().reloadAll(player);
ModuleHandler.getInstance().reloadAll(sender);
sender.sendMessage(ChatHelper.getStandardString("§7All modules have been reloaded."));
}



return true;
}

@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args) {
if(args.length == 1)
return Arrays.asList("help", "communicators", "checkForUpdates", "cache", "debug", "reload");

Expand Down Expand Up @@ -175,11 +164,6 @@ public static void sendBuildTeamToolsInfo(CommandSender sender){
&& NetworkModule.getInstance().getBuildTeam().getServerName() != null)
serverName = NetworkModule.getInstance().getBuildTeam().getServerName();

String continent = "-";
if (NetworkModule.getInstance().getBuildTeam() != null
&& NetworkModule.getInstance().getBuildTeam().getContinent() != null)
continent = NetworkModule.getInstance().getBuildTeam().getContinent().getLabel();

String status = "§c§lDISCONNECTED";
if (NetworkModule.getInstance().getBuildTeam() != null
&& NetworkModule.getInstance().getBuildTeam().isConnected() && !buildTeamID.equals("-") && !serverName.equals("-"))
Expand All @@ -189,9 +173,6 @@ else if (!buildTeamID.equals("-") && !serverName.equals("-"))

boolean debug = BuildTeamTools.getInstance().isDebug();




sender.sendMessage("§eStatus: " + status);
sender.sendMessage("§eVersion: §7" + BuildTeamTools.getInstance().getDescription().getVersion());

Expand All @@ -213,14 +194,24 @@ else if(!module.isEnabled())
}

if(NetworkModule.getInstance().getBuildTeam() != null){

List<String> regions = new ArrayList<>();
List<String> continents = new ArrayList<>();
for (Region region : NetworkModule.getInstance().getBuildTeam().getRegions()) {
if (region.getContinent() != null && !continents.contains(region.getContinent().getLabel()))
continents.add(region.getContinent().getLabel());

if (!regions.contains(region.getName()))
regions.add(region.getName());
}

Gson gson = new Gson();

sender.sendMessage("");
sender.sendMessage("§eBuildTeam ID: §7" + buildTeamID);
sender.sendMessage("§eServer Name: §7" + serverName);
sender.sendMessage("§eContinent: §7" + continent);
sender.sendMessage("§eRegions: §7");

for(Region region : NetworkModule.getInstance().getBuildTeam().getRegions())
sender.sendMessage("- §7" + region.getName());
sender.sendMessage("§eContinents: §7" + gson.toJson(continents));
sender.sendMessage("§eRegions: §7" + gson.toJson(regions));
}

sender.sendMessage("");
Expand Down
Loading