diff --git a/.gitignore b/.gitignore index d931432..4de3a45 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ bin/ *.class /target/ +/.classpath +/.DS_Store +/.project +/.gitignore diff --git a/src/main/java/world/bentobox/acidisland/AISettings.java b/src/main/java/world/bentobox/acidisland/AISettings.java index 678067e..f18b324 100644 --- a/src/main/java/world/bentobox/acidisland/AISettings.java +++ b/src/main/java/world/bentobox/acidisland/AISettings.java @@ -25,11 +25,11 @@ import world.bentobox.bentobox.database.objects.adapters.FlagSerializer2; import world.bentobox.bentobox.database.objects.adapters.PotionEffectListAdapter; /** - * A lot of placeholders right now in here... + * Settings for AcidIsland * @author tastybento * */ -@ConfigComment("AcidIsland Configuration") +@ConfigComment("AcidIsland Configuration [version]") @ConfigComment("This config file is dynamic and saved when the server is shutdown.") @ConfigComment("You cannot edit it while the server is running because changes will") @ConfigComment("be lost! Use in-game settings GUI or edit when server is offline.") @@ -148,8 +148,6 @@ public class AISettings implements DataObject, WorldSettings { @ConfigComment("Sea height (don't changes this mid-game unless you delete the world)") @ConfigComment("Minimum is 0, which means you are playing Skyblock!") - @ConfigComment("If sea height is less than about 10, then players will drop right through it") - @ConfigComment("if it exists. Makes for an interesting variation on skyblock.") @ConfigEntry(path = "world.sea-height") private int seaHeight = 55; @@ -167,6 +165,12 @@ public class AISettings implements DataObject, WorldSettings { @ConfigEntry(path = "world.default-biome") private Biome defaultBiome = Biome.WARM_OCEAN; + @ConfigComment("The maximum number of players a player can ban at any one time in this game mode.") + @ConfigComment("The permission acidisland.ban.maxlimit.X where X is a number can also be used per player") + @ConfigComment("-1 = unlimited") + @ConfigEntry(path = "world.ban-limit") + private int banLimit = -1; + // Nether @ConfigComment("Generate Nether - if this is false, the nether world will not be made and access to") @ConfigComment("the nether will not occur. Other plugins may still enable portal usage.") @@ -180,6 +184,11 @@ public class AISettings implements DataObject, WorldSettings { @ConfigEntry(path = "world.nether.islands", needsReset = true) private boolean netherIslands = true; + @ConfigComment("Sea height in Nether. Only operates if nether islands is true.") + @ConfigComment("Changing mid-game will cause problems!") + @ConfigEntry(path = "world.nether.sea-height", needsReset = true) + private int netherSeaHeight = 55; + @ConfigComment("Nether trees are made if a player grows a tree in the nether (gravel and glowstone)") @ConfigComment("Applies to both vanilla and islands Nether") @ConfigEntry(path = "world.nether.trees") @@ -199,12 +208,20 @@ public class AISettings implements DataObject, WorldSettings { private int netherSpawnRadius = 32; // End + @ConfigComment("End Nether - if this is false, the end world will not be made and access to") + @ConfigComment("the end will not occur. Other plugins may still enable portal usage.") @ConfigEntry(path = "world.end.generate") private boolean endGenerate = true; + @ConfigComment("Islands in The End. Change to false for standard vanilla end.") @ConfigEntry(path = "world.end.islands", needsReset = true) private boolean endIslands = true; + @ConfigComment("Sea height in The End. Only operates if end islands is true.") + @ConfigComment("Changing mid-game will cause problems!") + @ConfigEntry(path = "world.end.sea-height", needsReset = true) + private int endSeaHeight = 55; + @ConfigEntry(path = "world.end.dragon-spawn", experimental = true) private boolean dragonSpawn = false; @@ -409,48 +426,31 @@ public class AISettings implements DataObject, WorldSettings { private long resetEpoch = 0; private String uniqueId = "config"; - /** - * @return the acidDamageOp - */ - public boolean isAcidDamageOp() { - return acidDamageOp; - } - /** - * @return the acidDamageChickens - */ - public boolean isAcidDamageChickens() { - return acidDamageChickens; - } + /** * @return the acidDamage */ public int getAcidDamage() { return acidDamage; } - /** - * @return the acidDamageMonster - */ - public int getAcidDamageMonster() { - return acidDamageMonster; - } /** * @return the acidDamageAnimal */ public int getAcidDamageAnimal() { return acidDamageAnimal; } + /** + * @return the acidDamageMonster + */ + public int getAcidDamageMonster() { + return acidDamageMonster; + } /** * @return the acidDestroyItemTime */ public long getAcidDestroyItemTime() { return acidDestroyItemTime; } - /** - * @return the acidRainDamage - */ - public int getAcidRainDamage() { - return acidRainDamage; - } /** * @return the acidEffects */ @@ -458,76 +458,18 @@ public class AISettings implements DataObject, WorldSettings { return acidEffects; } /** - * @return the helmetProtection + * @return the acidRainDamage */ - public boolean isHelmetProtection() { - return helmetProtection; + public int getAcidRainDamage() { + return acidRainDamage; } /** - * @return the fullArmorProtection + * @return the command for accessing your admin command */ - public boolean isFullArmorProtection() { - return fullArmorProtection; - } - /** - * @param acidDamageOp the acidDamageOp to set - */ - public void setAcidDamageOp(boolean acidDamageOp) { - this.acidDamageOp = acidDamageOp; - } - /** - * @param acidDamageChickens the acidDamageChickens to set - */ - public void setAcidDamageChickens(boolean acidDamageChickens) { - this.acidDamageChickens = acidDamageChickens; - } - /** - * @param acidDamage the acidDamage to set - */ - public void setAcidDamage(int acidDamage) { - this.acidDamage = acidDamage; - } - /** - * @param acidDamageMonster the acidDamageMonster to set - */ - public void setAcidDamageMonster(int acidDamageMonster) { - this.acidDamageMonster = acidDamageMonster; - } - /** - * @param acidDamageAnimal the acidDamageAnimal to set - */ - public void setAcidDamageAnimal(int acidDamageAnimal) { - this.acidDamageAnimal = acidDamageAnimal; - } - /** - * @param acidDestroyItemTime the acidDestroyItemTime to set - */ - public void setAcidDestroyItemTime(long acidDestroyItemTime) { - this.acidDestroyItemTime = acidDestroyItemTime; - } - /** - * @param acidRainDamage the acidRainDamage to set - */ - public void setAcidRainDamage(int acidRainDamage) { - this.acidRainDamage = acidRainDamage; - } - /** - * @param acidEffects the acidEffects to set - */ - public void setAcidEffects(List acidEffects) { - this.acidEffects = acidEffects; - } - /** - * @param helmetProtection the helmetProtection to set - */ - public void setHelmetProtection(boolean helmetProtection) { - this.helmetProtection = helmetProtection; - } - /** - * @param fullArmorProtection the fullArmorProtection to set - */ - public void setFullArmorProtection(boolean fullArmorProtection) { - this.fullArmorProtection = fullArmorProtection; + public String getAdminCommand() { return adminCommand; } + @Override + public int getBanLimit() { + return banLimit; } //---------------------------------------------------------------------------------------/ /** @@ -544,11 +486,63 @@ public class AISettings implements DataObject, WorldSettings { return deathsMax; } /** - * @param teamJoinDeathReset the teamJoinDeathReset to set + * @return the defaultBiome */ - public void setTeamJoinDeathReset(boolean teamJoinDeathReset) { - this.teamJoinDeathReset = teamJoinDeathReset; + public Biome getDefaultBiome() { + return defaultBiome; } + /** + * @return the defaultGameMode + */ + @Override + public GameMode getDefaultGameMode() { + return defaultGameMode; + } + /** + * @return the defaultIslandProtection + */ + @Override + public Map getDefaultIslandFlags() { + return defaultIslandFlags; + } + /** + * @return the defaultIslandSettings + */ + @Override + public Map getDefaultIslandSettings() { + return defaultIslandSettings; + } + /** + * @return the difficulty + */ + @Override + public Difficulty getDifficulty() { + return difficulty; + } + /** + * @return the endSeaHeight + */ + public int getEndSeaHeight() { + return endSeaHeight; + } + /* (non-Javadoc) + * @see world.bentobox.bbox.api.configuration.WorldSettings#getFriendlyName() + */ + @Override + public String getFriendlyName() { + return friendlyName; + } + /** + * @return the geoLimitSettings + */ + @Override + public List getGeoLimitSettings() { + return geoLimitSettings; + } + /** + * @return the command for accessing your island + */ + public String getIslandCommand() { return islandCommand; } /** * @return the islandDistance */ @@ -598,6 +592,14 @@ public class AISettings implements DataObject, WorldSettings { public int getIslandZOffset() { return islandZOffset; } + /** + * Invincible visitor settings + * @return the ivSettings + */ + @Override + public List getIvSettings() { + return ivSettings; + } /** * @return the kickWait */ @@ -643,6 +645,12 @@ public class AISettings implements DataObject, WorldSettings { public int getNameMinLength() { return nameMinLength; } + /** + * @return the netherSeaHeight + */ + public int getNetherSeaHeight() { + return netherSeaHeight; + } /** * @return the netherSpawnRadius */ @@ -650,6 +658,21 @@ public class AISettings implements DataObject, WorldSettings { public int getNetherSpawnRadius() { return netherSpawnRadius; } + @Override + public String getPermissionPrefix() { + return "acidisland"; + } + /** + * @return the removeMobsWhitelist + */ + @Override + public Set getRemoveMobsWhitelist() { + return removeMobsWhitelist; + } + @Override + public long getResetEpoch() { + return resetEpoch; + } /** * @return the resetLimit */ @@ -677,6 +700,27 @@ public class AISettings implements DataObject, WorldSettings { public String getUniqueId() { return uniqueId; } + /** + * @return the visibleSettings + */ + @Override + public List getVisibleSettings() { + return visibleSettings; + } + /** + * @return the visitorbannedcommands + */ + @Override + public List getVisitorBannedCommands() { + return visitorBannedCommands; + } + /** + * @return the worldFlags + */ + @Override + public Map getWorldFlags() { + return worldFlags; + } /** * @return the worldName */ @@ -684,12 +728,58 @@ public class AISettings implements DataObject, WorldSettings { public String getWorldName() { return worldName; } + /** + * @return the acidDamageChickens + */ + public boolean isAcidDamageChickens() { + return acidDamageChickens; + } + /** + * @return the acidDamageOp + */ + public boolean isAcidDamageOp() { + return acidDamageOp; + } + /** + * @return the allowSetHomeInNether + */ + @Override + public boolean isAllowSetHomeInNether() { + return allowSetHomeInNether; + } + /** + * @return the allowSetHomeInTheEnd + */ + @Override + public boolean isAllowSetHomeInTheEnd() { + return allowSetHomeInTheEnd; + } + /** + * @return whether panels should close when clicked outside or not + */ + public boolean isClosePanelOnClickOutside() { + return closePanelOnClickOutside; + } + /** + * @return the isDeathsCounted + */ + @Override + public boolean isDeathsCounted() { + return deathsCounted; + } /** * @return the deathsSumTeam */ public boolean isDeathsSumTeam() { return deathsSumTeam; } + /** + * @return the dragonSpawn + */ + @Override + public boolean isDragonSpawn() { + return dragonSpawn; + } /** * @return the endGenerate */ @@ -704,6 +794,18 @@ public class AISettings implements DataObject, WorldSettings { public boolean isEndIslands() { return endIslands; } + /** + * @return the fullArmorProtection + */ + public boolean isFullArmorProtection() { + return fullArmorProtection; + } + /** + * @return the helmetProtection + */ + public boolean isHelmetProtection() { + return helmetProtection; + } /** * @return the immediateTeleportOnIsland */ @@ -722,24 +824,28 @@ public class AISettings implements DataObject, WorldSettings { public boolean isKickedKeepInventory() { return kickedKeepInventory; } + /** * @return the leaveConfirmation */ public boolean isLeaveConfirmation() { return leaveConfirmation; } + /** * @return the leaversLoseReset */ public boolean isLeaversLoseReset() { return leaversLoseReset; } + /** * @return the makeIslandIfNone */ public boolean isMakeIslandIfNone() { return makeIslandIfNone; } + /** * @return the netherGenerate */ @@ -767,6 +873,62 @@ public class AISettings implements DataObject, WorldSettings { public boolean isNetherTrees() { return netherTrees; } + /** + * @return the onJoinResetEnderChest + */ + @Override + public boolean isOnJoinResetEnderChest() { + return onJoinResetEnderChest; + } + /** + * @return the onJoinResetInventory + */ + @Override + public boolean isOnJoinResetInventory() { + return onJoinResetInventory; + } + /** + * @return the onJoinResetMoney + */ + @Override + public boolean isOnJoinResetMoney() { + return onJoinResetMoney; + } + /** + * @return the onLeaveResetEnderChest + */ + @Override + public boolean isOnLeaveResetEnderChest() { + return onLeaveResetEnderChest; + } + /** + * @return the onLeaveResetInventory + */ + @Override + public boolean isOnLeaveResetInventory() { + return onLeaveResetInventory; + } + /** + * @return the onLeaveResetMoney + */ + @Override + public boolean isOnLeaveResetMoney() { + return onLeaveResetMoney; + } + /** + * @return the requireConfirmationToSetHomeInNether + */ + @Override + public boolean isRequireConfirmationToSetHomeInNether() { + return requireConfirmationToSetHomeInNether; + } + /** + * @return the requireConfirmationToSetHomeInTheEnd + */ + @Override + public boolean isRequireConfirmationToSetHomeInTheEnd() { + return requireConfirmationToSetHomeInTheEnd; + } /** * @return the resetConfirmation */ @@ -779,6 +941,10 @@ public class AISettings implements DataObject, WorldSettings { public boolean isRespawnOnIsland() { return respawnOnIsland; } + @Override + public boolean isTeamJoinDeathReset() { + return teamJoinDeathReset; + } /** * @return the useOwnGenerator */ @@ -786,44 +952,87 @@ public class AISettings implements DataObject, WorldSettings { public boolean isUseOwnGenerator() { return useOwnGenerator; } - /** - * @return the isDeathsCounted - */ @Override - public boolean isDeathsCounted() { - return deathsCounted; + public boolean isWaterUnsafe() { + // Water is unsafe in acid island + return true; } - /** - * @return the allowSetHomeInNether + * @param acidDamage the acidDamage to set */ - @Override - public boolean isAllowSetHomeInNether() { - return allowSetHomeInNether; + public void setAcidDamage(int acidDamage) { + this.acidDamage = acidDamage; } - /** - * @return the allowSetHomeInTheEnd + * @param acidDamageAnimal the acidDamageAnimal to set */ - @Override - public boolean isAllowSetHomeInTheEnd() { - return allowSetHomeInTheEnd; + public void setAcidDamageAnimal(int acidDamageAnimal) { + this.acidDamageAnimal = acidDamageAnimal; } - /** - * @return the requireConfirmationToSetHomeInNether + * @param acidDamageChickens the acidDamageChickens to set */ - @Override - public boolean isRequireConfirmationToSetHomeInNether() { - return requireConfirmationToSetHomeInNether; + public void setAcidDamageChickens(boolean acidDamageChickens) { + this.acidDamageChickens = acidDamageChickens; } - /** - * @return the requireConfirmationToSetHomeInTheEnd + * @param acidDamageMonster the acidDamageMonster to set */ - @Override - public boolean isRequireConfirmationToSetHomeInTheEnd() { - return requireConfirmationToSetHomeInTheEnd; + public void setAcidDamageMonster(int acidDamageMonster) { + this.acidDamageMonster = acidDamageMonster; + } + /** + * @param acidDamageOp the acidDamageOp to set + */ + public void setAcidDamageOp(boolean acidDamageOp) { + this.acidDamageOp = acidDamageOp; + } + /** + * @param acidDestroyItemTime the acidDestroyItemTime to set + */ + public void setAcidDestroyItemTime(long acidDestroyItemTime) { + this.acidDestroyItemTime = acidDestroyItemTime; + } + /** + * @param acidEffects the acidEffects to set + */ + public void setAcidEffects(List acidEffects) { + this.acidEffects = acidEffects; + } + /** + * @param acidRainDamage the acidRainDamage to set + */ + public void setAcidRainDamage(int acidRainDamage) { + this.acidRainDamage = acidRainDamage; + } + /** + * @param adminCommand what you want your admin command to be + */ + public void setAdminCommand(String adminCommand) { this.adminCommand = adminCommand; } + /** + * @param allowSetHomeInNether the allowSetHomeInNether to set + */ + public void setAllowSetHomeInNether(boolean allowSetHomeInNether) { + this.allowSetHomeInNether = allowSetHomeInNether; + } + /** + * @param allowSetHomeInTheEnd the allowSetHomeInTheEnd to set + */ + public void setAllowSetHomeInTheEnd(boolean allowSetHomeInTheEnd) { + this.allowSetHomeInTheEnd = allowSetHomeInTheEnd; + } + /** + * @param banLimit the banLimit to set + */ + public void setBanLimit(int banLimit) { + this.banLimit = banLimit; + } + /** + * Set panel close on click outside + * @param closePanelOnClickOutside - true means close panel when click is outside panel + */ + public void setClosePanelOnClickOutside(boolean closePanelOnClickOutside) { + this.closePanelOnClickOutside = closePanelOnClickOutside; } /** * @param customRanks the customRanks to set @@ -849,6 +1058,42 @@ public class AISettings implements DataObject, WorldSettings { public void setDeathsSumTeam(boolean deathsSumTeam) { this.deathsSumTeam = deathsSumTeam; } + /** + * @param defaultBiome the defaultBiome to set + */ + public void setDefaultBiome(Biome defaultBiome) { + this.defaultBiome = defaultBiome; + } + /** + * @param defaultGameMode the defaultGameMode to set + */ + public void setDefaultGameMode(GameMode defaultGameMode) { + this.defaultGameMode = defaultGameMode; + } + /** + */ + public void setDefaultIslandFlags(Map defaultIslandFlags) { + this.defaultIslandFlags = defaultIslandFlags; + } + /** + * @param defaultIslandSettings the defaultIslandSettings to set + */ + public void setDefaultIslandSettings(Map defaultIslandSettings) { + this.defaultIslandSettings = defaultIslandSettings; + } + /** + * @param difficulty the difficulty to set + */ + @Override + public void setDifficulty(Difficulty difficulty) { + this.difficulty = difficulty; + } + /** + * @param dragonSpawn the dragonSpawn to set + */ + public void setDragonSpawn(boolean dragonSpawn) { + this.dragonSpawn = dragonSpawn; + } /** * @param endGenerate the endGenerate to set */ @@ -861,12 +1106,45 @@ public class AISettings implements DataObject, WorldSettings { public void setEndIslands(boolean endIslands) { this.endIslands = endIslands; } + + /** + * @param friendlyName the friendlyName to set + */ + public void setFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + } + /** + * @param fullArmorProtection the fullArmorProtection to set + */ + public void setFullArmorProtection(boolean fullArmorProtection) { + this.fullArmorProtection = fullArmorProtection; + } + /** + * @param geoLimitSettings the geoLimitSettings to set + */ + public void setGeoLimitSettings(List geoLimitSettings) { + this.geoLimitSettings = geoLimitSettings; + } + + /** + * @param helmetProtection the helmetProtection to set + */ + public void setHelmetProtection(boolean helmetProtection) { + this.helmetProtection = helmetProtection; + } + /** * @param immediateTeleportOnIsland the immediateTeleportOnIsland to set */ public void setImmediateTeleportOnIsland(boolean immediateTeleportOnIsland) { this.immediateTeleportOnIsland = immediateTeleportOnIsland; } + + /** + * @param islandCommand what you want your island command to be + */ + public void setIslandCommand(String islandCommand) { this.islandCommand = islandCommand; } + /** * @param islandDistance the islandDistance to set */ @@ -879,12 +1157,14 @@ public class AISettings implements DataObject, WorldSettings { public void setIslandHeight(int islandHeight) { this.islandHeight = islandHeight; } + /** * @param islandProtectionRange the islandProtectionRange to set */ public void setIslandProtectionRange(int islandProtectionRange) { this.islandProtectionRange = islandProtectionRange; } + /** * @param islandStartX the islandStartX to set */ @@ -909,6 +1189,12 @@ public class AISettings implements DataObject, WorldSettings { public void setIslandZOffset(int islandZOffset) { this.islandZOffset = islandZOffset; } + /** + * @param ivSettings the ivSettings to set + */ + public void setIvSettings(List ivSettings) { + this.ivSettings = ivSettings; + } /** * @param kickConfirmation the kickConfirmation to set */ @@ -981,6 +1267,7 @@ public class AISettings implements DataObject, WorldSettings { public void setNameMinLength(int nameMinLength) { this.nameMinLength = nameMinLength; } + /** * @param netherGenerate the netherGenerate to set */ @@ -1011,12 +1298,75 @@ public class AISettings implements DataObject, WorldSettings { public void setNetherTrees(boolean netherTrees) { this.netherTrees = netherTrees; } + /** + * @param onJoinResetEnderChest the onJoinResetEnderChest to set + */ + public void setOnJoinResetEnderChest(boolean onJoinResetEnderChest) { + this.onJoinResetEnderChest = onJoinResetEnderChest; + } + + /** + * @param onJoinResetInventory the onJoinResetInventory to set + */ + public void setOnJoinResetInventory(boolean onJoinResetInventory) { + this.onJoinResetInventory = onJoinResetInventory; + } + + /** + * @param onJoinResetMoney the onJoinResetMoney to set + */ + public void setOnJoinResetMoney(boolean onJoinResetMoney) { + this.onJoinResetMoney = onJoinResetMoney; + } + /** + * @param onLeaveResetEnderChest the onLeaveResetEnderChest to set + */ + public void setOnLeaveResetEnderChest(boolean onLeaveResetEnderChest) { + this.onLeaveResetEnderChest = onLeaveResetEnderChest; + } + + /** + * @param onLeaveResetInventory the onLeaveResetInventory to set + */ + public void setOnLeaveResetInventory(boolean onLeaveResetInventory) { + this.onLeaveResetInventory = onLeaveResetInventory; + } + /** + * @param onLeaveResetMoney the onLeaveResetMoney to set + */ + public void setOnLeaveResetMoney(boolean onLeaveResetMoney) { + this.onLeaveResetMoney = onLeaveResetMoney; + } + + /** + * @param removeMobsWhitelist the removeMobsWhitelist to set + */ + public void setRemoveMobsWhitelist(Set removeMobsWhitelist) { + this.removeMobsWhitelist = removeMobsWhitelist; + } + /** + * @param requireConfirmationToSetHomeInNether the requireConfirmationToSetHomeInNether to set + */ + public void setRequireConfirmationToSetHomeInNether(boolean requireConfirmationToSetHomeInNether) { + this.requireConfirmationToSetHomeInNether = requireConfirmationToSetHomeInNether; + } + /** + * @param requireConfirmationToSetHomeInTheEnd the requireConfirmationToSetHomeInTheEnd to set + */ + public void setRequireConfirmationToSetHomeInTheEnd(boolean requireConfirmationToSetHomeInTheEnd) { + this.requireConfirmationToSetHomeInTheEnd = requireConfirmationToSetHomeInTheEnd; + } + /** * @param resetConfirmation the resetConfirmation to set */ public void setResetConfirmation(boolean resetConfirmation) { this.resetConfirmation = resetConfirmation; } + @Override + public void setResetEpoch(long timestamp) { + this.resetEpoch = timestamp; + } /** * @param resetLimit the resetLimit to set */ @@ -1029,18 +1379,39 @@ public class AISettings implements DataObject, WorldSettings { public void setResetWait(long resetWait) { this.resetWait = resetWait; } + /** * @param respawnOnIsland the respawnOnIsland to set */ public void setRespawnOnIsland(boolean respawnOnIsland) { this.respawnOnIsland = respawnOnIsland; } + /** * @param seaHeight the seaHeight to set */ public void setSeaHeight(int seaHeight) { this.seaHeight = seaHeight; } + /** + * @param netherSeaHeight the netherSeaHeight to set + */ + public void setNetherSeaHeight(int netherSeaHeight) { + this.netherSeaHeight = netherSeaHeight; + } + /** + * @param endSeaHeight the endSeaHeight to set + */ + public void setEndSeaHeight(int endSeaHeight) { + this.endSeaHeight = endSeaHeight; + } + /** + * @param teamJoinDeathReset the teamJoinDeathReset to set + */ + public void setTeamJoinDeathReset(boolean teamJoinDeathReset) { + this.teamJoinDeathReset = teamJoinDeathReset; + } + /** * @param uniqueId - unique ID the uniqueId to set */ @@ -1048,251 +1419,21 @@ public class AISettings implements DataObject, WorldSettings { public void setUniqueId(String uniqueId) { this.uniqueId = uniqueId; } + /** * @param useOwnGenerator the useOwnGenerator to set */ public void setUseOwnGenerator(boolean useOwnGenerator) { this.useOwnGenerator = useOwnGenerator; } - /** - * @param worldName the worldName to set - */ - public void setWorldName(String worldName) { - this.worldName = worldName; - } - /* (non-Javadoc) - * @see world.bentobox.bbox.api.configuration.WorldSettings#getFriendlyName() - */ - @Override - public String getFriendlyName() { - return friendlyName; - } - /** - * @param friendlyName the friendlyName to set - */ - public void setFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - } - /** - * @return the dragonSpawn - */ - @Override - public boolean isDragonSpawn() { - return dragonSpawn; - } - /** - * @param dragonSpawn the dragonSpawn to set - */ - public void setDragonSpawn(boolean dragonSpawn) { - this.dragonSpawn = dragonSpawn; - } - - @Override - public String getPermissionPrefix() { - return "acidisland"; - } - - /** - * Invincible visitor settings - * @return the ivSettings - */ - @Override - public List getIvSettings() { - return ivSettings; - } - - /** - * @param ivSettings the ivSettings to set - */ - public void setIvSettings(List ivSettings) { - this.ivSettings = ivSettings; - } - - /** - * @return the worldFlags - */ - @Override - public Map getWorldFlags() { - return worldFlags; - } - /** - * @param worldFlags the worldFlags to set - */ - public void setWorldFlags(Map worldFlags) { - this.worldFlags = worldFlags; - } - - /** - * @return whether panels should close when clicked outside or not - */ - public boolean isClosePanelOnClickOutside() { - return closePanelOnClickOutside; - } - - /** - * Set panel close on click outside - * @param closePanelOnClickOutside - true means close panel when click is outside panel - */ - public void setClosePanelOnClickOutside(boolean closePanelOnClickOutside) { - this.closePanelOnClickOutside = closePanelOnClickOutside; - } - /** - * @return the defaultGameMode - */ - @Override - public GameMode getDefaultGameMode() { - return defaultGameMode; - } - /** - * @param defaultGameMode the defaultGameMode to set - */ - public void setDefaultGameMode(GameMode defaultGameMode) { - this.defaultGameMode = defaultGameMode; - } - /** - * @return the removeMobsWhitelist - */ - @Override - public Set getRemoveMobsWhitelist() { - return removeMobsWhitelist; - } - /** - * @param removeMobsWhitelist the removeMobsWhitelist to set - */ - public void setRemoveMobsWhitelist(Set removeMobsWhitelist) { - this.removeMobsWhitelist = removeMobsWhitelist; - } - /** - * @return the onJoinResetMoney - */ - @Override - public boolean isOnJoinResetMoney() { - return onJoinResetMoney; - } - /** - * @return the onJoinResetInventory - */ - @Override - public boolean isOnJoinResetInventory() { - return onJoinResetInventory; - } - /** - * @return the onJoinResetEnderChest - */ - @Override - public boolean isOnJoinResetEnderChest() { - return onJoinResetEnderChest; - } - /** - * @return the onLeaveResetMoney - */ - @Override - public boolean isOnLeaveResetMoney() { - return onLeaveResetMoney; - } - /** - * @return the onLeaveResetInventory - */ - @Override - public boolean isOnLeaveResetInventory() { - return onLeaveResetInventory; - } - /** - * @return the onLeaveResetEnderChest - */ - @Override - public boolean isOnLeaveResetEnderChest() { - return onLeaveResetEnderChest; - } - /** - * @param onJoinResetMoney the onJoinResetMoney to set - */ - public void setOnJoinResetMoney(boolean onJoinResetMoney) { - this.onJoinResetMoney = onJoinResetMoney; - } - /** - * @param onJoinResetInventory the onJoinResetInventory to set - */ - public void setOnJoinResetInventory(boolean onJoinResetInventory) { - this.onJoinResetInventory = onJoinResetInventory; - } - /** - * @param onJoinResetEnderChest the onJoinResetEnderChest to set - */ - public void setOnJoinResetEnderChest(boolean onJoinResetEnderChest) { - this.onJoinResetEnderChest = onJoinResetEnderChest; - } - /** - * @param onLeaveResetMoney the onLeaveResetMoney to set - */ - public void setOnLeaveResetMoney(boolean onLeaveResetMoney) { - this.onLeaveResetMoney = onLeaveResetMoney; - } - /** - * @param onLeaveResetInventory the onLeaveResetInventory to set - */ - public void setOnLeaveResetInventory(boolean onLeaveResetInventory) { - this.onLeaveResetInventory = onLeaveResetInventory; - } - /** - * @param onLeaveResetEnderChest the onLeaveResetEnderChest to set - */ - public void setOnLeaveResetEnderChest(boolean onLeaveResetEnderChest) { - this.onLeaveResetEnderChest = onLeaveResetEnderChest; - } - - /** - * @return the defaultIslandProtection - */ - @Override - public Map getDefaultIslandFlags() { - return defaultIslandFlags; - } - /** - * @return the visibleSettings - */ - @Override - public List getVisibleSettings() { - return visibleSettings; - } - /** - */ - public void setDefaultIslandFlags(Map defaultIslandFlags) { - this.defaultIslandFlags = defaultIslandFlags; - } /** * @param visibleSettings the visibleSettings to set */ public void setVisibleSettings(List visibleSettings) { this.visibleSettings = visibleSettings; } - /** - * @return the defaultIslandSettings - */ - @Override - public Map getDefaultIslandSettings() { - return defaultIslandSettings; - } - /** - * @param defaultIslandSettings the defaultIslandSettings to set - */ - public void setDefaultIslandSettings(Map defaultIslandSettings) { - this.defaultIslandSettings = defaultIslandSettings; - } - @Override - public boolean isTeamJoinDeathReset() { - return teamJoinDeathReset; - } - - /** - * @return the visitorbannedcommands - */ - @Override - public List getVisitorBannedCommands() { - return visitorBannedCommands; - } /** * @param visitorBannedCommands the visitorbannedcommands to set */ @@ -1301,104 +1442,16 @@ public class AISettings implements DataObject, WorldSettings { } /** - * @return the difficulty + * @param worldFlags the worldFlags to set */ - @Override - public Difficulty getDifficulty() { - return difficulty; - } - /** - * @param difficulty the difficulty to set - */ - @Override - public void setDifficulty(Difficulty difficulty) { - this.difficulty = difficulty; - } - - @Override - public boolean isWaterUnsafe() { - // Water is unsafe in acid island - return true; - } - /** - * @return the geoLimitSettings - */ - @Override - public List getGeoLimitSettings() { - return geoLimitSettings; - } - /** - * @param geoLimitSettings the geoLimitSettings to set - */ - public void setGeoLimitSettings(List geoLimitSettings) { - this.geoLimitSettings = geoLimitSettings; - } - - @Override - public long getResetEpoch() { - return resetEpoch; - } - @Override - public void setResetEpoch(long timestamp) { - this.resetEpoch = timestamp; - } - /** - * @return the defaultBiome - */ - public Biome getDefaultBiome() { - return defaultBiome; - } - /** - * @param defaultBiome the defaultBiome to set - */ - public void setDefaultBiome(Biome defaultBiome) { - this.defaultBiome = defaultBiome; + public void setWorldFlags(Map worldFlags) { + this.worldFlags = worldFlags; } /** - * @return the command for accessing your island + * @param worldName the worldName to set */ - 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; } - - /** - * @param allowSetHomeInNether the allowSetHomeInNether to set - */ - public void setAllowSetHomeInNether(boolean allowSetHomeInNether) { - this.allowSetHomeInNether = allowSetHomeInNether; - } - - /** - * @param allowSetHomeInTheEnd the allowSetHomeInTheEnd to set - */ - public void setAllowSetHomeInTheEnd(boolean allowSetHomeInTheEnd) { - this.allowSetHomeInTheEnd = allowSetHomeInTheEnd; - } - - /** - * @param requireConfirmationToSetHomeInNether the requireConfirmationToSetHomeInNether to set - */ - public void setRequireConfirmationToSetHomeInNether(boolean requireConfirmationToSetHomeInNether) { - this.requireConfirmationToSetHomeInNether = requireConfirmationToSetHomeInNether; - } - - /** - * @param requireConfirmationToSetHomeInTheEnd the requireConfirmationToSetHomeInTheEnd to set - */ - public void setRequireConfirmationToSetHomeInTheEnd(boolean requireConfirmationToSetHomeInTheEnd) { - this.requireConfirmationToSetHomeInTheEnd = requireConfirmationToSetHomeInTheEnd; + public void setWorldName(String worldName) { + this.worldName = worldName; } } diff --git a/src/main/java/world/bentobox/acidisland/AcidIsland.java b/src/main/java/world/bentobox/acidisland/AcidIsland.java index 32d0d87..12e0d71 100644 --- a/src/main/java/world/bentobox/acidisland/AcidIsland.java +++ b/src/main/java/world/bentobox/acidisland/AcidIsland.java @@ -28,16 +28,22 @@ public class AcidIsland extends GameModeAddon { private static final String NETHER = "_nether"; private static final String THE_END = "_the_end"; - @Override public void onLoad() { saveDefaultConfig(); // Load settings settings = new Config<>(this, AISettings.class).loadConfigObject(); + if (settings == null) { + // Woops + this.logError("Settings could not load! Addon disabled."); + } } @Override public void onEnable() { + if (settings == null) { + return; + } // Register listeners PluginManager manager = getServer().getPluginManager(); // Acid Effects @@ -52,6 +58,9 @@ public class AcidIsland extends GameModeAddon { @Override public void onDisable(){ + if (settings == null) { + return; + } acidTask.cancelTasks(); // Save settings if (settings != null) { diff --git a/src/main/java/world/bentobox/acidisland/world/ChunkGeneratorWorld.java b/src/main/java/world/bentobox/acidisland/world/ChunkGeneratorWorld.java index feaae8a..ccd23e8 100644 --- a/src/main/java/world/bentobox/acidisland/world/ChunkGeneratorWorld.java +++ b/src/main/java/world/bentobox/acidisland/world/ChunkGeneratorWorld.java @@ -36,14 +36,15 @@ public class ChunkGeneratorWorld extends ChunkGenerator { if (world.getEnvironment().equals(World.Environment.NETHER)) { return generateNetherChunks(world, random, chunkX, chunkZ, biomeGrid); } + int seaHeight = world.getEnvironment().equals(World.Environment.NORMAL) ? addon.getSettings().getSeaHeight() : addon.getSettings().getEndSeaHeight(); ChunkData result = createChunkData(world); - if (addon.getSettings().getSeaHeight() != 0) { + if (seaHeight != 0) { for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { if (world.getEnvironment().equals(Environment.NORMAL)) { biomeGrid.setBiome(x, z, addon.getSettings().getDefaultBiome()); } - for (int y = 0; y < addon.getSettings().getSeaHeight(); y++) { + for (int y = 0; y < seaHeight; y++) { result.setBlock(x, y, z, Material.WATER); } } @@ -79,7 +80,7 @@ public class ChunkGeneratorWorld extends ChunkGenerator { if (addon.getSettings().getSeaHeight() != 0) { for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { - for (int y = 0; y < addon.getSettings().getSeaHeight(); y++) { + for (int y = 0; y < addon.getSettings().getNetherSeaHeight(); y++) { result.setBlock(x, y, z, Material.WATER); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index f34906f..61ea5d5 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,4 +1,4 @@ -# AcidIsland Configuration +# AcidIsland Configuration [version] # This config file is dynamic and saved when the server is shutdown. # You cannot edit it while the server is running because changes will # be lost! Use in-game settings GUI or edit when server is offline. @@ -27,8 +27,8 @@ acid: # Portion effects from going into acid water # You can list multiple effects effects: - - CONFUSION - - BLINDNESS + - CONFUSION + - BLINDNESS protection: # If player wears a helmet then they will not suffer from acid rain helmet: false @@ -70,10 +70,8 @@ world: use-own-generator: false # Sea height (don't changes this mid-game unless you delete the world) # Minimum is 0, which means you are playing Skyblock! - # If sea height is less than about 10, then players will drop right through it - # if it exists. Makes for an interesting variation on skyblock. sea-height: 55 - # Maximum number of islands in the world. Set to -1 or 0 for unlimited. + # Maximum number of islands in the world. Set to -1 or 0 for unlimited. # If the number of islands is greater than this number, no new island will be created. max-islands: 0 # The default game mode for this world. Players will be set to this mode when they create @@ -81,6 +79,10 @@ world: default-game-mode: SURVIVAL # The default biome for the overworld default-biome: WARM_OCEAN + # The maximum number of players a player can ban at any one time in this game mode. + # The permission acidisland.ban.maxlimit.X where X is a number can also be used per player + # -1 = unlimited + ban-limit: -1 nether: # Generate Nether - if this is false, the nether world will not be made and access to # the nether will not occur. Other plugins may still enable portal usage. @@ -90,6 +92,9 @@ world: generate: true # Islands in Nether. Change to false for standard vanilla nether. islands: true + # Sea height in Nether. Only operates if nether islands is true. + # Changing mid-game will cause problems! + sea-height: 55 # Nether trees are made if a player grows a tree in the nether (gravel and glowstone) # Applies to both vanilla and islands Nether trees: true @@ -103,8 +108,14 @@ world: # Only applies to vanilla nether spawn-radius: 25 end: + # End Nether - if this is false, the end world will not be made and access to + # the end will not occur. Other plugins may still enable portal usage. generate: true + # Islands in The End. Change to false for standard vanilla end. islands: true + # Sea height in The End. Only operates if end islands is true. + # Changing mid-game will cause problems! + sea-height: 55 # /!\ This feature is experimental and might not work as expected or might not work at all. dragon-spawn: false # Removing mobs - this kills all monsters in the vicinity. Benefit is that it helps @@ -112,10 +123,10 @@ world: # This setting is toggled in world flags and set by the settings GUI. # Mob white list - these mobs will NOT be removed when logging in or doing /island remove-mobs-whitelist: - - WITHER - - ZOMBIE_VILLAGER - - PIG_ZOMBIE - - ENDERMAN + - PIG_ZOMBIE + - ENDERMAN + - ZOMBIE_VILLAGER + - WITHER # World flags. These are boolean settings for various flags for this world flags: CREEPER_DAMAGE: true @@ -143,29 +154,29 @@ world: DOOR: 500 FURNACE: 500 ANVIL: 500 - FIRE: 500 FISH_SCOOPING: 500 + FIRE: 500 END_PORTAL: 500 BREEDING: 500 - TNT: 500 HURT_VILLAGERS: 500 + TNT: 500 FROST_WALKER: 500 TURTLE_EGGS: 500 COLLECT_LAVA: 500 LEVER: 500 RIDING: 500 HURT_MONSTERS: 0 - NAME_TAG: 500 ARMOR_STAND: 500 + NAME_TAG: 500 TRADING: 0 EGGS: 500 ITEM_DROP: 0 - CHEST: 500 NOTE_BLOCK: 0 NETHER_PORTAL: 500 - ITEM_PICKUP: 0 CROP_TRAMPLE: 500 + ITEM_PICKUP: 0 BREWING: 500 + DROPPER: 500 COLLECT_WATER: 500 BUTTON: 500 FIRE_EXTINGUISH: 500 @@ -173,18 +184,22 @@ world: TRAPDOOR: 500 PRESSURE_PLATE: 0 PLACE_BLOCKS: 500 + ITEM_FRAME: 500 CRAFTING: 0 ENCHANTING: 0 SHEARING: 500 - SPAWN_EGGS: 500 BED: 500 + SPAWN_EGGS: 500 MILKING: 0 + DISPENSER: 500 GATE: 0 EXPERIENCE_PICKUP: 500 + HOPPER: 500 LEASH: 500 - MOUNT_INVENTORY: 500 BREAK_BLOCKS: 500 + MOUNT_INVENTORY: 500 CHORUS_FRUIT: 500 + CONTAINER: 500 JUKEBOX: 500 # These are the default settings for new islands default-island-settings: @@ -199,8 +214,8 @@ world: visible-settings: [] # Visitor banned commands - Visitors to islands cannot use these commands in this world visitor-banned-commands: - - spawner - - spawnmob + - spawner + - spawnmob island: # Default max team size # Use this permission to set for specific user groups: acidisland.team.maxsize. @@ -295,30 +310,30 @@ protection: # Invincible visitors. List of damages that will not affect visitors. # Make list blank if visitors should receive all damages invincible-visitors: - - BLOCK_EXPLOSION - - CONTACT - - CUSTOM - - DROWNING - - ENTITY_ATTACK - - ENTITY_EXPLOSION - - FALL - - FALLING_BLOCK - - FIRE - - FIRE_TICK - - LAVA - - LIGHTNING - - MAGIC - - POISON - - PROJECTILE - - STARVATION - - SUFFOCATION - - THORNS - - WITHER - - DRAGON_BREATH - - FLY_INTO_WALL - - HOT_FLOOR - - CRAMMING - - VOID + - BLOCK_EXPLOSION + - CONTACT + - CUSTOM + - DROWNING + - ENTITY_ATTACK + - ENTITY_EXPLOSION + - FALL + - FALLING_BLOCK + - FIRE + - FIRE_TICK + - LAVA + - LIGHTNING + - MAGIC + - POISON + - PROJECTILE + - STARVATION + - SUFFOCATION + - THORNS + - WITHER + - DRAGON_BREATH + - FLY_INTO_WALL + - HOT_FLOOR + - CRAMMING + - VOID panel: # Whether GUIs should be closed when the player clicks outside. close-on-click-outside: true