Add extra settings in Cave Block

This commit is contained in:
BONNe 2019-01-29 23:25:16 +02:00
parent 11db109656
commit 0564663bc4
2 changed files with 276 additions and 31 deletions

View File

@ -3,6 +3,7 @@ package world.bentobox.caveblock;
import org.bukkit.Difficulty;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.block.Biome;
import org.bukkit.entity.EntityType;
import java.util.*;
@ -661,7 +662,79 @@ public class Settings implements DataObject, WorldSettings
}
// ---------------------------------------------------------------------
public int getWorldDepth()
{
return worldDepth;
}
public boolean isNormalRoof()
{
return normalRoof;
}
public boolean isNormalFloor()
{
return normalFloor;
}
public Material getNormalMainBlock()
{
return normalMainBlock;
}
public List<String> getNormalBlocks()
{
return normalBlocks;
}
public boolean isNetherFloor()
{
return netherFloor;
}
public Material getNetherMainBlock()
{
return netherMainBlock;
}
public List<String> getNetherBlocks()
{
return netherBlocks;
}
public boolean isEndRoof()
{
return endRoof;
}
public boolean isEndFloor()
{
return endFloor;
}
public Material getEndMainBlock()
{
return endMainBlock;
}
public List<String> getEndBlocks()
{
return endBlocks;
}
// ---------------------------------------------------------------------
// Section: Setters
// ---------------------------------------------------------------------
@ -1283,6 +1356,77 @@ public class Settings implements DataObject, WorldSettings
}
public void setWorldDepth(int worldDepth)
{
this.worldDepth = worldDepth;
}
public void setNormalRoof(boolean normalRoof)
{
this.normalRoof = normalRoof;
}
public void setNormalFloor(boolean normalFloor)
{
this.normalFloor = normalFloor;
}
public void setNormalMainBlock(Material normalMainBlock)
{
this.normalMainBlock = normalMainBlock;
}
public void setNormalBlocks(List<String> normalBlocks)
{
this.normalBlocks = normalBlocks;
}
public void setNetherFloor(boolean netherFloor)
{
this.netherFloor = netherFloor;
}
public void setNetherMainBlock(Material netherMainBlock)
{
this.netherMainBlock = netherMainBlock;
}
public void setNetherBlocks(List<String> netherBlocks)
{
this.netherBlocks = netherBlocks;
}
public void setEndRoof(boolean endRoof)
{
this.endRoof = endRoof;
}
public void setEndFloor(boolean endFloor)
{
this.endFloor = endFloor;
}
public void setEndMainBlock(Material endMainBlock)
{
this.endMainBlock = endMainBlock;
}
public void setEndBlocks(List<String> endBlocks)
{
this.endBlocks = endBlocks;
}
// ---------------------------------------------------------------------
// Section: Variables
@ -1309,13 +1453,13 @@ public class Settings implements DataObject, WorldSettings
@ConfigComment("It is the same for every dimension : Overworld, Nether and End.")
@ConfigComment("This value cannot be changed mid-game and the plugin will not start if it is different.")
@ConfigEntry(path = "world.distance-between-islands", needsReset = true)
private int islandDistance = 192;
private int islandDistance = 100;
@ConfigComment("Default protection range radius in blocks. Cannot be larger than distance.")
@ConfigComment("Admins can change protection sizes for players individually using /cbadmin range set <player> <new range>")
@ConfigComment("or set this permission: caveblock.island.range.<number>")
@ConfigEntry(path = "world.protection-range")
private int islandProtectionRange = 100;
private int islandProtectionRange = 50;
@ConfigComment("Start islands at these coordinates. This is where new islands will start in the")
@ConfigComment("world. These must be a factor of your island distance, but the plugin will auto")
@ -1336,12 +1480,12 @@ public class Settings implements DataObject, WorldSettings
@ConfigComment("Island height - Lowest is 5.")
@ConfigComment("It is the y coordinate of the bedrock block in the schem.")
@ConfigEntry(path = "world.island-height")
private int islandHeight = 100;
private int islandHeight = 60;
@ConfigComment("Use your own world generator for this world.")
@ConfigComment("In this case, the plugin will not generate anything.")
@ConfigEntry(path = "world.use-own-generator", experimental = true)
private boolean useOwnGenerator;
private boolean useOwnGenerator = true;
@ConfigComment("Sea height (don't changes this mid-game unless you delete the world)")
@ConfigComment("Minimum is 0, which means you are playing CaveBlock!")
@ -1362,7 +1506,7 @@ public class Settings implements DataObject, WorldSettings
@ConfigComment("The default biome for the overworld")
@ConfigEntry(path = "world.default-biome")
private Biome defaultBiome = Biome.PLAINS;
private Biome defaultBiome = Biome.MOUNTAINS;
@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")
@ -1370,6 +1514,31 @@ public class Settings implements DataObject, WorldSettings
@ConfigEntry(path = "world.ban-limit")
private int banLimit = -1;
@ConfigComment("")
@ConfigComment("This is cave... no height... only depth. Max 256.")
@ConfigComment("Should not be less then island height.")
@ConfigEntry(path = "world.world-depth")
private int worldDepth = 256;
@ConfigComment("")
@ConfigComment("Make over world roof of bedrock, if false, it will be made from stone")
@ConfigEntry(path = "world.normal.roof")
private boolean normalRoof = true;
@ConfigComment("Make over world floor of bedrock, if false, it will be made from stone")
@ConfigEntry(path = "world.normal.floor")
private boolean normalFloor = true;
@ConfigComment("Main block of which world will be generated.")
@ConfigEntry(path = "world.normal.main-block")
private Material normalMainBlock = Material.STONE;
@ConfigComment("Rare blocks that will be randomly placed around world. 1-material, 2-rarity, 3-pack size")
@ConfigComment("F.E. DIAMOND_ORE:1:3 means that diamond has ~0.1% chance being spawned and max of 3 blocks.")
@ConfigComment("Rarity index can be over 100. It will be summed and rarity for block will be BLOCK_RARITY/RARITY_SUM * 10.")
@ConfigEntry(path = "world.normal.blocks")
private List<String> normalBlocks = new ArrayList<>();
// 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.")
@ -1388,12 +1557,6 @@ public class Settings implements DataObject, WorldSettings
@ConfigEntry(path = "world.nether.trees")
private boolean netherTrees = true;
@ConfigComment("Make the nether roof, if false, there is nothing up there")
@ConfigComment("Change to false if lag is a problem from the generation")
@ConfigComment("Only applies to islands Nether")
@ConfigEntry(path = "world.nether.roof")
private boolean netherRoof = true;
@ConfigComment("Nether spawn protection radius - this is the distance around the nether spawn")
@ConfigComment("that will be protected from player interaction (breaking blocks, pouring lava etc.)")
@ConfigComment("Minimum is 0 (not recommended), maximum is 100. Default is 25.")
@ -1401,6 +1564,24 @@ public class Settings implements DataObject, WorldSettings
@ConfigEntry(path = "world.nether.spawn-radius")
private int netherSpawnRadius = 32;
@ConfigComment("Make over world roof of bedrock, if false, it will be made from stone")
@ConfigEntry(path = "world.nether.roof")
private boolean netherRoof = true;
@ConfigComment("Make over world floor of bedrock, if false, it will be made from stone")
@ConfigEntry(path = "world.nether.floor")
private boolean netherFloor = true;
@ConfigComment("Main block of which world will be generated.")
@ConfigEntry(path = "world.nether.main-block")
private Material netherMainBlock = Material.STONE;
@ConfigComment("Rare blocks that will be randomly placed around world. 1-material, 2-rarity, 3-pack size")
@ConfigComment("F.E. DIAMOND_ORE:1:3 means that diamond has ~0.1% chance being spawned and max of 3 blocks.")
@ConfigComment("Rarity index can be over 100. It will be summed and rarity for block will be BLOCK_RARITY/RARITY_SUM * 10.")
@ConfigEntry(path = "world.nether.blocks")
private List<String> netherBlocks = new ArrayList<>();
// End
@ConfigEntry(path = "world.end.generate")
private boolean endGenerate = true;
@ -1411,6 +1592,26 @@ public class Settings implements DataObject, WorldSettings
@ConfigEntry(path = "world.end.dragon-spawn", experimental = true)
private boolean dragonSpawn = false;
@ConfigComment("Make over world roof of bedrock, if false, it will be made from stone")
@ConfigEntry(path = "world.end.roof")
private boolean endRoof = true;
@ConfigComment("Make over world floor of bedrock, if false, it will be made from stone")
@ConfigEntry(path = "world.end.floor")
private boolean endFloor = true;
@ConfigComment("Main block of which world will be generated.")
@ConfigEntry(path = "world.end.main-block")
private Material endMainBlock = Material.STONE;
@ConfigComment("Rare blocks that will be randomly placed around world. 1-material, 2-rarity, 3-pack size")
@ConfigComment("F.E. DIAMOND_ORE:1:3 means that diamond has ~0.1% chance being spawned and max of 3 blocks.")
@ConfigComment("Rarity index can be over 100. It will be summed and rarity for block will be BLOCK_RARITY/RARITY_SUM * 10.")
@ConfigEntry(path = "world.end.blocks")
private List<String> endBlocks = new ArrayList<>();
// Other staff.
@ConfigComment("Mob white list - these mobs will NOT be removed when logging in or doing /cave")
@ConfigEntry(path = "world.remove-mobs-whitelist")
private Set<EntityType> removeMobsWhitelist = new HashSet<>();
@ -1569,22 +1770,4 @@ public class Settings implements DataObject, WorldSettings
private long resetEpoch = 0;
private String uniqueId = "config";
public int getMountineHeight()
{
return 200;
}
public boolean isBedRockFloor()
{
return true;
}
public boolean isBedRockRoof()
{
return true;
}
}

