1.12.2
This commit is contained in:
parent
d6b889788b
commit
1dd7816c45
4 changed files with 17 additions and 9 deletions
|
|
@ -312,11 +312,13 @@ public class MainCommand implements CommandExecutor, TabCompleter {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean saveOriginalItems = false;
|
boolean saveOriginalItems = plugin.getConfigsManager().getMainConfigManager().isNewKitDefaultSaveModeOriginal();
|
||||||
if(args.length >= 3){
|
if(args.length >= 3){
|
||||||
if(args[2].equalsIgnoreCase("original")){
|
if(args[2].equalsIgnoreCase("original")){
|
||||||
saveOriginalItems = true;
|
saveOriginalItems = true;
|
||||||
}else if(!args[2].equalsIgnoreCase("configurable")){
|
}else if(args[2].equalsIgnoreCase("configurable")){
|
||||||
|
saveOriginalItems = false;
|
||||||
|
}else{
|
||||||
msgManager.sendMessage(player,messagesConfig.getString("commandCreateError"),true);
|
msgManager.sendMessage(player,messagesConfig.getString("commandCreateError"),true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ public class MainConfigManager {
|
||||||
private boolean closeInventoryOnClaim;
|
private boolean closeInventoryOnClaim;
|
||||||
private boolean claimKitShortCommand;
|
private boolean claimKitShortCommand;
|
||||||
private boolean kitPreviewRequiresKitPermission;
|
private boolean kitPreviewRequiresKitPermission;
|
||||||
|
private boolean newKitDefaultSaveModeOriginal;
|
||||||
private String firstJoinKit;
|
private String firstJoinKit;
|
||||||
private String newKitDefaultInventory;
|
private String newKitDefaultInventory;
|
||||||
private boolean isMySQL;
|
private boolean isMySQL;
|
||||||
|
|
@ -29,6 +30,7 @@ public class MainConfigManager {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.configFile = new CustomConfig("config.yml",plugin,null, false);
|
this.configFile = new CustomConfig("config.yml",plugin,null, false);
|
||||||
this.configFile.registerConfig();
|
this.configFile.registerConfig();
|
||||||
|
checkUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void configure(){
|
public void configure(){
|
||||||
|
|
@ -42,6 +44,7 @@ public class MainConfigManager {
|
||||||
isMySQL = config.getBoolean("mysql_database.enabled");
|
isMySQL = config.getBoolean("mysql_database.enabled");
|
||||||
updateNotify = config.getBoolean("update_notify");
|
updateNotify = config.getBoolean("update_notify");
|
||||||
claimKitShortCommand = config.getBoolean("claim_kit_short_command");
|
claimKitShortCommand = config.getBoolean("claim_kit_short_command");
|
||||||
|
newKitDefaultSaveModeOriginal = config.getBoolean("new_kit_default_save_mode_original");
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean reloadConfig(){
|
public boolean reloadConfig(){
|
||||||
|
|
@ -60,13 +63,11 @@ public class MainConfigManager {
|
||||||
Path pathConfig = Paths.get(configFile.getRoute());
|
Path pathConfig = Paths.get(configFile.getRoute());
|
||||||
try{
|
try{
|
||||||
String text = new String(Files.readAllBytes(pathConfig));
|
String text = new String(Files.readAllBytes(pathConfig));
|
||||||
/*
|
|
||||||
if(!text.contains("register_commands:")){
|
if(!text.contains("new_kit_default_save_mode_original:")){
|
||||||
List<String> commands = new ArrayList<>();
|
getConfig().set("new_kit_default_save_mode_original", true);
|
||||||
getConfig().set("Config.register_commands", commands);
|
configFile.saveConfig();
|
||||||
saveConfig();
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
@ -107,4 +108,8 @@ public class MainConfigManager {
|
||||||
public boolean isClaimKitShortCommand() {
|
public boolean isClaimKitShortCommand() {
|
||||||
return claimKitShortCommand;
|
return claimKitShortCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isNewKitDefaultSaveModeOriginal() {
|
||||||
|
return newKitDefaultSaveModeOriginal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ close_inventory_on_claim: false
|
||||||
kit_preview: true
|
kit_preview: true
|
||||||
kit_preview_requires_kit_permission: false
|
kit_preview_requires_kit_permission: false
|
||||||
first_join_kit: none
|
first_join_kit: none
|
||||||
|
new_kit_default_save_mode_original: true
|
||||||
new_kit_default_inventory: "main_inventory"
|
new_kit_default_inventory: "main_inventory"
|
||||||
new_kit_default_values:
|
new_kit_default_values:
|
||||||
cooldown: 3600
|
cooldown: 3600
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
main: pk.ajneb97.PlayerKits2
|
main: pk.ajneb97.PlayerKits2
|
||||||
version: 1.12.1
|
version: 1.12.2
|
||||||
name: PlayerKits2
|
name: PlayerKits2
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
softdepend: [Vault,PlaceholderAPI]
|
softdepend: [Vault,PlaceholderAPI]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue