Adds variable sea heights to overworld/nether/end.

Implements ban limit settings (new WorldSettings interface)

Also cleans up config file with better comments.

https://github.com/BentoBoxWorld/AcidIsland/issues/13
This commit is contained in:
tastybento 2019-01-02 10:10:23 -08:00
parent e58b499f84
commit 8e18923b81
5 changed files with 576 additions and 494 deletions

4
.gitignore vendored
View File

@ -3,3 +3,7 @@
bin/
*.class
/target/
/.classpath
/.DS_Store
/.project
/.gitignore

File diff suppressed because it is too large Load Diff

View File

@ -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) {

View File

@ -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);
}
}

View File

@ -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.<number>
@ -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