1.0.10
- A description / explanation of the alias files has been added. - Small code changes
This commit is contained in:
parent
4334b26be5
commit
e189722366
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>Alias</artifactId>
|
<artifactId>Alias</artifactId>
|
||||||
<version>1.0.9</version>
|
<version>1.0.10</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>T2C-Alias</name>
|
<name>T2C-Alias</name>
|
||||||
|
@ -21,9 +21,7 @@ public final class Main extends JavaPlugin {
|
|||||||
|
|
||||||
public static String version;
|
public static String version;
|
||||||
public static List<String> autor;
|
public static List<String> autor;
|
||||||
|
|
||||||
public static Main plugin;
|
public static Main plugin;
|
||||||
|
|
||||||
public static HashMap<String, AliasObjekt> aliasHashMap = new HashMap<>();
|
public static HashMap<String, AliasObjekt> aliasHashMap = new HashMap<>();
|
||||||
public static ArrayList<String> allAliases = new ArrayList<>();
|
public static ArrayList<String> allAliases = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -176,15 +176,14 @@ public class RegisterCommands extends Command {
|
|||||||
for (String cmd : alias.consoleCommands) {
|
for (String cmd : alias.consoleCommands) {
|
||||||
if (alias.consoleBungeeCommand) {
|
if (alias.consoleBungeeCommand) {
|
||||||
if (SelectConfig.Bungee) {
|
if (SelectConfig.Bungee) {
|
||||||
BCommandSenderReciver.sendToBungee(sender, cmd.replace("[player]", sender.getName()), true);
|
BCommandSenderReciver.sendToBungee(sender, cmd, true);
|
||||||
} else {
|
} else {
|
||||||
send.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
|
send.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
|
||||||
send.sender(sender, Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
|
send.sender(sender, Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Cmd.console(cmd.replace("[player]", sender.getName()));
|
Cmd.console(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (alias.consoleMessageEnable) {
|
if (alias.consoleMessageEnable) {
|
||||||
|
@ -18,7 +18,6 @@ public class CreateConfig {
|
|||||||
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
||||||
} else send.console(Util.getPrefix() + " §4config.yml are created...");
|
} else send.console(Util.getPrefix() + " §4config.yml are created...");
|
||||||
|
|
||||||
|
|
||||||
File config = new File(Main.getPath(), "config.yml");
|
File config = new File(Main.getPath(), "config.yml");
|
||||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
|
@ -8,24 +8,17 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class CreateExampleAliasConfig {
|
public class CreateExampleAliasConfig {
|
||||||
|
|
||||||
|
|
||||||
public static void configCreate() {
|
public static void configCreate() {
|
||||||
long long_ = System.currentTimeMillis();
|
long long_ = System.currentTimeMillis();
|
||||||
if (new File(Main.getPath(), "config.yml").exists()) {
|
send.console(Util.getPrefix() + " §4Alias/aliasexample.yml are created...");
|
||||||
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
|
||||||
} else send.console(Util.getPrefix() + " §4config.yml are created...");
|
|
||||||
|
|
||||||
|
|
||||||
File config = new File(Main.getPath(), "Alias/aliasexample.yml");
|
File config = new File(Main.getPath(), "Alias/aliasexample.yml");
|
||||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
|
|
||||||
Config.set("Alias.Enable", true, yamlConfiguration);
|
Config.set("Alias.Enable", true, yamlConfiguration);
|
||||||
Config.set("Alias.Permission.Necessary", true, yamlConfiguration);
|
Config.set("Alias.Permission.Necessary", true, yamlConfiguration);
|
||||||
|
|
||||||
@ -73,6 +66,6 @@ public class CreateExampleAliasConfig {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
send.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
send.console(Util.getPrefix() + " §2Alias/aliasexample.yml were successfully created." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ public class SelectAlias {
|
|||||||
File f = new File(Main.getPath() + "/Alias/");
|
File f = new File(Main.getPath() + "/Alias/");
|
||||||
File[] fileArray = f.listFiles();
|
File[] fileArray = f.listFiles();
|
||||||
for (File config_gui : fileArray) {
|
for (File config_gui : fileArray) {
|
||||||
|
if (config_gui.getName().equals("X_aliasDeclaration_X.yml")) return;
|
||||||
String sub = config_gui.getName().substring(config_gui.getName().length() - 4);
|
String sub = config_gui.getName().substring(config_gui.getName().length() - 4);
|
||||||
if (sub.equals(".yml")) {
|
if (sub.equals(".yml")) {
|
||||||
Main.allAliases.add(config_gui.getName().replace(".yml", ""));
|
Main.allAliases.add(config_gui.getName().replace(".yml", ""));
|
||||||
|
@ -32,7 +32,6 @@ public class Load {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void loadReload() {
|
public static void loadReload() {
|
||||||
|
|
||||||
if (!new File(Main.getPath(), "config.yml").exists()) {
|
if (!new File(Main.getPath(), "config.yml").exists()) {
|
||||||
try {
|
try {
|
||||||
CreateExampleAliasConfig.configCreate();
|
CreateExampleAliasConfig.configCreate();
|
||||||
@ -40,7 +39,11 @@ public class Load {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
plugin.saveResource("Alias/X_aliasDeclaration_X.yml",true);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
CreateConfig.configCreate();
|
CreateConfig.configCreate();
|
||||||
LanguagesCreate.langCreate();
|
LanguagesCreate.langCreate();
|
||||||
SelectConfig.onSelect();
|
SelectConfig.onSelect();
|
||||||
@ -53,4 +56,5 @@ public class Load {
|
|||||||
}
|
}
|
||||||
AliasRegisterPermissions.onPermRegister();
|
AliasRegisterPermissions.onPermRegister();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
130
src/main/resources/Alias/X_aliasDeclaration_X.yml
Normal file
130
src/main/resources/Alias/X_aliasDeclaration_X.yml
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
####################################################################
|
||||||
|
## To create another alias, simply copy the file ##
|
||||||
|
## and name it what you want the aliascommand to be. ##
|
||||||
|
## The alias command is always the filename without .yml!!! ##
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
Alias:
|
||||||
|
# Here you can disable the alias
|
||||||
|
Enable: true
|
||||||
|
Permission:
|
||||||
|
# Here you can say if a permission is needed to use the alias#
|
||||||
|
# Permission: t2code.alias.use.<aliasname>
|
||||||
|
Necessary: true
|
||||||
|
Cost:
|
||||||
|
# Here you can say if you have to pay for the alias
|
||||||
|
Enable: false
|
||||||
|
# Here you set the price
|
||||||
|
Price: 0.0
|
||||||
|
# Here you define if the bypass is activated or if you have to pay despite the bypass (t2code.alias.buy.bypass).
|
||||||
|
AllowByPass: true
|
||||||
|
Command:
|
||||||
|
# Here you can tell the alias to execute one or more commands
|
||||||
|
Enable: false
|
||||||
|
# Here you can specify whether the command should be executed from the console of the server
|
||||||
|
CommandAsConsole: false
|
||||||
|
# Here you can define if the command should be executed on the bungee.
|
||||||
|
# For this option, BungeeCord must be set to true in config.yml and the plugin must also work on the proxy as a bridge.
|
||||||
|
# (If it is to be executed from the proxy console, the CommandAsConsole option must also be enabled).
|
||||||
|
BungeeCommand: false
|
||||||
|
# Here you can specify one or more commands to be executed.
|
||||||
|
# Placeholder: [player] = The player who executes the alias
|
||||||
|
Commands: []
|
||||||
|
Message:
|
||||||
|
# Here you can specify whether the player should receive a message.
|
||||||
|
Enable: false
|
||||||
|
# Specify here the message that the player should get.
|
||||||
|
# Multiple lines can be used and placeholders are supported!
|
||||||
|
# Placeholder: [player] = The player who executes the alias
|
||||||
|
Messages: []
|
||||||
|
# With the TextBuilder it is possible to create messages with hover and clickable messages with actions.
|
||||||
|
# !!! There is currently a poll on our Discord asking if this option should be removed !!!
|
||||||
|
# To the poll: https://ptb.discord.com/channels/780682397950672897/915625982910672896/984228029297471529
|
||||||
|
TextBuilder:
|
||||||
|
# Here you can activate the TextBuilder.
|
||||||
|
Enable: false
|
||||||
|
# Set the hover here
|
||||||
|
Hover: ''
|
||||||
|
ClickEvent:
|
||||||
|
# Here you can give the message a function when clicked on
|
||||||
|
Enable: false
|
||||||
|
# Specify here what should happen
|
||||||
|
# OPEN_URL - Opens a URL under the path specified in ActionValue.
|
||||||
|
# OPEN_FILE - Opens a file under the path specified by ActionValue.
|
||||||
|
# RUN_COMMAND - Runs the command specified by ActionValue.
|
||||||
|
# SUGGEST_COMMAND - Inserts the string specified in ActionValue into the player text box.
|
||||||
|
# CHANGE_PAGE - Changes to the page number in a book specified by ActionValue.
|
||||||
|
# COPY_TO_CLIPBOARD - Copies the string specified by ActionValue to the player's clipboard.
|
||||||
|
Action: ''
|
||||||
|
# Here you set the value of the action.
|
||||||
|
# For example, the URL for the link to be opened or the command to be executed.
|
||||||
|
ActionValue: ''
|
||||||
|
|
||||||
|
# Here you can specify that players with the permission () have a different function than other players.
|
||||||
|
# For example, you can say that players should come to a certain point and players with the admin function only to the server to the position where they were before.
|
||||||
|
# Example:
|
||||||
|
# Player: /warp CityBuild
|
||||||
|
# Player with Admin Perm: /server CityBuild
|
||||||
|
Admin:
|
||||||
|
# Here you can enable or disable the admin function
|
||||||
|
Enable: true
|
||||||
|
# Here you set the permission for the admin function
|
||||||
|
Permission: t2code.alias.admin
|
||||||
|
Command:
|
||||||
|
# Here you can tell the alias to execute one or more commands
|
||||||
|
Enable: false
|
||||||
|
# Here you can specify whether the command should be executed from the console of the server
|
||||||
|
CommandAsConsole: false
|
||||||
|
# Here you can define if the command should be executed on the bungee.
|
||||||
|
# For this option, BungeeCord must be set to true in config.yml and the plugin must also work on the proxy as a bridge.
|
||||||
|
# (If it is to be executed from the proxy console, the CommandAsConsole option must also be enabled).
|
||||||
|
BungeeCommand: false
|
||||||
|
# Here you can specify one or more commands to be executed.
|
||||||
|
# Placeholder: [player] = The player who executes the alias
|
||||||
|
Commands: []
|
||||||
|
Message:
|
||||||
|
# Here you can specify whether the player should receive a message.
|
||||||
|
Enable: false
|
||||||
|
# Specify here the message that the player should get.
|
||||||
|
# Multiple lines can be used and placeholders are supported!
|
||||||
|
# Placeholder: [player] = The player who executes the alias
|
||||||
|
Messages: [ ]
|
||||||
|
# With the TextBuilder it is possible to create messages with hover and clickable messages with actions.
|
||||||
|
# !!! There is currently a poll on our Discord asking if this option should be removed !!!
|
||||||
|
# To the poll: https://ptb.discord.com/channels/780682397950672897/915625982910672896/984228029297471529
|
||||||
|
TextBuilder:
|
||||||
|
# Here you can activate the TextBuilder.
|
||||||
|
Enable: false
|
||||||
|
# Set the hover here
|
||||||
|
Hover: ''
|
||||||
|
ClickEvent:
|
||||||
|
# Here you can give the message a function when clicked on
|
||||||
|
Enable: false
|
||||||
|
# Specify here what should happen
|
||||||
|
# OPEN_URL - Opens a URL under the path specified in ActionValue.
|
||||||
|
# OPEN_FILE - Opens a file under the path specified by ActionValue.
|
||||||
|
# RUN_COMMAND - Runs the command specified by ActionValue.
|
||||||
|
# SUGGEST_COMMAND - Inserts the string specified in ActionValue into the player text box.
|
||||||
|
# CHANGE_PAGE - Changes to the page number in a book specified by ActionValue.
|
||||||
|
# COPY_TO_CLIPBOARD - Copies the string specified by ActionValue to the player's clipboard.
|
||||||
|
Action: ''
|
||||||
|
# Here you set the value of the action.
|
||||||
|
# For example, the URL for the link to be opened or the command to be executed.
|
||||||
|
ActionValue: ''
|
||||||
|
|
||||||
|
Console:
|
||||||
|
# Here you can define if the alias is also usable in the console and what it should do from there.
|
||||||
|
Enable: false
|
||||||
|
Command:
|
||||||
|
# Here you can tell the alias to execute one or more commands
|
||||||
|
Enable: false
|
||||||
|
# Here you can specify whether the command should be executed by the Bungee console.
|
||||||
|
# For this option, BungeeCord must be set to true in config.yml and the plugin must also work on the proxy as a bridge.
|
||||||
|
BungeeCommand: false
|
||||||
|
# Here you can specify one or more commands to be executed.
|
||||||
|
Commands: [ ]
|
||||||
|
Message:
|
||||||
|
# Here you can specify whether the player should receive a message.
|
||||||
|
Enable: false
|
||||||
|
# Specify here the message that the player should get.
|
||||||
|
Messages: [ ]
|
Loading…
Reference in New Issue
Block a user