Update to BentoBox 1.21

This commit is contained in:
BONNe 2022-10-04 14:52:40 +03:00
parent 03ff0e9cbd
commit c79f7e209b
6 changed files with 71 additions and 34 deletions

View File

@ -54,18 +54,18 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>16</java.version>
<java.version>17</java.version>
<!-- Non-minecraft related dependencies -->
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.16.5-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.16.5-SNAPSHOT</bentobox.version>
<spigot.version>1.19-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.21.0</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>1.15.2</build.version>
<build.version>1.16.0</build.version>
<!-- Sonar Cloud -->
<sonar.projectKey>BentoBoxWorld_BSkyBlock</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>

View File

@ -1,11 +1,6 @@
package world.bentobox.bskyblock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import org.bukkit.Difficulty;
import org.bukkit.GameMode;
@ -21,8 +16,7 @@ import world.bentobox.bentobox.api.configuration.StoreAt;
import world.bentobox.bentobox.api.configuration.WorldSettings;
import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.bentobox.database.objects.adapters.Adapter;
import world.bentobox.bentobox.database.objects.adapters.FlagSerializer;
import world.bentobox.bentobox.database.objects.adapters.FlagSerializer2;
import world.bentobox.bentobox.database.objects.adapters.FlagBooleanSerializer;
/**
* All the plugin settings are here
@ -232,13 +226,12 @@ public class Settings implements WorldSettings {
@ConfigComment(" SUB-OWNER = 900")
@ConfigComment(" OWNER = 1000")
@ConfigEntry(path = "world.default-island-flags")
@Adapter(FlagSerializer.class)
private Map<Flag, Integer> defaultIslandFlags = new HashMap<>();
private Map<String, Integer> defaultIslandFlagNames = new HashMap<>();
@ConfigComment("These are the default settings for new islands")
@ConfigEntry(path = "world.default-island-settings")
@Adapter(FlagSerializer2.class)
private Map<Flag, Integer> defaultIslandSettings = new HashMap<>();
@Adapter(FlagBooleanSerializer.class)
private Map<String, Integer> defaultIslandSettingNames = new HashMap<>();
@ConfigComment("These settings/flags are hidden from users")
@ConfigComment("Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings")
@ -690,22 +683,57 @@ public class Settings implements WorldSettings {
return worldFlags;
}
/**
* @return the defaultIslandFlags
* @deprecated since 1.21
*/
@Override
public Map<Flag, Integer> getDefaultIslandFlags() {
return defaultIslandFlags;
public Map<Flag, Integer> getDefaultIslandFlags()
{
return Collections.emptyMap();
}
/**
* @return the defaultIslandSettings
* @deprecated since 1.21
*/
@Override
public Map<Flag, Integer> getDefaultIslandSettings() {
return defaultIslandSettings;
public Map<Flag, Integer> getDefaultIslandSettings()
{
return Collections.emptyMap();
}
/**
* Return map of flags ID's linked to default rank for new island.
* This is necessary so users could specify any flag names in settings file from other plugins and addons.
* Otherwise, Flag reader would mark flag as invalid and remove it.
* @since 1.21
* @return default rank settings for new islands.
*/
@Override
public Map<String, Integer> getDefaultIslandFlagNames()
{
return this.defaultIslandFlagNames;
}
/**
* Return map of flags ID's linked to default settings for new island.
* This is necessary so users could specify any flag names in settings file from other plugins and addons.
* Otherwise, Flag reader would mark flag as invalid and remove it.
* @since 1.21
* @return default settings for new islands.
*/
@Override
public Map<String, Integer> getDefaultIslandSettingNames()
{
return this.defaultIslandSettingNames;
}
/**
* @return the hidden flags
*/
@ -1097,20 +1125,29 @@ public class Settings implements WorldSettings {
this.worldFlags = worldFlags;
}
/**
* @param defaultIslandFlags the defaultIslandFlags to set
*/
public void setDefaultIslandFlags(Map<Flag, Integer> defaultIslandFlags) {
this.defaultIslandFlags = defaultIslandFlags;
}
/**
* @param defaultIslandSettings the defaultIslandSettings to set
* Sets default island flag names.
*
* @param defaultIslandFlagNames the default island flag names
*/
public void setDefaultIslandSettings(Map<Flag, Integer> defaultIslandSettings) {
this.defaultIslandSettings = defaultIslandSettings;
public void setDefaultIslandFlagNames(Map<String, Integer> defaultIslandFlagNames)
{
this.defaultIslandFlagNames = defaultIslandFlagNames;
}
/**
* Sets default island setting names.
*
* @param defaultIslandSettingNames the default island setting names
*/
public void setDefaultIslandSettingNames(Map<String, Integer> defaultIslandSettingNames)
{
this.defaultIslandSettingNames = defaultIslandSettingNames;
}
/**
* @param hiddenFlags the hidden flags to set
*/

View File

@ -23,7 +23,7 @@ public class IslandAboutCommand extends CompositeCommand {
@Override
public boolean execute(User user, String label, List<String> args) {
user.sendRawMessage("About " + getAddon().getDescription().getName() + " " + getAddon().getDescription().getVersion() + ":");
user.sendRawMessage("Copyright (c) 2017 - 2020 tastybento, Poslovitch");
user.sendRawMessage("Copyright (c) 2017 - 2022 tastybento, Poslovitch");
user.sendRawMessage("See https://www.eclipse.org/legal/epl-2.0/");
user.sendRawMessage("for license information.");
return true;

View File

@ -39,7 +39,7 @@ public class ChunkGeneratorWorld extends ChunkGenerator {
public ChunkData generateChunks(World world) {
ChunkData result = createChunkData(world);
if (world.getEnvironment().equals(Environment.NORMAL) && addon.getSettings().getSeaHeight() > 0) {
result.setRegion(0, 0, 0, 16, addon.getSettings().getSeaHeight() + 1, 16, Material.WATER);
result.setRegion(0, world.getMinHeight(), 0, 16, addon.getSettings().getSeaHeight() + 1, 16, Material.WATER);
}
if (world.getEnvironment().equals(Environment.NETHER) && addon.getSettings().isNetherRoof()) {
roofChunk.forEach((k,v) -> result.setBlock(k.getBlockX(), world.getMaxHeight() + k.getBlockY(), k.getBlockZ(), v));
@ -58,7 +58,7 @@ public class ChunkGeneratorWorld extends ChunkGenerator {
world.getEnvironment() == Environment.NETHER ? addon.getSettings().getDefaultNetherBiome() : addon.getSettings().getDefaultEndBiome();
for (int x = 0; x < 16; x+=4) {
for (int z = 0; z < 16; z+=4) {
for (int y = 0; y < world.getMaxHeight(); y+=4) {
for (int y = world.getMinHeight(); y < world.getMaxHeight(); y+=4) {
biomeGrid.setBiome(x, y, z, biome);
}
}

View File

@ -1,7 +1,7 @@
name: BSkyBlock
main: world.bentobox.bskyblock.BSkyBlock
version: ${version}${build.number}
api-version: 1.16.5
api-version: 1.21.0
metrics: true
icon: "OAK_SAPLING"
repository: "BentoBoxWorld/BSkyBlock"

View File

@ -1,7 +1,7 @@
name: Pladdon
main: world.bentobox.bskyblock.BSkyBlockPladdon
version: ${version}
api-version: 1.16
api-version: 1.19
description: A SkyBlock Plugin
author: tastybento
depend: