Merge branch 'develop'

This commit is contained in:
tastybento 2020-03-24 08:08:43 -07:00
commit eb046428df
7 changed files with 242 additions and 67 deletions

View File

@ -65,7 +65,7 @@
<!-- Do not change unless you want different name for local builds. --> <!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number> <build.number>-LOCAL</build.number>
<!-- This allows to change between versions. --> <!-- This allows to change between versions. -->
<build.version>1.11.0</build.version> <build.version>1.12.0</build.version>
</properties> </properties>
<!-- Profiles will allow to automatically change build version. --> <!-- Profiles will allow to automatically change build version. -->

View File

@ -89,7 +89,6 @@ public class BSkyBlock extends GameModeAddon implements Listener {
// Create the world if it does not exist // Create the world if it does not exist
islandWorld = getWorld(worldName, World.Environment.NORMAL, chunkGenerator); islandWorld = getWorld(worldName, World.Environment.NORMAL, chunkGenerator);
// Make the nether if it does not exist // Make the nether if it does not exist
if (settings.isNetherGenerate()) { if (settings.isNetherGenerate()) {
if (getServer().getWorld(worldName + NETHER) == null) { if (getServer().getWorld(worldName + NETHER) == null) {
@ -118,7 +117,18 @@ public class BSkyBlock extends GameModeAddon implements Listener {
worldName2 = env.equals(World.Environment.NETHER) ? worldName2 + NETHER : worldName2; worldName2 = env.equals(World.Environment.NETHER) ? worldName2 + NETHER : worldName2;
worldName2 = env.equals(World.Environment.THE_END) ? worldName2 + THE_END : worldName2; worldName2 = env.equals(World.Environment.THE_END) ? worldName2 + THE_END : worldName2;
WorldCreator wc = WorldCreator.name(worldName2).type(WorldType.FLAT).environment(env); WorldCreator wc = WorldCreator.name(worldName2).type(WorldType.FLAT).environment(env);
return settings.isUseOwnGenerator() ? wc.createWorld() : wc.generator(chunkGenerator2).createWorld(); World w = settings.isUseOwnGenerator() ? wc.createWorld() : wc.generator(chunkGenerator2).createWorld();
// Set spawn rates
if (w != null) {
w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters());
w.setAmbientSpawnLimit(getSettings().getSpawnLimitAmbient());
w.setAnimalSpawnLimit(getSettings().getSpawnLimitAnimals());
w.setWaterAnimalSpawnLimit(getSettings().getSpawnLimitWaterAnimals());
w.setTicksPerAnimalSpawns(getSettings().getTicksPerAnimalSpawns());
w.setTicksPerMonsterSpawns(getSettings().getTicksPerMonsterSpawns());
}
return w;
} }
@Override @Override

View File

@ -55,6 +55,25 @@ public class Settings implements WorldSettings {
@ConfigEntry(path = "world.difficulty") @ConfigEntry(path = "world.difficulty")
private Difficulty difficulty = Difficulty.NORMAL; private Difficulty difficulty = Difficulty.NORMAL;
@ConfigComment("Spawn limits. These override the limits set in bukkit.yml")
@ConfigComment("If set to a negative number, the server defaults will be used")
@ConfigEntry(path = "world.spawn-limits.monsters", since = "1.11.2")
private int spawnLimitMonsters = -1;
@ConfigEntry(path = "world.spawn-limits.animals", since = "1.11.2")
private int spawnLimitAnimals = -1;
@ConfigEntry(path = "world.spawn-limits.water-animals", since = "1.11.2")
private int spawnLimitWaterAnimals = -1;
@ConfigEntry(path = "world.spawn-limits.ambient", since = "1.11.2")
private int spawnLimitAmbient = -1;
@ConfigComment("Setting to 0 will disable animal spawns, but this is not recommended. Minecraft default is 400.")
@ConfigComment("A negative value uses the server default")
@ConfigEntry(path = "world.spawn-limits.ticks-per-animal-spawns", since = "1.11.2")
private int ticksPerAnimalSpawns = -1;
@ConfigComment("Setting to 0 will disable monster spawns, but this is not recommended. Minecraft default is 400.")
@ConfigComment("A negative value uses the server default")
@ConfigEntry(path = "world.spawn-limits.ticks-per-monster-spawns", since = "1.11.2")
private int ticksPerMonsterSpawns = -1;
@ConfigComment("Radius of island in blocks. (So distance between islands is twice this)") @ConfigComment("Radius of island in blocks. (So distance between islands is twice this)")
@ConfigComment("It is the same for every dimension : Overworld, Nether and End.") @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.") @ConfigComment("This value cannot be changed mid-game and the plugin will not start if it is different.")
@ -328,8 +347,8 @@ public class Settings implements WorldSettings {
private boolean createIslandOnFirstLoginAbortOnLogout = true; private boolean createIslandOnFirstLoginAbortOnLogout = true;
@ConfigComment("Toggles whether the player should be teleported automatically to his island when it is created.") @ConfigComment("Toggles whether the player should be teleported automatically to his island when it is created.")
@ConfigComment("If set to false, the player will be told his island is ready but will have to teleport to his island using the command.") @ConfigComment("If set to false, the player will be told his island is ready but will have to teleport to his island using the command.")
@ConfigEntry(path = "island.teleport-player-to-island-when-created", since = "1.10.0") @ConfigEntry(path = "island.teleport-player-to-island-when-created", since = "1.10.0")
private boolean teleportPlayerToIslandUponIslandCreation = true; private boolean teleportPlayerToIslandUponIslandCreation = true;
@ConfigComment("Create Nether or End islands if they are missing when a player goes through a portal.") @ConfigComment("Create Nether or End islands if they are missing when a player goes through a portal.")
@ -1445,22 +1464,106 @@ public class Settings implements WorldSettings {
this.pasteMissingIslands = pasteMissingIslands; this.pasteMissingIslands = pasteMissingIslands;
} }
/** /**
* Toggles whether the player should be teleported automatically to his island when it is created. * Toggles whether the player should be teleported automatically to his island when it is created.
* @return {@code true} if the player should be teleported automatically to his island when it is created, * @return {@code true} if the player should be teleported automatically to his island when it is created,
* {@code false} otherwise. * {@code false} otherwise.
* @since 1.10.0 * @since 1.10.0
*/ */
@Override @Override
public boolean isTeleportPlayerToIslandUponIslandCreation() { public boolean isTeleportPlayerToIslandUponIslandCreation() {
return teleportPlayerToIslandUponIslandCreation; return teleportPlayerToIslandUponIslandCreation;
} }
/** /**
* @param teleportPlayerToIslandUponIslandCreation the teleportPlayerToIslandUponIslandCreation to set * @param teleportPlayerToIslandUponIslandCreation the teleportPlayerToIslandUponIslandCreation to set
* @since 1.10.0 * @since 1.10.0
*/ */
public void setTeleportPlayerToIslandUponIslandCreation(boolean teleportPlayerToIslandUponIslandCreation) { public void setTeleportPlayerToIslandUponIslandCreation(boolean teleportPlayerToIslandUponIslandCreation) {
this.teleportPlayerToIslandUponIslandCreation = teleportPlayerToIslandUponIslandCreation; this.teleportPlayerToIslandUponIslandCreation = teleportPlayerToIslandUponIslandCreation;
} }
/**
* @return the spawnLimitMonsters
*/
public int getSpawnLimitMonsters() {
return spawnLimitMonsters;
}
/**
* @param spawnLimitMonsters the spawnLimitMonsters to set
*/
public void setSpawnLimitMonsters(int spawnLimitMonsters) {
this.spawnLimitMonsters = spawnLimitMonsters;
}
/**
* @return the spawnLimitAnimals
*/
public int getSpawnLimitAnimals() {
return spawnLimitAnimals;
}
/**
* @param spawnLimitAnimals the spawnLimitAnimals to set
*/
public void setSpawnLimitAnimals(int spawnLimitAnimals) {
this.spawnLimitAnimals = spawnLimitAnimals;
}
/**
* @return the spawnLimitWaterAnimals
*/
public int getSpawnLimitWaterAnimals() {
return spawnLimitWaterAnimals;
}
/**
* @param spawnLimitWaterAnimals the spawnLimitWaterAnimals to set
*/
public void setSpawnLimitWaterAnimals(int spawnLimitWaterAnimals) {
this.spawnLimitWaterAnimals = spawnLimitWaterAnimals;
}
/**
* @return the spawnLimitAmbient
*/
public int getSpawnLimitAmbient() {
return spawnLimitAmbient;
}
/**
* @param spawnLimitAmbient the spawnLimitAmbient to set
*/
public void setSpawnLimitAmbient(int spawnLimitAmbient) {
this.spawnLimitAmbient = spawnLimitAmbient;
}
/**
* @return the ticksPerAnimalSpawns
*/
public int getTicksPerAnimalSpawns() {
return ticksPerAnimalSpawns;
}
/**
* @param ticksPerAnimalSpawns the ticksPerAnimalSpawns to set
*/
public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) {
this.ticksPerAnimalSpawns = ticksPerAnimalSpawns;
}
/**
* @return the ticksPerMonsterSpawns
*/
public int getTicksPerMonsterSpawns() {
return ticksPerMonsterSpawns;
}
/**
* @param ticksPerMonsterSpawns the ticksPerMonsterSpawns to set
*/
public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) {
this.ticksPerMonsterSpawns = ticksPerMonsterSpawns;
}
} }

