mirror of
https://github.com/BentoBoxWorld/BSkyBlock.git
synced 2024-11-24 12:06:02 +01:00
Update to BentoBox 1.21
This commit is contained in:
parent
03ff0e9cbd
commit
c79f7e209b
8
pom.xml
8
pom.xml
@ -54,18 +54,18 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>16</java.version>
|
<java.version>17</java.version>
|
||||||
<!-- Non-minecraft related dependencies -->
|
<!-- Non-minecraft related dependencies -->
|
||||||
<powermock.version>2.0.9</powermock.version>
|
<powermock.version>2.0.9</powermock.version>
|
||||||
<!-- More visible way how to change dependency versions -->
|
<!-- More visible way how to change dependency versions -->
|
||||||
<spigot.version>1.16.5-R0.1-SNAPSHOT</spigot.version>
|
<spigot.version>1.19-R0.1-SNAPSHOT</spigot.version>
|
||||||
<bentobox.version>1.16.5-SNAPSHOT</bentobox.version>
|
<bentobox.version>1.21.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>
|
||||||
<!-- 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.15.2</build.version>
|
<build.version>1.16.0</build.version>
|
||||||
<!-- Sonar Cloud -->
|
<!-- Sonar Cloud -->
|
||||||
<sonar.projectKey>BentoBoxWorld_BSkyBlock</sonar.projectKey>
|
<sonar.projectKey>BentoBoxWorld_BSkyBlock</sonar.projectKey>
|
||||||
<sonar.organization>bentobox-world</sonar.organization>
|
<sonar.organization>bentobox-world</sonar.organization>
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
package world.bentobox.bskyblock;
|
package world.bentobox.bskyblock;
|
||||||
|
|
||||||
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;
|
||||||
@ -21,8 +16,7 @@ import world.bentobox.bentobox.api.configuration.StoreAt;
|
|||||||
import world.bentobox.bentobox.api.configuration.WorldSettings;
|
import world.bentobox.bentobox.api.configuration.WorldSettings;
|
||||||
import world.bentobox.bentobox.api.flags.Flag;
|
import world.bentobox.bentobox.api.flags.Flag;
|
||||||
import world.bentobox.bentobox.database.objects.adapters.Adapter;
|
import world.bentobox.bentobox.database.objects.adapters.Adapter;
|
||||||
import world.bentobox.bentobox.database.objects.adapters.FlagSerializer;
|
import world.bentobox.bentobox.database.objects.adapters.FlagBooleanSerializer;
|
||||||
import world.bentobox.bentobox.database.objects.adapters.FlagSerializer2;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All the plugin settings are here
|
* All the plugin settings are here
|
||||||
@ -232,13 +226,12 @@ public class Settings implements WorldSettings {
|
|||||||
@ConfigComment(" SUB-OWNER = 900")
|
@ConfigComment(" SUB-OWNER = 900")
|
||||||
@ConfigComment(" OWNER = 1000")
|
@ConfigComment(" OWNER = 1000")
|
||||||
@ConfigEntry(path = "world.default-island-flags")
|
@ConfigEntry(path = "world.default-island-flags")
|
||||||
@Adapter(FlagSerializer.class)
|
private Map<String, Integer> defaultIslandFlagNames = new HashMap<>();
|
||||||
private Map<Flag, Integer> defaultIslandFlags = new HashMap<>();
|
|
||||||
|
|
||||||
@ConfigComment("These are the default settings for new islands")
|
@ConfigComment("These are the default settings for new islands")
|
||||||
@ConfigEntry(path = "world.default-island-settings")
|
@ConfigEntry(path = "world.default-island-settings")
|
||||||
@Adapter(FlagSerializer2.class)
|
@Adapter(FlagBooleanSerializer.class)
|
||||||
private Map<Flag, Integer> defaultIslandSettings = new HashMap<>();
|
private Map<String, Integer> defaultIslandSettingNames = 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")
|
||||||
@ -690,22 +683,57 @@ public class Settings implements WorldSettings {
|
|||||||
return worldFlags;
|
return worldFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the defaultIslandFlags
|
* @return the defaultIslandFlags
|
||||||
|
* @deprecated since 1.21
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<Flag, Integer> getDefaultIslandFlags() {
|
public Map<Flag, Integer> getDefaultIslandFlags()
|
||||||
return defaultIslandFlags;
|
{
|
||||||
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the defaultIslandSettings
|
* @return the defaultIslandSettings
|
||||||
|
* @deprecated since 1.21
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<Flag, Integer> getDefaultIslandSettings() {
|
public Map<Flag, Integer> getDefaultIslandSettings()
|
||||||
return defaultIslandSettings;
|
{
|
||||||
|
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
|
* @return the hidden flags
|
||||||
*/
|
*/
|
||||||
@ -1097,20 +1125,29 @@ public class Settings implements WorldSettings {
|
|||||||
this.worldFlags = worldFlags;
|
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) {
|
public void setDefaultIslandFlagNames(Map<String, Integer> defaultIslandFlagNames)
|
||||||
this.defaultIslandSettings = defaultIslandSettings;
|
{
|
||||||
|
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
|
* @param hiddenFlags the hidden flags to set
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ public class IslandAboutCommand extends CompositeCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, String label, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
user.sendRawMessage("About " + getAddon().getDescription().getName() + " " + getAddon().getDescription().getVersion() + ":");
|
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("See https://www.eclipse.org/legal/epl-2.0/");
|
||||||
user.sendRawMessage("for license information.");
|
user.sendRawMessage("for license information.");
|
||||||
return true;
|
return true;
|
||||||
|
@ -39,7 +39,7 @@ public class ChunkGeneratorWorld extends ChunkGenerator {
|
|||||||
public ChunkData generateChunks(World world) {
|
public ChunkData generateChunks(World world) {
|
||||||
ChunkData result = createChunkData(world);
|
ChunkData result = createChunkData(world);
|
||||||
if (world.getEnvironment().equals(Environment.NORMAL) && addon.getSettings().getSeaHeight() > 0) {
|
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()) {
|
if (world.getEnvironment().equals(Environment.NETHER) && addon.getSettings().isNetherRoof()) {
|
||||||
roofChunk.forEach((k,v) -> result.setBlock(k.getBlockX(), world.getMaxHeight() + k.getBlockY(), k.getBlockZ(), v));
|
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();
|
world.getEnvironment() == Environment.NETHER ? addon.getSettings().getDefaultNetherBiome() : addon.getSettings().getDefaultEndBiome();
|
||||||
for (int x = 0; x < 16; x+=4) {
|
for (int x = 0; x < 16; x+=4) {
|
||||||
for (int z = 0; z < 16; z+=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);
|
biomeGrid.setBiome(x, y, z, biome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: BSkyBlock
|
name: BSkyBlock
|
||||||
main: world.bentobox.bskyblock.BSkyBlock
|
main: world.bentobox.bskyblock.BSkyBlock
|
||||||
version: ${version}${build.number}
|
version: ${version}${build.number}
|
||||||
api-version: 1.16.5
|
api-version: 1.21.0
|
||||||
metrics: true
|
metrics: true
|
||||||
icon: "OAK_SAPLING"
|
icon: "OAK_SAPLING"
|
||||||
repository: "BentoBoxWorld/BSkyBlock"
|
repository: "BentoBoxWorld/BSkyBlock"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: Pladdon
|
name: Pladdon
|
||||||
main: world.bentobox.bskyblock.BSkyBlockPladdon
|
main: world.bentobox.bskyblock.BSkyBlockPladdon
|
||||||
version: ${version}
|
version: ${version}
|
||||||
api-version: 1.16
|
api-version: 1.19
|
||||||
description: A SkyBlock Plugin
|
description: A SkyBlock Plugin
|
||||||
author: tastybento
|
author: tastybento
|
||||||
depend:
|
depend:
|
||||||
|
Loading…
Reference in New Issue
Block a user