Merge development branch into master

This commit is contained in:
BONNe 2019-03-28 23:49:23 +02:00
commit 2216db970e
7 changed files with 47 additions and 32 deletions

16
pom.xml
View File

@ -46,16 +46,19 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<!-- More visible way how to change dependency versions --> <!-- More visible way how to change dependency versions -->
<spigot.version>1.13.2-R0.1-SNAPSHOT</spigot.version> <spigot.version>1.13.2-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.3.0</bentobox.version> <bentobox.version>1.4.0</bentobox.version>
<!-- Revision variable removes warning about dynamic version --> <!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}</revision> <revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. --> <!-- This allows to change between versions and snapshots. -->
<build.version>1.3.0</build.version> <build.version>1.4.0</build.version>
<build.number>0</build.number>
</properties> </properties>
<profiles> <profiles>
<!-- Build profile is activated by BUILD_NUMBER variable. It replaces 0 with correct build number. -->
<!-- This profile will be used only if BUILD_NUMBER environment variable exists. -->
<profile> <profile>
<id>develop</id> <id>ci</id>
<activation> <activation>
<property> <property>
<name>env.BUILD_NUMBER</name> <name>env.BUILD_NUMBER</name>
@ -63,10 +66,13 @@
</activation> </activation>
<properties> <properties>
<!-- Override only if necessary --> <!-- Override only if necessary -->
<revision>${build.version}-SNAPSHOT-${env.BUILD_NUMBER}</revision> <build.number>${env.BUILD_NUMBER}</build.number>
<!-- GIT_BRANCH --> <!-- GIT_BRANCH -->
</properties> </properties>
</profile> </profile>
<!-- master profile is activated by GIT_BRANCH variable. It removes '-SNAPSHOT' at the end of -->
<!-- ${build.version} -->
<!-- This profile will be used only if environment variable GIT_BRANCH is origin/master. -->
<profile> <profile>
<id>master</id> <id>master</id>
<activation> <activation>

View File

@ -29,6 +29,7 @@ public class CaveBlock extends GameModeAddon
this.saveDefaultConfig(); this.saveDefaultConfig();
this.loadSettings(); this.loadSettings();
this.saveWorldSettings();
} }
@ -61,10 +62,7 @@ public class CaveBlock extends GameModeAddon
@Override @Override
public void onDisable() public void onDisable()
{ {
if (this.settings != null) // Do nothing
{
new Config<>(this, Settings.class).saveConfigObject(this.settings);
}
} }
@ -204,6 +202,13 @@ public class CaveBlock extends GameModeAddon
return this.settings; return this.settings;
} }
@Override
public void saveWorldSettings() {
if (settings != null) {
new Config<>(this, Settings.class).saveConfigObject(settings);
}
}
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Section: Variables // Section: Variables
@ -235,4 +240,5 @@ public class CaveBlock extends GameModeAddon
* String for the end world. * String for the end world.
*/ */
private static final String THE_END = "_the_end"; private static final String THE_END = "_the_end";
} }

View File

@ -358,13 +358,13 @@ public class Settings implements DataObject, WorldSettings
/** /**
* This method returns the visibleSettings object. * This method returns the hiddenFlags object.
* @return the visibleSettings object. * @return the hiddenFlags object.
*/ */
@Override @Override
public List<String> getVisibleSettings() public List<String> getHiddenFlags()
{ {
return visibleSettings; return hiddenFlags;
} }
@ -1131,13 +1131,13 @@ public class Settings implements DataObject, WorldSettings
/** /**
* This method sets the visibleSettings object value. * This method sets the hiddenFlags object value.
* @param visibleSettings the visibleSettings object new value. * @param hiddenFlags the hiddenFlags object new value.
* *
*/ */
public void setVisibleSettings(List<String> visibleSettings) public void setHiddenFlags(List<String> hiddenFlags)
{ {
this.visibleSettings = visibleSettings; this.hiddenFlags = hiddenFlags;
} }
@ -1858,9 +1858,10 @@ public class Settings implements DataObject, WorldSettings
@Adapter(FlagSerializer2.class) @Adapter(FlagSerializer2.class)
private Map<Flag, Integer> defaultIslandSettings = new HashMap<>(); private Map<Flag, Integer> defaultIslandSettings = new HashMap<>();
@ConfigComment("These are the settings visible to users. (Not implemented yet)") @ConfigComment("These settings/flags are hidden from users")
@ConfigEntry(path = "world.visible-settings", experimental = true) @ConfigComment("Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings")
private List<String> visibleSettings = new ArrayList<>(); @ConfigEntry(path = "world.hidden-flags")
private List<String> hiddenFlags = new ArrayList<>();
@ConfigComment("Visitor banned commands - Visitors to islands cannot use these commands in this world") @ConfigComment("Visitor banned commands - Visitors to islands cannot use these commands in this world")
@ConfigEntry(path = "world.visitor-banned-commands") @ConfigEntry(path = "world.visitor-banned-commands")