View File

@ -92,6 +92,9 @@ permissions:
bskyblock.mod.bypasscooldowns: bskyblock.mod.bypasscooldowns:
description: Allow moderator to bypass cooldowns description: Allow moderator to bypass cooldowns
default: op default: op
bskyblock.mod.bypassdelays:
description: Allow moderator to bypass delays
default: op
bskyblock.mod.bypassprotect: bskyblock.mod.bypassprotect:
description: Allow moderator to bypass island protection description: Allow moderator to bypass island protection
default: op default: op

View File

@ -18,6 +18,25 @@ world:
# World difficulty setting - PEACEFUL, EASY, NORMAL, HARD # World difficulty setting - PEACEFUL, EASY, NORMAL, HARD
# Other plugins may override this setting # Other plugins may override this setting
difficulty: NORMAL difficulty: NORMAL
spawn-limits:
# Spawn limits. These override the limits set in bukkit.yml
# If set to a negative number, the server defaults will be used
# Added since 1.11.2.
monsters: -1
# Added since 1.11.2.
animals: -1
# Added since 1.11.2.
water-animals: -1
# Added since 1.11.2.
ambient: -1
# Setting to 0 will disable animal spawns, but this is not recommended. Minecraft default is 400.
# A negative value uses the server default
# Added since 1.11.2.
ticks-per-animal-spawns: -1
# Setting to 0 will disable monster spawns, but this is not recommended. Minecraft default is 400.
# A negative value uses the server default
# Added since 1.11.2.
ticks-per-monster-spawns: -1
# Radius of island in blocks. (So distance between islands is twice this) # Radius of island in blocks. (So distance between islands is twice this)
# It is the same for every dimension : Overworld, Nether and End. # 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. # This value cannot be changed mid-game and the plugin will not start if it is different.
@ -92,10 +111,10 @@ world:
dragon-spawn: false dragon-spawn: false
# Mob white list - these mobs will NOT be removed when logging in or doing /island # Mob white list - these mobs will NOT be removed when logging in or doing /island
remove-mobs-whitelist: remove-mobs-whitelist:
- WITHER - WITHER
- PIG_ZOMBIE - PIG_ZOMBIE
- ENDERMAN - ZOMBIE_VILLAGER
- ZOMBIE_VILLAGER - ENDERMAN
# World flags. These are boolean settings for various flags for this world # World flags. These are boolean settings for various flags for this world
flags: flags:
CREEPER_DAMAGE: true CREEPER_DAMAGE: true
@ -141,8 +160,8 @@ world:
LEVER: 500 LEVER: 500
RIDING: 500 RIDING: 500
HURT_MONSTERS: 0 HURT_MONSTERS: 0
NAME_TAG: 500
ARMOR_STAND: 500 ARMOR_STAND: 500
NAME_TAG: 500
TRADING: 0 TRADING: 0
EGGS: 500 EGGS: 500
ITEM_DROP: 0 ITEM_DROP: 0
@ -150,19 +169,19 @@ world:
NETHER_PORTAL: 500 NETHER_PORTAL: 500
ITEM_PICKUP: 0 ITEM_PICKUP: 0
CROP_TRAMPLE: 500 CROP_TRAMPLE: 500
DROPPER: 500
BREWING: 500 BREWING: 500
DROPPER: 500
COLLECT_WATER: 500 COLLECT_WATER: 500
BUTTON: 500 BUTTON: 500
FIRE_EXTINGUISH: 500 FIRE_EXTINGUISH: 500
BEACON: 500 BEACON: 500
TRAPDOOR: 500 TRAPDOOR: 500
PRESSURE_PLATE: 0 PRESSURE_PLATE: 0
PLACE_BLOCKS: 500
ITEM_FRAME: 500 ITEM_FRAME: 500
PLACE_BLOCKS: 500
CRAFTING: 0 CRAFTING: 0
SHEARING: 500
ENCHANTING: 0 ENCHANTING: 0
SHEARING: 500
SPAWN_EGGS: 500 SPAWN_EGGS: 500
BED: 500 BED: 500
MILKING: 0 MILKING: 0
@ -171,8 +190,8 @@ world:
EXPERIENCE_PICKUP: 500 EXPERIENCE_PICKUP: 500
HOPPER: 500 HOPPER: 500
LEASH: 500 LEASH: 500
BREAK_BLOCKS: 500
MOUNT_INVENTORY: 500 MOUNT_INVENTORY: 500
BREAK_BLOCKS: 500
CHORUS_FRUIT: 500 CHORUS_FRUIT: 500
CONTAINER: 500 CONTAINER: 500
POTION_THROWING: 500 POTION_THROWING: 500
@ -180,8 +199,8 @@ world:
# These are the default settings for new islands # These are the default settings for new islands
default-island-settings: default-island-settings:
PVP_END: false PVP_END: false
ANIMAL_SPAWN: true
PVP_NETHER: false PVP_NETHER: false
ANIMAL_SPAWN: true
MONSTER_SPAWN: true MONSTER_SPAWN: true
FIRE_SPREAD: true FIRE_SPREAD: true
PVP_OVERWORLD: false PVP_OVERWORLD: false
@ -191,14 +210,14 @@ world:
hidden-flags: [] hidden-flags: []
# Visitor banned commands - Visitors to islands cannot use these commands in this world # Visitor banned commands - Visitors to islands cannot use these commands in this world
visitor-banned-commands: visitor-banned-commands:
- spawner - spawner
- spawnmob - spawnmob
# Falling banned commands - players cannot use these commands when falling # Falling banned commands - players cannot use these commands when falling
# if the PREVENT_TELEPORT_WHEN_FALLING world setting flag is active # if the PREVENT_TELEPORT_WHEN_FALLING world setting flag is active
# Added since 1.8.0. # Added since 1.8.0.
falling-banned-commands: falling-banned-commands:
- warp - warp
- spawn - spawn
island: island:
# Default max team size # Default max team size
# Permission size cannot be less than the default below. # Permission size cannot be less than the default below.
@ -308,10 +327,30 @@ island:
# Added since 1.10.0. # Added since 1.10.0.
create-missing-nether-end-islands: false create-missing-nether-end-islands: false
commands: commands:
# List of commands to run when a player joins. # List of commands to run when a player joins an island or creates one.
# These commands are run by the console, unless otherwise stated using the [SUDO] prefix,
# in which case they are executed by the player.
#
# Available placeholders for the commands are the following:
# * [name]: name of the player
#
# Here are some examples of valid commands to execute:
# * "[SUDO] bbox version"
# * "bsbadmin deaths set [player] 0"
# Added since 1.8.0. # Added since 1.8.0.
on-join: [] on-join: []
# list of commands to run when a player leaves. # List of commands to run when a player leaves an island, resets his island or gets kicked from it.
# These commands are run by the console, unless otherwise stated using the [SUDO] prefix,
# in which case they are executed by the player.
#
# Available placeholders for the commands are the following:
# * [name]: name of the player
#
# Here are some examples of valid commands to execute:
# * '[SUDO] bbox version'
# * 'bsbadmin deaths set [player] 0'
#
# Note that player-executed commands might not work, as these commands can be run with said player being offline.
# Added since 1.8.0. # Added since 1.8.0.
on-leave: [] on-leave: []
sethome: sethome:
@ -335,36 +374,37 @@ protection:
# Geo restrict mobs. # Geo restrict mobs.
# Mobs that exit the island space where they were spawned will be removed. # Mobs that exit the island space where they were spawned will be removed.
geo-limit-settings: geo-limit-settings:
- GHAST - GHAST
- BAT - BAT
- BLAZE - BLAZE
# Invincible visitors. List of damages that will not affect visitors. # Invincible visitors. List of damages that will not affect visitors.
# Make list blank if visitors should receive all damages # Make list blank if visitors should receive all damages
invincible-visitors: invincible-visitors:
- BLOCK_EXPLOSION - BLOCK_EXPLOSION
- CONTACT - CONTACT
- CUSTOM - CUSTOM
- DROWNING - DROWNING
- ENTITY_ATTACK - ENTITY_ATTACK
- ENTITY_EXPLOSION - ENTITY_EXPLOSION
- FALL - FALL
- FALLING_BLOCK - FALLING_BLOCK
- FIRE - FIRE
- FIRE_TICK - FIRE_TICK
- LAVA - LAVA
- LIGHTNING - LIGHTNING
- MAGIC - MAGIC
- POISON - POISON
- PROJECTILE - PROJECTILE
- STARVATION - STARVATION
- SUFFOCATION - SUFFOCATION
- THORNS - THORNS
- WITHER - WITHER
- DRAGON_BREATH - DRAGON_BREATH
- FLY_INTO_WALL - FLY_INTO_WALL
- HOT_FLOOR - HOT_FLOOR
- CRAMMING - CRAMMING
- VOID - VOID
do-not-edit-these-settings: do-not-edit-these-settings:
# These settings should not be edited # These settings should not be edited
reset-epoch: 0 reset-epoch: 0

