Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into master
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
#	src/main/resources/addon.yml
  • Loading branch information
BONNe committed Oct 4, 2022
2 parents 6d3aab0 + c79f7e2 commit 44bf473
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 47 deletions.
36 changes: 31 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.17.1-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.17.1</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>
Expand Down Expand Up @@ -230,7 +230,33 @@
<version>3.0.0-M5</version>
<configuration>
<argLine>
--illegal-access=permit
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.math=ALL-UNNAMED
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens
java.base/java.util.stream=ALL-UNNAMED
--add-opens java.base/java.text=ALL-UNNAMED
--add-opens
java.base/java.util.regex=ALL-UNNAMED
--add-opens
java.base/java.nio.channels.spi=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.net=ALL-UNNAMED
--add-opens
java.base/java.util.concurrent=ALL-UNNAMED
--add-opens java.base/sun.nio.fs=ALL-UNNAMED
--add-opens java.base/sun.nio.cs=ALL-UNNAMED
--add-opens java.base/java.nio.file=ALL-UNNAMED
--add-opens
java.base/java.nio.charset=ALL-UNNAMED
--add-opens
java.base/java.lang.reflect=ALL-UNNAMED
--add-opens
java.logging/java.util.logging=ALL-UNNAMED
--add-opens java.base/java.lang.ref=ALL-UNNAMED
--add-opens java.base/java.util.jar=ALL-UNNAMED
--add-opens java.base/java.util.zip=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
Expand Down
81 changes: 59 additions & 22 deletions src/main/java/world/bentobox/bskyblock/Settings.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -21,8 +16,7 @@
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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -690,22 +683,57 @@ public Map<String, Boolean> getWorldFlags() {
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 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<Flag, Integer> getDefaultIslandSettings() {
return defaultIslandSettings;
public Map<String, Integer> getDefaultIslandSettingNames()
{
return this.defaultIslandSettingNames;
}


/**
* @return the hidden flags
*/
Expand Down Expand Up @@ -1097,20 +1125,29 @@ public void setWorldFlags(Map<String, Boolean> worldFlags) {
this.worldFlags = worldFlags;
}


/**
* @param defaultIslandFlags the defaultIslandFlags to set
* Sets default island flag names.
*
* @param defaultIslandFlagNames the default island flag names
*/
public void setDefaultIslandFlags(Map<Flag, Integer> defaultIslandFlags) {
this.defaultIslandFlags = defaultIslandFlags;
public void setDefaultIslandFlagNames(Map<String, Integer> defaultIslandFlagNames)
{
this.defaultIslandFlagNames = defaultIslandFlagNames;
}


/**
* @param defaultIslandSettings the defaultIslandSettings to set
* Sets default island setting names.
*
* @param defaultIslandSettingNames the default island setting names
*/
public void setDefaultIslandSettings(Map<Flag, Integer> defaultIslandSettings) {
this.defaultIslandSettings = defaultIslandSettings;
public void setDefaultIslandSettingNames(Map<String, Integer> defaultIslandSettingNames)
{
this.defaultIslandSettingNames = defaultIslandSettingNames;
}


/**
* @param hiddenFlags the hidden flags to set
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void setup() {
@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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public ChunkGeneratorWorld(BSkyBlock addon) {
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));
Expand All @@ -58,7 +58,7 @@ private void setBiome(World world, BiomeGrid biomeGrid) {
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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/addon.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/locales/de.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: Herzlich willkommen!
line2: "[name]"
line3: Fall nicht hin! &c<3
18 changes: 6 additions & 12 deletions src/main/resources/locales/fr.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
###########################################################################################
# Ceci est un fichier YAML. Soyez prudent lors de l'édition.Vérifiez vos changements dans #
# le vérificateur YAML suivant: http://yaml-online-parser.appspot.com #
###########################################################################################

meta:
authors:
- x9nico

---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: "Bienvenue!"
line1: Bienvenue!
line2: "[name]"
line3: "Ne tombez pas ! &c<3"

line3: Ne tombez pas ! &c<3
meta:
authors:
- x9nico
3 changes: 2 additions & 1 deletion src/main/resources/locales/pt.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: Bem vindo(a)!
line2: "[name]"
line3: Não caia! &c<3
line1: Bem vinda!
8 changes: 8 additions & 0 deletions src/main/resources/locales/ro.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: "Bine ai venit!"
line2: "[name]"
line3: "Sa nu cazi! &c<3"

7 changes: 7 additions & 0 deletions src/main/resources/locales/tr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: Hoş Geldin!
line2: "[name]"
line3: Aşağı Düşme! &c<3
7 changes: 7 additions & 0 deletions src/main/resources/locales/vi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: Chào mừng!
line2: "[Tên]"
line3: Đừng ngã xuống! &c<3
5 changes: 3 additions & 2 deletions src/main/resources/locales/zh-CN.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
bskyblock:
sign:
line0: "&c空岛生存"
line1: "欢迎你来到这里!"
line1: 欢迎你来到这里!
line2: "[name]"
line3: "千万不要掉下去! &c<3"
line3: 千万不要掉下去! &c<3
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Pladdon
main: world.bentobox.bskyblock.BSkyBlockPladdon
version: ${version}
api-version: 1.17
api-version: 1.19
description: A SkyBlock Plugin
author: tastybento
depend:
Expand Down

0 comments on commit 44bf473

Please sign in to comment.