This commit is contained in:
JaTiTV 2022-11-15 15:40:38 +01:00
parent 8b8678635a
commit f119b226b1
4 changed files with 39 additions and 6 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2C-AllayDuplicate</artifactId> <artifactId>T2C-AllayDuplicate</artifactId>
<version>1.3</version> <version>1.4</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>T2C AllayDuplicate</name> <name>T2C AllayDuplicate</name>
@ -89,8 +89,7 @@
<dependency> <dependency>
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId> <artifactId>T2CodeLib</artifactId>
<version>DEV-13.0</version> <version>13.4</version>
<classifier>dev-5</classifier>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.t2code.plotsquared</groupId> <groupId>net.t2code.plotsquared</groupId>

View File

@ -7,7 +7,7 @@ public class Util {
} }
public static String getRequiredT2CodeLibVersion() { public static String getRequiredT2CodeLibVersion() {
return "13.0"; return "13.4";
} }
public static String getPrefix() { public static String getPrefix() {
@ -18,6 +18,10 @@ public class Util {
return 103745; return 103745;
} }
public static String getGit() {
return "JaTiTV/T2C-AllayDuplicate";
}
public static Integer getBstatsID() { public static Integer getBstatsID() {
return 15932; return 15932;
} }

View File

@ -18,6 +18,10 @@ public class ConfigFile {
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config); YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
T2Cconfig.set("Plugin.Language", "ENGLISH", yamlConfiguration); 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("Duplicate.SneakRequired", true, yamlConfiguration); T2Cconfig.set("Duplicate.SneakRequired", true, yamlConfiguration);
T2Cconfig.set("Duplicate.Item.Enable", true, yamlConfiguration); T2Cconfig.set("Duplicate.Item.Enable", true, yamlConfiguration);
T2Cconfig.set("Duplicate.Item.Material", Material.AMETHYST_SHARD.toString(), yamlConfiguration); T2Cconfig.set("Duplicate.Item.Material", Material.AMETHYST_SHARD.toString(), yamlConfiguration);
@ -71,6 +75,9 @@ public class ConfigFile {
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);
language = yamlConfiguration.getString("Plugin.Language"); language = yamlConfiguration.getString("Plugin.Language");
updateCheckOnJoin = yamlConfiguration.getBoolean("Plugin.updateCheck.onJoin");
updateCheckSeePreReleaseUpdates = yamlConfiguration.getBoolean("Plugin.updateCheck.seePreReleaseUpdates");
updateCheckTimeInterval = yamlConfiguration.getInt("Plugin.updateCheck.timeInterval");
sneakRequired = yamlConfiguration.getBoolean("Duplicate.SneakRequired"); sneakRequired = yamlConfiguration.getBoolean("Duplicate.SneakRequired");
itemEnable = yamlConfiguration.getBoolean("Duplicate.Item.Enable"); itemEnable = yamlConfiguration.getBoolean("Duplicate.Item.Enable");
@ -122,6 +129,11 @@ public class ConfigFile {
} }
private static String language; private static String language;
private static Boolean updateCheckOnJoin;
private static Boolean updateCheckSeePreReleaseUpdates;
private static Integer updateCheckTimeInterval;
private static Boolean sneakRequired; private static Boolean sneakRequired;
private static Boolean itemEnable; private static Boolean itemEnable;
private static String itemMaterial; private static String itemMaterial;
@ -153,6 +165,22 @@ public class ConfigFile {
private static String reset; private static String reset;
private static String ResetAll; private static String ResetAll;
public static String getLanguage() {
return language;
}
public static Boolean getUpdateCheckOnJoin() {
return updateCheckOnJoin;
}
public static Boolean getUpdateCheckSeePreReleaseUpdates() {
return updateCheckSeePreReleaseUpdates;
}
public static Integer getUpdateCheckTimeInterval() {
return updateCheckTimeInterval;
}
public static Boolean getSneakRequired() { public static Boolean getSneakRequired() {
return sneakRequired; return sneakRequired;
} }
@ -240,6 +268,7 @@ public class ConfigFile {
public static String getErrorReset() { public static String getErrorReset() {
return errorReset; return errorReset;
} }
public static String getErrorCanNotBuild() { public static String getErrorCanNotBuild() {
return errorCanNotBuild; return errorCanNotBuild;
} }

View File

@ -50,7 +50,7 @@ public final class Main extends JavaPlugin {
if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return; if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return;
enable = true; enable = true;
long long_ = T2Ctemplate.onLoadHeader(Util.getPrefix(), this.getDescription().getAuthors(), this.getDescription().getVersion(), Util.getSpigot(), Util.getDiscord()); long long_ = T2Ctemplate.onLoadHeader(Util.getPrefix(), this.getDescription().getAuthors(), this.getDescription().getVersion(), Util.getSpigot(), Util.getDiscord());
T2CupdateAPI.onUpdateCheck(plugin, Util.getPrefix(), Util.getSpigotID(), Util.getDiscord());
Metrics.Bstats(); Metrics.Bstats();
if (T2CpluginCheck.plotSquared()) { if (T2CpluginCheck.plotSquared()) {
@ -66,7 +66,8 @@ public final class Main extends JavaPlugin {
ConfigFile.create(); ConfigFile.create();
ConfigFile.select(); ConfigFile.select();
T2CupdateAPI.onUpdateCheck(plugin, Util.getPrefix(),Util.getGit(), Util.getSpigotID(), Util.getDiscord()
,ConfigFile.getUpdateCheckOnJoin(),ConfigFile.getUpdateCheckSeePreReleaseUpdates(),ConfigFile.getUpdateCheckTimeInterval());
this.getCommand("t2c-allayduplicate").setExecutor(new CmdExecuter()); this.getCommand("t2c-allayduplicate").setExecutor(new CmdExecuter());
T2Cregister.listener(new Event(), this); T2Cregister.listener(new Event(), this);
T2Ctemplate.onLoadFooter(Util.getPrefix(), long_); T2Ctemplate.onLoadFooter(Util.getPrefix(), long_);