View File

@ -54,6 +54,33 @@ world:
# The permission acidisland.ban.maxlimit.X where X is a number can also be used per player
# -1 = unlimited
ban-limit: -1
#
# This is cave... no height... only depth. Max 256.
# Should not be less then island height.
world-depth: 256
# World settings.
normal:
# Make over world roof of bedrock, if false, it will be made from stone
roof: true
# Make over world floor of bedrock, if false, it will be made from stone
floor: true
# Main block of which world will be generated.
main-block: STONE
# Rare blocks that will be randomly placed around world. 1-material, 2-rarity, 3-pack size
# F.E. DIAMOND_ORE:1:3 means that diamond has ~0.1% chance being spawned and max of 3 blocks.
# Rarity index can be over 100. It will be summed and rarity for block will be BLOCK_RARITY/RARITY_SUM * 10.
blocks:
- DIAMOND_ORE:1:3
- GOLD_ORE:5:4
- IRON_ORE:5:4
- COAL_ORE:10:6
- EMERALD_ORE:1:1
- CLAY:3:6
- DIRT:3:10
- GRAVEL:3:6
- GRANITE:7:10
- ANDESITE:7:10
- DIORITE:12:8
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.
@ -66,18 +93,53 @@ world:
# 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
# Make the nether roof of bedrock, if false, it will be made from netherrack/soulsand
# Change to false if lag is a problem from the generation
# Only applies to islands Nether
roof: true
# Make the nether floor of bedrock, if false, it will be made from netherrack/soulsand
# Change to false if lag is a problem from the generation
# Only applies to islands Nether
floor: true
# Main block of which world will be generated.
main-block: NETHERRACK
# Rare blocks that will be randomly placed around world. 1-material, 2-rarity, 3-pack size
# F.E. DIAMOND_ORE:1:3 means that diamond has ~0.1% chance being spawned and max of 3 blocks.
# Rarity index can be over 100. It will be summed and rarity for block will be BLOCK_RARITY/RARITY_SUM * 10.
blocks:
- QUARTZ_ORE:10:5
- SOUL_SAND:6:10
- MAGMA_BLOCK:1:3
- LAVA:1:1
# 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 The End - if this is false, the nether world will not be made and access to
# the the end will not occur. Other plugins may still enable portal usage.
# Note: Some default challenges will not be possible if there is no end.
# Note that with a standard theend all players arrive at the same portal and entering a
# portal will return them back to their islands.
generate: true
# Islands in the end. Change to false for standard vanilla end.
islands: true
# Make the nether roof of bedrock, if false, it will be made from netherrack/soulsand
# Change to false if lag is a problem from the generation
# Only applies to islands Nether
roof: true
# Make the nether floor of bedrock, if false, it will be made from netherrack/soulsand
# Change to false if lag is a problem from the generation
# Only applies to islands Nether
floor: true
# Main block of which world will be generated.
main-block: END_STONE
# Rare blocks that will be randomly placed around world. 1-material, 2-rarity, 3-pack size
# F.E. DIAMOND_ORE:1:3 means that diamond has ~0.1% chance being spawned and max of 3 blocks.
# Rarity index can be over 100. It will be summed and rarity for block will be BLOCK_RARITY/RARITY_SUM * 10.
blocks:
- ENTITY:SHULKER:1:1
# /!\ This feature is experimental and might not work as expected or might not work at all.
dragon-spawn: false
# Mob white list - these mobs will NOT be removed when logging in or doing /island