Upgrade to BentoBox API 1.23

This commit is contained in:
BONNe 2023-04-16 19:45:56 +03:00
parent 75148c5e00
commit e1121d3dce
4 changed files with 34 additions and 17 deletions

View File

@ -45,8 +45,8 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version> <java.version>17</java.version>
<!-- More visible way how to change dependency versions --> <!-- More visible way how to change dependency versions -->
<spigot.version>1.19.2-R0.1-SNAPSHOT</spigot.version> <spigot.version>1.19.4-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.19.0</bentobox.version> <bentobox.version>1.23.0</bentobox.version>
<!-- Revision variable removes warning about dynamic version --> <!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision> <revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. --> <!-- This allows to change between versions and snapshots. -->

View File

@ -282,6 +282,16 @@ public class CaveBlock extends GameModeAddon
} }
/**
* This addon uses the new chunk generation API for the sea bottom
*/
@Override
public boolean isUsesNewChunkGeneration()
{
return true;
}
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Section: Variables // Section: Variables
// --------------------------------------------------------------------- // ---------------------------------------------------------------------

View File

@ -1,12 +1,7 @@
package world.bentobox.caveblock; package world.bentobox.caveblock;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.Difficulty; import org.bukkit.Difficulty;
import org.bukkit.GameMode; import org.bukkit.GameMode;
@ -333,7 +328,7 @@ public class Settings implements WorldSettings
* @return the defaultIslandFlags object. * @return the defaultIslandFlags object.
*/ */
@Override @Override
public Map<Flag, Integer> getDefaultIslandFlags() public Map<String, Integer> getDefaultIslandFlagNames()
{ {
return defaultIslandFlags; return defaultIslandFlags;
} }
@ -344,7 +339,7 @@ public class Settings implements WorldSettings
* @return the defaultIslandSettings object. * @return the defaultIslandSettings object.
*/ */
@Override @Override
public Map<Flag, Integer> getDefaultIslandSettings() public Map<String, Integer> getDefaultIslandSettingNames()
{ {
return defaultIslandSettings; return defaultIslandSettings;
} }
@ -1179,7 +1174,7 @@ public class Settings implements WorldSettings
* @param defaultIslandFlags the defaultIslandFlags object new value. * @param defaultIslandFlags the defaultIslandFlags object new value.
* *
*/ */
public void setDefaultIslandFlags(Map<Flag, Integer> defaultIslandFlags) public void setDefaultIslandFlags(Map<String, Integer> defaultIslandFlags)
{ {
this.defaultIslandFlags = defaultIslandFlags; this.defaultIslandFlags = defaultIslandFlags;
} }
@ -1190,7 +1185,7 @@ public class Settings implements WorldSettings
* @param defaultIslandSettings the defaultIslandSettings object new value. * @param defaultIslandSettings the defaultIslandSettings object new value.
* *
*/ */
public void setDefaultIslandSettings(Map<Flag, Integer> defaultIslandSettings) public void setDefaultIslandSettings(Map<String, Integer> defaultIslandSettings)
{ {
this.defaultIslandSettings = defaultIslandSettings; this.defaultIslandSettings = defaultIslandSettings;
} }
@ -2143,6 +2138,20 @@ public class Settings implements WorldSettings
} }
@Override
public Map<Flag, Integer> getDefaultIslandFlags()
{
return Collections.emptyMap();
}
@Override
public Map<Flag, Integer> getDefaultIslandSettings()
{
return Collections.emptyMap();
}
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Section: Variables // Section: Variables
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
@ -2439,13 +2448,11 @@ public class Settings implements WorldSettings
@ConfigComment(" SUB-OWNER = 900") @ConfigComment(" SUB-OWNER = 900")
@ConfigComment(" OWNER = 1000") @ConfigComment(" OWNER = 1000")
@ConfigEntry(path = "world.default-cave-flags") @ConfigEntry(path = "world.default-cave-flags")
@Adapter(FlagSerializer.class) private Map<String, Integer> defaultIslandFlags = new HashMap<>();
private Map<Flag, Integer> defaultIslandFlags = new HashMap<>();
@ConfigComment("These are the default settings for new caves") @ConfigComment("These are the default settings for new caves")
@ConfigEntry(path = "world.default-cave-settings") @ConfigEntry(path = "world.default-cave-settings")
@Adapter(FlagSerializer2.class) private Map<String, Integer> defaultIslandSettings = new HashMap<>();
private Map<Flag, Integer> defaultIslandSettings = new HashMap<>();
@ConfigComment("These settings/flags are hidden from users") @ConfigComment("These settings/flags are hidden from users")
@ConfigComment("Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings") @ConfigComment("Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings")

View File

@ -1,7 +1,7 @@
name: CaveBlock name: CaveBlock
main: world.bentobox.caveblock.CaveBlock main: world.bentobox.caveblock.CaveBlock
version: ${version}${build.number} version: ${version}${build.number}
api-version: 1.19.0 api-version: 1.23.0
metrics: true metrics: true
repository: "BentoBoxWorld/CaveBlock" repository: "BentoBoxWorld/CaveBlock"
icon: "STONE_PICKAXE" icon: "STONE_PICKAXE"