Added the ability to set what the command is. Also added a .gitignore.

This commit is contained in:
wherkamp 2018-09-13 10:07:06 -04:00
parent 98663e4a0e
commit 6c37f50879
5 changed files with 39 additions and 6 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.idea/
*.iml
bin/
*.class

View File

@ -52,6 +52,17 @@ public class AISettings implements DataObject, WorldSettings {
@ConfigEntry(path = "acid.damage-chickens")
private boolean acidDamageChickens = false;
// Command
@ConfigComment("")
@ConfigComment("Island Command. What command users will run to access their island")
@ConfigEntry(path = "acid.command.island")
private String islandCommand = "ai";
@ConfigComment("")
@ConfigComment("The island admin command.")
@ConfigEntry(path = "acid.command.admin")
private String adminCommand = "acid";
// Damage
@ConfigComment("Damage that a player will experience in acid. 10 is half their health typically. 5 would be easier.")
@ConfigEntry(path = "acid.damage.acid.player")
@ -1305,4 +1316,22 @@ public class AISettings implements DataObject, WorldSettings {
this.defaultBiome = defaultBiome;
}
/**
* @return the command for accessing your island
*/
public String getIslandCommand() { return islandCommand; }
/**
* @param islandCommand what you want your island command to be
*/
public void setIslandCommand(String islandCommand) { this.islandCommand = islandCommand; }
/**
* @return the command for accessing your admin command
*/
public String getAdminCommand() { return adminCommand; }
/**
* @param adminCommand what you want your admin command to be
*/
public void setAdminCommand(String adminCommand) { this.adminCommand = adminCommand; }
}

View File

@ -42,8 +42,8 @@ public class AcidIsland extends Addon {
manager.registerEvents(new AcidEffect(this), this.getPlugin());
manager.registerEvents(new LavaCheck(this), this.getPlugin());
// Register commands
new AcidCommand(this);
new AiCommand(this);
new AcidCommand(this, settings.getAdminCommand());
new AiCommand(this, settings.getIslandCommand());
// Burn everything
acidTask = new AcidTask(this);
}

View File

@ -25,8 +25,8 @@ import world.bentobox.bentobox.api.user.User;
public class AcidCommand extends CompositeCommand {
public AcidCommand(Addon addon) {
super(addon, "acid");
public AcidCommand(Addon addon, String command) {
super(addon, command);
}
@Override

View File

@ -26,8 +26,8 @@ import world.bentobox.bentobox.api.user.User;
public class AiCommand extends CompositeCommand {
public AiCommand(Addon addon) {
super(addon, "ai");
public AiCommand(Addon addon, String command) {
super(addon, command);
}
/* (non-Javadoc)