WIP. Added config.yml.

This commit is contained in:
tastybento 2018-05-26 22:13:41 -07:00
parent bc4b152cdf
commit d5dd7475a7
4 changed files with 945 additions and 55 deletions

View File

@ -1 +1,257 @@
# Nothing here yet
############################################################################
# Config for AcidIsland V${version}
#
# Created and maintained by Tastybento with the help of Poslovitch
############################################################################
### World Settings ###
world:
# Name of the world - if it does not exist then it will be generated.
# It acts like a prefix for nether and end (e.g. BSkyBlock, BSkyBlock_nether, BSkyBlock_end)
world-name: AcidIsland_world
# Radius of island in blocks. (So distance between islands is twice this)
# Will be rounded up to the nearest 16 blocks.
# It is the same for every dimension : Overworld, Nether and End.
# This value cannot be changed mid-game and the plugin will not start if it is different.
distance-between-islands: 64
# Default protection range radius in blocks. Cannot be larger than distance.
# Admins can change protection sizes for players individually using /bsadmin setrange
# or set this permission: bskyblock.island.range.<number>
protection-range: 50
# Start islands at these coordinates. This is where new islands will start in the
# world. These must be a factor of your island distance, but the plugin will auto
# calculate the closest location on the grid. Islands develop around this location
# both positively and negatively in a square grid.
# If none of this makes sense, leave it at 0,0.
start-x: 0
start-z: 0
# Island height - Lowest is 5.
# It is the y coordinate of the bedrock block in the schematic
island-height: 50
# 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 0 for unlimited.
# If the number of islands is greater than this number, no new island will be created.
max-islands: 0
### Nether-related Settings ###
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.
# Note: Some challenges will not be possible if there is no nether.
# Note that with a standard nether all players arrive at the same portal and entering a
# portal will return them back to their islands.
generate: true
# Islands in Nether. Change to false for standard vanilla nether.
islands: true
# 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
# Make the nether roof, if false, there is nothing up there
# Change to false if lag is a problem from the generation
# Only applies to islands Nether
roof: true
# Nether spawn protection radius - this is the distance around the nether spawn
# that will be protected from player interaction (breaking blocks, pouring lava etc.)
# Minimum is 0 (not recommended), maximum is 100. Default is 25.
# Only applies to vanilla nether
spawn-radius: 25
end:
generate: true
islands: true
### Island Settings ###
island:
# Default chest items
chest-items:
- ==: org.bukkit.inventory.ItemStack
type: LAVA_BUCKET
- ==: org.bukkit.inventory.ItemStack
type: ICE
amount: 2
- ==: org.bukkit.inventory.ItemStack
type: MELON_SEEDS
- ==: org.bukkit.inventory.ItemStack
type: BONE
amount: 2
- ==: org.bukkit.inventory.ItemStack
type: COBBLESTONE
amount: 5
- ==: org.bukkit.inventory.ItemStack
type: SAPLING
amount: 2
# Default max team size
# Use this permission to set for specific user groups: askyblock.team.maxsize.<number>
# Permission size cannot be less than the default below.
max-team-size: 4
# Default maximum number of homes a player can have. Min = 1
# Accessed via sethome <number> or go <number>
# Use this permission to set for specific user groups: askyblock.island.maxhomes.<number>
max-homes: 1
# How long a player must wait until they can rejoin a team island after being
# kicked in minutes. This slows the effectiveness of players repeating challenges
# by repetitively being invited to a team island.
invite-wait: 60
### Join/leave/reset island related settings ###
reset:
# How many resets a player is allowed (override with /asadmin clearreset <player>)
# Value of -1 means unlimited, 0 means hardcore - no resets.
# Example, 2 resets means they get 2 resets or 3 islands lifetime
reset-limit: -1
#How long a player must wait before they can reset their island again in second
reset-wait: 300
# Kicked or leaving players lose resets
# Players who leave a team will lose an island reset chance
# If a player has zero resets left and leaves a team, they cannot make a new
# island by themselves and can only join a team.
# Leave this true to avoid players exploiting free islands
leavers-lose-resets: true
# Allow kicked players to keep their inventory.
# If false, kicked player's inventory will be thrown at the island leader if the
# kicked player is online and in the island world.
kicked-keep-inventory: false
# What the plugin should reset when the player joins or creates an island
on-join:
# Reset Money - if this is true, will reset the player's money to the starting money
# Recommendation is that this is set to true, but if you run multi-worlds
# make sure your economy handles multi-worlds too.
money: false
# Reset inventory - if true, the player's inventory will be cleared.
# Note: if you have MultiInv running or a similar inventory control plugin, that
# plugin may still reset the inventory when the world changes.
inventory: false
# Reset Ender Chest - if true, the player's Ender Chest will be cleared.
ender-chest: false
# What the plugin should reset when the player leaves or is kicked from an island
on-leave:
# Reset Money - if this is true, will reset the player's money to the starting money
# Recommendation is that this is set to true, but if you run multi-worlds
# make sure your economy handles multi-worlds too.
money: false
# Reset inventory - if true, the player's inventory will be cleared.
# Note: if you have MultiInv running or a similar inventory control plugin, that
# plugin may still reset the inventory when the world changes.
inventory: false
# Reset Ender Chest - if true, the player's Ender Chest will be cleared.
ender-chest: false
# Removing mobs - this kills all monsters in the vicinity. Benefit is that it helps
# players return to their island if the island has been overrun by monsters.
# Con is that it kills any mob grinders.
remove-mobs:
# Remove mobs on island when logging in.
on-login: false
# Remove mobs when /island.
on-island: false
# Mob white list - these mobs will NOT be removed when logging in or doing /island
whitelist:
- WITHER
- ENDERMAN
- PIG_ZOMBIE
#- ZOMBIE_VILLAGER (1.10+)
# Make island if player teleports to the island world and does not have one
make-island-if-none: false
# Immediately teleport player to their island (home 1 if it exists) when entering the world
immediate-teleport-on-island: false
# Have player's respawn on their island if they die
respawn-on-island: false
# Only allow the island leader to coop players.
# Island members wont be able to coop other players.
only-leader-can-coop: false
# Deaths count
deaths:
# Max deaths
# If player dies more than this, it doesn't count anymore
max: 10
# Sum team deaths - if true, all the teams deaths are summed
# If false, only the leader's deaths counts
sum-team: false
### Acid Settings ###
# Originally designed for AcidIsland, but can be used for BSkyBlock as well.
acid:
# Ops receive damage from acid (Set to true if you want Ops to play properly)
damage-op: false
# Damage chickens in acid - true or false - chickens tend to go swimming...
damage-chickens: false
damage:
# Water is acid
acid:
# Acid damage to player per second by being in acid if they have no armor on.
# A fully health player has 20 health points. Players will regen some health
# so the default will give players about 3 seconds to get out the acid
# 0 = no damage, 10 = default damage, 20 = instant death
player: 0
# Damage that monsters will experience in acid.
monster: 0
# Damage that animals will experience in acid.
animal: 0
# Destroy items in water after this many seconds. Timing is variable and may occur
# up to 2x this time. If 0, items will not be removed. Acid damage does not need to
# be on for this setting to work. i.e., it'll work with water too.
# Items fizz when they are destroyed.
item: 0
# Damage that rain does.
rain: 0
# Damage type to apply in addition to acid damage
# Types can be : SLOW, SLOW_DIGGING, CONFUSION, BLINDNESS, HUNGER, WEAKNESS and POISON
# If you just want these to act, then make the acid damage 0 above
# Note - these are potion effects and so can be cured by milk
effects:
#- confusion
# Armor protection
protection:
# Protect players from acid rain if they have a helmet on
helmet: false
# Protect players from all acid if they have a full set of armor on
full-armor: false
# Config.yml version. DO NOT EDIT. This number only changes if the latest
# plugin config has been updated. If a new config is detected, it will be
# auto-saved to config.new.yml.
version: ${version}

View File

@ -1,6 +1,9 @@
package bskyblock.addon.acidisland;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -8,29 +11,179 @@ import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
import us.tastybento.bskyblock.api.configuration.ConfigEntry;
import us.tastybento.bskyblock.api.configuration.ISettings;
import us.tastybento.bskyblock.api.configuration.StoreAt;
import us.tastybento.bskyblock.api.configuration.WorldSettings;
import us.tastybento.bskyblock.database.objects.adapters.Adapter;
import us.tastybento.bskyblock.database.objects.adapters.PotionEffectListAdapter;
/**
* A lot of placeholders right now in here...
* @author tastybento
*
*/
public class AISettings implements WorldSettings {
@StoreAt(filename="config.yml", path="addons/BSkyBlock-AcidIsland") // Explicitly call out what name this should have.
public class AISettings implements ISettings<AISettings>, WorldSettings {
private String uniqueId = "config";
/* WORLD */
@ConfigEntry(path = "world.friendly-name", needsReset = true)
private String friendlyName = "AcidIsland";
@ConfigEntry(path = "world.world-name", needsReset = true)
private String worldName = "AcidIsland_world";
@ConfigEntry(path = "world.distance-between-islands", needsReset = true)
private int islandDistance = 200;
@ConfigEntry(path = "world.protection-range", overrideOnChange = true)
private int islandProtectionRange = 100;
@ConfigEntry(path = "world.start-x", needsReset = true)
private int islandStartX = 0;
@ConfigEntry(path = "world.start-z", needsReset = true)
private int islandStartZ = 0;
@ConfigEntry(path = "world.sea-height")
private int seaHeight = 55;
@ConfigEntry(path = "world.island-height")
private int islandHeight = 50;
@ConfigEntry(path = "world.max-islands")
private int maxIslands = -1;
// Nether
@ConfigEntry(path = "world.nether.generate")
private boolean netherGenerate = true;
@ConfigEntry(path = "world.nether.islands", needsReset = true)
private boolean netherIslands = true;
@ConfigEntry(path = "world.nether.trees")
private boolean netherTrees = true;
@ConfigEntry(path = "world.nether.roof")
private boolean netherRoof = true;
@ConfigEntry(path = "world.nether.spawn-radius")
private int netherSpawnRadius = 32;
// End
@ConfigEntry(path = "world.end.generate")
private boolean endGenerate = true;
@ConfigEntry(path = "world.end.islands", needsReset = true)
private boolean endIslands = true;
@ConfigEntry(path = "world.end.dragon-spawn")
private boolean dragonSpawn = false;
// ---------------------------------------------
/* ACID */
@ConfigEntry(path = "acid.damage-op")
private boolean acidDamageOp = false;
@ConfigEntry(path = "acid.damage-chickens")
private boolean acidDamageChickens = false;
@ConfigEntry(path = "acid.options.item-destroy-time")
private int acidDestroyItemTime = 0;
// Damage
@ConfigEntry(path = "acid.damage.acid.player")
private int acidDamage = 10;
@ConfigEntry(path = "acid.damage.rain")
private int acidRainDamage = 1;
@ConfigEntry(path = "acid.damage.effects")
@Adapter(PotionEffectListAdapter.class)
private List<PotionEffectType> acidEffects = new ArrayList<>(Arrays.asList(PotionEffectType.CONFUSION, PotionEffectType.SLOW));
// ---------------------------------------------
/* ISLAND */
// Entities
@ConfigEntry(path = "island.limits.entities")
private Map<EntityType, Integer> entityLimits = new EnumMap<>(EntityType.class);
@ConfigEntry(path = "island.limits.tile-entities")
private Map<String, Integer> tileEntityLimits = new HashMap<>();
@ConfigEntry(path = "island.max-team-size")
private int maxTeamSize = 4;
@ConfigEntry(path = "island.max-homes")
private int maxHomes = 5;
@ConfigEntry(path = "island.name.min-length")
private int nameMinLength = 4;
@ConfigEntry(path = "island.name.max-length")
private int nameMaxLength = 20;
@ConfigEntry(path = "island.invite-wait")
private int inviteWait = 60;
// Reset
@ConfigEntry(path = "island.reset.reset-limit")
private int resetLimit = -1;
@ConfigEntry(path = "island.require-confirmation.reset")
private boolean resetConfirmation = true;
@ConfigEntry(path = "island.reset-wait")
private long resetWait = 10L;
@ConfigEntry(path = "island.reset.leavers-lose-reset")
private boolean leaversLoseReset = false;
@ConfigEntry(path = "island.reset.kicked-keep-inventory")
private boolean kickedKeepInventory = false;
// Remove mobs
@ConfigEntry(path = "island.remove-mobs.on-login")
private boolean removeMobsOnLogin = false;
@ConfigEntry(path = "island.remove-mobs.on-island")
private boolean removeMobsOnIsland = false;
@ConfigEntry(path = "island.remove-mobs.whitelist")
private List<String> removeMobsWhitelist = new ArrayList<>();
@ConfigEntry(path = "island.make-island-if-none")
private boolean makeIslandIfNone = false;
@ConfigEntry(path = "island.immediate-teleport-on-island")
private boolean immediateTeleportOnIsland = false;
private boolean respawnOnIsland = true;
private int islandXOffset;
private int islandZOffset;
/* SCHEMATICS */
private List<String> companionNames = new ArrayList<>();
@ConfigEntry(path = "island.chest-items")
private List<ItemStack> chestItems = new ArrayList<>();
private EntityType companionType = EntityType.COW;
private boolean useOwnGenerator;
public int getAcidDamage() {
return 1;
}
public List<PotionEffectType> getAcidDamageType() {
List<PotionEffectType> result = new ArrayList<>();
result.add(PotionEffectType.CONFUSION);
return result;
return acidEffects;
}
public List<ItemStack> getChestItems() {
// TODO Auto-generated method stub
List<ItemStack> result = new ArrayList<>();
return result;
return chestItems;
}
public boolean getDamageOps() {
@ -39,8 +192,7 @@ public class AISettings implements WorldSettings {
@Override
public Map<EntityType, Integer> getEntityLimits() {
// TODO Auto-generated method stub
return null;
return entityLimits;
}
public boolean getFullArmorProtection() {
@ -55,93 +207,80 @@ public class AISettings implements WorldSettings {
@Override
public int getIslandDistance() {
// TODO Auto-generated method stub
return 60;
return islandDistance;
}
@Override
public int getIslandHeight() {
// TODO Auto-generated method stub
return 50;
return islandHeight;
}
@Override
public int getIslandProtectionRange() {
// TODO Auto-generated method stub
return 50;
return islandProtectionRange;
}
@Override
public int getIslandStartX() {
// TODO Auto-generated method stub
return 0;
return islandStartX;
}
@Override
public int getIslandStartZ() {
// TODO Auto-generated method stub
return 0;
return islandStartZ;
}
@Override
public int getIslandXOffset() {
// TODO Auto-generated method stub
return 0;
return islandXOffset;
}
@Override
public int getIslandZOffset() {
// TODO Auto-generated method stub
return 0;
return islandZOffset;
}
@Override
public int getMaxIslands() {
// TODO Auto-generated method stub
return 0;
return maxIslands;
}
@Override
public int getNetherSpawnRadius() {
// TODO Auto-generated method stub
return 0;
return netherSpawnRadius;
}
public int getRainDamage() {
return 1;
public int getAcidRainDamage() {
return acidRainDamage;
}
public int getSeaHeight() {
return 55;
return seaHeight;
}
@Override
public Map<String, Integer> getTileEntityLimits() {
// TODO Auto-generated method stub
return null;
return tileEntityLimits;
}
@Override
public String getWorldName() {
return "AcidIsland-world";
return worldName;
}
@Override
public boolean isEndGenerate() {
// TODO Auto-generated method stub
return false;
return endGenerate;
}
@Override
public boolean isEndIslands() {
// TODO Auto-generated method stub
return false;
return endIslands;
}
@Override
public boolean isNetherGenerate() {
// TODO Auto-generated method stub
return false;
return netherGenerate;
}
@Override
@ -151,37 +290,524 @@ public class AISettings implements WorldSettings {
}
public boolean isNetherRoof() {
// TODO Auto-generated method stub
return false;
return netherRoof;
}
@Override
public boolean isNetherTrees() {
// TODO Auto-generated method stub
return false;
return netherTrees;
}
@Override
public String getFriendlyName() {
return "AcidIsland";
return friendlyName;
}
@Override
public boolean isDragonSpawn() {
// TODO Auto-generated method stub
return false;
return dragonSpawn;
}
@Override
public int getMaxTeamSize() {
// TODO Auto-generated method stub
return 3;
return maxTeamSize;
}
@Override
public int getMaxHomes() {
// TODO Auto-generated method stub
return 1;
return maxHomes;
}
@Override
public AISettings getInstance() {
return this;
}
@Override
public String getUniqueId() {
return uniqueId;
}
@Override
public void setUniqueId(String uniqueId) {
this.uniqueId = uniqueId;
}
/**
* @return the acidDamageOp
*/
public boolean isAcidDamageOp() {
return acidDamageOp;
}
/**
* @param acidDamageOp the acidDamageOp to set
*/
public void setAcidDamageOp(boolean acidDamageOp) {
this.acidDamageOp = acidDamageOp;
}
/**
* @return the acidDamageChickens
*/
public boolean isAcidDamageChickens() {
return acidDamageChickens;
}
/**
* @param acidDamageChickens the acidDamageChickens to set
*/
public void setAcidDamageChickens(boolean acidDamageChickens) {
this.acidDamageChickens = acidDamageChickens;
}
/**
* @return the acidDestroyItemTime
*/
public int getAcidDestroyItemTime() {
return acidDestroyItemTime;
}
/**
* @param acidDestroyItemTime the acidDestroyItemTime to set
*/
public void setAcidDestroyItemTime(int acidDestroyItemTime) {
this.acidDestroyItemTime = acidDestroyItemTime;
}
/**
* @return the acidEffects
*/
public List<PotionEffectType> getAcidEffects() {
return acidEffects;
}
/**
* @param acidEffects the acidEffects to set
*/
public void setAcidEffects(List<PotionEffectType> acidEffects) {
this.acidEffects = acidEffects;
}
/**
* @return the nameMinLength
*/
public int getNameMinLength() {
return nameMinLength;
}
/**
* @param nameMinLength the nameMinLength to set
*/
public void setNameMinLength(int nameMinLength) {
this.nameMinLength = nameMinLength;
}
/**
* @return the nameMaxLength
*/
public int getNameMaxLength() {
return nameMaxLength;
}
/**
* @param nameMaxLength the nameMaxLength to set
*/
public void setNameMaxLength(int nameMaxLength) {
this.nameMaxLength = nameMaxLength;
}
/**
* @return the inviteWait
*/
public int getInviteWait() {
return inviteWait;
}
/**
* @param inviteWait the inviteWait to set
*/
public void setInviteWait(int inviteWait) {
this.inviteWait = inviteWait;
}
/**
* @return the resetLimit
*/
public int getResetLimit() {
return resetLimit;
}
/**
* @param resetLimit the resetLimit to set
*/
public void setResetLimit(int resetLimit) {
this.resetLimit = resetLimit;
}
/**
* @return the resetConfirmation
*/
public boolean isResetConfirmation() {
return resetConfirmation;
}
/**
* @param resetConfirmation the resetConfirmation to set
*/
public void setResetConfirmation(boolean resetConfirmation) {
this.resetConfirmation = resetConfirmation;
}
/**
* @return the resetWait
*/
public long getResetWait() {
return resetWait;
}
/**
* @param resetWait the resetWait to set
*/
public void setResetWait(long resetWait) {
this.resetWait = resetWait;
}
/**
* @return the leaversLoseReset
*/
public boolean isLeaversLoseReset() {
return leaversLoseReset;
}
/**
* @param leaversLoseReset the leaversLoseReset to set
*/
public void setLeaversLoseReset(boolean leaversLoseReset) {
this.leaversLoseReset = leaversLoseReset;
}
/**
* @return the kickedKeepInventory
*/
public boolean isKickedKeepInventory() {
return kickedKeepInventory;
}
/**
* @param kickedKeepInventory the kickedKeepInventory to set
*/
public void setKickedKeepInventory(boolean kickedKeepInventory) {
this.kickedKeepInventory = kickedKeepInventory;
}
/**
* @return the removeMobsOnLogin
*/
public boolean isRemoveMobsOnLogin() {
return removeMobsOnLogin;
}
/**
* @param removeMobsOnLogin the removeMobsOnLogin to set
*/
public void setRemoveMobsOnLogin(boolean removeMobsOnLogin) {
this.removeMobsOnLogin = removeMobsOnLogin;
}
/**
* @return the removeMobsOnIsland
*/
public boolean isRemoveMobsOnIsland() {
return removeMobsOnIsland;
}
/**
* @param removeMobsOnIsland the removeMobsOnIsland to set
*/
public void setRemoveMobsOnIsland(boolean removeMobsOnIsland) {
this.removeMobsOnIsland = removeMobsOnIsland;
}
/**
* @return the removeMobsWhitelist
*/
public List<String> getRemoveMobsWhitelist() {
return removeMobsWhitelist;
}
/**
* @param removeMobsWhitelist the removeMobsWhitelist to set
*/
public void setRemoveMobsWhitelist(List<String> removeMobsWhitelist) {
this.removeMobsWhitelist = removeMobsWhitelist;
}
/**
* @return the makeIslandIfNone
*/
public boolean isMakeIslandIfNone() {
return makeIslandIfNone;
}
/**
* @param makeIslandIfNone the makeIslandIfNone to set
*/
public void setMakeIslandIfNone(boolean makeIslandIfNone) {
this.makeIslandIfNone = makeIslandIfNone;
}
/**
* @return the immediateTeleportOnIsland
*/
public boolean isImmediateTeleportOnIsland() {
return immediateTeleportOnIsland;
}
/**
* @param immediateTeleportOnIsland the immediateTeleportOnIsland to set
*/
public void setImmediateTeleportOnIsland(boolean immediateTeleportOnIsland) {
this.immediateTeleportOnIsland = immediateTeleportOnIsland;
}
/**
* @return the respawnOnIsland
*/
public boolean isRespawnOnIsland() {
return respawnOnIsland;
}
/**
* @param respawnOnIsland the respawnOnIsland to set
*/
public void setRespawnOnIsland(boolean respawnOnIsland) {
this.respawnOnIsland = respawnOnIsland;
}
/**
* @return the companionNames
*/
public List<String> getCompanionNames() {
return companionNames;
}
/**
* @param companionNames the companionNames to set
*/
public void setCompanionNames(List<String> companionNames) {
this.companionNames = companionNames;
}
/**
* @return the companionType
*/
public EntityType getCompanionType() {
return companionType;
}
/**
* @param companionType the companionType to set
*/
public void setCompanionType(EntityType companionType) {
this.companionType = companionType;
}
/**
* @return the useOwnGenerator
*/
public boolean isUseOwnGenerator() {
return useOwnGenerator;
}
/**
* @param useOwnGenerator the useOwnGenerator to set
*/
public void setUseOwnGenerator(boolean useOwnGenerator) {
this.useOwnGenerator = useOwnGenerator;
}
/**
* @param friendlyName the friendlyName to set
*/
public void setFriendlyName(String friendlyName) {
this.friendlyName = friendlyName;
}
/**
* @param worldName the worldName to set
*/
public void setWorldName(String worldName) {
this.worldName = worldName;
}
/**
* @param islandDistance the islandDistance to set
*/
public void setIslandDistance(int islandDistance) {
this.islandDistance = islandDistance;
}
/**
* @param islandProtectionRange the islandProtectionRange to set
*/
public void setIslandProtectionRange(int islandProtectionRange) {
this.islandProtectionRange = islandProtectionRange;
}
/**
* @param islandStartX the islandStartX to set
*/
public void setIslandStartX(int islandStartX) {
this.islandStartX = islandStartX;
}
/**
* @param islandStartZ the islandStartZ to set
*/
public void setIslandStartZ(int islandStartZ) {
this.islandStartZ = islandStartZ;
}
/**
* @param seaHeight the seaHeight to set
*/
public void setSeaHeight(int seaHeight) {
this.seaHeight = seaHeight;
}
/**
* @param islandHeight the islandHeight to set
*/
public void setIslandHeight(int islandHeight) {
this.islandHeight = islandHeight;
}
/**
* @param maxIslands the maxIslands to set
*/
public void setMaxIslands(int maxIslands) {
this.maxIslands = maxIslands;
}
/**
* @param netherGenerate the netherGenerate to set
*/
public void setNetherGenerate(boolean netherGenerate) {
this.netherGenerate = netherGenerate;
}
/**
* @param netherIslands the netherIslands to set
*/
public void setNetherIslands(boolean netherIslands) {
this.netherIslands = netherIslands;
}
/**
* @param netherTrees the netherTrees to set
*/
public void setNetherTrees(boolean netherTrees) {
this.netherTrees = netherTrees;
}
/**
* @param netherRoof the netherRoof to set
*/
public void setNetherRoof(boolean netherRoof) {
this.netherRoof = netherRoof;
}
/**
* @param netherSpawnRadius the netherSpawnRadius to set
*/
public void setNetherSpawnRadius(int netherSpawnRadius) {
this.netherSpawnRadius = netherSpawnRadius;
}
/**
* @param endGenerate the endGenerate to set
*/
public void setEndGenerate(boolean endGenerate) {
this.endGenerate = endGenerate;
}
/**
* @param endIslands the endIslands to set
*/
public void setEndIslands(boolean endIslands) {
this.endIslands = endIslands;
}
/**
* @param dragonSpawn the dragonSpawn to set
*/
public void setDragonSpawn(boolean dragonSpawn) {
this.dragonSpawn = dragonSpawn;
}
/**
* @param acidDamage the acidDamage to set
*/
public void setAcidDamage(int acidDamage) {
this.acidDamage = acidDamage;
}
/**
* @param acidRainDamage the acidRainDamage to set
*/
public void setAcidRainDamage(int acidRainDamage) {
this.acidRainDamage = acidRainDamage;
}
/**
* @param entityLimits the entityLimits to set
*/
public void setEntityLimits(Map<EntityType, Integer> entityLimits) {
this.entityLimits = entityLimits;
}
/**
* @param tileEntityLimits the tileEntityLimits to set
*/
public void setTileEntityLimits(Map<String, Integer> tileEntityLimits) {
this.tileEntityLimits = tileEntityLimits;
}
/**
* @param maxTeamSize the maxTeamSize to set
*/
public void setMaxTeamSize(int maxTeamSize) {
this.maxTeamSize = maxTeamSize;
}
/**
* @param maxHomes the maxHomes to set
*/
public void setMaxHomes(int maxHomes) {
this.maxHomes = maxHomes;
}
/**
* @param islandXOffset the islandXOffset to set
*/
public void setIslandXOffset(int islandXOffset) {
this.islandXOffset = islandXOffset;
}
/**
* @param islandZOffset the islandZOffset to set
*/
public void setIslandZOffset(int islandZOffset) {
this.islandZOffset = islandZOffset;
}
/**
* @param chestItems the chestItems to set
*/
public void setChestItems(List<ItemStack> chestItems) {
this.chestItems = chestItems;
}

View File

@ -22,8 +22,16 @@ public class AcidIsland extends Addon {
@Override
public void onLoad() {
saveDefaultConfig();
// Load settings
settings = new AISettings();
// Load settings from config.yml. This will check if there are any issues with it too.
try {
settings = settings.loadSettings();
} catch (Exception e) {
this.log("Settings could not be loaded " + e.getMessage());
}
// Create worlds
aiw = new AcidIslandWorld(this);
// TODO Register settings

View File

@ -69,7 +69,7 @@ public class AcidEffect implements Listener {
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onPlayerMove(PlayerMoveEvent e) {
// Fast return if acid isn't being used
if (addon.getSettings().getRainDamage() == 0 && addon.getSettings().getAcidDamage() == 0) {
if (addon.getSettings().getAcidRainDamage() == 0 && addon.getSettings().getAcidDamage() == 0) {
return;
}
final Player player = e.getPlayer();
@ -102,7 +102,7 @@ public class AcidEffect implements Listener {
Location playerLoc = player.getLocation();
// Check for acid rain
if (addon.getSettings().getRainDamage() > 0D && isRaining) {
if (addon.getSettings().getAcidRainDamage() > 0D && isRaining) {
// Only check if they are in a non-dry biome
Biome biome = playerLoc.getBlock().getBiome();
if (biome != Biome.DESERT && biome != Biome.DESERT_HILLS
@ -121,12 +121,12 @@ public class AcidEffect implements Listener {
@Override
public void run() {
// Check if it is still raining or player is safe or dead or there is no damage
if (!isRaining || player.isDead() || isSafeFromRain(player) || addon.getSettings().getRainDamage() <= 0D) {
if (!isRaining || player.isDead() || isSafeFromRain(player) || addon.getSettings().getAcidRainDamage() <= 0D) {
wetPlayers.remove(player);
this.cancel();
// Check they are still in this world
} else {
player.damage((addon.getSettings().getRainDamage() - addon.getSettings().getRainDamage() * getDamageReduced(player)));
player.damage((addon.getSettings().getAcidRainDamage() - addon.getSettings().getAcidRainDamage() * getDamageReduced(player)));
if (addon.getServer().getVersion().contains("(MC: 1.8") || addon.getServer().getVersion().contains("(MC: 1.7")) {
player.getWorld().playSound(playerLoc, Sound.valueOf("FIZZ"), 3F, 3F);
} else {