forked from Upstream/CommandPanels
Changed soem internal messages and updated the issues
This commit is contained in:
parent
ff61588559
commit
69b650bc41
12
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
12
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -40,6 +40,18 @@ body:
|
||||
attributes:
|
||||
label: What CommandPanels version are you using?
|
||||
options:
|
||||
- latest
|
||||
- 3.19.0.3
|
||||
- 3.19.0.2
|
||||
- 3.19.0.1
|
||||
- 3.19.0.0
|
||||
- 3.18.6.2
|
||||
- 3.18.6.1
|
||||
- 3.18.6.0
|
||||
- 3.18.5.1
|
||||
- 3.18.5.0
|
||||
- 3.18.4.1
|
||||
- 3.18.4.0
|
||||
- 3.18.3.0
|
||||
- 3.18.2.0
|
||||
- 3.18.1.4
|
||||
|
12
.github/ISSUE_TEMPLATE/need-help.yml
vendored
12
.github/ISSUE_TEMPLATE/need-help.yml
vendored
@ -38,6 +38,18 @@ body:
|
||||
attributes:
|
||||
label: What CommandPanels version are you using?
|
||||
options:
|
||||
- latest
|
||||
- 3.19.0.3
|
||||
- 3.19.0.2
|
||||
- 3.19.0.1
|
||||
- 3.19.0.0
|
||||
- 3.18.6.2
|
||||
- 3.18.6.1
|
||||
- 3.18.6.0
|
||||
- 3.18.5.1
|
||||
- 3.18.5.0
|
||||
- 3.18.4.1
|
||||
- 3.18.4.0
|
||||
- 3.18.3.0
|
||||
- 3.18.2.0
|
||||
- 3.18.1.4
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: 3.19.0.3
|
||||
version: 3.19.0.3-DEV
|
||||
main: me.rockyhawk.commandpanels.CommandPanels
|
||||
name: CommandPanels
|
||||
author: RockyHawk
|
||||
|
@ -11,7 +11,7 @@ public class Commandpanelversion implements CommandExecutor {
|
||||
CommandPanels plugin;
|
||||
public Commandpanelversion(CommandPanels pl) { this.plugin = pl; }
|
||||
|
||||
@EventHandler
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
|
||||
if (label.equalsIgnoreCase("cpv") || label.equalsIgnoreCase("commandpanelversion") || label.equalsIgnoreCase("cpanelv")) {
|
||||
|
@ -24,7 +24,7 @@ public class CommandPanelsEditor implements CommandExecutor {
|
||||
this.plugin = pl;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if (sender.hasPermission("commandpanel.edit")) {
|
||||
if (!(sender instanceof Player)) {
|
||||
|
@ -1,8 +1,13 @@
|
||||
package me.rockyhawk.commandpanels.editor;
|
||||
|
||||
import me.rockyhawk.commandpanels.CommandPanels;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
@ -13,7 +18,11 @@ import java.util.logging.Level;
|
||||
public class PanelDownloader {
|
||||
|
||||
CommandPanels plugin;
|
||||
public PanelDownloader(CommandPanels pl) { this.plugin = pl; }
|
||||
|
||||
public PanelDownloader(CommandPanels pl) {
|
||||
this.plugin = pl;
|
||||
}
|
||||
|
||||
public void downloadPanel(CommandSender sender, String url, String fileName) {
|
||||
BufferedInputStream in = null;
|
||||
FileOutputStream fout = null;
|
||||
@ -58,7 +67,29 @@ public class PanelDownloader {
|
||||
while ((count = in.read(data, 0, 1024)) != -1) {
|
||||
fout.write(data, 0, count);
|
||||
}
|
||||
sender.sendMessage(plugin.tag + ChatColor.GREEN + "Finished downloading.");
|
||||
if (sender instanceof Player) {
|
||||
YamlConfiguration panels = YamlConfiguration.loadConfiguration(file);
|
||||
if (panels.getConfigurationSection("panels").getKeys(false).size()>1) {
|
||||
sender.sendMessage(plugin.tag + ChatColor.GREEN + "Finished downloading," +
|
||||
ChatColor.UNDERLINE +ChatColor.YELLOW+ " Panel '" + fileName + "'");
|
||||
} else {
|
||||
|
||||
BaseComponent[] components = new ComponentBuilder(plugin.tag +
|
||||
net.md_5.bungee.api.ChatColor.GREEN + "Finished downloading, " +
|
||||
ChatColor.UNDERLINE + "Panel '" + fileName + "'.\n" +
|
||||
ChatColor.YELLOW + ChatColor.UNDERLINE + " Click Here to open the panel.")
|
||||
.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/cp " +
|
||||
panels.getConfigurationSection("panels").getKeys(false).toArray()[0]))
|
||||
.create();
|
||||
Player player =(Player) sender;
|
||||
player.spigot().sendMessage(components);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
sender.sendMessage(plugin.tag + ChatColor.GREEN + "Finished downloading, " +
|
||||
ChatColor.UNDERLINE +ChatColor.YELLOW+ "Panel '" + fileName + "'");
|
||||
}
|
||||
} catch (Exception var22) {
|
||||
sender.sendMessage(plugin.tag + ChatColor.RED + "Could not download panel.");
|
||||
} finally {
|
||||
|
Loading…
Reference in New Issue
Block a user