View File

@ -0,0 +1,13 @@
###########################################################################################
# This is a YML file. Be careful when editing. Check your edits in a YAML checker like #
# the one at http://yaml-online-parser.appspot.com #
# #
# Translation by: CZghost #
###########################################################################################
bskyblock:
sign:
line0: '&cBSkyBlock'
line1: Vítej!
line2: '[name]'
line3: Nespadni! &c<3

View File

@ -39,6 +39,7 @@ import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox; import org.powermock.reflect.Whitebox;
import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.Settings;
import world.bentobox.bentobox.api.addons.AddonDescription; import world.bentobox.bentobox.api.addons.AddonDescription;
import world.bentobox.bentobox.api.configuration.Config; import world.bentobox.bentobox.api.configuration.Config;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;
@ -70,6 +71,8 @@ public class BSkyBlockTest {
private BentoBox plugin; private BentoBox plugin;
@Mock @Mock
private FlagsManager fm; private FlagsManager fm;
@Mock
private Settings settings;
/** /**
* @throws java.lang.Exception * @throws java.lang.Exception
@ -146,6 +149,9 @@ public class BSkyBlockTest {
when(plugin.getFlagsManager()).thenReturn(fm); when(plugin.getFlagsManager()).thenReturn(fm);
when(fm.getFlags()).thenReturn(Collections.emptyList()); when(fm.getFlags()).thenReturn(Collections.emptyList());
// Settings
when(plugin.getSettings()).thenReturn(settings);
} }
/** /**