1.2.0 Dev

[HOTFIX CODE] Added an option for players to confirm when an alias costs. (Per alias adjustable)
This commit is contained in:
JaTiTV 2023-05-03 22:47:58 +02:00
parent 546b827e02
commit 02e7020815
5 changed files with 11 additions and 50 deletions

10
pom.xml
View File

@ -6,11 +6,8 @@
<groupId>net.t2code</groupId>
<artifactId>Alias</artifactId>
<<<<<<< Updated upstream
<version>1.1.7</version>
=======
<version>1.2.0_DEV-1</version>
>>>>>>> Stashed changes
<packaging>jar</packaging>
<name>T2C-Alias</name>
@ -23,10 +20,7 @@
<url>T2Code.net</url>
<build>
<<<<<<< Updated upstream
=======
<finalName>${project.name}_${project.version}</finalName>
>>>>>>> Stashed changes
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -77,7 +71,7 @@
<dependency>
<groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId>
<version>13.4</version>
<version>14.4</version>
</dependency>
<dependency>
<groupId>net.t2code</groupId>

View File

@ -12,10 +12,7 @@ import net.t2code.t2codelib.SPIGOT.api.eco.T2Ceco;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.SPIGOT.api.plugins.T2CpluginCheck;
<<<<<<< Updated upstream
=======
import net.t2code.t2codelib.SPIGOT.api.yaml.T2CLibConfig;
>>>>>>> Stashed changes
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -179,7 +176,7 @@ public class ExecuteAlias {
if (alias.consoleCommandEnable) {
for (String cmd : alias.consoleCommands) {
if (alias.consoleBungeeCommand) {
if (SelectConfig.getBungee()) {
if (T2CLibConfig.getBungee()) {
BCommandSenderReciver.sendToBungee(sender, cmd, true);
} else {
T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
@ -209,7 +206,7 @@ public class ExecuteAlias {
for (String cmd : aliasObject.consoleCommands) {
String replace = cmd.replace("[target]", targetSt).replace("[alias]", alias);
if (aliasObject.consoleBungeeCommand) {
if (SelectConfig.getBungee()) {
if (T2CLibConfig.getBungee()) {
BCommandSenderReciver.sendToBungee(sender, replace, true);
} else {
T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
@ -237,7 +234,7 @@ public class ExecuteAlias {
}
for (String cmd : aliasObject.adminCommands) {
if (aliasObject.adminBungeeCommand) {
if (SelectConfig.getBungee()) {
if (T2CLibConfig.getBungee()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.adminCommandAsConsole);
} else {
@ -264,7 +261,7 @@ public class ExecuteAlias {
}
for (String cmd : aliasObject.adminCommands) {
if (aliasObject.adminBungeeCommand) {
if (SelectConfig.getBungee()) {
if (T2CLibConfig.getBungee()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.adminCommandAsConsole);
} else {
@ -329,7 +326,7 @@ public class ExecuteAlias {
}
for (String cmd : aliasObject.command) {
if (aliasObject.bungeeCommand) {
if (SelectConfig.getBungee()) {
if (T2CLibConfig.getBungee()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.commandAsConsole);
} else {
T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
@ -355,7 +352,7 @@ public class ExecuteAlias {
}
for (String cmd : alias.command) {
if (alias.bungeeCommand) {
if (SelectConfig.getBungee()) {
if (T2CLibConfig.getBungee()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt), alias.commandAsConsole);
} else {

View File

@ -11,7 +11,6 @@ import java.io.IOException;
public class CreateConfig {
public static void configCreate() {
long long_ = System.currentTimeMillis();
if (new File(Main.getPath(), "config.yml").exists()) {
@ -21,18 +20,7 @@ public class CreateConfig {
File config = new File(Main.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
T2Cconfig.set("Plugin.language", "english", yamlConfiguration);
T2Cconfig.set("Plugin.updateCheck.onJoin", true, yamlConfiguration);
T2Cconfig.set("Plugin.updateCheck.seePreReleaseUpdates", true, yamlConfiguration);
T2Cconfig.set("Plugin.updateCheck.timeInterval", 60, yamlConfiguration);
T2Cconfig.set("BungeeCord.Enable", false, yamlConfiguration);
T2Cconfig.set("BungeeCord.ThisServer", "server", yamlConfiguration);
<<<<<<< Updated upstream
T2Cconfig.set("Buy.Message", true, yamlConfiguration);
T2Cconfig.set("SubAlias.TabComplete", true, yamlConfiguration);
=======
T2Cconfig.set("plugin.language", "english", yamlConfiguration);
T2Cconfig.set("plugin.updateCheck.onJoin", true, yamlConfiguration);
T2Cconfig.set("plugin.updateCheck.seePreReleaseUpdates", true, yamlConfiguration);
@ -41,7 +29,7 @@ public class CreateConfig {
T2Cconfig.set("buy.message", true, yamlConfiguration);
T2Cconfig.set("buy.currency", "$", yamlConfiguration);
T2Cconfig.set("subAlias.tabComplete", true, yamlConfiguration);
>>>>>>> Stashed changes
try {
yamlConfiguration.save(config);
@ -50,8 +38,6 @@ public class CreateConfig {
}
T2Csend.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
}
<<<<<<< Updated upstream
=======
private static void convert() {
File configOld = new File(Main.getPath(), "config.yml");
@ -78,5 +64,4 @@ public class CreateConfig {
configCreate();
}
>>>>>>> Stashed changes
}

View File

@ -14,8 +14,6 @@ public class SelectConfig {
private static Boolean updateCheckSeePreReleaseUpdates;
private static Integer updateCheckTimeInterval;
private static String language;
private static Boolean Bungee;
private static String thisServer;
private static Boolean buyMessage;
private static String buyCurrency;
@ -32,18 +30,11 @@ public class SelectConfig {
updateCheckTimeInterval = yamlConfiguration.getInt("Plugin.updateCheck.timeInterval");
<<<<<<< Updated upstream
language = yamlConfiguration.getString("Plugin.language");
Bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
thisServer = yamlConfiguration.getString("BungeeCord.ThisServer");
buyMessage = yamlConfiguration.getBoolean("Buy.Message");
subAliasTab = yamlConfiguration.getBoolean("SubAlias.TabComplete");
=======
buyMessage = yamlConfiguration.getBoolean("buy.message");
buyCurrency = yamlConfiguration.getString("buy.currency");
subAliasTab = yamlConfiguration.getBoolean("subAlias.tabComplete");
>>>>>>> Stashed changes
}
public static void setConfigVersion() {
File config = new File(Main.getPath(), "config.yml");
@ -80,13 +71,6 @@ public class SelectConfig {
return language;
}
public static Boolean getBungee() {
return Bungee;
}
public static String getThisServer() {
return thisServer;
}
public static Boolean getBuyMessage() {
return buyMessage;

View File

@ -15,6 +15,7 @@ import net.t2code.alias.Util;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
import net.t2code.t2codelib.SPIGOT.api.register.T2Cregister;
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
import net.t2code.t2codelib.SPIGOT.api.yaml.T2CLibConfig;
import org.bukkit.Bukkit;
import java.io.File;
@ -72,7 +73,7 @@ public class Load {
T2Cregister.listener(new TabEvent(), plugin);
}
if (SelectConfig.getBungee()) {
if (T2CLibConfig.getBungee()) {
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bcmd");
}
AliasRegisterPermissions.onPermRegister();