Compare commits
353 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 | |
tastybento | baba69a74c | |
tastybento | 97485dc237 | |
tastybento | cc0b454aee | |
johncsuti | b6b6483360 | |
tastybento | 812a9727df | |
tastybento | 981f28e230 | |
tastybento | 8c9195c49c | |
tastybento | 9342479e94 | |
tastybento | c5915affc8 | |
tastybento | 9f702b187f | |
tastybento | e3f3b2effe | |
tastybento | eb046428df | |
tastybento | febd57d78b | |
tastybento | 6e7d92a3d5 | |
tastybento | dd9193d756 | |
tastybento | 675b052b95 | |
tastybento | 7bc76333eb | |
tastybento | 2f8169a109 | |
tastybento | 5b25c2ddc8 | |
tastybento | d2965c3809 | |
tastybento | 11c955f3bd | |
tastybento | 0cdd3b0487 | |
tastybento | af096bf706 | |
Florian CUNY | d6b4b2525e | |
Florian CUNY | 33cb41f56b | |
Florian CUNY | d7e1002dcf | |
Florian CUNY | 9480ea290f | |
Florian CUNY | ee5d2dca96 | |
Florian CUNY | b5bd8aaebc | |
Florian CUNY | f1f69a7022 | |
johncsuti | 1963397a63 | |
Florian CUNY | 85c0e1fdda | |
tastybento | c019a5db0f | |
tastybento | ae511379fd | |
tastybento | b5abc9c11b | |
gitlocalize-app[bot] | f746697d45 | |
gitlocalize-app[bot] | a0f6aecb64 | |
tastybento | 23f30cd29f | |
tastybento | 2996242662 | |
tastybento | e24d9a23d7 | |
tastybento | 392f40bd40 | |
tastybento | 4c87c317b1 | |
tastybento | 191d2b9cc2 | |
BONNe | b0c6499bf7 | |
tastybento | 7292e94afb | |
tastybento | 31717a45e5 | |
tastybento | 23b8062e5a | |
tastybento | cf0fa57ff6 | |
tastybento | 11a6ed582c | |
tastybento | a18d7fc951 | |
shaokeyibb | 8917a1d4db | |
tastybento | ca7d8fa360 | |
tastybento | 55ee57a294 | |
tastybento | bd028988eb | |
tastybento | d9cba6cd07 | |
tastybento | 0c669de9b0 | |
tastybento | 518a66bbde | |
Leonardo-DGS | 697450035d | |
tastybento | 32ce4b4ed6 | |
tastybento | 80c5155a26 | |
tastybento | d0e92f3890 | |
SrAcosta | e89adaec9e | |
SrAcosta | a8c20e7ec4 | |
tastybento | 891cced43a | |
tastybento | 4be0e1f46b | |
tastybento | 319558e999 | |
BONNe | f549ba2156 | |
tastybento | 2ac375582f | |
tastybento | 0b898127d5 | |
tastybento | b7e8872902 | |
Florian CUNY | e11b7a19b6 | |
Florian CUNY | 61d5f9be9d | |
Florian CUNY | 6fcc1ab87c | |
tastybento | 9503537365 | |
BONNe | c0dd1e5571 | |
tastybento | 02c05ed2d5 | |
tastybento | aff2320395 | |
tastybento | 6c70b9856d | |
tastybento | 1f0740104b | |
tastybento | 785e887881 | |
tastybento | 77ca4668ac | |
tastybento | 2d688b2d88 | |
tastybento | 9f8592eb59 | |
tastybento | 86deddf999 | |
tastybento | c5ebcb6bd9 | |
tastybento | afdfad84ab | |
tastybento | a90663e933 | |
tastybento | 854b596008 | |
Nicolas RAYNAUD | 68aaa618b0 | |
tastybento | 326ff24dfd | |
tastybento | d783d40c71 | |
Patbox | 5cad0b2677 | |
tastybento | 11bef0208b | |
tastybento | 26f58c683d | |
tastybento | ac86ac60cc | |
tastybento | f63680285b | |
tastybento | 8dd968a25a | |
tastybento | 6049c1d4c1 | |
tastybento | 4c8f6f804b | |
tastybento | 04c06f0c3e | |
tastybento | fc76f9c27a | |
tastybento | c1d0071248 | |
tastybento | eec6367543 | |
tastybento | c2818b73be | |
tastybento | 7e540e0b57 | |
tastybento | 4b0f277aea | |
tastybento | d91b3008ac | |
Florian CUNY | fc48c40eff | |
Florian CUNY | 208ce78395 | |
Florian CUNY | 1e629aa841 | |
tastybento | 34d8485367 | |
tastybento | a503709325 | |
tastybento | ac1ca2eee9 | |
tastybento | f487cf2723 | |
tastybento | 4b2ad43cef | |
tastybento | 106cc87fb9 | |
tastybento | 7640a50455 | |
tastybento | 654a876805 | |
tastybento | 49ebfbf48c | |
tastybento | 86a660b530 | |
tastybento | 92251ddbeb | |
tastybento | 2364aaa835 | |
tastybento | 3086815612 | |
tastybento | 6f2d3d0f5e | |
tastybento | 2dcdece3f3 | |
tastybento | b2aa604419 | |
tastybento | 3e26c89949 | |
tastybento | b25c8de95e | |
tastybento | 62051eb236 | |
tastybento | 648a2a4a5e | |
tastybento | ee9e073162 | |
tastybento | 8cbb85c3b8 | |
tastybento | ab8052b433 | |
tastybento | b51634b106 | |
tastybento | 0c03eb1a97 | |
tastybento | 79d89bfe84 | |
tastybento | 0d49d6fecb | |
Florian CUNY | 2305533f47 | |
Florian CUNY | 06a54b0fe5 | |
Florian CUNY | 6cf7ac7db7 | |
tastybento | d4147c8dda | |
tastybento | b94aff5e73 | |
tastybento | 400ceef9de | |
tastybento | 314704dd55 | |
tastybento | 6f676f77fa | |
tastybento | 40b6718d9c | |
tastybento | faaff04bd5 | |
tastybento | 1a0933bdb7 | |
tastybento | fb97fc96ef | |
tastybento | dceb74dfb1 | |
tastybento | 2566cac99d | |
tastybento | fe719121f4 | |
tastybento | 8a350b16c3 | |
tastybento | e94b0167f4 | |
tastybento | 10c0aef459 | |
tastybento | 1b671de7f4 | |
tastybento | ff4b0be3de | |
tastybento | 0716a09470 | |
tastybento | 30b4598ef5 | |
tastybento | 1563abf1a7 | |
tastybento | 467f1bb305 | |
tastybento | e2e372fa2d | |
tastybento | 2f87421704 | |
tastybento | 91b33b893c | |
tastybento | 02cfc28cd1 | |
tastybento | b335ac6bc7 | |
tastybento | 2f5201e0cc | |
tastybento | 51c586645a | |
YellowZaki | a4e1f09c12 | |
tastybento | 3fff9a6e42 | |
tastybento | 12d5b26536 | |
tastybento | c3c6e72384 | |
tastybento | 6b953930c7 | |
tastybento | f0b0734d22 | |
tastybento | dbde346afb | |
YellowZaki | bfe0cae1b7 | |
YellowZaki | a018bc141e | |
tastybento | 27e6b72382 | |
BONNe1704 | 93188d0a31 | |
tastybento | 32d05e9a99 | |
tastybento | 69f2e63266 | |
tastybento | 6115a37f84 | |
tastybento | e60ab110c5 | |
tastybento | 9cc53733dd | |
tastybento | 475988d451 | |
tastybento | 92e9d3d21e | |
tastybento | a8137b5e99 | |
tastybento | b83f831361 | |
tastybento | 6bc0817278 | |
tastybento | bc28f8c071 | |
Florian CUNY | 343386f493 | |
Florian CUNY | 83069b6e86 | |
Florian CUNY | 99fb7bdc9a | |
Florian CUNY | 5d1b562593 | |
tastybento | c3a892c1b7 | |
tastybento | 55ed2640d1 | |
tastybento | 0de2e04d6f | |
tastybento | a6df31244f | |
tastybento | 9fc167eb89 | |
Florian CUNY | b940ad0432 | |
Florian CUNY | ca647ea6a7 | |
Florian CUNY | 7d26d010e5 | |
tastybento | ff0433ecfa | |
tastybento | 2df9b4e19f | |
tastybento | 8cb0eba57e | |
Florian CUNY | bebe65479c | |
tastybento | a03a8ef2d0 | |
tastybento | c543fef045 | |
tastybento | d818fa8686 | |
Florian CUNY | 47936c1e26 | |
tastybento | e432d1e75e | |
tastybento | 61d109d0e8 | |
tastybento | f8986f340a | |
Florian CUNY | ab1d4744e5 | |
Florian CUNY | 9ac2acf990 | |
Florian CUNY | 926e2cfcfb | |
Florian CUNY | 51b6860fff | |
Florian CUNY | f9121edbe2 | |
Florian CUNY | d8c0400e3c | |
Florian CUNY | 3415c77706 | |
Florian CUNY | f8cfec332a | |
Florian CUNY | ceb1cfb358 | |
Florian CUNY | 4c62b12a4f | |
Florian CUNY | 4232350571 | |
tastybento | 8319070d6d | |
Florian CUNY | 0e2227e76d | |
Florian CUNY | d321d1f53a | |
Florian CUNY | 8290e15471 | |
Florian CUNY | d7cc07895f | |
Florian CUNY | 0dcf07c96f | |
tastybento | 11f515f391 | |
tastybento | 0f4b1f5619 |
|
@ -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
|
43
README.md
43
README.md
|
@ -1,31 +1,32 @@
|
|||
BSkyBlock
|
||||
==========
|
||||
# BSkyBlock
|
||||
|
||||
[![Build Status](https://travis-ci.org/tastybento/bskyblock.svg?branch=master)](https://travis-ci.org/tastybento/bskyblock)
|
||||
![Lines Of Code](https://sonarcloud.io/api/project_badges/measure?project=us.tastybento%3Abskyblock&metric=ncloc)
|
||||
![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=us.tastybento%3Abskyblock&metric=sqale_rating)
|
||||
![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=us.tastybento%3Abskyblock&metric=reliability_rating)
|
||||
![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=us.tastybento%3Abskyblock&metric=security_rating)
|
||||
![Bugs](https://sonarcloud.io/api/project_badges/measure?project=us.tastybento%3Abskyblock&metric=bugs)
|
||||
[![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">
|
||||
|
||||
This is a survival game where the player starts with an island in the sky.
|
||||
## About
|
||||
Play SkyBlock with your friends! Don't fall! See the config.yml for all the settings. This is an addon for BentoBox.
|
||||
|
||||
BSkyBlock (Better SkyBlock) represents a turning point on ASkyBlock's history : Tastybento and Poslovitch thought and designed together this complete rewrite in order to provide a whole new way to play Skyblock.
|
||||
## Documentation
|
||||
|
||||
**Discover today BSkyBlock, its gameplay overhaul, and enjoy the Skyblock revival!**
|
||||
Go to [docs.bentobox.world](https://docs.bentobox.world).
|
||||
|
||||
Add-ons
|
||||
=======
|
||||
BSkyBlock is an add-on that uses the BentoBox API. Here is a list of other ones:
|
||||
## Installation
|
||||
|
||||
* Level - provides island level calculation and a top ten
|
||||
* Welcome Warps - provides the warp sign feature
|
||||
* Challenges - challenges
|
||||
* AcidIsland - survival game in a sea of acid
|
||||
|
||||
You can find the projects on GitHub.
|
||||
1. Install BentoBox and run it on the server at least once to create its data folders.
|
||||
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 .
|
||||
6. Edit the config.yml how you want.
|
||||
7. Delete any worlds that were created by default if you made changes that would affect them.
|
||||
8. Restart the server.
|
||||
|
||||
Bugs and Feature requests
|
||||
=========================
|
||||
File bug and feature requests here: https://github.com/BentoBoxWorld/addon-bskyblock/issues
|
||||
File bug and feature requests here: https://github.com/BentoBoxWorld/BSkyBlock/issues
|
||||
|
|
582
pom.xml
582
pom.xml
|
@ -1,258 +1,350 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>BSkyBlock</artifactId>
|
||||
<version>0.4.0-SNAPSHOT</version>
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>bskyblock</artifactId>
|
||||
<version>${revision}</version>
|
||||
|
||||
<name>BSkyBlock</name>
|
||||
<description>BSkyBlock is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like ASkyBlock or AcidIsland.</description>
|
||||
<url>https://github.com/BentoBoxWorld/addon-bskyblock</url>
|
||||
<inceptionYear>2018</inceptionYear>
|
||||
<name>BSkyBlock</name>
|
||||
<description>BSkyBlock is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland.</description>
|
||||
<url>https://github.com/BentoBoxWorld/BSkyBlock</url>
|
||||
<inceptionYear>2017</inceptionYear>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/BentoBoxWorld/addon-bskyblock.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:BentoBoxWorld/addon-bskyblock.git</developerConnection>
|
||||
<url>https://github.com/BentoBoxWorld/addon-bskyblock</url>
|
||||
</scm>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>tastybento</id>
|
||||
<email>tastybento@bentobox.world</email>
|
||||
<timezone>-8</timezone>
|
||||
<roles>
|
||||
<role>Lead Developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<ciManagement>
|
||||
<system>jenkins</system>
|
||||
<url>http://ci.codemc.org/job/BentoBoxWorld/job/bentobox</url>
|
||||
</ciManagement>
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/BentoBoxWorld/BSkyBlock.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:BentoBoxWorld/BSkyBlock.git</developerConnection>
|
||||
<url>https://github.com/BentoBoxWorld/BSkyBlock</url>
|
||||
</scm>
|
||||
|
||||
<issueManagement>
|
||||
<system>GitHub</system>
|
||||
<url>https://github.com/BentoBoxWorld/addon-bskyblock/issues</url>
|
||||
</issueManagement>
|
||||
<ciManagement>
|
||||
<system>jenkins</system>
|
||||
<url>http://ci.codemc.org/job/BentoBoxWorld/job/BSkyBlock</url>
|
||||
</ciManagement>
|
||||
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>codemc-snapshots</id>
|
||||
<url>https://repo.codemc.org/repository/maven-snapshots</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>codemc-releases</id>
|
||||
<url>https://repo.codemc.org/repository/maven-releases</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<issueManagement>
|
||||
<system>GitHub</system>
|
||||
<url>https://github.com/BentoBoxWorld/BSkyBlock/issues</url>
|
||||
</issueManagement>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<powermock.version>1.7.4</powermock.version>
|
||||
</properties>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>codemc-snapshots</id>
|
||||
<url>https://repo.codemc.org/repository/maven-snapshots</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>codemc-releases</id>
|
||||
<url>https://repo.codemc.org/repository/maven-releases</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>codemc</id>
|
||||
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>17</java.version>
|
||||
<!-- Non-minecraft related dependencies -->
|
||||
<powermock.version>2.0.9</powermock.version>
|
||||
<!-- More visible way how to change dependency versions -->
|
||||
<spigot.version>1.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.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>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.13-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-all</artifactId>
|
||||
<version>1.10.19</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-module-junit4</artifactId>
|
||||
<version>${powermock.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-api-mockito</artifactId>
|
||||
<version>${powermock.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mongodb</groupId>
|
||||
<artifactId>mongodb-driver</artifactId>
|
||||
<version>3.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>bentobox</artifactId>
|
||||
<version>0.10.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<!-- Profiles will allow to automatically change build version. -->
|
||||
<profiles>
|
||||
<profile>
|
||||
<!-- ci profile is activated if exist environment variable BUILD_NUMBER. -->
|
||||
<!-- It replaces ${build.number} that is currently '-LOCAL' with
|
||||
correct build number from JENKINS machine. -->
|
||||
<id>ci</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env.BUILD_NUMBER</name>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<!-- Override only if necessary -->
|
||||
<build.number>-b${env.BUILD_NUMBER}</build.number>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<!-- Master profile is activated if exist environment variable
|
||||
GIT_BRANCH and its value is origin/master. -->
|
||||
<!-- It will replace 'revision' with '${build.version}' so it
|
||||
removes '-SNAPSHOT' string at the end. -->
|
||||
<!-- Also, as this is release build, build number can be set
|
||||
to empty string. -->
|
||||
<!-- This profile will be used only if exist environment variable
|
||||
GIT_BRANCH with value origin/master. -->
|
||||
<id>master</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env.GIT_BRANCH</name>
|
||||
<value>origin/master</value>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<!-- Override only if necessary -->
|
||||
<revision>${build.version}</revision>
|
||||
<!-- Empties build number variable. -->
|
||||
<build.number></build.number>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<defaultGoal>clean package</defaultGoal>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources/locales</directory>
|
||||
<targetPath>./locales</targetPath>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources/schems</directory>
|
||||
<targetPath>./schems</targetPath>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>*.schem</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<nonFilteredFileExtensions>
|
||||
<nonFilteredFileExtension>schem</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<configuration>
|
||||
<show>public</show>
|
||||
<failOnError>false</failOnError>
|
||||
<additionalJOption>-Xdoclint:none</additionalJOption>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<configuration>
|
||||
<minimizeJar>false</minimizeJar>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.1</version>
|
||||
<configuration>
|
||||
<append>true</append>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>pre-unit-test</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>post-unit-test</id>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>codemc</id>
|
||||
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>codemc-repo</id>
|
||||
<url>https://repo.codemc.org/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<profiles>
|
||||
<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>
|
||||
</project>
|
||||
<dependencies>
|
||||
<!-- Spigot API -->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>${spigot.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Mockito (Unit testing) -->
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-module-junit4</artifactId>
|
||||
<version>${powermock.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-api-mockito2</artifactId>
|
||||
<version>${powermock.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>bentobox</artifactId>
|
||||
<version>${bentobox.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<!-- By default ${revision} is ${build.version}-SNAPSHOT -->
|
||||
<!-- If GIT_BRANCH variable is set to origin/master, then it will
|
||||
be only ${build.version}. -->
|
||||
|
||||
<!-- By default ${build.number} is -LOCAL. -->
|
||||
<!-- If the BUILD_NUMBER variable is set, then it will be -b[number]. -->
|
||||
<!-- If GIT_BRANCH variable is set to origin/master, then it will
|
||||
be the empty string. -->
|
||||
<finalName>${project.name}-${revision}${build.number}</finalName>
|
||||
|
||||
<defaultGoal>clean package</defaultGoal>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources/locales</directory>
|
||||
<targetPath>./locales</targetPath>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources/blueprints</directory>
|
||||
<targetPath>./blueprints</targetPath>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>*.blu</include>
|
||||
<include>*.json</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<nonFilteredFileExtensions>
|
||||
<nonFilteredFileExtension>blu</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<release>${java.version}</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<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>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<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>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.10</version>
|
||||
<configuration>
|
||||
<append>true</append>
|
||||
<excludes>
|
||||
<!-- This is required to prevent Jacoco from adding
|
||||
synthetic fields to a JavaBean class (causes errors in testing) -->
|
||||
<exclude>**/*Names*</exclude>
|
||||
<!-- Prevents the Material is too large to mock error -->
|
||||
<exclude>org/bukkit/Material*</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>prepare-agent</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>report</id>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<formats>
|
||||
<format>XML</format>
|
||||
</formats>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,48 +1,86 @@
|
|||
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;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
import world.bentobox.bskyblock.commands.AdminCommand;
|
||||
import world.bentobox.bskyblock.commands.IslandCommand;
|
||||
import world.bentobox.bskyblock.generators.BSkyBlockWorld;
|
||||
import world.bentobox.bentobox.api.addons.Addon;
|
||||
import world.bentobox.bentobox.api.addons.GameModeAddon;
|
||||
import world.bentobox.bentobox.api.commands.admin.DefaultAdminCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.DefaultPlayerCommand;
|
||||
import world.bentobox.bentobox.api.configuration.Config;
|
||||
import world.bentobox.bentobox.api.configuration.WorldSettings;
|
||||
import world.bentobox.bskyblock.commands.IslandAboutCommand;
|
||||
import world.bentobox.bskyblock.generators.ChunkGeneratorWorld;
|
||||
|
||||
/**
|
||||
* Main BSkyBlock class - provides an island minigame in the sky
|
||||
* @author tastybento
|
||||
* @author Poslovitch
|
||||
*/
|
||||
public class BSkyBlock extends Addon {
|
||||
public class BSkyBlock extends GameModeAddon implements Listener {
|
||||
|
||||
private static final String NETHER = "_nether";
|
||||
private static final String THE_END = "_the_end";
|
||||
|
||||
private static Addon addon;
|
||||
// Settings
|
||||
private Settings settings;
|
||||
private BSkyBlockWorld bsbWorlds;
|
||||
private ChunkGeneratorWorld chunkGenerator;
|
||||
private final Config<Settings> configObject = new Config<>(this, Settings.class);
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
addon = this;
|
||||
// Save the default config from config.yml
|
||||
saveDefaultConfig();
|
||||
// Load settings from config.yml. This will check if there are any issues with it too.
|
||||
settings = new Config<>(this, Settings.class).loadConfigObject();
|
||||
// Load or create worlds
|
||||
bsbWorlds = new BSkyBlockWorld(this);
|
||||
loadSettings();
|
||||
// Chunk generator
|
||||
chunkGenerator = settings.isUseOwnGenerator() ? null : new ChunkGeneratorWorld(this);
|
||||
// Register commands
|
||||
playerCommand = new DefaultPlayerCommand(this)
|
||||
|
||||
{
|
||||
@Override
|
||||
public void setup()
|
||||
{
|
||||
super.setup();
|
||||
new IslandAboutCommand(this);
|
||||
}
|
||||
};
|
||||
adminCommand = new DefaultAdminCommand(this) {};
|
||||
}
|
||||
|
||||
private boolean loadSettings() {
|
||||
// Load settings again to get worlds
|
||||
settings = configObject.loadConfigObject();
|
||||
if (settings == null) {
|
||||
// Disable
|
||||
logError("BSkyBlock settings could not load! Addon disabled.");
|
||||
setState(State.DISABLED);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable(){
|
||||
// Register commands
|
||||
new IslandCommand(this);
|
||||
new AdminCommand(this);
|
||||
// Register this
|
||||
registerListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// Save settings
|
||||
if (settings != null) {
|
||||
new Config<>(this, Settings.class).saveConfigObject(settings);
|
||||
// Nothing to do here
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReload() {
|
||||
if (loadSettings()) {
|
||||
log("Reloaded BSkyBlock settings");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,15 +91,94 @@ public class BSkyBlock extends Addon {
|
|||
return settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the BSkyBlock world
|
||||
*/
|
||||
public World getIslandWorld() {
|
||||
return bsbWorlds.getOverWorld();
|
||||
@Override
|
||||
public void createWorlds() {
|
||||
String worldName = settings.getWorldName().toLowerCase();
|
||||
if (getServer().getWorld(worldName) == null) {
|
||||
log("Creating BSkyBlock world ...");
|
||||
}
|
||||
|
||||
// Create the world if it does not exist
|
||||
islandWorld = getWorld(worldName, World.Environment.NORMAL, chunkGenerator);
|
||||
// Make the nether if it does not exist
|
||||
if (settings.isNetherGenerate()) {
|
||||
if (getServer().getWorld(worldName + NETHER) == null) {
|
||||
log("Creating BSkyBlock's Nether...");
|
||||
}
|
||||
netherWorld = settings.isNetherIslands() ? getWorld(worldName, World.Environment.NETHER, chunkGenerator) : getWorld(worldName, World.Environment.NETHER, null);
|
||||
}
|
||||
// Make the end if it does not exist
|
||||
if (settings.isEndGenerate()) {
|
||||
if (getServer().getWorld(worldName + THE_END) == null) {
|
||||
log("Creating BSkyBlock's End World...");
|
||||
}
|
||||
endWorld = settings.isEndIslands() ? getWorld(worldName, World.Environment.THE_END, chunkGenerator) : getWorld(worldName, World.Environment.THE_END, null);
|
||||
}
|
||||
}
|
||||
|
||||
public static Addon getInstance() {
|
||||
return addon;
|
||||
/**
|
||||
* Gets a world or generates a new world if it does not exist
|
||||
* @param worldName2 - the overworld name
|
||||
* @param env - the environment
|
||||
* @param chunkGenerator2 - the chunk generator. If <tt>null</tt> then the generator will not be specified
|
||||
* @return world loaded or generated
|
||||
*/
|
||||
private World getWorld(String worldName2, Environment env, ChunkGeneratorWorld chunkGenerator2) {
|
||||
// Set world name
|
||||
worldName2 = env.equals(World.Environment.NETHER) ? worldName2 + NETHER : worldName2;
|
||||
worldName2 = env.equals(World.Environment.THE_END) ? worldName2 + THE_END : worldName2;
|
||||
WorldCreator wc = WorldCreator.name(worldName2).type(WorldType.FLAT).environment(env);
|
||||
World w = settings.isUseOwnGenerator() ? wc.createWorld() : wc.generator(chunkGenerator2).createWorld();
|
||||
// Set spawn rates
|
||||
// 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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WorldSettings getWorldSettings() {
|
||||
return getSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
|
||||
return chunkGenerator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveWorldSettings() {
|
||||
if (settings != null) {
|
||||
configObject.saveConfigObject(settings);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see world.bentobox.bentobox.api.addons.Addon#allLoaded()
|
||||
*/
|
||||
@Override
|
||||
public void allLoaded() {
|
||||
// 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();
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,79 +0,0 @@
|
|||
package world.bentobox.bskyblock.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminWhyCommand;
|
||||
import world.bentobox.bskyblock.BSkyBlock;
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminClearResetsAllCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminClearResetsCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminDeleteCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminGetRankCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminInfoCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminRegisterCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminSetRankCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminTeleportCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminUnregisterCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminVersionCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.range.AdminRangeCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.schem.AdminSchemCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamAddCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamDisbandCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamKickCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamMakeLeaderCommand;
|
||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
|
||||
public class AdminCommand extends CompositeCommand {
|
||||
|
||||
public AdminCommand(BSkyBlock addon) {
|
||||
super(addon, "bsbadmin", "bsb");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
setPermissionPrefix("bskyblock");
|
||||
setPermission("admin.*");
|
||||
setOnlyPlayer(false);
|
||||
setParametersHelp("commands.admin.help.parameters");
|
||||
setDescription("commands.admin.help.description");
|
||||
setWorld(((BSkyBlock)getAddon()).getIslandWorld());
|
||||
new AdminVersionCommand(this);
|
||||
new AdminTeleportCommand(this, "tp");
|
||||
new AdminTeleportCommand(this, "tpnether");
|
||||
new AdminTeleportCommand(this, "tpend");
|
||||
new AdminGetRankCommand(this);
|
||||
new AdminSetRankCommand(this);
|
||||
new AdminInfoCommand(this);
|
||||
// Team commands
|
||||
new AdminTeamAddCommand(this);
|
||||
new AdminTeamKickCommand(this);
|
||||
new AdminTeamDisbandCommand(this);
|
||||
new AdminTeamMakeLeaderCommand(this);
|
||||
// Schems
|
||||
new AdminSchemCommand(this);
|
||||
// Register/unregister islands
|
||||
new AdminRegisterCommand(this);
|
||||
new AdminUnregisterCommand(this);
|
||||
// Range
|
||||
new AdminRangeCommand(this);
|
||||
// Resets
|
||||
new AdminClearResetsCommand(this);
|
||||
new AdminClearResetsAllCommand(this);
|
||||
// Delete
|
||||
new AdminDeleteCommand(this);
|
||||
// Why
|
||||
new AdminWhyCommand(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(User user, String label, List<String> args) {
|
||||
if (!args.isEmpty()) {
|
||||
user.sendMessage("general.errors.unknown-command", TextVariables.LABEL, getTopLabel());
|
||||
return false;
|
||||
}
|
||||
// By default run the attached help command, if it exists (it should)
|
||||
return showHelp(this, user);
|
||||
}
|
||||
|
||||
}
|
|
@ -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 - 2018 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;
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
package world.bentobox.bskyblock.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import world.bentobox.bskyblock.BSkyBlock;
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandBanCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandBanlistCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandCreateCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandGoCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandLanguageCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandResetCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandResetnameCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandSethomeCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandSetnameCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandSettingsCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.IslandUnbanCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.team.IslandTeamCommand;
|
||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
|
||||
public class IslandCommand extends CompositeCommand {
|
||||
|
||||
public IslandCommand(BSkyBlock addon) {
|
||||
super(addon, "island", "is");
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see us.tastybento.bskyblock.api.commands.CompositeCommand#setup()
|
||||
*/
|
||||
@Override
|
||||
public void setup() {
|
||||
setDescription("commands.island.help.description");
|
||||
setOnlyPlayer(true);
|
||||
// Permission
|
||||
setPermissionPrefix("bskyblock");
|
||||
setPermission("island");
|
||||
setWorld(((BSkyBlock)getAddon()).getIslandWorld());
|
||||
// Set up subcommands
|
||||
new IslandAboutCommand(this);
|
||||
new IslandCreateCommand(this);
|
||||
new IslandGoCommand(this);
|
||||
new IslandResetCommand(this);
|
||||
new IslandSetnameCommand(this);
|
||||
new IslandResetnameCommand(this);
|
||||
new IslandSethomeCommand(this);
|
||||
new IslandSettingsCommand(this);
|
||||
new IslandLanguageCommand(this);
|
||||
new IslandBanCommand(this);
|
||||
new IslandUnbanCommand(this);
|
||||
new IslandBanlistCommand(this);
|
||||
// Team commands
|
||||
new IslandTeamCommand(this);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see us.tastybento.bskyblock.api.commands.CommandArgument#execute(org.bukkit.command.CommandSender, java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean execute(User user, String label, List<String> args) {
|
||||
if (user == null) {
|
||||
return false;
|
||||
}
|
||||
if (args.isEmpty()) {
|
||||
// If user has an island, go
|
||||
if (getPlugin().getIslands().getIsland(getWorld(), user.getUniqueId()) != null) {
|
||||
return getSubCommand("go").map(goCmd -> goCmd.execute(user, goCmd.getLabel(), new ArrayList<>())).orElse(false);
|
||||
}
|
||||
// No islands currently
|
||||
return getSubCommand("create").map(createCmd -> createCmd.execute(user, createCmd.getLabel(), new ArrayList<>())).orElse(false);
|
||||
}
|
||||
user.sendMessage("general.errors.unknown-command", TextVariables.LABEL, getTopLabel());
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
package world.bentobox.bskyblock.generators;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.WorldType;
|
||||
|
||||
import world.bentobox.bskyblock.BSkyBlock;
|
||||
import world.bentobox.bentobox.util.Util;
|
||||
|
||||
/**
|
||||
* Creates the worlds and registers them with BentoBox
|
||||
* @author tastybento
|
||||
*
|
||||
*/
|
||||
public class BSkyBlockWorld {
|
||||
|
||||
private static final String NETHER = "_nether";
|
||||
private static final String THE_END = "_the_end";
|
||||
private World islandWorld;
|
||||
private World netherWorld;
|
||||
private World endWorld;
|
||||
|
||||
/**
|
||||
* Create and register worlds with BentoBox
|
||||
* @param addon - addon
|
||||
*/
|
||||
public BSkyBlockWorld(BSkyBlock addon) {
|
||||
String worldName = addon.getSettings().getWorldName();
|
||||
if (addon.getServer().getWorld(worldName) == null) {
|
||||
addon.getLogger().info("Creating BSkyBlock worlds...");
|
||||
}
|
||||
// Create the world if it does not exist
|
||||
islandWorld = WorldCreator.name(worldName).type(WorldType.FLAT).environment(World.Environment.NORMAL).generator(new ChunkGeneratorWorld(addon))
|
||||
.createWorld();
|
||||
addon.getPlugin().registerWorld(islandWorld, addon.getSettings());
|
||||
|
||||
// Make the nether if it does not exist
|
||||
if (addon.getSettings().isNetherGenerate()) {
|
||||
if (addon.getServer().getWorld(worldName + NETHER) == null) {
|
||||
addon.log("Creating BSkyBlock's Nether...");
|
||||
}
|
||||
if (!addon.getSettings().isNetherIslands()) {
|
||||
netherWorld = WorldCreator.name(worldName + NETHER).type(WorldType.NORMAL).environment(World.Environment.NETHER).createWorld();
|
||||
} else {
|
||||
netherWorld = WorldCreator.name(worldName + NETHER).type(WorldType.FLAT).generator(new ChunkGeneratorWorld(addon))
|
||||
.environment(World.Environment.NETHER).createWorld();
|
||||
}
|
||||
}
|
||||
// Make the end if it does not exist
|
||||
if (addon.getSettings().isEndGenerate()) {
|
||||
if (addon.getServer().getWorld(worldName + THE_END) == null) {
|
||||
addon.log("Creating BSkyBlock's End World...");
|
||||
}
|
||||
if (!addon.getSettings().isEndIslands()) {
|
||||
endWorld = WorldCreator.name(worldName + THE_END).type(WorldType.NORMAL).environment(World.Environment.THE_END).createWorld();
|
||||
} else {
|
||||
endWorld = WorldCreator.name(worldName + THE_END).type(WorldType.FLAT).generator(new ChunkGeneratorWorld(addon))
|
||||
.environment(World.Environment.THE_END).createWorld();
|
||||
}
|
||||
}
|
||||
|
||||
// Load schematics
|
||||
addon.getPlugin().getSchemsManager().loadIslands(islandWorld);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if a player is in any of the island worlds
|
||||
* @param loc - player to check
|
||||
* @return true if in a world or false if not
|
||||
*/
|
||||
public boolean inWorld(Location loc) {
|
||||
return Util.sameWorld(loc.getWorld(), islandWorld);
|
||||
}
|
||||
|
||||
public World getOverWorld() {
|
||||
return islandWorld;
|
||||
}
|
||||
|
||||
public World getNetherWorld() {
|
||||
return netherWorld;
|
||||
}
|
||||
|
||||
public World getEndWorld() {
|
||||
return endWorld;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,14 +1,18 @@
|
|||
package world.bentobox.bskyblock.generators;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.World.Environment;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.generator.BlockPopulator;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.bukkit.util.noise.PerlinOctaveGenerator;
|
||||
|
||||
import world.bentobox.bskyblock.BSkyBlock;
|
||||
|
@ -19,41 +23,51 @@ import world.bentobox.bskyblock.BSkyBlock;
|
|||
*/
|
||||
public class ChunkGeneratorWorld extends ChunkGenerator {
|
||||
|
||||
BSkyBlock addon;
|
||||
Random rand = new Random();
|
||||
PerlinOctaveGenerator gen;
|
||||
private final BSkyBlock addon;
|
||||
private final Random rand = new Random();
|
||||
private final Map<Vector, Material> roofChunk = new HashMap<>();
|
||||
|
||||
/**
|
||||
* @param addon - BSkyBlock object
|
||||
* @param addon - addon
|
||||
*/
|
||||
public ChunkGeneratorWorld(BSkyBlock addon) {
|
||||
super();
|
||||
this.addon = addon;
|
||||
makeNetherRoof();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, ChunkGenerator.BiomeGrid biomeGrid) {
|
||||
if (world.getEnvironment().equals(World.Environment.NETHER)) {
|
||||
return generateNetherChunks(world, random, chunkX, chunkZ, biomeGrid);
|
||||
}
|
||||
public ChunkData generateChunks(World world) {
|
||||
ChunkData result = createChunkData(world);
|
||||
if (addon.getSettings().getSeaHeight() != 0) {
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
if (world.getEnvironment().equals(Environment.NORMAL)) {
|
||||
biomeGrid.setBiome(x, z, addon.getSettings().getDefaultBiome());
|
||||
}
|
||||
for (int y = 0; y < addon.getSettings().getSeaHeight(); y++) {
|
||||
result.setBlock(x, y, z, Material.WATER);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (world.getEnvironment().equals(Environment.NORMAL) && addon.getSettings().getSeaHeight() > 0) {
|
||||
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));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biomeGrid) {
|
||||
setBiome(world, biomeGrid);
|
||||
return generateChunks(world);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// This needs to be set to return true to override minecraft's default
|
||||
// behavior
|
||||
@Override
|
||||
public boolean canSpawn(World world, int x, int z) {
|
||||
return true;
|
||||
|
@ -61,85 +75,81 @@ public class ChunkGeneratorWorld extends ChunkGenerator {
|
|||
|
||||
@Override
|
||||
public List<BlockPopulator> getDefaultPopulators(final World world) {
|
||||
return Arrays.asList(new BlockPopulator[0]);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/*
|
||||
* Nether Section
|
||||
*/
|
||||
private ChunkData generateNetherChunks(World world, Random random, int chunkX, int chunkZ, BiomeGrid biomeGrid) {
|
||||
ChunkData result = createChunkData(world);
|
||||
rand.setSeed(world.getSeed());
|
||||
gen = new PerlinOctaveGenerator((long) (random.nextLong() * random.nextGaussian()), 8);
|
||||
// This is a nether generator
|
||||
if (!world.getEnvironment().equals(Environment.NETHER)) {
|
||||
return result;
|
||||
}
|
||||
if (addon.getSettings().isNetherRoof()) {
|
||||
// Make the roof - common across the world
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
// Do the ceiling
|
||||
int maxHeight = world.getMaxHeight();
|
||||
result.setBlock(x, (maxHeight - 1), z, Material.BEDROCK);
|
||||
// Next three layers are a mix of bedrock and netherrack
|
||||
for (int y = 2; y < 5; y++) {
|
||||
double r = gen.noise(x, (maxHeight - y), z, 0.5, 0.5);
|
||||
if (r > 0D) {
|
||||
result.setBlock(x, (maxHeight - y), z, Material.BEDROCK);
|
||||
}
|
||||
}
|
||||
// Next three layers are a mix of netherrack and air
|
||||
for (int y = 5; y < 8; y++) {
|
||||
double r = gen.noise(x, (double)maxHeight - y, z, 0.5, 0.5);
|
||||
if (r > 0D) {
|
||||
result.setBlock(x, (maxHeight - y), z, Material.NETHERRACK);
|
||||
} else {
|
||||
result.setBlock(x, (maxHeight - y), z, Material.AIR);
|
||||
}
|
||||
}
|
||||
// Layer 8 may be glowstone
|
||||
double r = gen.noise(x, (double)maxHeight - 8, z, random.nextFloat(), random.nextFloat());
|
||||
if (r > 0.5D) {
|
||||
// Have blobs of glowstone
|
||||
switch (random.nextInt(4)) {
|
||||
case 1:
|
||||
// Single block
|
||||
result.setBlock(x, (maxHeight - 8), z, Material.GLOWSTONE);
|
||||
if (x < 14 && z < 14) {
|
||||
result.setBlock(x + 1, (maxHeight - 8), z + 1, Material.GLOWSTONE);
|
||||
result.setBlock(x + 2, (maxHeight - 8), z + 2, Material.GLOWSTONE);
|
||||
result.setBlock(x + 1, (maxHeight - 8), z + 2, Material.GLOWSTONE);
|
||||
result.setBlock(x + 1, (maxHeight - 8), z + 2, Material.GLOWSTONE);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
// Stalatite
|
||||
for (int i = 0; i < random.nextInt(10); i++) {
|
||||
result.setBlock(x, (maxHeight - 8 - i), z, Material.GLOWSTONE);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
result.setBlock(x, (maxHeight - 8), z, Material.GLOWSTONE);
|
||||
if (x > 3 && z > 3) {
|
||||
for (int xx = 0; xx < 3; xx++) {
|
||||
for (int zz = 0; zz < 3; zz++) {
|
||||
result.setBlock(x - xx, (maxHeight - 8 - random.nextInt(2)), z - xx, Material.GLOWSTONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
result.setBlock(x, (maxHeight - 8), z, Material.GLOWSTONE);
|
||||
}
|
||||
result.setBlock(x, (maxHeight - 8), z, Material.GLOWSTONE);
|
||||
} else {
|
||||
result.setBlock(x, (maxHeight - 8), z, Material.AIR);
|
||||
private void makeNetherRoof() {
|
||||
rand.setSeed(System.currentTimeMillis());
|
||||
PerlinOctaveGenerator gen = new PerlinOctaveGenerator((long) (rand.nextLong() * rand.nextGaussian()), 8);
|
||||
|
||||
// Make the roof - common across the world
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
// Do the ceiling
|
||||
setBlock(x, -1, z, Material.BEDROCK);
|
||||
// Next three layers are a mix of bedrock and netherrack
|
||||
for (int y = 2; y < 5; y++) {
|
||||
double r = gen.noise(x, - y, z, 0.5, 0.5);
|
||||
if (r > 0D) {
|
||||
setBlock(x, - y, z, Material.BEDROCK);
|
||||
}
|
||||
}
|
||||
// Next three layers are a mix of netherrack and air
|
||||
for (int y = 5; y < 8; y++) {
|
||||
double r = gen.noise(x, - y, z, 0.5, 0.5);
|
||||
if (r > 0D) {
|
||||
setBlock(x, -y, z, Material.NETHERRACK);
|
||||
} else {
|
||||
setBlock(x, -y, z, Material.AIR);
|
||||
}
|
||||
}
|
||||
// Layer 8 may be glowstone
|
||||
double r = gen.noise(x, - 8, z, rand.nextFloat(), rand.nextFloat());
|
||||
if (r > 0.5D) {
|
||||
// Have blobs of glowstone
|
||||
switch (rand.nextInt(4)) {
|
||||
case 1:
|
||||
// Single block
|
||||
setBlock(x, -8, z, Material.GLOWSTONE);
|
||||
if (x < 14 && z < 14) {
|
||||
setBlock(x + 1, -8, z + 1, Material.GLOWSTONE);
|
||||
setBlock(x + 2, -8, z + 2, Material.GLOWSTONE);
|
||||
setBlock(x + 1, -8, z + 2, Material.GLOWSTONE);
|
||||
setBlock(x + 1, -8, z + 2, Material.GLOWSTONE);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
// Stalactite
|
||||
for (int i = 0; i < rand.nextInt(10); i++) {
|
||||
setBlock(x, - 8 - i, z, Material.GLOWSTONE);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
setBlock(x, -8, z, Material.GLOWSTONE);
|
||||
if (x > 3 && z > 3) {
|
||||
for (int xx = 0; xx < 3; xx++) {
|
||||
for (int zz = 0; zz < 3; zz++) {
|
||||
setBlock(x - xx, - 8 - rand.nextInt(2), z - xx, Material.GLOWSTONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
setBlock(x, -8, z, Material.GLOWSTONE);
|
||||
}
|
||||
setBlock(x, -8, z, Material.GLOWSTONE);
|
||||
} else {
|
||||
setBlock(x, -8, z, Material.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void setBlock(int x, int y, int z, Material m) {
|
||||
roofChunk.put(new Vector(x, y, z), m);
|
||||
}
|
||||
}
|
|
@ -1,79 +1,30 @@
|
|||
name: BSkyBlock
|
||||
main: world.bentobox.bskyblock.BSkyBlock
|
||||
version: ${version}
|
||||
version: ${version}${build.number}
|
||||
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 their island level
|
||||
default: true
|
||||
bskyblock.island.sethome:
|
||||
description: Let the player set their island teleport point
|
||||
default: true
|
||||
permissions:
|
||||
# Non-command permissions
|
||||
bskyblock.island.lock:
|
||||
description: Allows island locking
|
||||
default: false
|
||||
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 commands
|
||||
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
|
||||
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.resethome:
|
||||
description: Allows setting or reseting of a player's home position
|
||||
default: op
|
||||
bskyblock.mod.clearreset:
|
||||
description: Allow clearing of island reset limit
|
||||
default: false
|
||||
bskyblock.mod.tp:
|
||||
description: Allows teleport to an island
|
||||
default: op
|
||||
bskyblock.mod.bypasscooldowns:
|
||||
description: Allow moderator to bypass cooldowns
|
||||
default: op
|
||||
bskyblock.mod.bypassdelays:
|
||||
description: Allow moderator to bypass delays
|
||||
default: op
|
||||
bskyblock.mod.bypassprotect:
|
||||
description: Allow moderator to bypass island protection
|
||||
default: op
|
||||
|
@ -81,56 +32,264 @@ permissions:
|
|||
description: Allow moderator to bypass island expulsion
|
||||
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.team:
|
||||
description: Enables modification of teams via kick and add commands
|
||||
default: false
|
||||
bskyblock.mod.name:
|
||||
description: Enables naming of player's islands
|
||||
default: false
|
||||
bskyblock.mod.resetname:
|
||||
description: Enables reset of player's island names
|
||||
default: false
|
||||
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.deleteisland:
|
||||
description: Let a player completely remove the island the player is on
|
||||
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.purge:
|
||||
description: Let a player purge old islands.
|
||||
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.reserve:
|
||||
description: Reserves an empty spot for a player's next island
|
||||
default: op
|
||||
bskyblock.admin.settingsreset:
|
||||
description: Resets all the islands to default protection settings
|
||||
bskyblock.mod.bypassban:
|
||||
description: Bypasses island ban
|
||||
default: op
|
||||
bskyblock.admin.noban:
|
||||
description: Player cannot be banned from an island
|
||||
default: op
|
||||
bskyblock.admin.setlanguage:
|
||||
description: Resets all player languages and sets the default language
|
||||
bskyblock.admin.noexpel:
|
||||
description: Player cannot be expelled from an island
|
||||
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: 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: 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
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"uniqueId": "default",
|
||||
"icon": "GRASS_BLOCK",
|
||||
"displayName": "&eThe Original SkyBlock",
|
||||
"description": [
|
||||
"&bStandard island, with a cow - moo!",
|
||||
"&aIncludes an Overworld island",
|
||||
"&cIncludes a Nether island",
|
||||
"&6Includes an End island"
|
||||
],
|
||||
"requirePermission": false,
|
||||
"blueprints": {
|
||||
"NORMAL": "island",
|
||||
"NETHER": "nether-island",
|
||||
"THE_END": "end-island"
|
||||
},
|
||||
"slot": 0
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"uniqueId": "double_island",
|
||||
"icon": "FURNACE",
|
||||
"displayName": "&cDouble Island",
|
||||
"description": [
|
||||
"&bTwo islands in one!",
|
||||
"&bCan you reach the",
|
||||
"&bdesert?"
|
||||
],
|
||||
"requirePermission": false,
|
||||
"blueprints": {
|
||||
"NORMAL": "double",
|
||||
"NETHER": "nether-island",
|
||||
"THE_END": "end-island"
|
||||
},
|
||||
"slot": 1
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"uniqueId": "harder_island",
|
||||
"icon": "SNOWBALL",
|
||||
"displayName": "&7Harder Island",
|
||||
"description": [
|
||||
"&fThis island is",
|
||||
"&fmuch harder and cold.",
|
||||
"&fBeware the &6lava&f!"
|
||||
],
|
||||
"requirePermission": false,
|
||||
"blueprints": {
|
||||
"NORMAL": "harder",
|
||||
"NETHER": "nether-island",
|
||||
"THE_END": "end-island"
|
||||
},
|
||||
"slot": 2
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,24 +1,59 @@
|
|||
# BSkyBlock Configuration 0.4.0-SNAPSHOT
|
||||
# This config file is dynamic and saved when the server is shutdown.
|
||||
# You cannot edit it while the server is running because changes will
|
||||
# be lost! Use in-game settings GUI or edit when server is offline.
|
||||
#
|
||||
# BSkyBlock Configuration {$version}
|
||||
bskyblock:
|
||||
command:
|
||||
# Island Command. What command users will run to access their island.
|
||||
# To define alias, just separate commands with white space.
|
||||
# Added since 1.3.0.
|
||||
island: island is skyblock sb
|
||||
# The island admin command.
|
||||
# To define alias, just separate commands with white space.
|
||||
# Added since 1.3.0.
|
||||
admin: bsbadmin bsb skyblockadmin sbadmin sba
|
||||
# The default action for new player command call.
|
||||
# Sub-command of main player command that will be run on first player command call.
|
||||
# By default it is sub-command 'create'.
|
||||
# Added since 1.13.1.
|
||||
new-player-action: create
|
||||
# The default action for player command.
|
||||
# Sub-command of main player command that will be run on each player command call.
|
||||
# By default it is sub-command 'go'.
|
||||
# Added since 1.13.1.
|
||||
default-action: go
|
||||
world:
|
||||
# Friendly name for this world. Used in admin commands. Must be a single word
|
||||
friendly-name: BSkyBlock
|
||||
# Name of the world - if it does not exist then it will be generated.
|
||||
# It acts like a prefix for nether and end (e.g. BSkyBlock, BSkyBlock_nether, BSkyBlock_end)
|
||||
world-name: BSkyBlock_world
|
||||
# It acts like a prefix for nether and end (e.g. bskyblock_world, bskyblock_world_nether, bskyblock_world_end)
|
||||
world-name: bskyblock_world
|
||||
# World difficulty setting - PEACEFUL, EASY, NORMAL, HARD
|
||||
# Other plugins may override this setting
|
||||
difficulty: NORMAL
|
||||
spawn-limits:
|
||||
# Spawn limits. These override the limits set in bukkit.yml
|
||||
# If set to a negative number, the server defaults will be used
|
||||
# Added since 1.11.2.
|
||||
monsters: -1
|
||||
# Added since 1.11.2.
|
||||
animals: -1
|
||||
# Added since 1.11.2.
|
||||
water-animals: -1
|
||||
# Added since 1.11.2.
|
||||
ambient: -1
|
||||
# Setting to 0 will disable animal spawns, but this is not recommended. Minecraft default is 400.
|
||||
# A negative value uses the server default
|
||||
# Added since 1.11.2.
|
||||
ticks-per-animal-spawns: -1
|
||||
# Setting to 0 will disable monster spawns, but this is not recommended. Minecraft default is 400.
|
||||
# A negative value uses the server default
|
||||
# Added since 1.11.2.
|
||||
ticks-per-monster-spawns: -1
|
||||
# Radius of island in blocks. (So distance between islands is twice this)
|
||||
# Will be rounded up to the nearest 16 blocks.
|
||||
# It is the same for every dimension : Overworld, Nether and End.
|
||||
# This value cannot be changed mid-game and the plugin will not start if it is different.
|
||||
distance-between-islands: 64
|
||||
# /!\ 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.
|
||||
distance-between-islands: 400
|
||||
# Default protection range radius in blocks. Cannot be larger than distance.
|
||||
# Admins can change protection sizes for players individually using /bsadmin setrange
|
||||
# Admins can change protection sizes for players individually using /bsbadmin range set <player> <new range>
|
||||
# or set this permission: bskyblock.island.range.<number>
|
||||
protection-range: 50
|
||||
# Start islands at these coordinates. This is where new islands will start in the
|
||||
|
@ -26,41 +61,52 @@ world:
|
|||
# calculate the closest location on the grid. Islands develop around this location
|
||||
# both positively and negatively in a square grid.
|
||||
# If none of this makes sense, leave it at 0,0.
|
||||
# /!\ 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.
|
||||
start-x: 0
|
||||
# /!\ 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.
|
||||
start-z: 0
|
||||
offset-x: 0
|
||||
offset-z: 0
|
||||
# Island height - Lowest is 5.
|
||||
# It is the y coordinate of the bedrock block in the schem
|
||||
island-height: 120
|
||||
# Use your own world generator for this world. In this case, the plugin will not generate
|
||||
# anything.
|
||||
# It is the y coordinate of the bedrock block in the schem.
|
||||
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.
|
||||
# See https://bukkit.gamepedia.com/Bukkit.yml#.2AOPTIONAL.2A_worlds
|
||||
use-own-generator: false
|
||||
# Sea height (don't changes this mid-game unless you delete the world)
|
||||
# Minimum is 0, which means you are playing Skyblock!
|
||||
# If sea height is less than about 10, then players will drop right through it
|
||||
# if it exists. Makes for an interesting variation on skyblock.
|
||||
# /!\ 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.
|
||||
sea-height: 0
|
||||
# Maximum number of islands in the world. Set to 0 for unlimited.
|
||||
# If the number of islands is greater than this number, no new island will be created.
|
||||
# Maximum number of islands in the world. Set to -1 or 0 for unlimited.
|
||||
# If the number of islands is greater than this number, it will stop players from creating islands.
|
||||
max-islands: 0
|
||||
# The default game mode for this world. Players will be set to this mode when they create
|
||||
# a new island for example. Options are SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR
|
||||
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
|
||||
ban-limit: -1
|
||||
nether:
|
||||
# Generate Nether - if this is false, the nether world will not be made and access to
|
||||
# the nether will not occur. Other plugins may still enable portal usage.
|
||||
# Note: Some challenges will not be possible if there is no nether.
|
||||
# Note: Some default challenges will not be possible if there is no nether.
|
||||
# Note that with a standard nether all players arrive at the same portal and entering a
|
||||
# portal will return them back to their islands.
|
||||
generate: true
|
||||
# Islands in Nether. Change to false for standard vanilla nether.
|
||||
# /!\ 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
|
||||
# Nether trees are made if a player grows a tree in the nether (gravel and glowstone)
|
||||
# Applies to both vanilla and islands Nether
|
||||
trees: true
|
||||
# Make the nether roof, if false, there is nothing up there
|
||||
# Change to false if lag is a problem from the generation
|
||||
# Only applies to islands Nether
|
||||
|
@ -70,105 +116,209 @@ 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:
|
||||
- ENDERMAN
|
||||
- ZOMBIE_VILLAGER
|
||||
- WITHER
|
||||
- PIG_ZOMBIE
|
||||
- ZOMBIE_VILLAGER
|
||||
- ENDERMAN
|
||||
# World flags. These are boolean settings for various flags for this world
|
||||
flags:
|
||||
CREEPER_DAMAGE: true
|
||||
PISTON_PUSH: false
|
||||
OBSIDIAN_SCOOPING: true
|
||||
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
|
||||
WORLD_TNT_DAMAGE: false
|
||||
ENTER_EXIT_MESSAGES: true
|
||||
ENDERMAN_DEATH_DROP: true
|
||||
OFFLINE_REDSTONE: true
|
||||
REMOVE_MOBS: true
|
||||
ENDER_CHEST: false
|
||||
REMOVE_END_EXIT_ISLAND: true
|
||||
OFFLINE_GROWTH: true
|
||||
ITEM_FRAME_DAMAGE: 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: Visitor = 0, Member = 900, Owner = 1000
|
||||
# Ranks are the following:
|
||||
# VISITOR = 0
|
||||
# COOP = 200
|
||||
# TRUSTED = 400
|
||||
# MEMBER = 500
|
||||
# SUB-OWNER = 900
|
||||
# OWNER = 1000
|
||||
default-island-flags:
|
||||
HURT_ANIMALS: 500
|
||||
COLLECT_WATER: 500
|
||||
DRAGON_EGG: 500
|
||||
REDSTONE: 500
|
||||
BUCKET: 500
|
||||
BUTTON: 500
|
||||
FIRE_EXTINGUISH: 500
|
||||
LOCK: 0
|
||||
ENDER_PEARL: 500
|
||||
DOOR: 500
|
||||
BEACON: 500
|
||||
TRAPDOOR: 500
|
||||
PRESSURE_PLATE: 0
|
||||
BREAK_HOPPERS: 500
|
||||
FURNACE: 500
|
||||
PLACE_BLOCKS: 500
|
||||
MINECART: 500
|
||||
ANVIL: 500
|
||||
FIRE: 500
|
||||
CRAFTING: 0
|
||||
FISH_SCOOPING: 500
|
||||
END_PORTAL: 500
|
||||
BREEDING: 500
|
||||
TNT: 500
|
||||
HURT_VILLAGERS: 500
|
||||
ENCHANTING: 0
|
||||
SHEARING: 500
|
||||
SPAWN_EGGS: 500
|
||||
BED: 500
|
||||
TURTLE_EGGS: 500
|
||||
FROST_WALKER: 500
|
||||
COLLECT_LAVA: 500
|
||||
MILKING: 0
|
||||
BREAK_SPAWNERS: 500
|
||||
LEVER: 500
|
||||
RIDING: 500
|
||||
ELYTRA: 0
|
||||
HURT_MONSTERS: 0
|
||||
RIDING: 500
|
||||
CAKE: 500
|
||||
NAME_TAG: 500
|
||||
ARMOR_STAND: 500
|
||||
GATE: 0
|
||||
TRADING: 0
|
||||
EGGS: 500
|
||||
PORTAL: 0
|
||||
ITEM_DROP: 0
|
||||
CHEST: 500
|
||||
NOTE_BLOCK: 0
|
||||
LEASH: 500
|
||||
BREAK_BLOCKS: 500
|
||||
MOUNT_INVENTORY: 500
|
||||
CHORUS_FRUIT: 500
|
||||
JUKEBOX: 500
|
||||
FLINT_AND_STEEL: 500
|
||||
NETHER_PORTAL: 500
|
||||
LECTERN: 500
|
||||
ITEM_PICKUP: 0
|
||||
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
|
||||
HIVE: 500
|
||||
DYE: 500
|
||||
PLACE_BLOCKS: 500
|
||||
ITEM_FRAME: 500
|
||||
CRAFTING: 0
|
||||
ENCHANTING: 0
|
||||
SHEARING: 500
|
||||
BOAT: 500
|
||||
BED: 500
|
||||
SPAWN_EGGS: 500
|
||||
MILKING: 0
|
||||
DISPENSER: 500
|
||||
GATE: 0
|
||||
EXPERIENCE_PICKUP: 500
|
||||
HOPPER: 500
|
||||
LEASH: 500
|
||||
MOUNT_INVENTORY: 500
|
||||
BREAK_BLOCKS: 500
|
||||
CHORUS_FRUIT: 500
|
||||
CONTAINER: 500
|
||||
POTION_THROWING: 500
|
||||
JUKEBOX: 500
|
||||
# These are the default settings for new islands
|
||||
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 are the settings visible to users. (Not implemented yet)
|
||||
visible-settings: []
|
||||
# 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:
|
||||
- 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
|
||||
- spawnmob
|
||||
# Falling banned commands - players cannot use these commands when falling
|
||||
# if the PREVENT_TELEPORT_WHEN_FALLING world setting flag is active
|
||||
# Added since 1.8.0.
|
||||
falling-banned-commands:
|
||||
- warp
|
||||
- spawn
|
||||
island:
|
||||
# Default max team size
|
||||
# Use this permission to set for specific user groups: askyblock.team.maxsize.<number>
|
||||
# Permission size cannot be less than the default below.
|
||||
max-team-size: 4
|
||||
# Default maximum number of coop rank members per island
|
||||
# Players can have the bskyblock.coop.maxsize.<number> permission to be bigger but
|
||||
# permission size cannot be less than the default below.
|
||||
# Added since 1.13.0.
|
||||
max-coop-size: 4
|
||||
# Default maximum number of trusted rank members per island
|
||||
# Players can have the bskyblock.trust.maxsize.<number> permission to be bigger but
|
||||
# permission size cannot be less than the default below.
|
||||
# Added since 1.13.0.
|
||||
max-trusted-size: 4
|
||||
# Default maximum number of homes a player can have. Min = 1
|
||||
# Accessed via sethome <number> or go <number>
|
||||
# Use this permission to set for specific user groups: askyblock.island.maxhomes.<number>
|
||||
# Accessed via /is sethome <number> or /is go <number>
|
||||
max-homes: 1
|
||||
reset:
|
||||
# How many resets a player is allowed (override with /asadmin clearreset <player>)
|
||||
# How many resets a player is allowed (manage with /bsbadmin reset add/remove/reset/set command)
|
||||
# Value of -1 means unlimited, 0 means hardcore - no resets.
|
||||
# Example, 2 resets means they get 2 resets or 3 islands lifetime
|
||||
reset-limit: -1
|
||||
|
@ -179,11 +329,10 @@ island:
|
|||
# Leave this true to avoid players exploiting free islands
|
||||
leavers-lose-reset: false
|
||||
# Allow kicked players to keep their inventory.
|
||||
# If false, kicked player's inventory will be thrown at the island leader if the
|
||||
# kicked player is online and in the island world.
|
||||
# Overrides the on-leave inventory reset for kicked players.
|
||||
kicked-keep-inventory: false
|
||||
on-join:
|
||||
# What the plugin should reset when the player joins or creates an island
|
||||
# What the addon should reset when the player joins or creates an island
|
||||
# Reset Money - if this is true, will reset the player's money to the starting money
|
||||
# Recommendation is that this is set to true, but if you run multi-worlds
|
||||
# make sure your economy handles multi-worlds too.
|
||||
|
@ -192,6 +341,15 @@ island:
|
|||
# Note: if you have MultiInv running or a similar inventory control plugin, that
|
||||
# plugin may still reset the inventory when the world changes.
|
||||
inventory: false
|
||||
# Reset health - if true, the player's health will be reset.
|
||||
# Added since 1.8.0.
|
||||
health: true
|
||||
# Reset hunger - if true, the player's hunger will be reset.
|
||||
# Added since 1.8.0.
|
||||
hunger: true
|
||||
# Reset experience points - if true, the player's experience will be reset.
|
||||
# Added since 1.8.0.
|
||||
exp: false
|
||||
# Reset Ender Chest - if true, the player's Ender Chest will be cleared.
|
||||
ender-chest: false
|
||||
on-leave:
|
||||
|
@ -204,17 +362,110 @@ island:
|
|||
# Note: if you have MultiInv running or a similar inventory control plugin, that
|
||||
# plugin may still reset the inventory when the world changes.
|
||||
inventory: false
|
||||
# Reset health - if true, the player's health will be reset.
|
||||
# Added since 1.8.0.
|
||||
health: false
|
||||
# Reset hunger - if true, the player's hunger will be reset.
|
||||
# Added since 1.8.0.
|
||||
hunger: false
|
||||
# Reset experience - if true, the player's experience will be reset.
|
||||
# Added since 1.8.0.
|
||||
exp: false
|
||||
# Reset Ender Chest - if true, the player's Ender Chest will be cleared.
|
||||
ender-chest: false
|
||||
require-confirmation:
|
||||
reset: true
|
||||
# Have player's respawn on their island if they die
|
||||
respawn-on-island: false
|
||||
create-island-on-first-login:
|
||||
# Toggles the automatic island creation upon the player's first login on your server.
|
||||
# If set to true,
|
||||
# * Upon connecting to your server for the first time, the player will be told that
|
||||
# an island will be created for him.
|
||||
# * Make sure you have a Blueprint Bundle called "default": this is the one that will
|
||||
# be used to create the island.
|
||||
# * An island will be created for the player without needing him to run the create command.
|
||||
# If set to false, this will disable this feature entirely.
|
||||
# Warning:
|
||||
# * If you are running multiple gamemodes on your server, and all of them have
|
||||
# this feature enabled, an island in all the gamemodes will be created simultaneously.
|
||||
# However, it is impossible to know on which island the player will be teleported to afterwards.
|
||||
# * Island creation can be resource-intensive, please consider the options below to help mitigate
|
||||
# the potential issues, especially if you expect a lot of players to connect to your server
|
||||
# in a limited period of time.
|
||||
# Added since 1.9.0.
|
||||
enable: false
|
||||
# Time in seconds after the player logged in, before his island gets created.
|
||||
# If set to 0 or less, the island will be created directly upon the player's login.
|
||||
# It is recommended to keep this value under a minute's time.
|
||||
# Added since 1.9.0.
|
||||
delay: 5
|
||||
# Toggles whether the island creation should be aborted if the player logged off while the
|
||||
# delay (see the option above) has not worn off yet.
|
||||
# If set to true,
|
||||
# * If the player has logged off the server while the delay (see the option above) has not
|
||||
# worn off yet, this will cancel the island creation.
|
||||
# * If the player relogs afterward, since he will not be recognized as a new player, no island
|
||||
# would be created for him.
|
||||
# * If the island creation started before the player logged off, it will continue.
|
||||
# If set to false, the player's island will be created even if he went offline in the meantime.
|
||||
# Note this option has no effect if the delay (see the option above) is set to 0 or less.
|
||||
# Added since 1.9.0.
|
||||
abort-on-logout: true
|
||||
# Toggles whether the player should be teleported automatically to his island when it is created.
|
||||
# If set to false, the player will be told his island is ready but will have to teleport to his island using the command.
|
||||
# Added since 1.10.0.
|
||||
teleport-player-to-island-when-created: true
|
||||
# Create Nether or End islands if they are missing when a player goes through a portal.
|
||||
# Nether and End islands are usually pasted when a player makes their island, but if they are
|
||||
# missing for some reason, you can switch this on.
|
||||
# Note that bedrock removal glitches can exploit this option.
|
||||
# Added since 1.10.0.
|
||||
create-missing-nether-end-islands: false
|
||||
commands:
|
||||
# List of commands to run when a player joins an island or creates one.
|
||||
# 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"
|
||||
# Added since 1.8.0.
|
||||
on-join: []
|
||||
# List of commands to run when a player leaves an island, resets his island or gets kicked from it.
|
||||
# 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.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:
|
||||
|
@ -222,10 +473,11 @@ island:
|
|||
counted: true
|
||||
# Maximum number of deaths to count. The death count can be used by add-ons.
|
||||
max: 10
|
||||
sum-team: false
|
||||
# When a player joins a team, reset their death count
|
||||
team-join-reset: true
|
||||
togglePvPCooldown: 0
|
||||
# Reset player death count when they start a new island or reset an island
|
||||
# Added since 1.6.0.
|
||||
reset-on-new-island: true
|
||||
protection:
|
||||
# Geo restrict mobs.
|
||||
# Mobs that exit the island space where they were spawned will be removed.
|
||||
|
@ -233,6 +485,10 @@ protection:
|
|||
- GHAST
|
||||
- BAT
|
||||
- BLAZE
|
||||
# BSkyBlock blocked mobs.
|
||||
# List of mobs that should not spawn in BSkyBlock.
|
||||
# Added since 1.13.1.
|
||||
block-mobs: []
|
||||
# Invincible visitors. List of damages that will not affect visitors.
|
||||
# Make list blank if visitors should receive all damages
|
||||
invincible-visitors:
|
||||
|
@ -260,9 +516,6 @@ protection:
|
|||
- HOT_FLOOR
|
||||
- CRAMMING
|
||||
- VOID
|
||||
panel:
|
||||
close-on-click-outside: true
|
||||
do-not-edit-these-settings:
|
||||
# These settings should not be edited
|
||||
reset-epoch: 0
|
||||
uniqueId: config
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
###########################################################################################
|
||||
# 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 #
|
||||
# #
|
||||
# Translation by: CZghost #
|
||||
###########################################################################################
|
||||
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: '&cBSkyBlock'
|
||||
line1: Vítej!
|
||||
line2: '[name]'
|
||||
line3: Nespadni! &c<3
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: Herzlich Willkommen!
|
||||
line2: "[name]"
|
||||
line3: Fall nicht runter! &c<3
|
|
@ -0,0 +1,12 @@
|
|||
###########################################################################################
|
||||
# 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: "Welcome!"
|
||||
line2: "[name]"
|
||||
line3: "Do not fall! &c<3"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
###########################################################################################################
|
||||
# Este es un archivo YML. Tenga cuidado al editar. Revisa tus ediciones en un verificador de YAML como #
|
||||
# el de http://yaml-online-parser.appspot.com #
|
||||
###########################################################################################################
|
||||
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: "Bienvenido!"
|
||||
line2: "[name]"
|
||||
line3: "No te caigas! &c<3"
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: Bienvenue!
|
||||
line2: "[name]"
|
||||
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"
|
||||
line2: "[name]"
|
||||
line3: 'Jangan jatuh! '
|
||||
line1: Selamat datang!
|
|
@ -0,0 +1,6 @@
|
|||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: "Benvenuto/a!"
|
||||
line2: "[name]"
|
||||
line3: "Non cadere! &c<3"
|
|
@ -0,0 +1,6 @@
|
|||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line2: "[name]"
|
||||
line3: 落ちるな!
|
||||
line1: ようこそ!
|
|
@ -0,0 +1,6 @@
|
|||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line2: "[name]"
|
||||
line3: '떨어지지 마! '
|
||||
line1: 환영!
|
|
@ -0,0 +1,6 @@
|
|||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: Sveicināts!
|
||||
line2: "[name]"
|
||||
line3: Nenokrīti! &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"
|
|
@ -0,0 +1,12 @@
|
|||
###########################################################################################
|
||||
# To jest plik YML. Uważaj podczas edycji. Sprawdź swoje edycje na weryfikatorach YAML #
|
||||
# takich jak http://yaml-online-parser.appspot.com #
|
||||
###########################################################################################
|
||||
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: "Witaj!"
|
||||
line2: "[name]"
|
||||
line3: "Nie spadnij! &c<3"
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&cBSkyBlock"
|
||||
line1: Bem vindo(a)!
|
||||
line2: "[name]"
|
||||
line3: Não caia! &c<3
|
|
@ -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
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&c空岛生存"
|
||||
line1: 欢迎你来到这里!
|
||||
line2: "[name]"
|
||||
line3: 千万不要掉下去! &c<3
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
bskyblock:
|
||||
sign:
|
||||
line0: "&c空島生存"
|
||||
line1: 歡迎!
|
||||
line2: "[name]"
|
||||
line3: 小心不要掉下去喔! &c<3
|
|
@ -0,0 +1,9 @@
|
|||
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}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,279 @@
|
|||
package world.bentobox.bskyblock;
|
||||
|
||||
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;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Server;
|
||||
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;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.stubbing.Answer;
|
||||
import org.powermock.api.mockito.PowerMockito;
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import org.powermock.reflect.Whitebox;
|
||||
|
||||
import world.bentobox.bentobox.BentoBox;
|
||||
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;
|
||||
import world.bentobox.bentobox.managers.FlagsManager;
|
||||
import world.bentobox.bentobox.managers.IslandWorldManager;
|
||||
import world.bentobox.bentobox.managers.IslandsManager;
|
||||
import world.bentobox.bskyblock.generators.ChunkGeneratorWorld;
|
||||
|
||||
/**
|
||||
* @author tastybento
|
||||
*
|
||||
*/
|
||||
@RunWith(PowerMockRunner.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;
|
||||
|
||||
private BSkyBlock addon;
|
||||
@Mock
|
||||
private BentoBox plugin;
|
||||
@Mock
|
||||
private FlagsManager fm;
|
||||
@Mock
|
||||
private Settings settings;
|
||||
|
||||
private static AbstractDatabaseHandler<Object> h;
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
@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"));
|
||||
|
||||
}
|
||||
|
||||
private void deleteAll(File file) throws IOException {
|
||||
if (file.exists()) {
|
||||
Files.walk(file.toPath()).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @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);
|
||||
|
||||
// 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);
|
||||
|
||||
// Island World Manager
|
||||
IslandWorldManager iwm = mock(IslandWorldManager.class);
|
||||
when(plugin.getIWM()).thenReturn(iwm);
|
||||
|
||||
// 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);
|
||||
|
||||
// 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));
|
||||
|
||||
// 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())) {
|
||||
|
||||
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);
|
||||
|
||||
// Flags manager
|
||||
when(plugin.getFlagsManager()).thenReturn(fm);
|
||||
when(fm.getFlags()).thenReturn(Collections.emptyList());
|
||||
|
||||
// Settings
|
||||
when(plugin.getSettings()).thenReturn(settings);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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#onEnable()}.
|
||||
*/
|
||||
@Test
|
||||
public void testOnEnable() {
|
||||
testOnLoad();
|
||||
addon.onEnable();
|
||||
assertTrue(addon.getPlayerCommand().isPresent());
|
||||
assertTrue(addon.getAdminCommand().isPresent());
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,507 @@
|
|||
package world.bentobox.bskyblock;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Difficulty;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author tastybento
|
||||
*
|
||||
*/
|
||||
public class SettingsTest {
|
||||
|
||||
Settings s;
|
||||
|
||||
/**
|
||||
* @throws java.lang.Exception
|
||||
*/
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
s = new Settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setFriendlyName(java.lang.String)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetFriendlyName() {
|
||||
s.setFriendlyName("name");
|
||||
assertEquals("name", s.getFriendlyName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setWorldName(java.lang.String)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetWorldName() {
|
||||
s.setWorldName("name");
|
||||
assertEquals("name", s.getWorldName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setDifficulty(org.bukkit.Difficulty)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetDifficulty() {
|
||||
s.setDifficulty(Difficulty.PEACEFUL);
|
||||
assertEquals(Difficulty.PEACEFUL, s.getDifficulty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setIslandDistance(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetIslandDistance() {
|
||||
s.setIslandDistance(123);
|
||||
assertEquals(123, s.getIslandDistance());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setIslandProtectionRange(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetIslandProtectionRange() {
|
||||
s.setIslandProtectionRange(123);
|
||||
assertEquals(123, s.getIslandProtectionRange());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setIslandStartX(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetIslandStartX() {
|
||||
s.setIslandStartX(123);
|
||||
assertEquals(123, s.getIslandStartX());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setIslandStartZ(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetIslandStartZ() {
|
||||
s.setIslandStartZ(123);
|
||||
assertEquals(123, s.getIslandStartZ());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setIslandXOffset(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetIslandXOffset() {
|
||||
s.setIslandXOffset(123);
|
||||
assertEquals(123, s.getIslandXOffset());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setIslandZOffset(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetIslandZOffset() {
|
||||
s.setIslandZOffset(123);
|
||||
assertEquals(123, s.getIslandZOffset());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setIslandHeight(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetIslandHeight() {
|
||||
s.setIslandHeight(123);
|
||||
assertEquals(123, s.getIslandHeight());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setUseOwnGenerator(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetUseOwnGenerator() {
|
||||
s.setUseOwnGenerator(true);
|
||||
assertTrue(s.isUseOwnGenerator());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setSeaHeight(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetSeaHeight() {
|
||||
s.setSeaHeight(123);
|
||||
assertEquals(123, s.getSeaHeight());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setMaxIslands(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetMaxIslands() {
|
||||
s.setMaxIslands(123);
|
||||
assertEquals(123, s.getMaxIslands());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setDefaultGameMode(org.bukkit.GameMode)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetDefaultGameMode() {
|
||||
s.setDefaultGameMode(GameMode.CREATIVE);
|
||||
assertEquals(GameMode.CREATIVE, s.getDefaultGameMode());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setNetherGenerate(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetNetherGenerate() {
|
||||
s.setNetherGenerate(true);
|
||||
assertTrue(s.isNetherGenerate());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setNetherIslands(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetNetherIslands() {
|
||||
s.setNetherIslands(true);
|
||||
assertTrue(s.isNetherIslands());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setNetherRoof(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetNetherRoof() {
|
||||
s.setNetherRoof(true);
|
||||
assertTrue(s.isNetherRoof());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setNetherSpawnRadius(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetNetherSpawnRadius() {
|
||||
s.setNetherSpawnRadius(123);
|
||||
assertEquals(123, s.getNetherSpawnRadius());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setEndGenerate(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetEndGenerate() {
|
||||
s.setEndGenerate(true);
|
||||
assertTrue(s.isEndGenerate());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setEndIslands(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetEndIslands() {
|
||||
s.setEndIslands(true);
|
||||
assertTrue(s.isEndIslands());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setDragonSpawn(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetDragonSpawn() {
|
||||
s.setDragonSpawn(true);
|
||||
assertTrue(s.isDragonSpawn());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setRemoveMobsWhitelist(java.util.Set)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetRemoveMobsWhitelist() {
|
||||
Set<EntityType> wl = Collections.emptySet();
|
||||
s.setRemoveMobsWhitelist(wl);
|
||||
assertEquals(wl, s.getRemoveMobsWhitelist());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setWorldFlags(java.util.Map)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetWorldFlags() {
|
||||
Map<String, Boolean> worldFlags = Collections.emptyMap();
|
||||
s.setWorldFlags(worldFlags);
|
||||
assertEquals(worldFlags, s.getWorldFlags());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setHiddenFlags(java.util.List)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetVisibleSettings() {
|
||||
List<String> visibleSettings = Collections.emptyList();
|
||||
s.setHiddenFlags(visibleSettings);
|
||||
assertEquals(visibleSettings, s.getHiddenFlags());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setVisitorBannedCommands(java.util.List)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetVisitorBannedCommands() {
|
||||
List<String> visitorBannedCommands = Collections.emptyList();
|
||||
s.setVisitorBannedCommands(visitorBannedCommands);
|
||||
assertEquals(visitorBannedCommands, s.getVisitorBannedCommands());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setMaxTeamSize(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetMaxTeamSize() {
|
||||
s.setMaxTeamSize(123);
|
||||
assertEquals(123, s.getMaxTeamSize());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setMaxHomes(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetMaxHomes() {
|
||||
s.setMaxHomes(123);
|
||||
assertEquals(123, s.getMaxHomes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setResetLimit(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetResetLimit() {
|
||||
s.setResetLimit(123);
|
||||
assertEquals(123, s.getResetLimit());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setLeaversLoseReset(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetLeaversLoseReset() {
|
||||
s.setLeaversLoseReset(true);
|
||||
assertTrue(s.isLeaversLoseReset());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setKickedKeepInventory(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetKickedKeepInventory() {
|
||||
s.setKickedKeepInventory(true);
|
||||
assertTrue(s.isKickedKeepInventory());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setOnJoinResetMoney(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetOnJoinResetMoney() {
|
||||
s.setOnJoinResetMoney(true);
|
||||
assertTrue(s.isOnJoinResetMoney());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setOnJoinResetInventory(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetOnJoinResetInventory() {
|
||||
s.setOnJoinResetInventory(true);
|
||||
assertTrue(s.isOnJoinResetInventory());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setOnJoinResetEnderChest(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetOnJoinResetEnderChest() {
|
||||
s.setOnJoinResetEnderChest(true);
|
||||
assertTrue(s.isOnJoinResetEnderChest());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setOnLeaveResetMoney(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetOnLeaveResetMoney() {
|
||||
s.setOnLeaveResetMoney(true);
|
||||
assertTrue(s.isOnLeaveResetMoney());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setOnLeaveResetInventory(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetOnLeaveResetInventory() {
|
||||
s.setOnLeaveResetInventory(true);
|
||||
assertTrue(s.isOnLeaveResetInventory());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setOnLeaveResetEnderChest(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetOnLeaveResetEnderChest() {
|
||||
s.setOnLeaveResetEnderChest(true);
|
||||
assertTrue(s.isOnLeaveResetEnderChest());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setDeathsCounted(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetDeathsCounted() {
|
||||
s.setDeathsCounted(true);
|
||||
assertTrue(s.isDeathsCounted());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setDeathsMax(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetDeathsMax() {
|
||||
s.setDeathsMax(123);
|
||||
assertEquals(123, s.getDeathsMax());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setTeamJoinDeathReset(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetTeamJoinDeathReset() {
|
||||
s.setTeamJoinDeathReset(true);
|
||||
assertTrue(s.isTeamJoinDeathReset());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setGeoLimitSettings(java.util.List)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetGeoLimitSettings() {
|
||||
List<String> geoLimitSettings = Collections.emptyList();
|
||||
s.setGeoLimitSettings(geoLimitSettings);
|
||||
assertEquals(geoLimitSettings, s.getGeoLimitSettings());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setIvSettings(java.util.List)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetIvSettings() {
|
||||
List<String> ivSettings = Collections.emptyList();
|
||||
s.setIvSettings(ivSettings);
|
||||
assertEquals(ivSettings, s.getIvSettings());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setAllowSetHomeInNether(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetAllowSetHomeInNether() {
|
||||
s.setAllowSetHomeInNether(true);
|
||||
assertTrue(s.isAllowSetHomeInNether());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setAllowSetHomeInTheEnd(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetAllowSetHomeInTheEnd() {
|
||||
s.setAllowSetHomeInTheEnd(true);
|
||||
assertTrue(s.isAllowSetHomeInTheEnd());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setRequireConfirmationToSetHomeInNether(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetRequireConfirmationToSetHomeInNether() {
|
||||
s.setRequireConfirmationToSetHomeInNether(true);
|
||||
assertTrue(s.isRequireConfirmationToSetHomeInNether());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setRequireConfirmationToSetHomeInTheEnd(boolean)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetRequireConfirmationToSetHomeInTheEnd() {
|
||||
s.setRequireConfirmationToSetHomeInTheEnd(true);
|
||||
assertTrue(s.isRequireConfirmationToSetHomeInTheEnd());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setResetEpoch(long)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetResetEpoch() {
|
||||
s.setResetEpoch(123);
|
||||
assertEquals(123, s.getResetEpoch());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#getPermissionPrefix()}.
|
||||
*/
|
||||
@Test
|
||||
public void testGetPermissionPrefix() {
|
||||
assertEquals("bskyblock", s.getPermissionPrefix());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#isWaterUnsafe()}.
|
||||
*/
|
||||
@Test
|
||||
public void testIsWaterUnsafe() {
|
||||
assertFalse(s.isWaterUnsafe());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setDefaultBiome(org.bukkit.block.Biome)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetDefaultBiome() {
|
||||
s.setDefaultBiome(Biome.BADLANDS);
|
||||
assertEquals(Biome.BADLANDS, s.getDefaultBiome());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#setBanLimit(int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testSetBanLimit() {
|
||||
s.setBanLimit(123);
|
||||
assertEquals(123, s.getBanLimit());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#getIslandCommand()}.
|
||||
*/
|
||||
@Test
|
||||
public void testGetIslandCommand() {
|
||||
s.setPlayerCommandAliases("island");
|
||||
assertEquals("island", s.getPlayerCommandAliases());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.Settings#getAdminCommand()}.
|
||||
*/
|
||||
@Test
|
||||
public void testGetAdminCommand() {
|
||||
s.setAdminCommandAliases("admin");
|
||||
assertEquals("admin", s.getAdminCommandAliases());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package world.bentobox.bskyblock.commands;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import world.bentobox.bentobox.api.addons.Addon;
|
||||
import world.bentobox.bentobox.api.addons.AddonDescription;
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
|
||||
/**
|
||||
* @author tastybento
|
||||
*
|
||||
*/
|
||||
public class IslandAboutCommandTest {
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.commands.IslandAboutCommand#execute(world.bentobox.bentobox.api.user.User, java.lang.String, java.util.List)}.
|
||||
*/
|
||||
@Test
|
||||
public void testExecuteUserStringListOfString() {
|
||||
CompositeCommand ic= mock(CompositeCommand.class);
|
||||
Addon addon = mock(Addon.class);
|
||||
AddonDescription desc = new AddonDescription.Builder("","BSkyBlock","1.2.3").build();
|
||||
when(addon.getDescription()).thenReturn(desc);
|
||||
when(ic.getAddon()).thenReturn(addon);
|
||||
IslandAboutCommand c = new IslandAboutCommand(ic);
|
||||
User user = mock(User.class);
|
||||
c.execute(user, "", Collections.emptyList());
|
||||
// Verify
|
||||
Mockito.verify(user).sendRawMessage(Mockito.eq("Copyright (c) 2017 - 2022 tastybento, Poslovitch"));
|
||||
Mockito.verify(user).sendRawMessage(Mockito.eq("About BSkyBlock 1.2.3:"));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,196 @@
|
|||
package world.bentobox.bskyblock.generators;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.atLeast;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
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;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.powermock.api.mockito.PowerMockito;
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
|
||||
import world.bentobox.bskyblock.BSkyBlock;
|
||||
import world.bentobox.bskyblock.Settings;
|
||||
|
||||
/**
|
||||
* @author tastybento
|
||||
*
|
||||
*/
|
||||
@RunWith(PowerMockRunner.class)
|
||||
@PrepareForTest({Bukkit.class})
|
||||
public class ChunkGeneratorWorldTest {
|
||||
|
||||
@Mock
|
||||
private BSkyBlock addon;
|
||||
private ChunkGeneratorWorld cg;
|
||||
@Mock
|
||||
private World world;
|
||||
private final Random random = new Random();
|
||||
@Mock
|
||||
private BiomeGrid biomeGrid;
|
||||
@Mock
|
||||
private Settings settings;
|
||||
@Mock
|
||||
private ChunkData data;
|
||||
|
||||
/**
|
||||
* @throws java.lang.Exception
|
||||
*/
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
// Bukkit
|
||||
PowerMockito.mockStatic(Bukkit.class);
|
||||
Server server = mock(Server.class);
|
||||
when(server.createChunkData(any())).thenReturn(data);
|
||||
when(Bukkit.getServer()).thenReturn(server);
|
||||
|
||||
// Instance
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws java.lang.Exception
|
||||
*/
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}.
|
||||
*/
|
||||
@Test
|
||||
public void testGenerateChunkDataWorldRandomIntIntBiomeGridOverworldVoid() {
|
||||
ChunkData cd = cg.generateChunkData(world, random, 0 , 0 , biomeGrid);
|
||||
assertEquals(data, cd);
|
||||
// Verifications
|
||||
// Default biome
|
||||
verify(settings).getDefaultBiome();
|
||||
verify(biomeGrid, times(64)).setBiome(anyInt(), anyInt(), anyInt(), any());
|
||||
// Sea height
|
||||
verify(settings).getSeaHeight();
|
||||
// Void
|
||||
verify(cd, never()).setRegion(anyInt(), anyInt(), anyInt(), anyInt(), anyInt(), anyInt(), any(Material.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}.
|
||||
*/
|
||||
@Test
|
||||
public void testGenerateChunkDataWorldRandomIntIntBiomeGridOverworldSea() {
|
||||
// Set sea height
|
||||
when(settings.getSeaHeight()).thenReturn(10);
|
||||
ChunkData cd = cg.generateChunkData(world, random, 0 , 0 , biomeGrid);
|
||||
assertEquals(data, cd);
|
||||
// Verifications
|
||||
// Default biome
|
||||
verify(settings).getDefaultBiome();
|
||||
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
|
||||
verify(cd).setRegion(0, 0, 0, 16, 11, 16, Material.WATER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}.
|
||||
*/
|
||||
@Test
|
||||
public void testGenerateChunkDataWorldRandomIntIntBiomeGridEnd() {
|
||||
when(world.getEnvironment()).thenReturn(World.Environment.THE_END);
|
||||
ChunkData cd = cg.generateChunkData(world, random, 0 , 0 , biomeGrid);
|
||||
assertEquals(data, cd);
|
||||
// Verifications
|
||||
// Default biome
|
||||
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
|
||||
verify(cd, never()).setRegion(anyInt(), anyInt(), anyInt(), anyInt(), anyInt(), anyInt(), any(Material.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}.
|
||||
*/
|
||||
@Test
|
||||
public void testGenerateChunkDataWorldRandomIntIntBiomeGridNetherWithRoof() {
|
||||
when(world.getEnvironment()).thenReturn(World.Environment.NETHER);
|
||||
ChunkData cd = cg.generateChunkData(world, random, 0 , 0 , biomeGrid);
|
||||
assertEquals(data, cd);
|
||||
// Verifications
|
||||
// Nether roof check
|
||||
verify(settings).isNetherRoof();
|
||||
// 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(64)).setBlock(anyInt(), anyInt(), anyInt(), eq(Material.BEDROCK));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}.
|
||||
*/
|
||||
@Test
|
||||
public void testGenerateChunkDataWorldRandomIntIntBiomeGridNetherNoRoof() {
|
||||
when(settings.isNetherRoof()).thenReturn(false);
|
||||
when(world.getEnvironment()).thenReturn(World.Environment.NETHER);
|
||||
ChunkData cd = cg.generateChunkData(world, random, 0 , 0 , biomeGrid);
|
||||
assertEquals(data, cd);
|
||||
// Verifications
|
||||
verify(settings).getDefaultNetherBiome();
|
||||
// Nether roof check
|
||||
verify(settings).isNetherRoof();
|
||||
// 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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#canSpawn(org.bukkit.World, int, int)}.
|
||||
*/
|
||||
@Test
|
||||
public void testCanSpawnWorldIntInt() {
|
||||
assertTrue(cg.canSpawn(mock(World.class), 0, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#getDefaultPopulators(org.bukkit.World)}.
|
||||
*/
|
||||
@Test
|
||||
public void testGetDefaultPopulatorsWorld() {
|
||||
assertTrue(cg.getDefaultPopulators(mock(World.class)).isEmpty());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue