Compare commits

...

79 Commits

Author SHA1 Message Date
tastybento d272873410 Enable team members to have islands - requires Bentobox 2.3.0 2024-04-06 09:32:06 -07:00
tastybento 706178d3d5 Fix for L-Shaped island mis-naming 2024-01-20 17:11:25 -08:00
tastybento 72274c0174 Version 1.17.1 2024-01-20 17:11:09 -08:00
tastybento e532e5fad5 Version 1.17.0 2024-01-20 08:32:06 -08:00
tastybento 935884c94d Merge branch 'develop' 2024-01-20 08:31:21 -08:00
tastybento afa1ae028f
Release 1.17.0 (#510)
* Translate fr.yml via GitLocalize (#501)

Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>

* Update Github Action build script

* Added distribution required for Github Action

* Update perms list

* Fix deprecation code for setting world settings

* Fix duplicate permission listing

* Fix typo

* Updated POM version numbers

* Update Jacoco

* Update pom.xml

* Add Modrinth publish workflow for GitHub Actions

* Fix syntax

* Syntax

* GitHub Action test

* More Action

* Update to BentoBox 2.0.0 API

* Updated island blueprints to 1.20.4

Grass was missing.

* Fix tests

---------

Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
2024-01-20 08:26:59 -08:00
tastybento 9599935527
Release 1.17.0 (#509)
* Translate fr.yml via GitLocalize (#501)

Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>

* Update Github Action build script

* Added distribution required for Github Action

* Update perms list

* Fix deprecation code for setting world settings

* Fix duplicate permission listing

* Fix typo

* Updated POM version numbers

* Update Jacoco

* Update pom.xml

* Add Modrinth publish workflow for GitHub Actions

* Fix syntax

* Syntax

* GitHub Action test

* More Action

* Update to BentoBox 2.0.0 API

* Updated island blueprints to 1.20.4

Grass was missing.

* Fix tests

---------

Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
2024-01-20 08:21:35 -08:00
tastybento bc19f352e5 Fix tests 2024-01-13 08:05:30 -08:00
tastybento 32251d4e48 Updated island blueprints to 1.20.4
Grass was missing.
2023-12-10 09:52:42 -08:00
tastybento 25fba16138 Update to BentoBox 2.0.0 API 2023-11-12 12:35:38 -08:00
tastybento 246a4d4185 More Action 2023-08-06 12:26:19 -07:00
tastybento d066e58b32 GitHub Action test 2023-08-06 12:23:49 -07:00
tastybento 24b963fa9c Syntax 2023-08-06 12:20:48 -07:00
tastybento d47493c906 Fix syntax 2023-08-06 12:17:53 -07:00
tastybento 5cde5b624b Merge branch 'develop' of https://github.com/BentoBoxWorld/BSkyBlock.git into develop 2023-08-06 12:14:22 -07:00
tastybento 01e6f9263b Add Modrinth publish workflow for GitHub Actions 2023-08-06 12:14:14 -07:00
tastybento 44d8e1ce39
Update pom.xml 2023-07-10 21:35:51 -07:00
tastybento 0e0c0b24f2 Update Jacoco 2023-07-10 21:21:52 -07:00
tastybento 6cbf4eee77 Updated POM version numbers 2023-07-04 17:10:52 -07:00
tastybento 6c91835e8f Fix typo 2023-07-04 17:06:38 -07:00
tastybento ffd5e9fcd5 Fix duplicate permission listing 2023-07-04 17:06:15 -07:00
tastybento 7a67d2b7f6 Fix deprecation code for setting world settings 2023-07-04 17:05:44 -07:00
tastybento 98d3a55c50 Merge branch 'develop' of https://github.com/BentoBoxWorld/BSkyBlock.git into develop 2023-07-03 08:38:25 -07:00
tastybento cefefefa93 Update perms list 2023-07-03 08:38:15 -07:00
tastybento 48967eff87 Added distribution required for Github Action 2023-06-24 13:55:14 -07:00
tastybento 27e67fb123 Merge branch 'develop' of https://github.com/BentoBoxWorld/BSkyBlock.git into develop 2023-06-24 13:01:04 -07:00
tastybento 8a97bca2a0 Update Github Action build script 2023-06-24 13:00:57 -07:00
gitlocalize-app[bot] 036d7934d8
Translate fr.yml via GitLocalize (#501)
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
2023-05-29 09:47:35 -07:00
BONNe 844996fe3a Downgrade to 1.16.1 2023-04-15 23:31:59 +03:00
BONNe f44c6fa2a8 Merge branch 'develop' into master 2023-04-15 23:31:26 +03:00
tastybento e88ee17d1c Updated dependencies 2023-04-15 11:30:36 -07:00
BONNe 41414ccb26
Merge pull request #498 from BentoBoxWorld/return-to-plugin
Return to plugin.yml
2023-04-08 19:04:24 +03:00
BONNe 0efc1af21f
Update BSkyBlockPladdon.java 2023-04-08 19:04:16 +03:00
BONNe 92b7366159
Update pom.xml 2023-04-08 19:04:01 +03:00
BONNe f341e05ba4
Create plugin.yml 2023-04-08 19:03:31 +03:00
tastybento 55e7732b82
Update README.md 2023-03-25 18:28:20 -07:00
tastybento dee662b4b6
Update README.md
Update flags from SonarCloud
2023-03-25 18:24:59 -07:00
tastybento 12092cb89f Remove dependency 2023-03-25 09:53:30 -07:00
tastybento 9d4d671168 Switch to use annotations for plugin.yml 2023-03-25 09:46:28 -07:00
tastybento 7e7512549c Updated plugin.yml to have name of addon to make it unique 2023-03-25 09:12:35 -07:00
blombergs5 11201c7758
Update README.md (#493)
added link to releases page
2023-02-12 10:37:16 -08:00
tastybento 86d6eb1da6 Update script to Java 17 2023-02-09 17:02:42 -08:00
tastybento 300a80b3e3 Update compiler maven plugin version 2023-02-09 16:59:59 -08:00
tastybento 352ec8d5b2 Fix Jacoco POM entry to enable code scanning 2023-02-09 16:55:44 -08:00
tastybento 20e2ee1e22
Add ${argLine} to get jacoco coverage 2023-02-09 15:08:31 -08:00
BONNe e1a7ed4e77
Merge pull request #487 from BentoBoxWorld/gitlocalize-21678
Update FR
2022-10-31 08:44:13 +02:00
gitlocalize-app[bot] 9c4e4bd15e
Translate fr.yml via GitLocalize 2022-10-31 06:44:04 +00:00
BONNe c2e1fcc91b
Merge pull request #484 from BentoBoxWorld/gitlocalize-21660
Update DE
2022-10-31 08:27:39 +02:00
BONNe 49b81ef81a
Merge pull request #485 from BentoBoxWorld/gitlocalize-21661
Update FR
2022-10-31 08:27:33 +02:00
BONNe 0cdc9c5b65
Merge pull request #486 from BentoBoxWorld/gitlocalize-21662
Update RU
2022-10-31 08:27:27 +02:00
Andrew 04cfa79452 Translate ru.yml via GitLocalize 2022-10-31 06:13:37 +00:00
gitlocalize-app[bot] 5cfbc8f046
Translate fr.yml via GitLocalize 2022-10-31 06:13:23 +00:00
DahliaSR 2238e04709 Translate de.yml via GitLocalize 2022-10-31 06:13:03 +00:00
BONNe fe780a94cd Fix failing unit-test 2022-10-04 15:00:40 +03:00
BONNe 66a37da076 Init next BSkyBlock version 2022-10-04 14:59:54 +03:00
BONNe e20fc256da Update workflow to Java 17 2022-10-04 14:55:05 +03:00
BONNe 44bf473803 Merge remote-tracking branch 'origin/develop' into master
# Conflicts:
#	pom.xml
#	src/main/resources/addon.yml
2022-10-04 14:54:19 +03:00
BONNe c79f7e209b Update to BentoBox 1.21 2022-10-04 14:52:40 +03:00
BONNe 03ff0e9cbd
Update ro.yml (#465)
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1930
2022-02-11 18:07:45 -08:00
gitlocalize-app[bot] 21eacb025d
Translate tr.yml via GitLocalize (#459)
Co-authored-by: trafoziya <omerziyaakay@gmail.com>
2022-01-01 16:54:32 -08:00
gitlocalize-app[bot] 5b73578dee
Romanian translation (#458)
* Translate ro.yml via GitLocalize

* Translate ro.yml via GitLocalize

Co-authored-by: Adi <hlobaadrian@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
2022-01-01 16:54:16 -08:00
gitlocalize-app[bot] d666179f15
Vietnamese translation (#457)
* Translate vi.yml via GitLocalize

* Translate vi.yml via GitLocalize

Co-authored-by: Nguyen Minh An <minh.annguyen264@gmail.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
2022-01-01 16:54:07 -08:00
gitlocalize-app[bot] 048232cf5d
German Translation (#456)
* Translate de.yml via GitLocalize

* Translate de.yml via GitLocalize

Co-authored-by: SrAcosta <gerardo.gomez.acosta@gmail.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
2022-01-01 16:53:50 -08:00
gitlocalize-app[bot] 4ebc7a255c
Translate zh-CN.yml via GitLocalize (#455)
Co-authored-by: MinghuaChiyuan <tianxianshe@outlook.com>
2022-01-01 16:53:40 -08:00
gitlocalize-app[bot] 10a5d137ae
Translate pt.yml via GitLocalize (#454)
Co-authored-by: Ricardo Borsato <ricardoborrb@gmail.com>
2022-01-01 16:53:18 -08:00
gitlocalize-app[bot] 2bc72df3d4
Translate fr.yml via GitLocalize (#453)
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
2022-01-01 16:52:54 -08:00
tastybento 2794465a9d Back support for BentoBox 1.16.5. 2021-10-04 23:01:43 -07:00
tastybento 58966eade8 Build against BentoBox 1.18 API 2021-10-01 17:46:05 -07:00
tastybento 6d3aab0762
Release 1.15.2 (#441)
* Version 1.15.1

* Remove unused comments.

* Reference correct BentoBox API

* Remove sonar plugin. Now use Github actions.

* Change plugin name to Pladdon

* Add informative messages to the options. (#440)

`create-and-link-portals` works only if allow-nether is enabled.
`create-obsidian-platform` works only if allow-end is enabled.

* Allow BentoBox 1.16.5 version

* Version 1.15.2

Co-authored-by: BONNe <bonne@bonne.id.lv>
2021-09-17 07:44:20 -07:00
tastybento b81342ef5e
Merge branch 'master' into develop 2021-09-17 07:43:17 -07:00
tastybento 113ee71736 Version 1.15.2 2021-09-17 07:40:26 -07:00
tastybento 0296fe2301 Merge branch 'develop' of https://github.com/BentoBoxWorld/BSkyBlock.git into develop 2021-09-17 07:38:08 -07:00
tastybento 4243416ca6 Allow BentoBox 1.16.5 version 2021-09-17 07:37:57 -07:00
BONNe 46c38d9b5b
Add informative messages to the options. (#440)
`create-and-link-portals` works only if allow-nether is enabled.
`create-obsidian-platform` works only if allow-end is enabled.
2021-08-19 15:45:26 -07:00
tastybento d1bfbe5e78 Change plugin name to Pladdon 2021-08-12 18:37:52 -07:00
tastybento e95255b190 Remove sonar plugin. Now use Github actions. 2021-07-25 10:22:13 -07:00
tastybento c5316c70c5 Reference correct BentoBox API 2021-07-25 10:21:26 -07:00
tastybento 2586013b9a Remove unused comments. 2021-07-25 10:21:17 -07:00
tastybento 48e731d7db Version 1.15.1 2021-07-03 15:34:37 -07:00
28 changed files with 691 additions and 376 deletions

1
.github/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.DS_Store

View File

@ -11,21 +11,22 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 16
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 16
distribution: 'adopt'
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

15
.github/workflows/modrinth.yml vendored Normal file
View File

@ -0,0 +1,15 @@
name: Modrinth-Release
on:
release:
types: [published]
jobs:
build:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: mc-publish
uses: Kir-Antipov/mc-publish@v3.3
with:
# Publish on Modrinth.
modrinth-id: bskyblock
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/target/
/.classpath
/.DS_Store
/.project
/addon-bskyblock.iml

View File

@ -1,26 +1,25 @@
BSkyBlock
==========
# BSkyBlock
[![Build Status](https://ci.codemc.org/buildStatus/icon?job=BentoBoxWorld/BSkyBlock)](https://ci.codemc.org/job/BentoBoxWorld/job/BSkyBlock/)
[![Lines Of Code](https://sonarcloud.io/api/project_badges/measure?project=world.bentobox%3Abskyblock&metric=ncloc)](https://sonarcloud.io/component_measures?id=world.bentobox%3Abskyblock&metric=ncloc)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=world.bentobox%3Abskyblock&metric=sqale_rating)](https://sonarcloud.io/component_measures?id=world.bentobox%3Abskyblock&metric=Maintainability)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=world.bentobox%3Abskyblock&metric=reliability_rating)](https://sonarcloud.io/component_measures?id=world.bentobox%3Abskyblock&metric=Reliability)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=world.bentobox%3Abskyblock&metric=security_rating)](https://sonarcloud.io/component_measures?id=world.bentobox%3Abskyblock&metric=Security)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=world.bentobox%3Abskyblock&metric=bugs)](https://sonarcloud.io/project/issues?id=world.bentobox%3Abskyblock&resolved=false&types=BUG)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BSkyBlock&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=BentoBoxWorld_BSkyBlock)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BSkyBlock&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=BentoBoxWorld_BSkyBlock)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BSkyBlock&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=BentoBoxWorld_BSkyBlock)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BSkyBlock&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=BentoBoxWorld_BSkyBlock)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BSkyBlock&metric=bugs)](https://sonarcloud.io/summary/new_code?id=BentoBoxWorld_BSkyBlock)
# NOTE
BSkyBlock requires BentoBox, so to run BSkyBlock, you must have BentoBox installed and place BSkyBlock in BentoBox's addon folder.
# Documentation
Go to [docs.bentobox.world](https://docs.bentobox.world).
<img width="509" alt="BSkyBlock" src="https://user-images.githubusercontent.com/4407265/227750292-5617537d-c99a-4a7e-864e-5de990b8c195.png">
## About
Play SkyBlock with your friends! Don't fall! See the config.yml for all the settings.
Play SkyBlock with your friends! Don't fall! See the config.yml for all the settings. This is an addon for BentoBox.
## Documentation
Go to [docs.bentobox.world](https://docs.bentobox.world).
## Installation
1. Install BentoBox and run it on the server at least once to create its data folders.
2. Place this jar in the addons folder of the BentoBox plugin.
2. Place [this jar](https://github.com/BentoBoxWorld/BSkyBlock/releases) in the addons folder of the BentoBox plugin.
3. Restart the server.
4. The addon will create worlds and a data folder and inside the folder will be a config.yml.
5. Stop the server .

61
pom.xml
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.17-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.17.0</bentobox.version>
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.3.0-SNAPSHOT</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.1</build.version>
<build.version>1.18.0</build.version>
<!-- Sonar Cloud -->
<sonar.projectKey>BentoBoxWorld_BSkyBlock</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
@ -219,7 +219,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.1</version>
<configuration>
<release>${java.version}</release>
</configuration>
@ -227,10 +227,38 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.1.2</version>
<!--suppress MavenModelInspection -->
<configuration>
<argLine>
--illegal-access=permit
${argLine}
--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>
@ -244,8 +272,6 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<source>8</source>
<show>private</show>
<failOnError>false</failOnError>
<additionalJOption>-Xdoclint:none</additionalJOption>
<!-- To compile with Java 11, this tag may be required -->
@ -261,7 +287,7 @@
</execution>
</executions>
</plugin>
<plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
@ -287,31 +313,38 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.3</version>
<version>0.8.10</version>
<configuration>
<append>true</append>
<excludes>
<!-- This is required to prevent Jacoco from adding
synthetic fields to a JavaBean class (causes errors in testing) -->
<exclude>**/*Names*</exclude>
<!-- Prevents the Material is too large to mock error -->
<exclude>org/bukkit/Material*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>pre-unit-test</id>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>XML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
</project>

View File

@ -2,6 +2,7 @@ package world.bentobox.bskyblock;
import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.entity.SpawnCategory;
import org.bukkit.WorldCreator;
import org.bukkit.WorldType;
import org.bukkit.event.Listener;
@ -129,24 +130,25 @@ public class BSkyBlock extends GameModeAddon implements Listener {
WorldCreator wc = WorldCreator.name(worldName2).type(WorldType.FLAT).environment(env);
World w = settings.isUseOwnGenerator() ? wc.createWorld() : wc.generator(chunkGenerator2).createWorld();
// Set spawn rates
if (w != null) {
// Set spawn rates
if (w != null && getSettings() != null) {
if (getSettings().getSpawnLimitMonsters() > 0) {
w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters());
w.setSpawnLimit(SpawnCategory.MONSTER, getSettings().getSpawnLimitMonsters());
}
if (getSettings().getSpawnLimitAmbient() > 0) {
w.setAmbientSpawnLimit(getSettings().getSpawnLimitAmbient());
w.setSpawnLimit(SpawnCategory.AMBIENT, getSettings().getSpawnLimitAmbient());
}
if (getSettings().getSpawnLimitAnimals() > 0) {
w.setAnimalSpawnLimit(getSettings().getSpawnLimitAnimals());
w.setSpawnLimit(SpawnCategory.ANIMAL, getSettings().getSpawnLimitAnimals());
}
if (getSettings().getSpawnLimitWaterAnimals() > 0) {
w.setWaterAnimalSpawnLimit(getSettings().getSpawnLimitWaterAnimals());
w.setSpawnLimit(SpawnCategory.WATER_ANIMAL, getSettings().getSpawnLimitWaterAnimals());
}
if (getSettings().getTicksPerAnimalSpawns() > 0) {
w.setTicksPerAnimalSpawns(getSettings().getTicksPerAnimalSpawns());
w.setTicksPerSpawns(SpawnCategory.ANIMAL, getSettings().getTicksPerAnimalSpawns());
}
if (getSettings().getTicksPerMonsterSpawns() > 0) {
w.setTicksPerMonsterSpawns(getSettings().getTicksPerMonsterSpawns());
w.setTicksPerSpawns(SpawnCategory.MONSTER, getSettings().getTicksPerMonsterSpawns());
}
}
return w;

View File

@ -1,8 +1,10 @@
package world.bentobox.bskyblock;
import world.bentobox.bentobox.api.addons.Addon;
import world.bentobox.bentobox.api.addons.Pladdon;
public class BSkyBlockPladdon extends Pladdon {
@Override

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
@ -122,6 +116,10 @@ public class Settings implements WorldSettings {
@ConfigEntry(path = "world.island-height")
private int islandHeight = 120;
@ConfigComment("Disallow team members from having their own islands.")
@ConfigEntry(path = "world.disallow-team-member-islands")
private boolean disallowTeamMemberIslands = false;
@ConfigComment("Use your own world generator for this world.")
@ConfigComment("In this case, the plugin will not generate anything.")
@ConfigComment("If used, you must specify the world name and generator in the bukkit.yml file.")
@ -191,6 +189,7 @@ public class Settings implements WorldSettings {
@ConfigComment("This option indicates if nether portals should be linked via dimensions.")
@ConfigComment("Option will simulate vanilla portal mechanics that links portals together")
@ConfigComment("or creates a new portal, if there is not a portal in that dimension.")
@ConfigComment("This option requires `allow-nether=true` in server.properties.")
@ConfigEntry(path = "world.nether.create-and-link-portals", since = "1.14.4")
private boolean makeNetherPortals = false;
@ -206,6 +205,7 @@ public class Settings implements WorldSettings {
@ConfigComment("This option indicates if obsidian platform in the end should be generated")
@ConfigComment("when player enters the end world.")
@ConfigComment("This option requires `allow-end=true` in bukkit.yml.")
@ConfigEntry(path = "world.end.create-obsidian-platform", since = "1.14.4")
private boolean makeEndPortals = false;
@ -230,13 +230,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")
@ -688,22 +687,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
*/
@ -1095,20 +1129,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
*/
@ -1777,4 +1820,18 @@ public class Settings implements WorldSettings {
public void setMakeEndPortals(boolean makeEndPortals) {
this.makeEndPortals = makeEndPortals;
}
/**
* @return the disallowTeamMemberIslands
*/
public boolean isDisallowTeamMemberIslands() {
return disallowTeamMemberIslands;
}
/**
* @param disallowTeamMemberIslands the disallowTeamMemberIslands to set
*/
public void setDisallowTeamMemberIslands(boolean disallowTeamMemberIslands) {
this.disallowTeamMemberIslands = disallowTeamMemberIslands;
}
}

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);
}
}
@ -122,7 +122,7 @@ public class ChunkGeneratorWorld extends ChunkGenerator {
}
break;
case 2:
// Stalatite
// Stalactite
for (int i = 0; i < rand.nextInt(10); i++) {
setBlock(x, - 8 - i, z, Material.GLOWSTONE);
}

View File

@ -1,95 +1,21 @@
name: BSkyBlock
main: world.bentobox.bskyblock.BSkyBlock
version: ${version}${build.number}
api-version: 1.17
api-version: 1.21.0
metrics: true
icon: "OAK_SAPLING"
repository: "BentoBoxWorld/BSkyBlock"
authors: tastybento
permissions:
bskyblock.island:
description: Allow island command usage
default: true
bskyblock.island.create:
description: Allow island creation
default: true
bskyblock.island.home:
description: Allow teleporting to player island
default: true
bskyblock.island.homes:
description: Allow use of the homes command
default: true
bskyblock.island.sethome:
description: Let the player use the sethome command
default: true
bskyblock.island.info:
description: Let the player use the island info command
default: true
permissions:
# Non-command permissions
bskyblock.island.lock:
description: Allows island locking
default: true
bskyblock.island.near:
description: Players can see nearby island names
default: true
bskyblock.island.expel:
description: Allows expelling of visitors
default: true
bskyblock.island.ban:
description: Allows banning of visitors
default: true
bskyblock.island.settings:
description: Player can see server settings
default: true
bskyblock.island.language:
description: Player can select a language
default: true
bskyblock.island.name:
description: Player can set the name of their island
default: true
bskyblock.island.spawn:
description: Player can use the island spawn command if spawn exists
default: true
bskyblock.island.reset:
description: Player can use the island reset or restart command
default: true
bskyblock.island.team:
description: Let a player use team command
default: true
bskyblock.island.team.setowner:
description: Let a player change the team owner
default: true
bskyblock.island.team.invite:
description: Let a player invite others
default: true
bskyblock.island.team.reject:
description: Let a player reject invites
default: true
bskyblock.island.team.leave:
description: Let a player leave the team
default: true
bskyblock.island.team.kick:
description: Let a player kick team members
default: true
bskyblock.island.team.accept:
description: Let a player accept invitations
default: true
bskyblock.island.team.trust:
description: Let a player use team trust commands
default: true
bskyblock.island.team.coop:
description: Let a player use team coop commands
default: true
bskyblock.island.team.promote:
description: Let a player use promote commands
description: Allows island locking in settings
default: true
bskyblock.settings.*:
description: Allow use of settings on island
default: true
bskyblock.mod.info:
description: Let a moderator see info on a player
default: op
bskyblock.mod.clearreset:
description: Allow clearing of island reset limit
default: false
@ -105,47 +31,14 @@ permissions:
bskyblock.mod.bypassexpel:
description: Allow moderator to bypass island expulsion
default: op
bskyblock.mod.switch:
description: Allows moderator to switch bypass protection on and off
default: op
bskyblock.mod.lock:
description: Locks or unlocks an island
description: Allows lock or unlock of an island
default: op
bskyblock.mod.bypasslock:
description: Bypasses an island lock
default: op
bskyblock.mod.bypassban:
description: Bypasses island ban
default: op
bskyblock.mod.team:
description: Enables modification of teams via kick and add commands
default: false
bskyblock.admin.tp:
description: Allows teleport to an island
default: op
bskyblock.admin.clearresetall:
description: Allow clearing of island reset limit of all players
default: op
bskyblock.admin.reload:
description: Reload the config.yml
default: op
bskyblock.admin.delete:
description: Let a player completely remove a player (including island)
default: op
bskyblock.admin.register:
description: Let a player register the nearest island to another player.
default: op
bskyblock.admin.unregister:
description: Removes a player from an island without deleting the island blocks.
default: op
bskyblock.admin.setspawn:
description: Allows use of spawn tools
default: op
bskyblock.admin.setrange:
description: Allows setting of island protection range
default: op
bskyblock.admin.settingsreset:
description: Resets all the islands to default protection settings
default: op
bskyblock.admin.noban:
description: Player cannot be banned from an island
@ -153,13 +46,250 @@ permissions:
bskyblock.admin.noexpel:
description: Player cannot be expelled from an island
default: op
bskyblock.admin.setlanguage:
description: Resets all player languages and sets the default language
default: op
# Command permissions
bskyblock.island:
description: Allow use of '/island' command - the main island command
default: TRUE
bskyblock.island.home:
description: Allow use of '/island go' command - teleport you to your island
default: TRUE
bskyblock.island.spawn:
description: Allow use of '/island spawn' command - teleport you to the spawn
default: TRUE
bskyblock.island.create:
description: Allow use of '/island create' command - create an island, using optional blueprint (requires permission)
default: TRUE
bskyblock.island.reset:
description: Allow use of '/island reset' command - restart your island and remove the old one
default: TRUE
bskyblock.island.info:
description: Allow use of '/island info' command - display info about your island or the player's island
default: TRUE
bskyblock.island.settings:
description: Allow use of '/island settings' command - display island settings
default: TRUE
bskyblock.island.name:
description: Allow use of '/island setname' or '/island resetname' command - your island name
default: TRUE
bskyblock.island.language:
description: Allow use of '/island language' command - select language
default: TRUE
bskyblock.island.ban:
description: Allow use of '/island ban' or '/island unban' or '/island banlist' command - banned players
default: TRUE
bskyblock.island.expel:
description: Allow use of '/island expel' command - expel a player from your island
default: TRUE
bskyblock.island.near:
description: Allow use of '/island near' command - show the name of neighboring islands around you
default: TRUE
bskyblock.island.team:
description: Allow use of '/island team' command - manage your team
default: TRUE
bskyblock.island.team.invite:
description: Allow use of '/island team invite' command - invite a player to join your island
default: TRUE
bskyblock.island.team.leave:
description: Allow use of '/island team leave' command - leave your island
default: TRUE
bskyblock.island.team.setowner:
description: Allow use of '/island team setowner' command - transfer your island ownership to a member
default: TRUE
bskyblock.island.team.kick:
description: Allow use of '/island team kick' command - remove a member from your island
default: TRUE
bskyblock.island.team.accept:
description: Allow use of '/island team accept' command - accept an invitation
default: TRUE
bskyblock.island.team.reject:
description: Allow use of '/island team reject' command - reject an invitation
default: TRUE
bskyblock.island.team.coop:
description: Allow use of '/island team coop' or '/island team uncoop' command - coop rank from player
default: TRUE
bskyblock.island.team.trust:
description: Allow use of '/island team trust' or '/island team untrust' command - trusted player rank for player
default: TRUE
bskyblock.island.team.promote:
description: Allow use of '/island team promote' or '/island team demote' command - move a player's rank on your island
default: TRUE
bskyblock.island.sethome:
description: Allow use of '/island sethome' command - set your home teleport point
default: TRUE
bskyblock.island.deletehome:
description: Allow use of '/island deletehome' command - delete a home location
default: OP
bskyblock.island.renamehome:
description: Allow use of '/island renamehome' command - rename a home location
default: OP
bskyblock.island.homes:
description: Allow use of '/island homes' command - list your homes
default: TRUE
bskyblock.admin:
description: Allow use of '/bsbadmin' command - admin command
default: OP
bskyblock.admin.version:
description: Allow use of '/bsbadmin version' command - display BentoBox and addons versions
default: OP
bskyblock.admin.tp:
description: Allow use of '/bsbadmin tp/tpnether/tpend' command - teleport to a player's island
default: OP
bskyblock.admin.getrank:
description: Get a player's rank
default: op
description: Allow use of '/bsbadmin getrank' command - get a player's rank on their island or the island of the owner
default: OP
bskyblock.admin.setrank:
description: Set a player's rank
default: op
description: Allow use of '/bsbadmin setrank' command - set a player's rank on their island or the island of the owner
default: OP
bskyblock.mod.info:
description: Allow use of '/bsbadmin info' command - get info on where you are or player's island
default: OP
bskyblock.mod.team:
description: Allow use of '/bsbadmin team' command - manage teams
default: FALSE
bskyblock.mod.team.add:
description: Allow use of '/bsbadmin team add' command - add player to owner's team
default: OP
bskyblock.mod.team.disband:
description: Allow use of '/bsbadmin team disband' command - disband owner's team
default: OP
bskyblock.mod.team.fix:
description: Allow use of '/bsbadmin team fix' command - scans and fixes cross island membership in database
default: OP
bskyblock.mod.team.kick:
description: Allow use of '/bsbadmin team kick' command - kick a player from a team
default: OP
bskyblock.mod.team.setowner:
description: Allow use of '/bsbadmin team setowner' command - transfers island ownership to the player
default: OP
bskyblock.admin.blueprint:
description: Allow use of '/bsbadmin blueprint' command - manipulate blueprints
default: OP
bskyblock.admin.blueprint.load:
description: Allow use of '/bsbadmin blueprint load' command - load blueprint into the clipboard
default: OP
bskyblock.admin.blueprint.paste:
description: Allow use of '/bsbadmin blueprint paste' command - paste the clipboard to your location
default: OP
bskyblock.admin.blueprint.origin:
description: Allow use of '/bsbadmin blueprint origin' command - set the blueprint's origin to your position
default: OP
bskyblock.admin.blueprint.copy:
description: Allow use of '/bsbadmin blueprint copy' command - copy the clipboard set by pos1 and pos2 and optionally the air blocks
default: OP
bskyblock.admin.blueprint.save:
description: Allow use of '/bsbadmin blueprint save' command - save the copied clipboard
default: OP
bskyblock.admin.blueprint.rename:
description: Allow use of '/bsbadmin blueprint rename' command - rename a blueprint
default: OP
bskyblock.admin.blueprint.delete:
description: Allow use of '/bsbadmin blueprint delete' command - delete the blueprint
default: OP
bskyblock.admin.blueprint.pos1:
description: Allow use of '/bsbadmin blueprint pos1' command - set 1st corner of cuboid clipboard
default: OP
bskyblock.admin.blueprint.pos2:
description: Allow use of '/bsbadmin blueprint pos2' command - set 2nd corner of cuboid clipboard
default: OP
bskyblock.admin.blueprint.list:
description: Allow use of '/bsbadmin blueprint list' command - list available blueprints
default: OP
bskyblock.admin.register:
description: Allow use of '/bsbadmin register' command - register player to unowned island you are on
default: OP
bskyblock.admin.unregister:
description: Allow use of '/bsbadmin unregister' command - unregister owner from island, but keep island blocks
default: OP
bskyblock.admin.range:
description: Allow use of '/bsbadmin range' command - admin island range command
default: OP
bskyblock.admin.range.display:
description: Allow use of '/bsbadmin range display' command - show/hide island range indicators
default: OP
bskyblock.admin.range.set:
description: Allow use of '/bsbadmin range set' command - sets the island protected range
default: OP
bskyblock.admin.range.reset:
description: Allow use of '/bsbadmin range reset' command - resets the island protected range to the world default
default: OP
bskyblock.admin.range.add:
description: Allow use of '/bsbadmin range add' command - increases the island protected range
default: OP
bskyblock.admin.range.remove:
description: Allow use of '/bsbadmin range remove' command - decreases the island protected range
default: OP
bskyblock.admin.resets:
description: Allow use of '/bsbadmin resets' command - edit player reset values
default: OP
bskyblock.admin.resets.set:
description: Allow use of '/bsbadmin resets set' command - sets how many times this player has reset his island
default: OP
bskyblock.admin.resets.add:
description: Allow use of '/bsbadmin resets add' command - adds this player's island reset count
default: OP
bskyblock.admin.resets.remove:
description: Allow use of '/bsbadmin resets remove' command - reduces the player's island reset count
default: OP
bskyblock.admin.delete:
description: Allow use of '/bsbadmin delete' command - deletes a player's island
default: OP
bskyblock.admin.why:
description: Allow use of '/bsbadmin why' command - toggle console protection debug reporting
default: OP
bskyblock.admin.deaths:
description: Allow use of '/bsbadmin deaths' command - edit deaths of players
default: OP
bskyblock.admin.deaths.reset:
description: Allow use of '/bsbadmin deaths reset' command - resets deaths of the player
default: OP
bskyblock.admin.deaths.set:
description: Allow use of '/bsbadmin deaths set' command - sets deaths of the player
default: OP
bskyblock.admin.deaths.add:
description: Allow use of '/bsbadmin deaths add' command - adds deaths to the player
default: OP
bskyblock.admin.deaths.remove:
description: Allow use of '/bsbadmin deaths remove' command - removes deaths to the player
default: OP
bskyblock.admin.reload:
description: Allow use of '/bsbadmin reload' command - reload
default: OP
bskyblock.admin.setspawn:
description: Allow use of '/bsbadmin setspawn' command - set an island as spawn for this gamemode
default: OP
bskyblock.admin.setspawnpoint:
description: Allow use of '/bsbadmin setspawnpoint' command - set current location as spawn point for this island
default: OP
bskyblock.admin.resetflags:
description: Allow use of '/bsbadmin resetflags' command - Reset all islands to default flag settings in config.yml
default: OP
bskyblock.mod.switch:
description: Allow use of '/bsbadmin switch' command - switch on/off protection bypass
default: OP
bskyblock.admin.purge:
description: Allow use of '/bsbadmin purge' command - purge islands abandoned for more than [days]
default: OP
bskyblock.admin.purge.status:
description: Allow use of '/bsbadmin purge status' command - displays the status of the purge
default: OP
bskyblock.admin.purge.stop:
description: Allow use of '/bsbadmin purge stop' command - stop a purge in progress
default: OP
bskyblock.admin.purge.unowned:
description: Allow use of '/bsbadmin purge unowned' command - purge unowned islands
default: OP
bskyblock.admin.purge.protect:
description: Allow use of '/bsbadmin purge protect' command - toggle island purge protection
default: OP
bskyblock.admin.settings:
description: Allow use of '/bsbadmin settings' command - open settings GUI or set settings
default: OP
bskyblock.admin.setprotectionlocation:
description: Allow use of '/bsbadmin setprotectionlocation' command - set current location or [x y z] as center of island's protection area
default: OP
bskyblock.mod.deletehomes:
description: Allow use of '/bsbadmin deletehomes' command - deletes all named homes from an island
default: OP
bskyblock.mod.resetname:
description: Allow use of '/bsbadmin resetname' command - reset player island name
default: OP

View File

@ -9,7 +9,7 @@
],
"requirePermission": false,
"blueprints": {
"NORMAL": "classic-lshape",
"NORMAL": "l-shaped",
"NETHER": "nether-island",
"THE_END": "end-island"
},

Binary file not shown.

View File

@ -119,6 +119,7 @@ world:
# This option indicates if nether portals should be linked via dimensions.
# Option will simulate vanilla portal mechanics that links portals together
# or creates a new portal, if there is not a portal in that dimension.
# This option requires `allow-nether=true` in server.properties.
# Added since 1.14.4.
create-and-link-portals: false
end:
@ -130,6 +131,7 @@ world:
islands: true
# This option indicates if obsidian platform in the end should be generated
# when player enters the end world.
# This option requires `allow-end=true` in bukkit.yml.
# Added since 1.14.4.
create-obsidian-platform: false
# /!\ This feature is experimental and might not work as expected or might not work at all.

View File

@ -0,0 +1,7 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: Herzlich Willkommen!
line2: "[name]"
line3: Fall nicht runter! &c<3

View File

@ -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

View File

@ -1,6 +1,7 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: Bem vindo(a)!
line2: "[name]"
line3: Não caia! &c<3
line1: Bem vinda!

View File

@ -0,0 +1,8 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: "Bine ai venit!"
line2: "[name]"
line3: "Sa nu cazi! &c<3"

View File

@ -0,0 +1,7 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: Добро пожаловать!
line2: "[name]"
line3: Не падай! &c <3

View File

@ -0,0 +1,7 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: Hoş Geldin!
line2: "[name]"
line3: Aşağı Düşme! &c<3

View File

@ -0,0 +1,7 @@
---
bskyblock:
sign:
line0: "&cBSkyBlock"
line1: Chào mừng!
line2: "[Tên]"
line3: Đừng ngã xuống! &c<3

View File

@ -1,6 +1,7 @@
---
bskyblock:
sign:
line0: "&c空岛生存"
line1: "欢迎你来到这里!"
line1: 欢迎你来到这里!
line2: "[name]"
line3: "千万不要掉下去! &c<3"
line3: 千万不要掉下去! &c<3

View File

@ -1,8 +1,9 @@
name: BSkyBlock
name: BentoBox-BSkyBlock
main: world.bentobox.bskyblock.BSkyBlockPladdon
version: ${version}
api-version: 1.17
description: A SkyBlock Plugin
author: tastybento
depend:
- BentoBox
version: ${project.version}${build.number}
api-version: "1.19"
authors: [tastybento]
contributors: ["The BentoBoxWorld Community"]
website: https://bentobox.world
description: ${project.description}

View File

@ -4,20 +4,26 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.beans.IntrospectionException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import java.util.logging.Logger;
@ -28,6 +34,7 @@ import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@ -43,6 +50,8 @@ import world.bentobox.bentobox.Settings;
import world.bentobox.bentobox.api.addons.AddonDescription;
import world.bentobox.bentobox.api.configuration.Config;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
import world.bentobox.bentobox.database.DatabaseSetup;
import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.bentobox.managers.AddonsManager;
import world.bentobox.bentobox.managers.CommandsManager;
@ -56,189 +65,215 @@ import world.bentobox.bskyblock.generators.ChunkGeneratorWorld;
*
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({Bukkit.class, BentoBox.class, User.class, Config.class })
@PrepareForTest({ Bukkit.class, BentoBox.class, User.class, Config.class, DatabaseSetup.class })
public class BSkyBlockTest {
@Mock
private User user;
@Mock
private IslandsManager im;
@Mock
private Island island;
@Mock
private User user;
@Mock
private IslandsManager im;
@Mock
private Island island;
private BSkyBlock addon;
@Mock
private BentoBox plugin;
@Mock
private FlagsManager fm;
@Mock
private Settings settings;
private BSkyBlock addon;
@Mock
private BentoBox plugin;
@Mock
private FlagsManager fm;
@Mock
private Settings settings;
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
// Set up plugin
Whitebox.setInternalState(BentoBox.class, "instance", plugin);
when(plugin.getLogger()).thenReturn(Logger.getAnonymousLogger());
// Command manager
CommandsManager cm = mock(CommandsManager.class);
when(plugin.getCommandsManager()).thenReturn(cm);
private static AbstractDatabaseHandler<Object> h;
// Player
Player p = mock(Player.class);
// Sometimes use Mockito.withSettings().verboseLogging()
when(user.isOp()).thenReturn(false);
UUID uuid = UUID.randomUUID();
when(user.getUniqueId()).thenReturn(uuid);
when(user.getPlayer()).thenReturn(p);
when(user.getName()).thenReturn("tastybento");
User.setPlugin(plugin);
@SuppressWarnings("unchecked")
@BeforeClass
public static void beforeClass() throws IllegalAccessException, InvocationTargetException, IntrospectionException {
// This has to be done beforeClass otherwise the tests will interfere with each
// other
h = mock(AbstractDatabaseHandler.class);
// Database
PowerMockito.mockStatic(DatabaseSetup.class);
DatabaseSetup dbSetup = mock(DatabaseSetup.class);
when(DatabaseSetup.getDatabase()).thenReturn(dbSetup);
when(dbSetup.getHandler(any())).thenReturn(h);
when(h.saveObject(any())).thenReturn(CompletableFuture.completedFuture(true));
}
// Island World Manager
IslandWorldManager iwm = mock(IslandWorldManager.class);
when(plugin.getIWM()).thenReturn(iwm);
@After
public void tearDown() throws IOException {
User.clearUsers();
Mockito.framework().clearInlineMocks();
deleteAll(new File("database"));
deleteAll(new File("database_backup"));
deleteAll(new File("addon.jar"));
deleteAll(new File("config.yml"));
deleteAll(new File("addons"));
}
// Player has island to begin with
island = mock(Island.class);
when(im.getIsland(Mockito.any(), Mockito.any(UUID.class))).thenReturn(island);
when(plugin.getIslands()).thenReturn(im);
private void deleteAll(File file) throws IOException {
if (file.exists()) {
Files.walk(file.toPath()).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);
}
// Locales
// Return the reference (USE THIS IN THE FUTURE)
when(user.getTranslation(Mockito.anyString())).thenAnswer((Answer<String>) invocation -> invocation.getArgument(0, String.class));
}
// Server
PowerMockito.mockStatic(Bukkit.class);
Server server = mock(Server.class);
when(Bukkit.getServer()).thenReturn(server);
when(Bukkit.getLogger()).thenReturn(Logger.getAnonymousLogger());
when(Bukkit.getPluginManager()).thenReturn(mock(PluginManager.class));
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
// Set up plugin
Whitebox.setInternalState(BentoBox.class, "instance", plugin);
when(plugin.getLogger()).thenReturn(Logger.getAnonymousLogger());
// Command manager
CommandsManager cm = mock(CommandsManager.class);
when(plugin.getCommandsManager()).thenReturn(cm);
// Addon
addon = new BSkyBlock();
File jFile = new File("addon.jar");
List<String> lines = Arrays.asList("# BSkyBlock Configuration", "uniqueId: config");
Path path = Paths.get("config.yml");
Files.write(path, lines, Charset.forName("UTF-8"));
try (JarOutputStream tempJarOutputStream = new JarOutputStream(new FileOutputStream(jFile))) {
//Added the new files to the jar.
try (FileInputStream fis = new FileInputStream(path.toFile())) {
// Player
Player p = mock(Player.class);
// Sometimes use Mockito.withSettings().verboseLogging()
when(user.isOp()).thenReturn(false);
UUID uuid = UUID.randomUUID();
when(user.getUniqueId()).thenReturn(uuid);
when(user.getPlayer()).thenReturn(p);
when(user.getName()).thenReturn("tastybento");
User.setPlugin(plugin);
byte[] buffer = new byte[1024];
int bytesRead = 0;
JarEntry entry = new JarEntry(path.toString());
tempJarOutputStream.putNextEntry(entry);
while((bytesRead = fis.read(buffer)) != -1) {
tempJarOutputStream.write(buffer, 0, bytesRead);
}
}
}
File dataFolder = new File("addons/BSkyBlock");
addon.setDataFolder(dataFolder);
addon.setFile(jFile);
AddonDescription desc = new AddonDescription.Builder("bentobox", "bskyblock", "1.3").description("test").authors("tasty").build();
addon.setDescription(desc);
// Addons manager
AddonsManager am = mock(AddonsManager.class);
when(plugin.getAddonsManager()).thenReturn(am);
// Island World Manager
IslandWorldManager iwm = mock(IslandWorldManager.class);
when(plugin.getIWM()).thenReturn(iwm);
// Flags manager
when(plugin.getFlagsManager()).thenReturn(fm);
when(fm.getFlags()).thenReturn(Collections.emptyList());
// Player has island to begin with
island = mock(Island.class);
when(im.getIsland(Mockito.any(), Mockito.any(UUID.class))).thenReturn(island);
when(plugin.getIslands()).thenReturn(im);
// Settings
when(plugin.getSettings()).thenReturn(settings);
// Locales
// Return the reference (USE THIS IN THE FUTURE)
when(user.getTranslation(Mockito.anyString()))
.thenAnswer((Answer<String>) invocation -> invocation.getArgument(0, String.class));
}
// Server
PowerMockito.mockStatic(Bukkit.class);
Server server = mock(Server.class);
when(Bukkit.getServer()).thenReturn(server);
when(Bukkit.getLogger()).thenReturn(Logger.getAnonymousLogger());
when(Bukkit.getPluginManager()).thenReturn(mock(PluginManager.class));
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
new File("addon.jar").delete();
new File("config.yml").delete();
new File("addons/BSkyBlock","config.yml").delete();
new File("addons/BSkyBlock").delete();
new File("addons").delete();
}
// Addon
addon = new BSkyBlock();
File jFile = new File("addon.jar");
List<String> lines = Arrays.asList("# BSkyBlock Configuration", "uniqueId: config");
Path path = Paths.get("config.yml");
Files.write(path, lines, Charset.forName("UTF-8"));
try (JarOutputStream tempJarOutputStream = new JarOutputStream(new FileOutputStream(jFile))) {
// Added the new files to the jar.
try (FileInputStream fis = new FileInputStream(path.toFile())) {
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#onLoad()}.
*/
@Test
public void testOnLoad() {
addon.onLoad();
// Check that config.yml file has been saved
File check = new File("addons/BSkyBlock","config.yml");
assertTrue(check.exists());
}
byte[] buffer = new byte[1024];
int bytesRead = 0;
JarEntry entry = new JarEntry(path.toString());
tempJarOutputStream.putNextEntry(entry);
while ((bytesRead = fis.read(buffer)) != -1) {
tempJarOutputStream.write(buffer, 0, bytesRead);
}
}
}
File dataFolder = new File("addons/BSkyBlock");
addon.setDataFolder(dataFolder);
addon.setFile(jFile);
AddonDescription desc = new AddonDescription.Builder("bentobox", "bskyblock", "1.3").description("test")
.authors("tasty").build();
addon.setDescription(desc);
// Addons manager
AddonsManager am = mock(AddonsManager.class);
when(plugin.getAddonsManager()).thenReturn(am);
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#onEnable()}.
*/
@Test
public void testOnEnable() {
testOnLoad();
addon.onEnable();
assertTrue(addon.getPlayerCommand().isPresent());
assertTrue(addon.getAdminCommand().isPresent());
}
// Flags manager
when(plugin.getFlagsManager()).thenReturn(fm);
when(fm.getFlags()).thenReturn(Collections.emptyList());
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#onReload()}.
*/
@Test
public void testOnReload() {
addon.onReload();
// Check that config.yml file has been saved
File check = new File("addons/BSkyBlock","config.yml");
assertTrue(check.exists());
}
// Settings
when(plugin.getSettings()).thenReturn(settings);
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#createWorlds()}.
*/
@Test
public void testCreateWorlds() {
addon.onLoad();
addon.createWorlds();
Mockito.verify(plugin).log("[bskyblock] Creating BSkyBlock world ...");
Mockito.verify(plugin).log("[bskyblock] Creating BSkyBlock's Nether...");
Mockito.verify(plugin).log("[bskyblock] Creating BSkyBlock's End World...");
}
}
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#getSettings()}.
*/
@Test
public void testGetSettings() {
addon.onLoad();
assertNotNull(addon.getSettings());
}
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#onLoad()}.
*/
@Test
public void testOnLoad() {
addon.onLoad();
// Check that config.yml file has been saved
File check = new File("addons/BSkyBlock", "config.yml");
assertTrue(check.exists());
}
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#getWorldSettings()}.
*/
@Test
public void testGetWorldSettings() {
addon.onLoad();
assertEquals(addon.getSettings(), addon.getWorldSettings());
}
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#onEnable()}.
*/
@Test
public void testOnEnable() {
testOnLoad();
addon.onEnable();
assertTrue(addon.getPlayerCommand().isPresent());
assertTrue(addon.getAdminCommand().isPresent());
}
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#getDefaultWorldGenerator(java.lang.String, java.lang.String)}.
*/
@Test
public void testGetDefaultWorldGeneratorStringString() {
assertNull(addon.getDefaultWorldGenerator("", ""));
addon.onLoad();
addon.createWorlds();
assertNotNull(addon.getDefaultWorldGenerator("", ""));
assertTrue(addon.getDefaultWorldGenerator("", "") instanceof ChunkGeneratorWorld);
}
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#onReload()}.
*/
@Test
public void testOnReload() {
addon.onReload();
// Check that config.yml file has been saved
File check = new File("addons/BSkyBlock", "config.yml");
assertTrue(check.exists());
}
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#createWorlds()}.
*/
@Test
public void testCreateWorlds() {
addon.onLoad();
addon.createWorlds();
Mockito.verify(plugin).log("[bskyblock] Creating BSkyBlock world ...");
Mockito.verify(plugin).log("[bskyblock] Creating BSkyBlock's Nether...");
Mockito.verify(plugin).log("[bskyblock] Creating BSkyBlock's End World...");
}
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#getSettings()}.
*/
@Test
public void testGetSettings() {
addon.onLoad();
assertNotNull(addon.getSettings());
}
/**
* Test method for
* {@link world.bentobox.bskyblock.BSkyBlock#getWorldSettings()}.
*/
@Test
public void testGetWorldSettings() {
addon.onLoad();
assertEquals(addon.getSettings(), addon.getWorldSettings());
}
/**
* Test method for
* {@link world.bentobox.bskyblock.BSkyBlock#getDefaultWorldGenerator(java.lang.String, java.lang.String)}.
*/
@Test
public void testGetDefaultWorldGeneratorStringString() {
assertNull(addon.getDefaultWorldGenerator("", ""));
addon.onLoad();
addon.createWorlds();
assertNotNull(addon.getDefaultWorldGenerator("", ""));
assertTrue(addon.getDefaultWorldGenerator("", "") instanceof ChunkGeneratorWorld);
}
}

View File

@ -33,7 +33,7 @@ public class IslandAboutCommandTest {
User user = mock(User.class);
c.execute(user, "", Collections.emptyList());
// Verify
Mockito.verify(user).sendRawMessage(Mockito.eq("Copyright (c) 2017 - 2020 tastybento, Poslovitch"));
Mockito.verify(user).sendRawMessage(Mockito.eq("Copyright (c) 2017 - 2022 tastybento, Poslovitch"));
Mockito.verify(user).sendRawMessage(Mockito.eq("About BSkyBlock 1.2.3:"));
}