Compare commits
121 Commits
Author | SHA1 | Date |
---|---|---|
tastybento | d272873410 | |
tastybento | 706178d3d5 | |
tastybento | 72274c0174 | |
tastybento | e532e5fad5 | |
tastybento | 935884c94d | |
tastybento | afa1ae028f | |
tastybento | 9599935527 | |
tastybento | bc19f352e5 | |
tastybento | 32251d4e48 | |
tastybento | 25fba16138 | |
tastybento | 246a4d4185 | |
tastybento | d066e58b32 | |
tastybento | 24b963fa9c | |
tastybento | d47493c906 | |
tastybento | 5cde5b624b | |
tastybento | 01e6f9263b | |
tastybento | 44d8e1ce39 | |
tastybento | 0e0c0b24f2 | |
tastybento | 6cbf4eee77 | |
tastybento | 6c91835e8f | |
tastybento | ffd5e9fcd5 | |
tastybento | 7a67d2b7f6 | |
tastybento | 98d3a55c50 | |
tastybento | cefefefa93 | |
tastybento | 48967eff87 | |
tastybento | 27e67fb123 | |
tastybento | 8a97bca2a0 | |
gitlocalize-app[bot] | 036d7934d8 | |
BONNe | 844996fe3a | |
BONNe | f44c6fa2a8 | |
tastybento | e88ee17d1c | |
BONNe | 41414ccb26 | |
BONNe | 0efc1af21f | |
BONNe | 92b7366159 | |
BONNe | f341e05ba4 | |
tastybento | 55e7732b82 | |
tastybento | dee662b4b6 | |
tastybento | 12092cb89f | |
tastybento | 9d4d671168 | |
tastybento | 7e7512549c | |
blombergs5 | 11201c7758 | |
tastybento | 86d6eb1da6 | |
tastybento | 300a80b3e3 | |
tastybento | 352ec8d5b2 | |
tastybento | 20e2ee1e22 | |
BONNe | e1a7ed4e77 | |
gitlocalize-app[bot] | 9c4e4bd15e | |
BONNe | c2e1fcc91b | |
BONNe | 49b81ef81a | |
BONNe | 0cdc9c5b65 | |
Andrew | 04cfa79452 | |
gitlocalize-app[bot] | 5cfbc8f046 | |
DahliaSR | 2238e04709 | |
BONNe | fe780a94cd | |
BONNe | 66a37da076 | |
BONNe | e20fc256da | |
BONNe | 44bf473803 | |
BONNe | c79f7e209b | |
BONNe | 03ff0e9cbd | |
gitlocalize-app[bot] | 21eacb025d | |
gitlocalize-app[bot] | 5b73578dee | |
gitlocalize-app[bot] | d666179f15 | |
gitlocalize-app[bot] | 048232cf5d | |
gitlocalize-app[bot] | 4ebc7a255c | |
gitlocalize-app[bot] | 10a5d137ae | |
gitlocalize-app[bot] | 2bc72df3d4 | |
tastybento | 2794465a9d | |
tastybento | 58966eade8 | |
tastybento | 6d3aab0762 | |
tastybento | b81342ef5e | |
tastybento | 113ee71736 | |
tastybento | 0296fe2301 | |
tastybento | 4243416ca6 | |
BONNe | 46c38d9b5b | |
tastybento | d1bfbe5e78 | |
tastybento | e8047b5868 | |
tastybento | e95255b190 | |
tastybento | c5316c70c5 | |
tastybento | 2586013b9a | |
tastybento | 48e731d7db | |
tastybento | 52e1ee4c78 | |
tastybento | 02633a2b60 | |
tastybento | 55f27390a9 | |
tastybento | 9707d98eb8 | |
tastybento | 33a34aab44 | |
tastybento | a388f806cb | |
BONNe | 045d81aac6 | |
tastybento | 4dac6515f2 | |
tastybento | c06c089429 | |
tastybento | 2c299b4a88 | |
tastybento | e1b150934f | |
tastybento | 316d5eb33e | |
Dark_Ville | c16ed5089f | |
tastybento | 6a0ace8a1a | |
tastybento | 32ccd0cbb5 | |
tastybento | 793a971222 | |
tastybento | 358f1069f3 | |
BONNe | 718ec2979e | |
BONNe | 58ecd1ce1f | |
tastybento | 440f4694de | |
tastybento | f41cf8b3a1 | |
tastybento | 4e99aaa525 | |
tastybento | 86a078e31f | |
tastybento | 78067971f6 | |
tastybento | 295471acc6 | |
tastybento | 730ab03795 | |
tastybento | f5c6a08aeb | |
gitlocalize-app[bot] | cf9cd3b52d | |
gitlocalize-app[bot] | 4427a524f1 | |
tastybento | 97c29e31e6 | |
tastybento | b354793f03 | |
tastybento | 763b039b03 | |
tastybento | 00b37a0264 | |
tastybento | 6833fb011a | |
tastybento | 27edda539c | |
tastybento | 3a5a866ea5 | |
tastybento | 1016d73545 | |
tastybento | af0838d8e4 | |
tastybento | b3a613ed2a | |
tastybento | e5b01a1647 | |
opticyclic | f8dc0bea98 |
|
@ -0,0 +1 @@
|
|||
.DS_Store
|
|
@ -0,0 +1,38 @@
|
|||
name: Build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- master
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: 17
|
||||
- name: Cache SonarCloud packages
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.sonar/cache
|
||||
key: ${{ runner.os }}-sonar
|
||||
restore-keys: ${{ runner.os }}-sonar
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-m2
|
||||
- name: Build and analyze
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
|
|
@ -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 }}
|
|
@ -0,0 +1,5 @@
|
|||
/target/
|
||||
/.classpath
|
||||
/.DS_Store
|
||||
/.project
|
||||
/addon-bskyblock.iml
|
21
.travis.yml
21
.travis.yml
|
@ -1,21 +0,0 @@
|
|||
language: java
|
||||
sudo: false
|
||||
addons:
|
||||
sonarcloud:
|
||||
organization: "bentobox-world"
|
||||
|
||||
jdk:
|
||||
- openjdk8
|
||||
- openjdk11
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- jdk: openjdk11
|
||||
|
||||
|
||||
script:
|
||||
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=BentoBoxWorld_BSkyBlock
|
||||
cache:
|
||||
directories:
|
||||
- '$HOME/.m2/repository'
|
||||
- '$HOME/.sonar/cache'
|
38
README.md
38
README.md
|
@ -1,22 +1,25 @@
|
|||
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)
|
||||
# BSkyBlock
|
||||
|
||||
# NOTE
|
||||
BSkyBlock requires BentoBox, so to run BSkyBlock, you must have BentoBox installed and place BSkyBlock in BentoBox's addon folder.
|
||||
[![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=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)
|
||||
|
||||
<img width="509" alt="BSkyBlock" src="https://user-images.githubusercontent.com/4407265/227750292-5617537d-c99a-4a7e-864e-5de990b8c195.png">
|
||||
|
||||
## About
|
||||
BSkyBlock provides a skyblock-type Minecraft game for players that supports a default set of 3 islands (overworld, nether and end), protection of islands, team and coop play and other features. Please 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 .
|
||||
|
@ -24,17 +27,6 @@ BSkyBlock provides a skyblock-type Minecraft game for players that supports a de
|
|||
7. Delete any worlds that were created by default if you made changes that would affect them.
|
||||
8. Restart the server.
|
||||
|
||||
## Config.yml
|
||||
|
||||
The config.yml is similar to ASkyBlock but *not the same*. Note that distance between islands and protection range are **radius values** so the island size will be twice these values in blocks! Also, the distance between islands will be set automatically to a chunk boundary (a multiple of 16 blocks).
|
||||
|
||||
|
||||
### Other Add-ons
|
||||
|
||||
BSkyBlock is an add-on that uses the BentoBox API. Here are some other ones that you may be interested in:
|
||||
|
||||
* [**Addons**](https://github.com/BentoBoxWorld/BentoBox/blob/develop/ADDON.md)
|
||||
|
||||
Bugs and Feature requests
|
||||
=========================
|
||||
File bug and feature requests here: https://github.com/BentoBoxWorld/BSkyBlock/issues
|
||||
|
|
105
pom.xml
105
pom.xml
|
@ -54,18 +54,22 @@
|
|||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<java.version>17</java.version>
|
||||
<!-- Non-minecraft related dependencies -->
|
||||
<powermock.version>2.0.2</powermock.version>
|
||||
<powermock.version>2.0.9</powermock.version>
|
||||
<!-- More visible way how to change dependency versions -->
|
||||
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
|
||||
<bentobox.version>1.13.1</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.13.1</build.version>
|
||||
<build.version>1.18.0</build.version>
|
||||
<!-- Sonar Cloud -->
|
||||
<sonar.projectKey>BentoBoxWorld_BSkyBlock</sonar.projectKey>
|
||||
<sonar.organization>bentobox-world</sonar.organization>
|
||||
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
|
||||
</properties>
|
||||
|
||||
<!-- Profiles will allow to automatically change build version. -->
|
||||
|
@ -108,30 +112,6 @@
|
|||
<build.number></build.number>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>sonar</id>
|
||||
<properties>
|
||||
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
|
||||
<sonar.organization>tastybento-github</sonar.organization>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
<version>3.4.1.1168</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sonar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
|
@ -161,7 +141,7 @@
|
|||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -239,16 +219,48 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<release>${java.version}</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.0</version>
|
||||
<version>3.1.2</version>
|
||||
<!--suppress MavenModelInspection -->
|
||||
<configuration>
|
||||
<argLine>
|
||||
${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>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -258,15 +270,17 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<show>public</show>
|
||||
<failOnError>false</failOnError>
|
||||
<additionalJOption>-Xdoclint:none</additionalJOption>
|
||||
<!-- To compile with Java 11, this tag may be required -->
|
||||
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
|
@ -299,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) -->
|
||||
<!-- 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>
|
||||
|
|
|
@ -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;
|
||||
|
@ -29,7 +30,7 @@ public class BSkyBlock extends GameModeAddon implements Listener {
|
|||
// Settings
|
||||
private Settings settings;
|
||||
private ChunkGeneratorWorld chunkGenerator;
|
||||
private Config<Settings> configObject = new Config<>(this, Settings.class);
|
||||
private final Config<Settings> configObject = new Config<>(this, Settings.class);
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
|
@ -129,13 +130,26 @@ 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) {
|
||||
w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters());
|
||||
w.setAmbientSpawnLimit(getSettings().getSpawnLimitAmbient());
|
||||
w.setAnimalSpawnLimit(getSettings().getSpawnLimitAnimals());
|
||||
w.setWaterAnimalSpawnLimit(getSettings().getSpawnLimitWaterAnimals());
|
||||
w.setTicksPerAnimalSpawns(getSettings().getTicksPerAnimalSpawns());
|
||||
w.setTicksPerMonsterSpawns(getSettings().getTicksPerMonsterSpawns());
|
||||
// Set spawn rates
|
||||
if (w != null && getSettings() != null) {
|
||||
if (getSettings().getSpawnLimitMonsters() > 0) {
|
||||
w.setSpawnLimit(SpawnCategory.MONSTER, getSettings().getSpawnLimitMonsters());
|
||||
}
|
||||
if (getSettings().getSpawnLimitAmbient() > 0) {
|
||||
w.setSpawnLimit(SpawnCategory.AMBIENT, getSettings().getSpawnLimitAmbient());
|
||||
}
|
||||
if (getSettings().getSpawnLimitAnimals() > 0) {
|
||||
w.setSpawnLimit(SpawnCategory.ANIMAL, getSettings().getSpawnLimitAnimals());
|
||||
}
|
||||
if (getSettings().getSpawnLimitWaterAnimals() > 0) {
|
||||
w.setSpawnLimit(SpawnCategory.WATER_ANIMAL, getSettings().getSpawnLimitWaterAnimals());
|
||||
}
|
||||
if (getSettings().getTicksPerAnimalSpawns() > 0) {
|
||||
w.setTicksPerSpawns(SpawnCategory.ANIMAL, getSettings().getTicksPerAnimalSpawns());
|
||||
}
|
||||
if (getSettings().getTicksPerMonsterSpawns() > 0) {
|
||||
w.setTicksPerSpawns(SpawnCategory.MONSTER, getSettings().getTicksPerMonsterSpawns());
|
||||
}
|
||||
}
|
||||
return w;
|
||||
|
||||
|
@ -163,8 +177,7 @@ public class BSkyBlock extends GameModeAddon implements Listener {
|
|||
*/
|
||||
@Override
|
||||
public void allLoaded() {
|
||||
// Reload settings and save them. This will occur after all addons have loaded
|
||||
this.loadSettings();
|
||||
// Save settings. This will occur after all addons have loaded
|
||||
this.saveWorldSettings();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package world.bentobox.bskyblock;
|
||||
|
||||
|
||||
import world.bentobox.bentobox.api.addons.Addon;
|
||||
import world.bentobox.bentobox.api.addons.Pladdon;
|
||||
|
||||
|
||||
public class BSkyBlockPladdon extends Pladdon {
|
||||
|
||||
@Override
|
||||
public Addon getAddon() {
|
||||
return new BSkyBlock();
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package world.bentobox.bskyblock;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.google.common.io.Files;
|
||||
|
||||
import world.bentobox.bentobox.api.events.BentoBoxReadyEvent;
|
||||
|
||||
public class CopyToBentoBox extends JavaPlugin implements Listener {
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
Bukkit.getPluginManager().registerEvents(this, this);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBentoBoxReady(BentoBoxReadyEvent e) {
|
||||
getLogger().severe("BSkyBlock.jar must be in the BentoBox/addons folder! Trying to move it there...");
|
||||
File addons = new File(getFile().getParent(), "BentoBox/addons");
|
||||
if (addons.exists()) {
|
||||
File to = new File(addons, getFile().getName());
|
||||
if (!to.exists()) {
|
||||
|
||||
try {
|
||||
Files.move(getFile(), to);
|
||||
getLogger().severe(getFile().getName() + " moved successfully. Restart server now to activate!");
|
||||
|
||||
} catch (IOException ex) {
|
||||
getLogger().severe("Failed to move it. " + ex.getMessage());
|
||||
getLogger().severe("Move " + getFile().getName() + " manually into the BentoBox/addons folder. Then restart server.");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
getLogger().severe("BentoBox folders do not exist! " + addons.getAbsolutePath());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,16 +1,14 @@
|
|||
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;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
|
||||
import com.google.common.base.Enums;
|
||||
|
||||
import world.bentobox.bentobox.api.configuration.ConfigComment;
|
||||
import world.bentobox.bentobox.api.configuration.ConfigEntry;
|
||||
|
@ -18,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
|
||||
|
@ -95,7 +92,7 @@ public class Settings implements WorldSettings {
|
|||
@ConfigComment("Default protection range radius in blocks. Cannot be larger than distance.")
|
||||
@ConfigComment("Admins can change protection sizes for players individually using /bsbadmin range set <player> <new range>")
|
||||
@ConfigComment("or set this permission: bskyblock.island.range.<number>")
|
||||
@ConfigEntry(path = "world.protection-range", needsReset = true)
|
||||
@ConfigEntry(path = "world.protection-range")
|
||||
private int islandProtectionRange = 50;
|
||||
|
||||
@ConfigComment("Start islands at these coordinates. This is where new islands will start in the")
|
||||
|
@ -119,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.")
|
||||
|
@ -146,6 +147,12 @@ public class Settings implements WorldSettings {
|
|||
@ConfigComment("The default biome for the overworld")
|
||||
@ConfigEntry(path = "world.default-biome")
|
||||
private Biome defaultBiome = Biome.PLAINS;
|
||||
@ConfigComment("The default biome for the nether world (this may affect what mobs can spawn)")
|
||||
@ConfigEntry(path = "world.default-nether-biome")
|
||||
private Biome defaultNetherBiome = Enums.getIfPresent(Biome.class, "NETHER").or(Enums.getIfPresent(Biome.class, "NETHER_WASTES").or(Biome.BADLANDS));
|
||||
@ConfigComment("The default biome for the end world (this may affect what mobs can spawn)")
|
||||
@ConfigEntry(path = "world.default-end-biome")
|
||||
private Biome defaultEndBiome = Biome.THE_END;
|
||||
|
||||
@ConfigComment("The maximum number of players a player can ban at any one time in this game mode.")
|
||||
@ConfigComment("The permission acidisland.ban.maxlimit.X where X is a number can also be used per player")
|
||||
|
@ -179,13 +186,29 @@ public class Settings implements WorldSettings {
|
|||
@ConfigEntry(path = "world.nether.spawn-radius")
|
||||
private int netherSpawnRadius = 32;
|
||||
|
||||
@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;
|
||||
|
||||
// End
|
||||
@ConfigComment("End Nether - if this is false, the end world will not be made and access to")
|
||||
@ConfigComment("the end will not occur. Other plugins may still enable portal usage.")
|
||||
@ConfigEntry(path = "world.end.generate")
|
||||
private boolean endGenerate = true;
|
||||
|
||||
@ConfigComment("Islands in The End. Change to false for standard vanilla end.")
|
||||
@ConfigEntry(path = "world.end.islands", needsReset = true)
|
||||
private boolean endIslands = true;
|
||||
|
||||
@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;
|
||||
|
||||
@ConfigEntry(path = "world.end.dragon-spawn", experimental = true)
|
||||
private boolean dragonSpawn = false;
|
||||
|
||||
|
@ -207,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")
|
||||
|
@ -411,13 +433,30 @@ public class Settings implements WorldSettings {
|
|||
@ConfigEntry(path = "island.commands.on-leave", since = "1.8.0")
|
||||
private List<String> onLeaveCommands = new ArrayList<>();
|
||||
|
||||
@ConfigComment("List of commands that should be executed when the player respawns after death if Flags.ISLAND_RESPAWN is true.")
|
||||
@ConfigComment("These commands are run by the console, unless otherwise stated using the [SUDO] prefix,")
|
||||
@ConfigComment("in which case they are executed by the player.")
|
||||
@ConfigComment("")
|
||||
@ConfigComment("Available placeholders for the commands are the following:")
|
||||
@ConfigComment(" * [name]: name of the player")
|
||||
@ConfigComment("")
|
||||
@ConfigComment("Here are some examples of valid commands to execute:")
|
||||
@ConfigComment(" * '[SUDO] bbox version'")
|
||||
@ConfigComment(" * 'bsbadmin deaths set [player] 0'")
|
||||
@ConfigComment("")
|
||||
@ConfigComment("Note that player-executed commands might not work, as these commands can be run with said player being offline.")
|
||||
@ConfigEntry(path = "island.commands.on-respawn", since = "1.14.0")
|
||||
private List<String> onRespawnCommands = new ArrayList<>();
|
||||
|
||||
// Sethome
|
||||
@ConfigComment("Allow setting home in the nether. Only available on nether islands, not vanilla nether.")
|
||||
@ConfigEntry(path = "island.sethome.nether.allow")
|
||||
private boolean allowSetHomeInNether = true;
|
||||
|
||||
@ConfigEntry(path = "island.sethome.nether.require-confirmation")
|
||||
private boolean requireConfirmationToSetHomeInNether = true;
|
||||
|
||||
@ConfigComment("Allow setting home in the end. Only available on end islands, not vanilla end.")
|
||||
@ConfigEntry(path = "island.sethome.the-end.allow")
|
||||
private boolean allowSetHomeInTheEnd = true;
|
||||
|
||||
|
@ -453,7 +492,7 @@ public class Settings implements WorldSettings {
|
|||
@ConfigComment("List of mobs that should not spawn in BSkyBlock.")
|
||||
@ConfigEntry(path = "protection.block-mobs", since = "1.13.1")
|
||||
private List<String> mobLimitSettings = new ArrayList<>();
|
||||
|
||||
|
||||
// Invincible visitor settings
|
||||
@ConfigComment("Invincible visitors. List of damages that will not affect visitors.")
|
||||
@ConfigComment("Make list blank if visitors should receive all damages")
|
||||
|
@ -648,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
|
||||
*/
|
||||
|
@ -1055,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
|
||||
*/
|
||||
|
@ -1376,6 +1459,25 @@ public class Settings implements WorldSettings {
|
|||
this.onLeaveCommands = onLeaveCommands;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the onRespawnCommands
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
public List<String> getOnRespawnCommands() {
|
||||
return onRespawnCommands;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets on respawn commands.
|
||||
*
|
||||
* @param onRespawnCommands the on respawn commands
|
||||
*/
|
||||
public void setOnRespawnCommands(List<String> onRespawnCommands) {
|
||||
this.onRespawnCommands = onRespawnCommands;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the onJoinResetHealth
|
||||
*/
|
||||
|
@ -1613,7 +1715,7 @@ public class Settings implements WorldSettings {
|
|||
public void setMaxTrustSize(int maxTrustSize) {
|
||||
this.maxTrustSize = maxTrustSize;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the defaultNewPlayerAction
|
||||
*/
|
||||
|
@ -1658,4 +1760,78 @@ public class Settings implements WorldSettings {
|
|||
public void setMobLimitSettings(List<String> mobLimitSettings) {
|
||||
this.mobLimitSettings = mobLimitSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the defaultNetherBiome
|
||||
*/
|
||||
public Biome getDefaultNetherBiome() {
|
||||
return defaultNetherBiome;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultNetherBiome the defaultNetherBiome to set
|
||||
*/
|
||||
public void setDefaultNetherBiome(Biome defaultNetherBiome) {
|
||||
this.defaultNetherBiome = defaultNetherBiome;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the defaultEndBiome
|
||||
*/
|
||||
public Biome getDefaultEndBiome() {
|
||||
return defaultEndBiome;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultEndBiome the defaultEndBiome to set
|
||||
*/
|
||||
public void setDefaultEndBiome(Biome defaultEndBiome) {
|
||||
this.defaultEndBiome = defaultEndBiome;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the makeNetherPortals
|
||||
*/
|
||||
@Override
|
||||
public boolean isMakeNetherPortals() {
|
||||
return makeNetherPortals;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the makeEndPortals
|
||||
*/
|
||||
@Override
|
||||
public boolean isMakeEndPortals() {
|
||||
return makeEndPortals;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets make nether portals.
|
||||
* @param makeNetherPortals the make nether portals
|
||||
*/
|
||||
public void setMakeNetherPortals(boolean makeNetherPortals) {
|
||||
this.makeNetherPortals = makeNetherPortals;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets make end portals.
|
||||
* @param makeEndPortals the make end portals
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -25,7 +25,7 @@ public class ChunkGeneratorWorld extends ChunkGenerator {
|
|||
|
||||
private final BSkyBlock addon;
|
||||
private final Random rand = new Random();
|
||||
private Map<Vector, Material> roofChunk = new HashMap<>();
|
||||
private final Map<Vector, Material> roofChunk = new HashMap<>();
|
||||
|
||||
/**
|
||||
* @param addon - addon
|
||||
|
@ -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));
|
||||
|
@ -49,17 +49,20 @@ public class ChunkGeneratorWorld extends ChunkGenerator {
|
|||
|
||||
@Override
|
||||
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biomeGrid) {
|
||||
if (world.getEnvironment().equals(Environment.NORMAL)) setBiome(biomeGrid);
|
||||
setBiome(world, biomeGrid);
|
||||
return generateChunks(world);
|
||||
}
|
||||
|
||||
private void setBiome(BiomeGrid biomeGrid) {
|
||||
Biome biome = addon.getSettings().getDefaultBiome();
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
biomeGrid.setBiome(x, z, biome);
|
||||
private void setBiome(World world, BiomeGrid biomeGrid) {
|
||||
Biome biome = world.getEnvironment() == Environment.NORMAL ? addon.getSettings().getDefaultBiome() :
|
||||
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 = world.getMinHeight(); y < world.getMaxHeight(); y+=4) {
|
||||
biomeGrid.setBiome(x, y, z, biome);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -119,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);
|
||||
}
|
||||
|
|
|
@ -1,92 +1,21 @@
|
|||
name: BSkyBlock
|
||||
main: world.bentobox.bskyblock.BSkyBlock
|
||||
version: ${version}${build.number}
|
||||
api-version: 1.13.0
|
||||
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.sethome:
|
||||
description: Let the player use the sethome command
|
||||
default: true
|
||||
bskyblock.island.info:
|
||||
description: Let the player check other players info
|
||||
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
|
||||
|
@ -102,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
|
||||
|
@ -150,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
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"uniqueId": "classic-island",
|
||||
"icon": "DIRT_PATH",
|
||||
"displayName": "&bClassic L Island",
|
||||
"description": [
|
||||
"&2The Classic &6L-Shaped",
|
||||
"&2Skyblock Island!",
|
||||
"&eVery hard!"
|
||||
],
|
||||
"requirePermission": false,
|
||||
"blueprints": {
|
||||
"NORMAL": "l-shaped",
|
||||
"NETHER": "nether-island",
|
||||
"THE_END": "end-island"
|
||||
},
|
||||
"slot": 3
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"uniqueId": "default",
|
||||
"icon": "GRASS",
|
||||
"icon": "GRASS_BLOCK",
|
||||
"displayName": "&eThe Original SkyBlock",
|
||||
"description": [
|
||||
"&bStandard island, with a cow - moo!",
|
||||
|
@ -13,5 +13,6 @@
|
|||
"NORMAL": "island",
|
||||
"NETHER": "nether-island",
|
||||
"THE_END": "end-island"
|
||||
}
|
||||
},
|
||||
"slot": 0
|
||||
}
|
Binary file not shown.
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"uniqueId": "double_island",
|
||||
"icon": "FURNACE",
|
||||
"displayName": "Double Island",
|
||||
"displayName": "&cDouble Island",
|
||||
"description": [
|
||||
"Two islands in one!",
|
||||
"Can you reach the",
|
||||
"desert?"
|
||||
"&bTwo islands in one!",
|
||||
"&bCan you reach the",
|
||||
"&bdesert?"
|
||||
],
|
||||
"requirePermission": false,
|
||||
"blueprints": {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"uniqueId": "harder_island",
|
||||
"icon": "SNOWBALL",
|
||||
"displayName": "Harder Island",
|
||||
"displayName": "&7Harder Island",
|
||||
"description": [
|
||||
"This island is",
|
||||
"much harder.",
|
||||
"Beware the lava!"
|
||||
"&fThis island is",
|
||||
"&fmuch harder and cold.",
|
||||
"&fBeware the &6lava&f!"
|
||||
],
|
||||
"requirePermission": false,
|
||||
"blueprints": {
|
||||
|
|
Binary file not shown.
|
@ -55,7 +55,6 @@ world:
|
|||
# Default protection range radius in blocks. Cannot be larger than distance.
|
||||
# Admins can change protection sizes for players individually using /bsbadmin range set <player> <new range>
|
||||
# or set this permission: bskyblock.island.range.<number>
|
||||
# /!\ BentoBox currently does not support changing this value mid-game. If you do need to change it, do a full reset of your databases and worlds.
|
||||
protection-range: 50
|
||||
# Start islands at these coordinates. This is where new islands will start in the
|
||||
# world. These must be a factor of your island distance, but the plugin will auto
|
||||
|
@ -70,7 +69,7 @@ world:
|
|||
offset-z: 0
|
||||
# Island height - Lowest is 5.
|
||||
# It is the y coordinate of the bedrock block in the schem.
|
||||
island-height: 120
|
||||
island-height: 80
|
||||
# Use your own world generator for this world.
|
||||
# In this case, the plugin will not generate anything.
|
||||
# If used, you must specify the world name and generator in the bukkit.yml file.
|
||||
|
@ -90,6 +89,10 @@ world:
|
|||
default-game-mode: SURVIVAL
|
||||
# The default biome for the overworld
|
||||
default-biome: PLAINS
|
||||
# The default biome for the nether world (this may affect what mobs can spawn)
|
||||
default-nether-biome: NETHER_WASTES
|
||||
# The default biome for the end world (this may affect what mobs can spawn)
|
||||
default-end-biome: THE_END
|
||||
# The maximum number of players a player can ban at any one time in this game mode.
|
||||
# The permission acidisland.ban.maxlimit.X where X is a number can also be used per player
|
||||
# -1 = unlimited
|
||||
|
@ -113,38 +116,60 @@ world:
|
|||
# Minimum is 0 (not recommended), maximum is 100. Default is 25.
|
||||
# Only applies to vanilla nether
|
||||
spawn-radius: 25
|
||||
# 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:
|
||||
# End Nether - if this is false, the end world will not be made and access to
|
||||
# the end will not occur. Other plugins may still enable portal usage.
|
||||
generate: true
|
||||
# Islands in The End. Change to false for standard vanilla end.
|
||||
# /!\ BentoBox currently does not support changing this value mid-game. If you do need to change it, do a full reset of your databases and worlds.
|
||||
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.
|
||||
dragon-spawn: false
|
||||
# Mob white list - these mobs will NOT be removed when logging in or doing /island
|
||||
remove-mobs-whitelist:
|
||||
- WITHER
|
||||
- ZOMBIE_VILLAGER
|
||||
- ENDERMAN
|
||||
- PIG_ZOMBIE
|
||||
- WITHER
|
||||
# World flags. These are boolean settings for various flags for this world
|
||||
flags:
|
||||
CREEPER_DAMAGE: true
|
||||
OBSIDIAN_SCOOPING: true
|
||||
PISTON_PUSH: false
|
||||
ISLAND_RESPAWN: true
|
||||
CREEPER_GRIEFING: false
|
||||
PETS_STAY_AT_HOME: true
|
||||
NATURAL_SPAWNING_OUTSIDE_RANGE: true
|
||||
LIQUIDS_FLOWING_OUT: false
|
||||
REMOVE_MOBS: false
|
||||
ENDER_CHEST: false
|
||||
TREES_GROWING_OUTSIDE_RANGE: false
|
||||
WITHER_DAMAGE: false
|
||||
BIOMES_WORLD_PROTECTION: true
|
||||
PISTON_PUSH: false
|
||||
COARSE_DIRT_TILLING: true
|
||||
ENDERMAN_GRIEFING: true
|
||||
CLEAN_SUPER_FLAT: false
|
||||
CHEST_DAMAGE: false
|
||||
CHALLENGES_WORLD_PROTECTION: true
|
||||
PREVENT_TELEPORT_WHEN_FALLING: false
|
||||
NATURAL_SPAWNING_OUTSIDE_RANGE: true
|
||||
WORLD_TNT_DAMAGE: false
|
||||
ENTER_EXIT_MESSAGES: true
|
||||
ENDERMAN_DEATH_DROP: true
|
||||
OFFLINE_REDSTONE: true
|
||||
REMOVE_END_EXIT_ISLAND: true
|
||||
REMOVE_MOBS: true
|
||||
ENDER_CHEST: false
|
||||
OFFLINE_GROWTH: true
|
||||
ITEM_FRAME_DAMAGE: false
|
||||
TREES_GROWING_OUTSIDE_RANGE: false
|
||||
SPAWNER_SPAWN_EGGS: true
|
||||
# These are the default protection settings for new islands.
|
||||
# The value is the minimum island rank required allowed to do the action
|
||||
# Ranks are the following:
|
||||
|
@ -156,12 +181,15 @@ world:
|
|||
# OWNER = 1000
|
||||
default-island-flags:
|
||||
HURT_ANIMALS: 500
|
||||
DRAGON_EGG: 500
|
||||
REDSTONE: 500
|
||||
BUCKET: 500
|
||||
LOCK: 0
|
||||
ENDER_PEARL: 500
|
||||
DOOR: 500
|
||||
BREAK_HOPPERS: 500
|
||||
FURNACE: 500
|
||||
MINECART: 500
|
||||
ANVIL: 500
|
||||
FISH_SCOOPING: 500
|
||||
END_PORTAL: 500
|
||||
|
@ -170,33 +198,44 @@ world:
|
|||
TURTLE_EGGS: 500
|
||||
FROST_WALKER: 500
|
||||
COLLECT_LAVA: 500
|
||||
BREAK_SPAWNERS: 500
|
||||
LEVER: 500
|
||||
RIDING: 500
|
||||
ELYTRA: 0
|
||||
HURT_MONSTERS: 0
|
||||
ARMOR_STAND: 500
|
||||
RIDING: 500
|
||||
CAKE: 500
|
||||
NAME_TAG: 500
|
||||
ARMOR_STAND: 500
|
||||
TRADING: 0
|
||||
EGGS: 500
|
||||
ITEM_DROP: 0
|
||||
NOTE_BLOCK: 0
|
||||
FLINT_AND_STEEL: 500
|
||||
NETHER_PORTAL: 500
|
||||
CROP_TRAMPLE: 500
|
||||
LECTERN: 500
|
||||
ITEM_PICKUP: 0
|
||||
BREWING: 500
|
||||
CROP_TRAMPLE: 500
|
||||
DROPPER: 500
|
||||
BREWING: 500
|
||||
TNT_PRIMING: 500
|
||||
COLLECT_WATER: 500
|
||||
BUTTON: 500
|
||||
FIRE_EXTINGUISH: 500
|
||||
COMMAND_RANKS: 500
|
||||
BEACON: 500
|
||||
TRAPDOOR: 500
|
||||
EXPERIENCE_BOTTLE_THROWING: 500
|
||||
PRESSURE_PLATE: 0
|
||||
ITEM_FRAME: 500
|
||||
HIVE: 500
|
||||
DYE: 500
|
||||
PLACE_BLOCKS: 500
|
||||
ITEM_FRAME: 500
|
||||
CRAFTING: 0
|
||||
SHEARING: 500
|
||||
ENCHANTING: 0
|
||||
SPAWN_EGGS: 500
|
||||
SHEARING: 500
|
||||
BOAT: 500
|
||||
BED: 500
|
||||
SPAWN_EGGS: 500
|
||||
MILKING: 0
|
||||
DISPENSER: 500
|
||||
GATE: 0
|
||||
|
@ -213,14 +252,44 @@ world:
|
|||
default-island-settings:
|
||||
PVP_END: false
|
||||
PVP_NETHER: false
|
||||
ANIMAL_SPAWN: true
|
||||
MONSTER_SPAWN: true
|
||||
LEAF_DECAY: true
|
||||
TNT_DAMAGE: true
|
||||
MONSTER_SPAWNERS_SPAWN: true
|
||||
ANIMAL_NATURAL_SPAWN: true
|
||||
MONSTER_NATURAL_SPAWN: true
|
||||
FIRE_IGNITE: true
|
||||
FIRE_SPREAD: true
|
||||
ANIMAL_SPAWNERS_SPAWN: true
|
||||
FIRE_BURNING: true
|
||||
PVP_OVERWORLD: false
|
||||
# These settings/flags are hidden from users
|
||||
# Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings
|
||||
# Added since 1.4.1.
|
||||
hidden-flags: []
|
||||
hidden-flags:
|
||||
- CHEST_DAMAGE
|
||||
- HURT_MONSTERS
|
||||
- BREAK_SPAWNERS
|
||||
- DISPENSER
|
||||
- DRAGON_EGG
|
||||
- DROPPER
|
||||
- EXPERIENCE_BOTTLE_THROWING
|
||||
- HURT_VILLAGERS
|
||||
- MOUNT_INVENTORY
|
||||
- NOTE_BLOCK
|
||||
- TURTLE_EGGS
|
||||
- PVP_END
|
||||
- FIRE_BURNING
|
||||
- FIRE_IGNITE
|
||||
- FIRE_SPREAD
|
||||
- PVP_NETHER
|
||||
- PVP_OVERWORLD
|
||||
- TNT_DAMAGE
|
||||
- MONSTER_NATURAL_SPAWN
|
||||
- MONSTER_SPAWNERS_SPAWN
|
||||
- ANIMAL_SPAWNERS_SPAWN
|
||||
- ANIMAL_NATURAL_SPAWN
|
||||
- LEAF_DECAY
|
||||
- BREAK_HOPPERS
|
||||
# Visitor banned commands - Visitors to islands cannot use these commands in this world
|
||||
visitor-banned-commands:
|
||||
- spawner
|
||||
|
@ -376,11 +445,27 @@ island:
|
|||
# Note that player-executed commands might not work, as these commands can be run with said player being offline.
|
||||
# Added since 1.8.0.
|
||||
on-leave: []
|
||||
# List of commands that should be executed when the player respawns after death if Flags.ISLAND_RESPAWN is true.
|
||||
# These commands are run by the console, unless otherwise stated using the [SUDO] prefix,
|
||||
# in which case they are executed by the player.
|
||||
#
|
||||
# Available placeholders for the commands are the following:
|
||||
# * [name]: name of the player
|
||||
#
|
||||
# Here are some examples of valid commands to execute:
|
||||
# * '[SUDO] bbox version'
|
||||
# * 'bsbadmin deaths set [player] 0'
|
||||
#
|
||||
# Note that player-executed commands might not work, as these commands can be run with said player being offline.
|
||||
# Added since 1.14.0.
|
||||
on-respawn: []
|
||||
sethome:
|
||||
nether:
|
||||
# Allow setting home in the nether. Only available on nether islands, not vanilla nether.
|
||||
allow: true
|
||||
require-confirmation: true
|
||||
the-end:
|
||||
# Allow setting home in the end. Only available on end islands, not vanilla end.
|
||||
allow: true
|
||||
require-confirmation: true
|
||||
deaths:
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: Herzlich Willkommen!
|
||||
line2: "[name]"
|
||||
line3: Fall nicht runter! &c<3
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: Üdvözöljük!
|
||||
line2: "[name]"
|
||||
line3: Ne ess le! &c<3
|
|
@ -0,0 +1,11 @@
|
|||
###########################################################################################
|
||||
# This is a YML file. Be careful when editing. Check your edits in a YAML checker like #
|
||||
# the one at http://yaml-online-parser.appspot.com #
|
||||
###########################################################################################
|
||||
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: "Welkom!"
|
||||
line2: "[name]"
|
||||
line3: "Val niet! &c<3"
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: Bem vindo(a)!
|
||||
line2: "[name]"
|
||||
line3: Não caia! &c<3
|
||||
line1: Bem vinda!
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: "Bine ai venit!"
|
||||
line2: "[name]"
|
||||
line3: "Sa nu cazi! &c<3"
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: Добро пожаловать!
|
||||
line2: "[name]"
|
||||
line3: Не падай! &c <3
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: Hoş Geldin!
|
||||
line2: "[name]"
|
||||
line3: Aşağı Düşme! &c<3
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: Chào mừng!
|
||||
line2: "[Tên]"
|
||||
line3: Đừng ngã xuống! &c<3
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&c空岛生存"
|
||||
line1: "欢迎你来到这里!"
|
||||
line1: 欢迎你来到这里!
|
||||
line2: "[name]"
|
||||
line3: "千万不要掉下去! &c<3"
|
||||
line3: 千万不要掉下去! &c<3
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&c空島生存"
|
||||
line1: 歡迎!
|
||||
line2: "[name]"
|
||||
line3: 小心不要掉下去喔! &c<3
|
|
@ -1,6 +1,9 @@
|
|||
name: BSkyBlock
|
||||
main: world.bentobox.bskyblock.CopyToBentoBox
|
||||
version: ${version}
|
||||
description: A SkyBlock Plugin
|
||||
author: tastybento
|
||||
depend: [BentoBox]
|
||||
name: BentoBox-BSkyBlock
|
||||
main: world.bentobox.bskyblock.BSkyBlockPladdon
|
||||
version: ${project.version}${build.number}
|
||||
api-version: "1.19"
|
||||
|
||||
authors: [tastybento]
|
||||
contributors: ["The BentoBoxWorld Community"]
|
||||
website: https://bentobox.world
|
||||
description: ${project.description}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package world.bentobox.bskyblock;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
|
|
@ -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:"));
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.bukkit.Bukkit;
|
|||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.generator.ChunkGenerator.BiomeGrid;
|
||||
import org.bukkit.generator.ChunkGenerator.ChunkData;
|
||||
import org.junit.After;
|
||||
|
@ -68,10 +69,14 @@ public class ChunkGeneratorWorldTest {
|
|||
cg = new ChunkGeneratorWorld(addon);
|
||||
// World
|
||||
when(world.getEnvironment()).thenReturn(World.Environment.NORMAL);
|
||||
when(world.getMaxHeight()).thenReturn(16);
|
||||
// Settings
|
||||
when(addon.getSettings()).thenReturn(settings);
|
||||
when(settings.getSeaHeight()).thenReturn(0);
|
||||
when(settings.isNetherRoof()).thenReturn(true);
|
||||
when(settings.getDefaultBiome()).thenReturn(Biome.TAIGA);
|
||||
when(settings.getDefaultNetherBiome()).thenReturn(Biome.CRIMSON_FOREST);
|
||||
when(settings.getDefaultEndBiome()).thenReturn(Biome.END_MIDLANDS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,7 +96,7 @@ public class ChunkGeneratorWorldTest {
|
|||
// Verifications
|
||||
// Default biome
|
||||
verify(settings).getDefaultBiome();
|
||||
verify(biomeGrid, times(16 * 16)).setBiome(anyInt(), anyInt(), any());
|
||||
verify(biomeGrid, times(64)).setBiome(anyInt(), anyInt(), anyInt(), any());
|
||||
// Sea height
|
||||
verify(settings).getSeaHeight();
|
||||
// Void
|
||||
|
@ -110,7 +115,7 @@ public class ChunkGeneratorWorldTest {
|
|||
// Verifications
|
||||
// Default biome
|
||||
verify(settings).getDefaultBiome();
|
||||
verify(biomeGrid, times(16 * 16)).setBiome(anyInt(), anyInt(), any());
|
||||
verify(biomeGrid, times(64)).setBiome(anyInt(), anyInt(), anyInt(), eq(Biome.TAIGA));
|
||||
// Sea height
|
||||
verify(settings, times(2)).getSeaHeight();
|
||||
// Water. Blocks = 16 x 16 x 11 because block 0
|
||||
|
@ -127,9 +132,9 @@ public class ChunkGeneratorWorldTest {
|
|||
assertEquals(data, cd);
|
||||
// Verifications
|
||||
// Default biome
|
||||
verify(settings, never()).getDefaultBiome();
|
||||
// Never set biome in end
|
||||
verify(biomeGrid, never()).setBiome(anyInt(), anyInt(), any());
|
||||
verify(settings).getDefaultEndBiome();
|
||||
// Set biome in end
|
||||
verify(biomeGrid, times(64)).setBiome(anyInt(), anyInt(), anyInt(), eq(Biome.END_MIDLANDS));
|
||||
// Sea height
|
||||
verify(settings, never()).getSeaHeight();
|
||||
// Void
|
||||
|
@ -147,10 +152,10 @@ public class ChunkGeneratorWorldTest {
|
|||
// Verifications
|
||||
// Nether roof check
|
||||
verify(settings).isNetherRoof();
|
||||
// Never set biome in nether
|
||||
verify(biomeGrid, never()).setBiome(anyInt(), anyInt(), any());
|
||||
// Set biome in nether
|
||||
verify(biomeGrid, times(64)).setBiome(anyInt(), anyInt(), anyInt(), eq(Biome.CRIMSON_FOREST));
|
||||
// Nether roof - at least bedrock layer
|
||||
verify(cd, atLeast(16 * 16)).setBlock(anyInt(), anyInt(), anyInt(), eq(Material.BEDROCK));
|
||||
verify(cd, atLeast(64)).setBlock(anyInt(), anyInt(), anyInt(), eq(Material.BEDROCK));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -163,10 +168,11 @@ public class ChunkGeneratorWorldTest {
|
|||
ChunkData cd = cg.generateChunkData(world, random, 0 , 0 , biomeGrid);
|
||||
assertEquals(data, cd);
|
||||
// Verifications
|
||||
verify(settings).getDefaultNetherBiome();
|
||||
// Nether roof check
|
||||
verify(settings).isNetherRoof();
|
||||
// Never set biome in nether
|
||||
verify(biomeGrid, never()).setBiome(anyInt(), anyInt(), any());
|
||||
// Set biome in nether
|
||||
verify(biomeGrid, times(64)).setBiome(anyInt(), anyInt(), anyInt(), eq(Biome.CRIMSON_FOREST));
|
||||
// Nether roof - at least bedrock layer
|
||||
verify(cd, never()).setBlock(anyInt(), anyInt(), anyInt(), any(Material.class));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue