Compare commits

..

No commits in common. "2f168197fe0aba8b492ba223ad020afbfff0da12" and "f3bc2e3d4f2cb9b205603c74a1e452ffd0f45785" have entirely different histories.

6 changed files with 18 additions and 63 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId> <artifactId>T2CodeLib</artifactId>
<version>16.7_dev-2</version> <version>16.7_dev-1</version>
<!--version>VERSION_snapshot-0</version--> <!--version>VERSION_snapshot-0</version-->
<!--version>VERSION_beta-0</version--> <!--version>VERSION_beta-0</version-->
<!--version>VERSION_dev-0</version--> <!--version>VERSION_dev-0</version-->

View File

@ -14,23 +14,21 @@ import java.util.List;
public class T2CBlibConfig { public class T2CBlibConfig {
public enum VALUES implements T2CconfigItem{ public enum VALUES implements T2CconfigItem{
updateTimer("updateCheck.timerInMin", 60,true,"In this option you can set the time interval in minutes in which updates should be checked."), updateTimer("updateCheck.timerInMin", 60,"In this option you can set the time interval in minutes in which updates should be checked."),
seePreReleaseUpdates("updateCheck.seePreReleaseUpdates", true,true,"In this option you can set whether you want to receive and display beta and snapshot versions in the update check."), seePreReleaseUpdates("updateCheck.seePreReleaseUpdates", true,"In this option you can set whether you want to receive and display beta and snapshot versions in the update check."),
apiCommandGUIEnable("api.commandGUI.enable", false, true,"With this option you activate the api interface for the T2C-CommandGUI plugin."), apiCommandGUIEnable("api.commandGUI.enable", false, "With this option you activate the api interface for the T2C-CommandGUI plugin."),
apiAutoResponse("api.autoResponse.enable", false,true,"With this option you activate the api interface for the T2C-AutoResponse plugin."), apiAutoResponse("api.autoResponse.enable", false,"With this option you activate the api interface for the T2C-AutoResponse plugin."),
apiOpSecurity("api.opSecurity.enable", false,true,"With this option you activate the api interface for the T2C-OPSecurity plugin."), apiOpSecurity("api.opSecurity.enable", false,"With this option you activate the api interface for the T2C-OPSecurity plugin."),
; ;
private final String path; private final String path;
private Object value; private Object value;
private final boolean forceSet;
private final List<String> comments; private final List<String> comments;
VALUES(String path, Object value,boolean forceSet, String... comments) { VALUES(String path, Object value, String... comments) {
this.path = path; this.path = path;
this.value = value; this.value = value;
this.forceSet=forceSet;
this.comments = new ArrayList<>(Arrays.asList(comments)); this.comments = new ArrayList<>(Arrays.asList(comments));
} }
@ -44,11 +42,6 @@ public class T2CBlibConfig {
return value; return value;
} }
@Override
public boolean getForceSet() {
return forceSet;
}
@Override @Override
public List<String> getComments() { public List<String> getComments() {
return comments; return comments;

View File

@ -20,8 +20,8 @@ public class T2CconfigWriter {
public static void createConfig(File configFile, T2CconfigItem[] values, String... header) { public static void createConfig(File configFile, T2CconfigItem[] values, String... header) {
boolean exist = configFile.exists(); boolean exist = false;
if (!exist) { if (!configFile.exists()) {
configFile.getParentFile().mkdirs(); configFile.getParentFile().mkdirs();
try { try {
configFile.createNewFile(); configFile.createNewFile();
@ -35,7 +35,7 @@ public class T2CconfigWriter {
Map<String, List<String>> comments = new LinkedHashMap<>(); Map<String, List<String>> comments = new LinkedHashMap<>();
for (T2CconfigItem value : values) { for (T2CconfigItem value : values) {
if ((value.getForceSet() && exist) || (!exist && !value.getForceSet())) { if ((value.getForceSet() && exist)||!exist && !value.getForceSet()){
config.addDefault(value.getPath(), value.getValue()); config.addDefault(value.getPath(), value.getValue());
comments.put(value.getPath(), value.getComments()); comments.put(value.getPath(), value.getComments());
} }

View File

@ -44,14 +44,6 @@ public class T2CLibConfig {
space_command("command", null, true,""), space_command("command", null, true,""),
test("opWhitelist.whitelist", null, true,"Test"),
testp1n("opWhitelist.whitelist.player1.name", "PlayerName", false,"Test"),
testp1u("opWhitelist.whitelist.player1.uuid", "00000000000000000000000000000000", false,"Test"),
commandPermToggleCommand("command.permToggle.permissionSetCommand", "lp user [player] permission set [perm] [value]", commandPermToggleCommand("command.permToggle.permissionSetCommand", "lp user [player] permission set [perm] [value]",
true,"This option specifies which command is to be used for the T2CodeLib command '/t2code permtoggle <player> <permission>'."), true,"This option specifies which command is to be used for the T2CodeLib command '/t2code permtoggle <player> <permission>'."),
; ;

View File

@ -1,24 +0,0 @@
// This class was created by JaTiTV.
package net.t2code.t2codelib.SPIGOT.system.config.config;
import net.t2code.t2codelib.T2CconfigItem;
import org.bukkit.configuration.ConfigurationSection;
import java.util.List;
public class test {
/**
public void test(){
ConfigurationSection test = (ConfigurationSection) T2CLibConfig.VALUES.test.getValue();
for (String key : test.getConfigurationSection("").getKeys(false)) {
String name = test.getString(key + ".Playername");//value.pathPlayerName.replace("KEY", key));
PlayerObject playerObject = new PlayerObject(
name,
test.getString(key + ".UUID")//value.pathPlayerUuid.replace("KEY", key)).replace("-", ""));
PlayerCache.getOpHashMap().put(name, playerObject);
}
}
*/
}

View File

@ -17,25 +17,24 @@ import java.util.List;
public class T2CVlibConfig { public class T2CVlibConfig {
public enum VALUES implements T2CconfigItem { public enum VALUES implements T2CconfigItem {
updateTimer("updateCheck.timerInMin", 60, true, "In this option you can set the time interval in minutes in which updates should be checked."), updateTimer("updateCheck.timerInMin", 60, "In this option you can set the time interval in minutes in which updates should be checked."),
seePreReleaseUpdates("updateCheck.seePreReleaseUpdates", true, true, "In this option you can set whether you want to receive and display beta and snapshot versions in the update check."), seePreReleaseUpdates("updateCheck.seePreReleaseUpdates", true, "In this option you can set whether you want to receive and display beta and snapshot versions in the update check."),
debug("plugin.debug.debugModus", false, true, "The debug mode sends more detailed debug information to the console."), debug("plugin.debug.debugModus", false, "The debug mode sends more detailed debug information to the console."),
apiCommandGUIEnable("api.commandGUI.enable", false, true, "With this option you activate the api interface for the T2C-CommandGUI plugin."), apiCommandGUIEnable("api.commandGUI.enable", false, "With this option you activate the api interface for the T2C-CommandGUI plugin."),
apiAutoResponse("api.autoResponse.enable", false, true, "With this option you activate the api interface for the T2C-AutoResponse plugin."), apiAutoResponse("api.autoResponse.enable", false, "With this option you activate the api interface for the T2C-AutoResponse plugin."),
apiOpSecurity("api.opSecurity.enable", false, true, "With this option you activate the api interface for the T2C-OPSecurity plugin."), apiOpSecurity("api.opSecurity.enable", false, "With this option you activate the api interface for the T2C-OPSecurity plugin."),
; ;
private final String path; private final String path;
private Object value; private Object value;
private final boolean forceSet;
private final List<String> comments; private final List<String> comments;
VALUES(String path, Object value, boolean forceSet, String... comments) { VALUES(String path, Object value, String... comments) {
this.path = path; this.path = path;
this.value = value; this.value = value;
this.forceSet = forceSet;
this.comments = new ArrayList<>(Arrays.asList(comments)); this.comments = new ArrayList<>(Arrays.asList(comments));
} }
@ -49,11 +48,6 @@ public class T2CVlibConfig {
return value; return value;
} }
@Override
public boolean getForceSet() {
return forceSet;
}
@Override @Override
public List<String> getComments() { public List<String> getComments() {
return comments; return comments;