Skip to content

Commit

Permalink
Updated to BentoBox 1.13.0 API
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed May 6, 2020
1 parent 0cdb761 commit 2195a42
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 622 deletions.
111 changes: 76 additions & 35 deletions src/main/java/world/bentobox/acidisland/AISettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ public class AISettings implements WorldSettings {

// ---------------------------------------------

// Command
@ConfigComment("Island Command. What command users will run to access their island")
@ConfigEntry(path = "acid.command.island")
private String playerCommandAliases = "ai";

@ConfigComment("The island admin command.")
@ConfigEntry(path = "acid.command.admin")
private String adminCommandAliases = "acid";

@ConfigComment("The default action for new player command call.")
@ConfigComment("Sub-command of main player command that will be run on first player command call.")
@ConfigComment("By default it is sub-command 'create'.")
@ConfigEntry(path = "acid.command.new-player-action", since = "1.13.1")
private String defaultNewPlayerAction = "create";

@ConfigComment("The default action for player command.")
@ConfigComment("Sub-command of main player command that will be run on each player command call.")
@ConfigComment("By default it is sub-command 'go'.")
@ConfigEntry(path = "acid.command.default-action", since = "1.13.1")
private String defaultPlayerAction = "go";

/* ACID */
@ConfigComment("Acid can damage ops or not")
@ConfigEntry(path = "acid.damage-op")
Expand All @@ -43,19 +64,6 @@ public class AISettings implements WorldSettings {
@ConfigEntry(path = "acid.damage-chickens")
private boolean acidDamageChickens = false;

// Command
@ConfigComment("Island Command. What command users will run to access their island")
@ConfigEntry(path = "acid.command.island")
private String islandCommand = "ai";

@ConfigComment("The island admin command.")
@ConfigEntry(path = "acid.command.admin")

private String adminCommand = "acid";
@ConfigComment("Use control panel if it exists (ControlPanel addon must be in addons)")
@ConfigEntry(path = "acid.use-control-panel", since = "1.13.0")
private boolean useControlPanel = false;

// 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")
Expand Down Expand Up @@ -568,10 +576,7 @@ public List<PotionEffectType> getAcidEffects() {
public int getAcidRainDamage() {
return acidRainDamage;
}
/**
* @return the command for accessing your admin command
*/
public String getAdminCommand() { return adminCommand; }

@Override
public int getBanLimit() {
return banLimit;
Expand Down Expand Up @@ -644,10 +649,6 @@ public String getFriendlyName() {
public List<String> getGeoLimitSettings() {
return geoLimitSettings;
}
/**
* @return the command for accessing your island
*/
public String getIslandCommand() { return islandCommand; }
/**
* @return the islandDistance
*/
Expand Down Expand Up @@ -1071,7 +1072,7 @@ public void setAcidRainDamage(int acidRainDamage) {
/**
* @param adminCommand what you want your admin command to be
*/
public void setAdminCommand(String adminCommand) { this.adminCommand = adminCommand; }
public void setAdminCommand(String adminCommand) { this.adminCommandAliases = adminCommand; }
/**
* @param allowSetHomeInNether the allowSetHomeInNether to set
*/
Expand Down Expand Up @@ -1185,7 +1186,7 @@ public void setHelmetProtection(boolean helmetProtection) {
/**
* @param islandCommand what you want your island command to be
*/
public void setIslandCommand(String islandCommand) { this.islandCommand = islandCommand; }
public void setIslandCommand(String islandCommand) { this.playerCommandAliases = islandCommand; }

/**
* @param islandDistance the islandDistance to set
Expand Down Expand Up @@ -1709,18 +1710,6 @@ public int getTicksPerMonsterSpawns() {
public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) {
this.ticksPerMonsterSpawns = ticksPerMonsterSpawns;
}
/**
* @return the useControlPanel
*/
public boolean isUseControlPanel() {
return useControlPanel;
}
/**
* @param useControlPanel the useControlPanel to set
*/
public void setUseControlPanel(boolean useControlPanel) {
this.useControlPanel = useControlPanel;
}
/**
* @return the maxCoopSize
*/
Expand Down Expand Up @@ -1750,4 +1739,56 @@ public int getMaxTrustSize() {
public void setMaxTrustSize(int maxTrustSize) {
this.maxTrustSize = maxTrustSize;
}
/**
* @return the playerCommandAliases
*/
@Override
public String getPlayerCommandAliases() {
return playerCommandAliases;
}
/**
* @param playerCommandAliases the playerCommandAliases to set
*/
public void setPlayerCommandAliases(String playerCommandAliases) {
this.playerCommandAliases = playerCommandAliases;
}
/**
* @return the adminCommandAliases
*/
@Override
public String getAdminCommandAliases() {
return adminCommandAliases;
}
/**
* @param adminCommandAliases the adminCommandAliases to set
*/
public void setAdminCommandAliases(String adminCommandAliases) {
this.adminCommandAliases = adminCommandAliases;
}
/**
* @return the defaultNewPlayerAction
*/
@Override
public String getDefaultNewPlayerAction() {
return defaultNewPlayerAction;
}
/**
* @param defaultNewPlayerAction the defaultNewPlayerAction to set
*/
public void setDefaultNewPlayerAction(String defaultNewPlayerAction) {
this.defaultNewPlayerAction = defaultNewPlayerAction;
}
/**
* @return the defaultPlayerAction
*/
@Override
public String getDefaultPlayerAction() {
return defaultPlayerAction;
}
/**
* @param defaultPlayerAction the defaultPlayerAction to set
*/
public void setDefaultPlayerAction(String defaultPlayerAction) {
this.defaultPlayerAction = defaultPlayerAction;
}
}
21 changes: 16 additions & 5 deletions src/main/java/world/bentobox/acidisland/AcidIsland.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
package world.bentobox.acidisland;

import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.WorldCreator;
import org.bukkit.WorldType;
import org.bukkit.World.Environment;
import org.bukkit.generator.ChunkGenerator;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;

import world.bentobox.acidisland.commands.AcidCommand;
import world.bentobox.acidisland.commands.AiCommand;
import world.bentobox.acidisland.commands.IslandAboutCommand;
import world.bentobox.acidisland.listeners.AcidEffect;
import world.bentobox.acidisland.listeners.LavaCheck;
import world.bentobox.acidisland.world.AcidTask;
import world.bentobox.acidisland.world.ChunkGeneratorWorld;
import world.bentobox.bentobox.api.addons.GameModeAddon;
import world.bentobox.bentobox.api.commands.admin.DefaultAdminCommand;
import world.bentobox.bentobox.api.commands.island.DefaultPlayerCommand;
import world.bentobox.bentobox.api.configuration.Config;
import world.bentobox.bentobox.api.configuration.WorldSettings;
import world.bentobox.bentobox.lists.Flags;
Expand Down Expand Up @@ -43,8 +44,18 @@ public void onLoad() {
// Chunk generator
chunkGenerator = settings.isUseOwnGenerator() ? null : new ChunkGeneratorWorld(this);
// Register commands
adminCommand = new AcidCommand(this, settings.getAdminCommand());
playerCommand = new AiCommand(this, settings.getIslandCommand());
// Register commands
playerCommand = new DefaultPlayerCommand(this)

{
@Override
public void setup()
{
super.setup();
new IslandAboutCommand(this);
}
};
adminCommand = new DefaultAdminCommand(this) {};
}

private boolean loadSettings() {
Expand Down
103 changes: 0 additions & 103 deletions src/main/java/world/bentobox/acidisland/commands/AcidCommand.java

This file was deleted.

Loading

0 comments on commit 2195a42

Please sign in to comment.