Compare commits

..

No commits in common. "84bbd3c00e323dc0888dc5ed833103b7560b98e6" and "142e310d11bf9708f83f0e80103f0f6fb393927d" have entirely different histories.

6 changed files with 12 additions and 21 deletions

View file

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>eu.m724</groupId> <groupId>eu.m724</groupId>
<artifactId>realweather</artifactId> <artifactId>realweather</artifactId>
<version>0.9-alpha.3</version> <version>0.9-alpha.3-SNAPSHOT</version>
<properties> <properties>
<maven.compiler.source>21</maven.compiler.source> <maven.compiler.source>21</maven.compiler.source>
@ -14,7 +14,7 @@
<scm> <scm>
<developerConnection>scm:git:git@git.724.rocks:Minecon724/realweather.git</developerConnection> <developerConnection>scm:git:git@git.724.rocks:Minecon724/realweather.git</developerConnection>
<tag>realweather-0.9-alpha.3</tag> <tag>HEAD</tag>
</scm> </scm>
<distributionManagement> <distributionManagement>

View file

@ -1,5 +1,5 @@
#release configuration #release configuration
#Tue Jun 18 13:42:52 CEST 2024 #Tue Jun 18 13:28:07 CEST 2024
completedPhase=check-poms completedPhase=check-poms
exec.pomFileName=pom.xml exec.pomFileName=pom.xml
exec.snapshotReleasePluginAllowed=false exec.snapshotReleasePluginAllowed=false

View file

@ -138,7 +138,8 @@ public class RealWeatherPlugin extends JavaPlugin {
GlobalConstants.thunderMaster = thunderMaster; GlobalConstants.thunderMaster = thunderMaster;
getCommand("rwadmin").setExecutor(new AdminCommand(updater)); getCommand("rwadmin").setExecutor(new AdminCommand());
getCommand("rwadmin update").setExecutor(new UpdateCommand(updater));
getCommand("geo").setExecutor(new GeoCommand()); getCommand("geo").setExecutor(new GeoCommand());
if (GlobalConstants.timeConfig.enabled) if (GlobalConstants.timeConfig.enabled)

View file

@ -12,7 +12,6 @@ import eu.m724.realweather.mapper.MapperConfig;
import eu.m724.realweather.thunder.ThunderConfig; import eu.m724.realweather.thunder.ThunderConfig;
import eu.m724.realweather.thunder.ThunderMaster; import eu.m724.realweather.thunder.ThunderMaster;
import eu.m724.realweather.time.TimeConfig; import eu.m724.realweather.time.TimeConfig;
import eu.m724.realweather.updater.Updater;
import eu.m724.realweather.weather.WeatherConfig; import eu.m724.realweather.weather.WeatherConfig;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.BaseComponent; import net.md_5.bungee.api.chat.BaseComponent;
@ -20,7 +19,6 @@ import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
public class AdminCommand implements CommandExecutor { public class AdminCommand implements CommandExecutor {
private UpdateCommand updateCommand;
private Plugin plugin = GlobalConstants.getPlugin(); private Plugin plugin = GlobalConstants.getPlugin();
private WeatherConfig weatherConfig = GlobalConstants.getWeatherConfig(); private WeatherConfig weatherConfig = GlobalConstants.getWeatherConfig();
@ -33,17 +31,9 @@ public class AdminCommand implements CommandExecutor {
private BaseComponent enabledComponent = TextComponent.fromLegacy("YES\n", ChatColor.GREEN); private BaseComponent enabledComponent = TextComponent.fromLegacy("YES\n", ChatColor.GREEN);
private BaseComponent disabledComponent = TextComponent.fromLegacy("NO\n", ChatColor.RED); private BaseComponent disabledComponent = TextComponent.fromLegacy("NO\n", ChatColor.RED);
public AdminCommand(Updater updater) {
this.updateCommand = new UpdateCommand(updater);
}
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length > 0 && args[0].equals("update")) {
return updateCommand.onCommand(sender, command, label, args);
}
ComponentBuilder componentBuilder = ComponentBuilder componentBuilder =
new ComponentBuilder("\nRealWeather " + plugin.getDescription().getVersion() + "\n\n") new ComponentBuilder("\nRealWeather " + plugin.getDescription().getVersion() + "\n\n")
.color(ChatColor.YELLOW); .color(ChatColor.YELLOW);

View file

@ -9,19 +9,15 @@ import org.bukkit.command.CommandSender;
import eu.m724.realweather.updater.Updater; import eu.m724.realweather.updater.Updater;
import eu.m724.realweather.updater.metadata.VersionMetadata; import eu.m724.realweather.updater.metadata.VersionMetadata;
/** public class UpdateCommand implements CommandExecutor {
* not actually a command but deserves a separate file
*/
public class UpdateCommand {
private Updater updater; private Updater updater;
public UpdateCommand(Updater updater) { public UpdateCommand(Updater updater) {
this.updater = updater; this.updater = updater;
} }
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!sender.hasPermission("realweather.admin.update")) return false;
sender.sendMessage("Please wait"); sender.sendMessage("Please wait");
CompletableFuture<VersionMetadata> latestFuture = updater.getLatestVersion(); CompletableFuture<VersionMetadata> latestFuture = updater.getLatestVersion();

View file

@ -16,6 +16,10 @@ commands:
description: RealWeather admin command description: RealWeather admin command
permission: realweather.admin permission: realweather.admin
permission-message: You do not have permission to use this command. permission-message: You do not have permission to use this command.
rwadmin update:
description: Update RealWeather
permission: realweather.admin.update
permission-message: You do not have permission to use this command.
geo: geo:
description: Convert lat,lon to x,y,z and vice versa description: Convert lat,lon to x,y,z and vice versa