1.6_dev-23

This commit is contained in:
JaTiTV 2024-07-05 22:37:44 +02:00
parent 4735f9f6fe
commit 2f2c68efdd
5 changed files with 20 additions and 26 deletions

View File

@ -7,7 +7,7 @@
<groupId>net.t2code</groupId>
<artifactId>Alias</artifactId>
<version>1.6_beta-1</version>
<version>1.6_dev-23</version>
<!--version>VERSION_snapshot-0</version-->
<!--version>VERSION_beta-0</version-->
<!--version>VERSION_dev-0</version-->
@ -101,7 +101,7 @@
<groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId>
<version>16.7</version>
<classifier>dev-21</classifier>
<classifier>dev-23</classifier>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -303,7 +303,7 @@ public class AliasFile {
}
}
}
new AliasRegister(Main.getInstance());
new AliasRegister(Main.getInstance(),isReload);
}
}

View File

@ -32,7 +32,7 @@ public class SubAliasFile {
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of("Specify here what the SubAlias commands should be for this function"));
}}),
subAliasFor("subAlias.subAliasFor", List.of("aliasexample1"), true,
subAliasFor("subAlias.subAliasFor", "aliasexample1", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of("Enter here the alias command where the subalias should follow.","For example:"," - aliasexample1 -> aliasexample1 <this SubAlias>"," - aliasexample2 test -> aliasexample2 test <this SubAlias>"));
@ -43,7 +43,7 @@ public class SubAliasFile {
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of("Here you can say if a permission is needed to use the alias."));
}}),
permission("subAlias.permission.permission", "t2c.alias.use.[alias]", true,
permission("subAlias.permission.permission", "t2c.alias.sub.use.[alias]", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of("Here you can set the permission for the alias.", "The placeholder <alias> is the alias name.", "If you have set multiple alias referrers in the list 'Alias.AliasList' you have a permission for each alias."));
@ -91,7 +91,7 @@ public class SubAliasFile {
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of("Here you can tell the alias to execute one or more commands"));
}}),
commandAsConsole("subAlias.command.commandAsConsole", true, true,
commandAsConsole("subAlias.command.commandAsConsole", false, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of("Here you can specify whether the command should be executed from the console of the server"));
@ -113,7 +113,7 @@ public class SubAliasFile {
put(T2C_LanguageEnum.english, List.of("Here you can specify whether the player should receive a message."));
}}),
messages("subAlias.message.messages", Arrays.asList("<rainbow>This is a test alias</rainbow>", "<color:#d7ff0f>With this you can use several functions such as <color:#ffd6ad>colored text</color>, <click:suggest_command:'/command'><hover:show_text:'<color:#ff745c>Use Command</color>'>clickable texts</hover></click>, <hover:show_text:'<color:#1f66ff>For example Warps</color>'><click:suggest_command:'/warp home'><color:#365eff>shorten commands of other plugins</color></click></hover> and much more.</color>", "<color:#85a0ff><click:open_url:'http://dc.t2code.net'><hover:show_text:'<color:#0887ff>http://dc.t2code.net</color>'>If you have any questions, please contact our support Discord.</hover></click></color>"), true,
messages("subAlias.message.messages", List.of("This is a test subvcommand of T2C-Alias."), true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of("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", "#", "You can use Minecraft custom color codes: https://minecraft.fandom.com/de/wiki/Formatierungscodes", "You can also use MiniMessage:", " Wiki: https://docs.adventure.kyori.net/minimessage/format.html", " WebUI: https://webui.adventure.kyori.net"));
@ -273,9 +273,10 @@ public class SubAliasFile {
Main.allSubAliases.add(s);
}
}
Main.allForSubAliases.add((String) VALUES.subAliasFor.value);
int subAliasArg = 0;
if ((String) VALUES.subAliasFor.value != null) {
if (VALUES.subAliasFor.value != null) {
Main.allForSubAliases.add((String) VALUES.subAliasFor.value);
String[] imp = ((String) VALUES.subAliasFor.value).split(" ");
if (!Main.allAliases.contains(imp[0])) {
T2C_Send.error(Main.getInstance(), "The alias " + imp[0] + " in the file " + file.getName() + " does not exist!");
@ -323,7 +324,6 @@ public class SubAliasFile {
}
}
}
new AliasRegister(Main.getInstance());
}
}

View File

@ -4,8 +4,6 @@ import net.t2code.alias.Spigot.Main;
import net.t2code.alias.Spigot.cmdManagement.RegisterCommands;
import net.t2code.alias.util.Util;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
import org.bukkit.command.Command;
import org.bukkit.command.CommandMap;
import org.bukkit.plugin.SimplePluginManager;
@ -16,12 +14,12 @@ import java.util.Objects;
public class AliasRegister {
private Main main;
public AliasRegister(Main main) {
public AliasRegister(Main main, boolean isReload) {
this.main = main;
loadAliasCommands();
loadAliasCommands(isReload);
}
private void loadAliasCommands() {
private void loadAliasCommands(boolean isReload) {
CommandMap commandMap = getCommandMap();
unregister(commandMap);
if (commandMap == null) {
@ -33,9 +31,8 @@ public class AliasRegister {
if (Main.aliasHashMap.get(alias).aliasEnable) {
// Registrieren des Befehls
System.out.println("Alias: " +alias);
commandMap.register(main.getDescription().getName(), new RegisterCommands(alias));
T2C_Send.console(Util.getPrefix() + " §aAlias §e" + alias + " §aregister");
T2C_Send.sendStartTextCenter(Util.getPrefix(), "§aAlias §e" + alias + " §aregister", isReload);
Main.loadAliasHashMap.put(alias, true);
} else Main.loadAliasHashMap.put(alias, false);
@ -57,7 +54,6 @@ System.out.println("Alias: " +alias);
}
private void unregister(CommandMap commandMap) {
if (commandMap == null) return;
for (Map.Entry<String, Boolean> entry : Main.loadAliasHashMap.entrySet()) {

View File

@ -36,9 +36,9 @@ public class Load {
T2C_UpdateAPI.onUpdateCheck(plugin, prefix, Util.getGit(), Util.getSpigotID(), Util.getDiscord(),
(Boolean) Config.VALUES.updateCheckOnJoin.getValue(), (Boolean) Config.VALUES.updateCheckSeePreReleaseUpdates.getValue(), (Integer) Config.VALUES.updateCheckTimeInterval.getValue());
T2C_Template.onLoadFooter(prefix, long_);
T2C_Register.listener(new PluginEvents(), plugin);
Metrics.Bstats(plugin, bstatsID);
T2C_Template.onLoadFooter(prefix, long_);
}
private static ChatConfirm chatListener;
@ -49,8 +49,8 @@ public class Load {
HandlerList.unregisterAll(guiListener);
boolean newInstall = !new File(Main.getPath(), "config.yml").exists();
Config.set(isReload);
T2C_Template.onLoadSeparateStroke(Util.getPrefix());
Language.set(false);
T2C_Template.onLoadSeparateStroke(Util.getPrefix());
if (newInstall) {
AliasFile.set(false);
SubAliasFile.set(false);
@ -59,8 +59,6 @@ public class Load {
SubAliasFile.select(false);
T2C_Template.onLoadSeparateStroke(Util.getPrefix());
T2C_Template.onLoadSeparateStroke(Util.getPrefix());
if ((Boolean) Config.VALUES.subAliasTab.getValue()) {
T2C_Register.listener(new TabEvent(), plugin);
}