View File

@ -44,6 +44,10 @@ public class IslandCommand extends CompositeCommand {
new IslandBanCommand(this); new IslandBanCommand(this);
new IslandUnbanCommand(this); new IslandUnbanCommand(this);
new IslandBanlistCommand(this); new IslandBanlistCommand(this);
// Expel command
new IslandExpelCommand(this);
// Team commands // Team commands
new IslandTeamCommand(this); new IslandTeamCommand(this);
} }

View File

@ -62,7 +62,9 @@ public class MaterialPopulator extends BlockPopulator
@Override @Override
public void populate(World world, Random random, Chunk chunk) public void populate(World world, Random random, Chunk chunk)
{ {
for (Map.Entry<Material, Pair<Double, Integer>> entry : chances.get(world.getEnvironment()).materialChanceMap.entrySet()) Chances chances = this.chances.get(world.getEnvironment());
for (Map.Entry<Material, Pair<Double, Integer>> entry : chances.materialChanceMap.entrySet())
{ {
for (int subY = 1; subY < worldHeight; subY += 16) for (int subY = 1; subY < worldHeight; subY += 16)
{ {
@ -81,7 +83,7 @@ public class MaterialPopulator extends BlockPopulator
*/ */
Block block = chunk.getBlock(x, y, z); Block block = chunk.getBlock(x, y, z);
if (block.getType().equals(chances.get(world.getEnvironment()).mainMaterial)) if (block.getType().equals(chances.mainMaterial))
{ {
int packSize = random.nextInt(entry.getValue().z); int packSize = random.nextInt(entry.getValue().z);
@ -120,8 +122,7 @@ public class MaterialPopulator extends BlockPopulator
block = chunk.getBlock(x, y, z); block = chunk.getBlock(x, y, z);
continuePlacing = packSize > 0 && continuePlacing = packSize > 0 && (block.getType().equals(chances.mainMaterial) ||
(block.getType().equals(chances.get(world.getEnvironment()).mainMaterial) ||
block.getType().equals(entry.getKey())); block.getType().equals(entry.getKey()));
} }
} }

View File

@ -1,6 +1,6 @@
name: CaveBlock name: CaveBlock
main: world.bentobox.caveblock.CaveBlock main: world.bentobox.caveblock.CaveBlock
version: ${version} version: ${version}-#${build.number}
authors: BONNe authors: BONNe
@ -14,9 +14,6 @@ permissions:
caveblock.island.home: caveblock.island.home:
description: Allow teleporting to player cave description: Allow teleporting to player cave
default: true default: true
caveblock.island.sethome:
description: Let the player use the sethome command
default: true
caveblock.island.info: caveblock.island.info:
description: Let the player check their cave level description: Let the player check their cave level
default: true default: true

View File

@ -266,9 +266,9 @@ world:
MONSTER_SPAWN: true MONSTER_SPAWN: true
FIRE_SPREAD: true FIRE_SPREAD: true
PVP_OVERWORLD: false PVP_OVERWORLD: false
# These are the settings visible to users. (Not implemented yet) # These settings/flags are hidden from users
# /!\ This feature is experimental and might not work as expected or might not work at all. # Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings
visible-settings: [] 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