Initial commit.

This commit is contained in:
tastybento 2021-01-30 09:59:42 -08:00
parent eb469f9631
commit 6e69cfbc0d
13 changed files with 3131 additions and 23 deletions

30
.gitignore vendored
View File

@ -1,23 +1,7 @@
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/target/
/.classpath
/.gitignore
/.project
/.DS_Store
/pom.xml.versionsBackup
/bin/

313
pom.xml Normal file
View File

@ -0,0 +1,313 @@
<?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>
<groupId>world.bentobox</groupId>
<artifactId>boxed</artifactId>
<version>${revision}</version>
<name>Boxed</name>
<description>Boxed is an add-on for BentoBox that puts players into a tiny expandable island area.</description>
<url>https://github.com/BentoBoxWorld/Boxed</url>
<inceptionYear>2017</inceptionYear>
<developers>
<developer>
<id>tastybento</id>
<email>tastybento@bentobox.world</email>
<timezone>-8</timezone>
<roles>
<role>Lead Developer</role>
</roles>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/BentoBoxWorld/Boxed.git</connection>
<developerConnection>scm:git:git@github.com:BentoBoxWorld/Boxed.git</developerConnection>
<url>https://github.com/BentoBoxWorld/Boxed</url>
</scm>
<ciManagement>
<system>jenkins</system>
<url>http://ci.codemc.org/job/BentoBoxWorld/job/Boxed</url>
</ciManagement>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/BentoBoxWorld/Boxed/issues</url>
</issueManagement>
<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>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<!-- Non-minecraft related dependencies -->
<powermock.version>2.0.2</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.16.5-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.15.5</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>0.0.1</build.version>
</properties>
<!-- 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>
<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>
<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.0.0</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>
<dependency>
<groupId>nl.rutgerkok</groupId>
<artifactId>worldgeneratorapi</artifactId>
<version>1.1.3</version>
<scope>provided</scope> <!-- Important, otherwise WorldGeneratorApi will be placed in your JAR file
if you're using maven-shade-plugin -->
</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.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>
<source>8</source>
<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-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.3</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>
</excludes>
</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>
</project>

View File

@ -0,0 +1,198 @@
package world.bentobox.boxed;
import org.bukkit.World;
import org.bukkit.World.Environment;
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 nl.rutgerkok.worldgeneratorapi.WorldGeneratorApi;
import nl.rutgerkok.worldgeneratorapi.WorldRef;
import nl.rutgerkok.worldgeneratorapi.decoration.DecorationType;
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.boxed.generators.BasicWorldGenerator;
import world.bentobox.boxed.listeners.AdvancementListener;
/**
* Main BSkyBlock class - provides an island minigame in the sky
* @author tastybento
* @author Poslovitch
*/
public class Boxed extends GameModeAddon implements Listener {
private static final String NETHER = "_nether";
private static final String THE_END = "_the_end";
// Settings
private Settings settings;
private ChunkGenerator chunkGenerator;
private Config<Settings> configObject = new Config<>(this, Settings.class);
@Override
public void onLoad() {
// Save the default config from config.yml
saveDefaultConfig();
// Load settings from config.yml. This will check if there are any issues with it too.
loadSettings();
// Chunk generator
//chunkGenerator = settings.isUseOwnGenerator() ? null : new ChunkGeneratorWorld(this);
WorldRef wordRef = WorldRef.ofName(getSettings().getWorldName());
chunkGenerator = WorldGeneratorApi
.getInstance(getPlugin(), 0, 5)
.createCustomGenerator(wordRef, generator -> {
// Set the noise generator
generator.setBaseNoiseGenerator(new BasicWorldGenerator(this, wordRef));
generator.getWorldDecorator().withoutDefaultDecorations(DecorationType.SURFACE_STRUCTURES);
generator.getWorldDecorator().withoutDefaultDecorations(DecorationType.STRONGHOLDS);
});
// Register commands
playerCommand = new DefaultPlayerCommand(this)
{
@Override
public void setup()
{
super.setup();
}
};
adminCommand = new DefaultAdminCommand(this) {};
// Register listeners
this.registerListener(new AdvancementListener(this));
//this.registerListener(new JoinListener(this));
}
private boolean loadSettings() {
// Load settings again to get worlds
settings = configObject.loadConfigObject();
if (settings == null) {
// Disable
logError("Brix settings could not load! Addon disabled.");
setState(State.DISABLED);
return false;
}
return true;
}
@Override
public void onEnable(){
// Register this
registerListener(this);
}
@Override
public void onDisable() {
// Nothing to do here
}
@Override
public void onReload() {
if (loadSettings()) {
log("Reloaded Brix settings");
}
}
/**
* @return the settings
*/
public Settings getSettings() {
return settings;
}
@Override
public void createWorlds() {
String worldName = settings.getWorldName().toLowerCase();
if (getServer().getWorld(worldName) == null) {
log("Creating Brix 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 Brix'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 Brix's End World...");
}
endWorld = settings.isEndIslands() ? getWorld(worldName, World.Environment.THE_END, chunkGenerator) : getWorld(worldName, World.Environment.THE_END, null);
}
}
/**
* 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, ChunkGenerator 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
if (w != null) {
if (getSettings().getSpawnLimitMonsters() > 0) {
w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters());
}
if (getSettings().getSpawnLimitAmbient() > 0) {
w.setAmbientSpawnLimit(getSettings().getSpawnLimitAmbient());
}
if (getSettings().getSpawnLimitAnimals() > 0) {
w.setAnimalSpawnLimit(getSettings().getSpawnLimitAnimals());
}
if (getSettings().getSpawnLimitWaterAnimals() > 0) {
w.setWaterAnimalSpawnLimit(getSettings().getSpawnLimitWaterAnimals());
}
if (getSettings().getTicksPerAnimalSpawns() > 0) {
w.setTicksPerAnimalSpawns(getSettings().getTicksPerAnimalSpawns());
}
if (getSettings().getTicksPerMonsterSpawns() > 0) {
w.setTicksPerMonsterSpawns(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() {
// Reload settings and save them. This will occur after all addons have loaded
this.loadSettings();
this.saveWorldSettings();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
package world.bentobox.boxed.generators;
import org.bukkit.util.noise.SimplexNoiseGenerator;
import nl.rutgerkok.worldgeneratorapi.BaseNoiseGenerator;
import nl.rutgerkok.worldgeneratorapi.BiomeGenerator;
import nl.rutgerkok.worldgeneratorapi.WorldRef;
import world.bentobox.boxed.Boxed;
/**
* @author tastybento
*
*/
public class BasicWorldGenerator implements BaseNoiseGenerator {
private final SimplexNoiseGenerator mainNoiseGenerator;
private final Boxed addon;
public BasicWorldGenerator(Boxed addon, WorldRef world) {
this.addon = addon;
// Initialize the noise generator based on the world seed
this.mainNoiseGenerator = new SimplexNoiseGenerator(123456789L);
}
@Override
public void getNoise(BiomeGenerator biomeGenerator, double[] buffer, int scaledX, int scaledZ) {
//addon.getPlugin().logDebug("1 Scaled x = " + scaledX + " scaled z = " + scaledZ);
// Repeat on an island boundary
int dist = addon.getSettings().getIslandDistance();
scaledX = ((scaledX*4) % dist) / 4;
scaledZ = ((scaledZ*4) % dist) / 4;
float noiseScaleHorizontal = addon.getSettings().getNoiseScaleHorizontal();
for (int y = 0; y < buffer.length; y++) {
double noise = this.mainNoiseGenerator.noise(scaledX / noiseScaleHorizontal, y, scaledZ / noiseScaleHorizontal);
int heightOffset = -y + 8;
buffer[y] = noise + heightOffset;
}
}
}

View File

@ -0,0 +1,27 @@
package world.bentobox.boxed.generators;
import org.bukkit.Material;
import nl.rutgerkok.worldgeneratorapi.BaseTerrainGenerator;
import nl.rutgerkok.worldgeneratorapi.BiomeGenerator;
import world.bentobox.boxed.Boxed;
public class PancakeGenerator implements BaseTerrainGenerator {
private Boxed addon;
public PancakeGenerator(Boxed addon) {
this.addon = addon;
}
@Override
public int getHeight(BiomeGenerator biomeGenerator, int x, int z, HeightType type) {
return addon.getSettings().getIslandHeight();
}
@Override
public void setBlocksInChunk(GeneratingChunk chunk) {
chunk.getBlocksForChunk().setRegion(0, 0, 0, CHUNK_SIZE, 63, CHUNK_SIZE, Material.STONE);
}
}

View File

@ -0,0 +1,39 @@
package world.bentobox.boxed.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerAdvancementDoneEvent;
import world.bentobox.boxed.Boxed;
/**
* @author tastybento
*
*/
public class AdvancementListener implements Listener {
private Boxed addon;
/**
* @param addon
*/
public AdvancementListener(Boxed addon) {
this.addon = addon;
}
@EventHandler
public void onAdvancement(PlayerAdvancementDoneEvent e) {
if (e.getPlayer().getWorld().equals(addon.getOverWorld())
&& e.getAdvancement().getKey().getNamespace().equals("minecraft")
&& !e.getAdvancement().getKey().getKey().startsWith("recipes")) {
addon.getIslands().getIslandAt(e.getPlayer().getLocation()).ifPresent(i -> {
i.setProtectionRange(i.getProtectionRange() + 1);
i.getPlayersOnIsland().forEach(p -> p.sendRawMessage("Area expanded! " + e.getAdvancement().getKey() + " " + e.getAdvancement().getCriteria()));
});
}
}
}

View File

@ -0,0 +1,44 @@
package world.bentobox.boxed.listeners;
import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.advancement.Advancement;
import org.bukkit.advancement.AdvancementProgress;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.boxed.Boxed;
/**
* @author tastybento
*
*/
public class JoinListener implements Listener {
private Boxed addon;
public JoinListener(Boxed addon) {
this.addon = addon;
}
@EventHandler
public void onJoinEvent(PlayerJoinEvent e) {
Iterator<Advancement> it = Bukkit.advancementIterator();
while (it.hasNext()) {
Advancement a = it.next();
if (!a.getKey().getKey().startsWith("recipe")) {
AdvancementProgress progress = e.getPlayer().getAdvancementProgress(a);
BentoBox.getInstance().logDebug(a.getKey() + " " + progress.isDone());
BentoBox.getInstance().logDebug("Awarded criteria");
progress.getAwardedCriteria().forEach(s -> BentoBox.getInstance().logDebug(s + " " + progress.getDateAwarded(s)));
BentoBox.getInstance().logDebug("Remaining criteria " + progress.getRemainingCriteria());
progress.getAwardedCriteria().forEach(progress::revokeCriteria);
}
}
}
}

162
src/main/resources/addon.yml Executable file
View File

@ -0,0 +1,162 @@
name: Boxed
main: world.bentobox.boxed.Boxed
version: ${version}${build.number}
api-version: 1.16
metrics: true
icon: "COMPOSTER"
repository: "BentoBoxWorld/Boxed"
authors: tastybento
permissions:
boxed.island:
description: Allow island command usage
default: true
boxed.island.create:
description: Allow island creation
default: true
boxed.island.home:
description: Allow teleporting to player island
default: true
boxed.island.sethome:
description: Let the player use the sethome command
default: true
boxed.island.info:
description: Let the player check other players info
default: true
boxed.island.lock:
description: Allows island locking
default: true
boxed.island.near:
description: Players can see nearby island names
default: true
boxed.island.expel:
description: Allows expelling of visitors
default: true
boxed.island.ban:
description: Allows banning of visitors
default: true
boxed.island.settings:
description: Player can see server settings
default: true
boxed.island.language:
description: Player can select a language
default: true
boxed.island.name:
description: Player can set the name of their island
default: true
boxed.island.spawn:
description: Player can use the island spawn command if spawn exists
default: true
boxed.island.reset:
description: Player can use the island reset or restart command
default: true
boxed.island.team:
description: Let a player use team command
default: true
boxed.island.team.setowner:
description: Let a player change the team owner
default: true
boxed.island.team.invite:
description: Let a player invite others
default: true
boxed.island.team.reject:
description: Let a player reject invites
default: true
boxed.island.team.leave:
description: Let a player leave the team
default: true
boxed.island.team.kick:
description: Let a player kick team members
default: true
boxed.island.team.accept:
description: Let a player accept invitations
default: true
boxed.island.team.trust:
description: Let a player use team trust commands
default: true
boxed.island.team.coop:
description: Let a player use team coop commands
default: true
boxed.island.team.promote:
description: Let a player use promote commands
default: true
boxed.settings.*:
description: Allow use of settings on island
default: true
boxed.mod.info:
description: Let a moderator see info on a player
default: op
boxed.mod.clearreset:
description: Allow clearing of island reset limit
default: false
boxed.mod.bypasscooldowns:
description: Allow moderator to bypass cooldowns
default: op
boxed.mod.bypassdelays:
description: Allow moderator to bypass delays
default: op
boxed.mod.bypassprotect:
description: Allow moderator to bypass island protection
default: op
boxed.mod.bypassexpel:
description: Allow moderator to bypass island expulsion
default: op
boxed.mod.switch:
description: Allows moderator to switch bypass protection on and off
default: op
boxed.mod.lock:
description: Locks or unlocks an island
default: op
boxed.mod.bypasslock:
description: Bypasses an island lock
default: op
boxed.mod.bypassban:
description: Bypasses island ban
default: op
boxed.mod.team:
description: Enables modification of teams via kick and add commands
default: false
boxed.admin.tp:
description: Allows teleport to an island
default: op
boxed.admin.clearresetall:
description: Allow clearing of island reset limit of all players
default: op
boxed.admin.reload:
description: Reload the config.yml
default: op
boxed.admin.delete:
description: Let a player completely remove a player (including island)
default: op
boxed.admin.register:
description: Let a player register the nearest island to another player.
default: op
boxed.admin.unregister:
description: Removes a player from an island without deleting the island blocks.
default: op
boxed.admin.setspawn:
description: Allows use of spawn tools
default: op
boxed.admin.setrange:
description: Allows setting of island protection range
default: op
boxed.admin.settingsreset:
description: Resets all the islands to default protection settings
default: op
boxed.admin.noban:
description: Player cannot be banned from an island
default: op
boxed.admin.noexpel:
description: Player cannot be expelled from an island
default: op
boxed.admin.setlanguage:
description: Resets all player languages and sets the default language
default: op
boxed.admin.getrank:
description: Get a player's rank
default: op
boxed.admin.setrank:
description: Set a player's rank
default: op

View File

@ -0,0 +1,15 @@
{
"uniqueId": "default",
"icon": "PAPER",
"displayName": "Default bundle",
"description": [
"§bDefault bundle of blueprints"
],
"requirePermission": false,
"blueprints": {
"NORMAL": "island",
"NETHER": "bedrock",
"THE_END": "bedrock"
},
"slot": 0
}

Binary file not shown.

View File

@ -0,0 +1,462 @@
# Boxed Configuration {$version}
boxed:
command:
# Player Command. What command users will run to access their area.
# To define alias, just separate commands with white space.
island: boxed bx
# The admin command.
# To define alias, just separate commands with white space.
admin: boxadmin
# 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'.
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'.
default-action: go
world:
# Friendly name for this world. Used in admin commands. Must be a single word
friendly-name: Boxed
# 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. boxed_world, boxed_world_nether, boxed_world_end)
world-name: boxed_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
monsters: -1
animals: -1
water-animals: -1
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
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
ticks-per-monster-spawns: -1
# Radius of island in blocks. (So distance between islands is twice this)
# 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.
# /!\ 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 /boxadmin range set <player> <new range>
# or set this permission: boxed.island.range.<number>
protection-range: 1
# Start islands at these coordinates. This is where new islands will start in the
# world. These must be a factor of your island distance, but the plugin will auto
# 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
# Area height - Lowest is 5.
# It is the y coordinate of the bedrock block in the blueprint.
area-height: 5
# Maximum number of player areas in the world. Set to -1 or 0 for unlimited.
# If the number of areas is greater than this number, it will stop players from joining the world.
max-areas: -1
# The default game mode for this world. Players will be set to this mode when they create
# a new area 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 boxed.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 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 areas.
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.
areas: 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 areas Nether
roof: true
# Nether spawn protection radius - this is the distance around the nether spawn
# that will be protected from player interaction (breaking blocks, pouring lava etc.)
# Minimum is 0 (not recommended), maximum is 100. Default is 25.
# Only applies to vanilla nether
spawn-radius: 32
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.
areas: true
# /!\ 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 /boxed
remove-mobs-whitelist: []
# World flags. These are boolean settings for various flags for this world
flags:
HURT_ANIMALS: false
DRAGON_EGG: false
ISLAND_RESPAWN: true
REDSTONE: false
CREEPER_GRIEFING: false
BUCKET: false
ENDER_PEARL: false
DOOR: true
NATURAL_SPAWNING_OUTSIDE_RANGE: false
BREAK_HOPPERS: false
FURNACE: false
LIQUIDS_FLOWING_OUT: true
ANVIL: false
MINECART: false
FISH_SCOOPING: false
END_PORTAL: false
BREEDING: false
ENDER_CHEST: true
HURT_VILLAGERS: false
TREES_GROWING_OUTSIDE_RANGE: true
WITHER_DAMAGE: false
FROST_WALKER: false
TURTLE_EGGS: false
PISTON_PUSH: true
COLLECT_LAVA: false
BREAK_SPAWNERS: false
LEVER: false
ELYTRA: true
COARSE_DIRT_TILLING: false
RIDING: false
CAKE: false
HURT_MONSTERS: false
ARMOR_STAND: false
NAME_TAG: false
ENDERMAN_GRIEFING: true
CLEAN_SUPER_FLAT: false
TRADING: true
EGGS: false
ITEM_DROP: true
NOTE_BLOCK: false
ENTER_EXIT_MESSAGES: true
FLINT_AND_STEEL: false
NETHER_PORTAL: false
REMOVE_END_EXIT_ISLAND: true
LECTERN: false
OFFLINE_GROWTH: true
ITEM_PICKUP: false
CROP_TRAMPLE: false
BREWING: false
DROPPER: false
OBSIDIAN_SCOOPING: true
CREEPER_DAMAGE: true
TNT_PRIMING: false
COLLECT_WATER: false
GREENHOUSE: false
BUTTON: false
FIRE_EXTINGUISH: false
COMMAND_RANKS: false
BEACON: false
TRAPDOOR: true
EXPERIENCE_BOTTLE_THROWING: false
PRESSURE_PLATE: true
DYE: false
ITEM_FRAME: false
PLACE_BLOCKS: false
CRAFTING: true
REMOVE_MOBS: false
ENCHANTING: true
SHEARING: false
BOAT: false
BANK_ACCESS: false
BED: false
SPAWN_EGGS: false
MILKING: false
DISPENSER: false
GATE: true
CHEST_DAMAGE: false
EXPERIENCE_PICKUP: false
PREVENT_TELEPORT_WHEN_FALLING: false
WORLD_TNT_DAMAGE: false
HOPPER: false
LEASH: false
BREAK_BLOCKS: false
MOUNT_INVENTORY: false
OFFLINE_REDSTONE: true
CHORUS_FRUIT: false
CONTAINER: false
ITEM_FRAME_DAMAGE: false
JUKEBOX: false
POTION_THROWING: false
SPAWNER_SPAWN_EGGS: true
# These are the default protection settings for new areas.
# The value is the minimum area rank required allowed to do the action
# Ranks are the following:
# VISITOR = 0
# COOP = 200
# TRUSTED = 400
# MEMBER = 500
# SUB-OWNER = 900
# OWNER = 1000
default-area-flags:
HURT_ANIMALS: 500
DRAGON_EGG: 500
REDSTONE: 500
BUCKET: 500
ENDER_PEARL: 500
DOOR: 0
BREAK_HOPPERS: 500
FURNACE: 500
MONSTER_SPAWNERS_SPAWN: 500
ANVIL: 500
MINECART: 500
FISH_SCOOPING: 500
FIRE_IGNITE: 500
END_PORTAL: 500
BREEDING: 500
HURT_VILLAGERS: 500
FROST_WALKER: 500
TURTLE_EGGS: 500
COLLECT_LAVA: 500
BREAK_SPAWNERS: 500
LEVER: 0
ELYTRA: 0
CAKE: 500
RIDING: 500
HURT_MONSTERS: 0
NAME_TAG: 500
ARMOR_STAND: 500
TRADING: 0
EGGS: 500
ITEM_DROP: 0
NOTE_BLOCK: 0
FLINT_AND_STEEL: 500
NETHER_PORTAL: 0
LECTERN: 500
CROP_TRAMPLE: 500
ITEM_PICKUP: 0
DROPPER: 500
BREWING: 500
TNT_PRIMING: 500
COLLECT_WATER: 500
BUTTON: 0
FIRE_EXTINGUISH: 500
COMMAND_RANKS: 500
BEACON: 500
TRAPDOOR: 500
PRESSURE_PLATE: 0
EXPERIENCE_BOTTLE_THROWING: 500
DYE: 500
PLACE_BLOCKS: 500
ITEM_FRAME: 500
CRAFTING: 0
SHEARING: 500
ANIMAL_SPAWNERS_SPAWN: 500
ENCHANTING: 500
BOAT: 0
SPAWN_EGGS: 500
BED: 500
MILKING: 500
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 areas
default-area-settings:
PVP_END: false
PVP_NETHER: false
LEAF_DECAY: false
TNT_DAMAGE: false
ANIMAL_NATURAL_SPAWN: false
MONSTER_NATURAL_SPAWN: false
FIRE_SPREAD: false
FIRE_BURNING: true
PVP_OVERWORLD: false
# These settings/flags are hidden from users
# Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings
hidden-flags: []
# Visitor banned commands - Visitors to areas cannot use these commands in this world
visitor-banned-commands: []
# Falling banned commands - players cannot use these commands when falling
# if the PREVENT_TELEPORT_WHEN_FALLING world setting flag is active
falling-banned-commands: []
area:
# Default max team size
# Permission size cannot be less than the default below.
max-team-size: 4
# Default maximum number of coop rank members per area
# Players can have the boxed.coop.maxsize.<number> permission to be bigger but
# permission size cannot be less than the default below.
max-coop-size: 4
# Default maximum number of trusted rank members per area
# Players can have the boxed.trust.maxsize.<number> permission to be bigger but
# permission size cannot be less than the default below.
max-trusted-size: 4
# Default maximum number of homes a player can have. Min = 1
# Accessed via /is sethome <number> or /is go <number>
max-homes: 5
reset:
# 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 areas lifetime
reset-limit: -1
# Kicked or leaving players lose resets
# Players who leave a team will lose an area reset chance
# If a player has zero resets left and leaves a team, they cannot make a new
# area by themselves and can only join a team.
# Leave this true to avoid players exploiting free areas
leavers-lose-reset: false
# Allow kicked players to keep their inventory.
# Overrides the on-leave inventory reset for kicked players.
kicked-keep-inventory: false
on-join:
# What the addon should reset when the player joins or creates an area
# 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.
money: false
# Reset inventory - if true, the player's inventory will be cleared.
# Note: if you have MultiInv running or a similar inventory control plugin, that
# plugin may still reset the inventory when the world changes.
inventory: true
# Reset health - if true, the player's health will be reset.
health: true
# Reset hunger - if true, the player's hunger will be reset.
hunger: true
# Reset experience points - if true, the player's experience will be reset.
exp: true
# Reset Ender Chest - if true, the player's Ender Chest will be cleared.
ender-chest: false
on-leave:
# What the plugin should reset when the player leaves or is kicked from an area
# 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.
money: false
# Reset inventory - if true, the player's inventory will be cleared.
# Note: if you have MultiInv running or a similar inventory control plugin, that
# plugin may still reset the inventory when the world changes.
inventory: true
# Reset health - if true, the player's health will be reset.
health: false
# Reset hunger - if true, the player's hunger will be reset.
hunger: false
# Reset experience - if true, the player's experience will be reset.
exp: false
# Reset Ender Chest - if true, the player's Ender Chest will be cleared.
ender-chest: false
create-area-on-first-login:
# Toggles the automatic area 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 area 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 area.
# * An area 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 area in all the gamemodes will be created simultaneously.
# However, it is impossible to know on which area 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.
enable: false
# Time in seconds after the player logged in, before his area gets created.
# If set to 0 or less, the area will be created directly upon the player's login.
# It is recommended to keep this value under a minute's time.
delay: 5
# Toggles whether the area 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 area creation.
# * If the player relogs afterward, since he will not be recognized as a new player, no area
# would be created for him.
# * If the area creation started before the player logged off, it will continue.
# If set to false, the player's area 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.
abort-on-logout: true
# Toggles whether the player should be teleported automatically to his area when it is created.
# If set to false, the player will be told his area is ready but will have to teleport to his area using the command.
teleport-player-to-area-when-created: true
# Create Nether or End areas if they are missing when a player goes through a portal.
# Nether and End areas are usually pasted when a player makes their area, but if they are
# missing for some reason, you can switch this on.
# Note that bedrock removal glitches can exploit this option.
create-missing-nether-end-areas: false
commands:
# List of commands to run when a player joins an area 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"
on-join:
- advancement revoke [player] everything
# List of commands to run when a player leaves an area, resets his area 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.
on-leave: []
sethome:
nether:
# Allow setting home in the nether. Only available on nether areas, not vanilla nether.
allow: true
require-confirmation: true
the-end:
# Allow setting home in the end. Only available on end areas, not vanilla end.
allow: true
require-confirmation: true
deaths:
# Whether deaths are counted or not.
counted: true
# Maximum number of deaths to count. The death count can be used by add-ons.
max: 10
# When a player joins a team, reset their death count
team-join-reset: true
# Reset player death count when they start a new area or reset an area
reset-on-new-area: true
protection:
# Geo restrict mobs.
# Mobs that exit the area space where they were spawned will be removed.
geo-limit-settings: []
# Boxed blocked mobs.
# List of mobs that should not spawn in Boxed.
block-mobs: []
# Invincible visitors. List of damages that will not affect visitors.
# Make list blank if visitors should receive all damages
invincible-visitors: []
do-not-edit-these-settings:
# These settings should not be edited
reset-epoch: 0

View File

@ -0,0 +1,215 @@
###########################################################################################
# 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 #
###########################################################################################
# These strings are deltas to the strings in BentoBox. Any BentoBox string can be
# overridden by placing it under the boxed key.
boxed:
# General strings
general:
errors:
no-island: "&c You do not have an area!"
player-has-island: "&c Player already has an area!"
player-has-no-island: "&c That player has no area!"
already-have-island: "&c You already have an area!"
no-safe-location: "&c No safe location found in area!"
not-owner: "&c You are not the owner of your team!"
commands:
#Main Boxed command
boxed:
help:
description: "Start a Boxed game or teleport to your Boxed home"
go:
description: "Go home"
tip: "&c You cannot teleport when falling!"
# Override BentoBox default island command strings
island:
info:
description: "display info about your area or the player's area"
reset:
description: "restart in another area"
parameters: ""
must-remove-members: "&c You must remove all team players before you can restart (/[label] team kick <player>)."
sethome:
must-be-on-your-island: "&c You must be in your area to set home!"
home-set: "&6 Your home has been set to your current location."
setname:
description: "set a name for your area"
resetname:
description: "reset your area name"
team:
coop:
description: "make a player coop rank"
uncoop:
you-are-no-longer-a-coop-member: "&c You are no longer a coop member of [name]'s area"
all-members-logged-off: "&c All team members logged off so you are no longer a coop member of [name]'s area"
trust:
description: "give a player trusted rank"
invite:
description: "invite a player to join your team"
name-has-invited-you: "&a [name] has invited you to join their team."
to-accept-or-reject: "&a Do /[label] team accept to accept, or /[label] team reject to reject"
you-will-lose-your-island: "&c WARNING! You will lose your our area if you accept!"
errors:
island-is-full: "&c Your team is full, you can't invite anyone else."
accept:
you-joined-island: "&a You joined a team! Use /[label] team info to see the other members."
name-joined-your-island: "&a [name] joined your team!"
confirmation: |-
&c Are you sure you want to accept this invite?
&c&l This will &n WIPE &r&c&l your current area!
reject:
you-rejected-invite: "&a You rejected the invitation to join a team."
name-rejected-your-invite: "&c [name] rejected your invite!"
cancel:
description: "cancel the pending invite to join your team"
leave:
description: "leave your team"
left-your-island: "&c [name] &c left your team"
kick:
description: "remove a team member"
owner-kicked: "&c The owner kicked you from the team!"
demote:
description: "demote a player one rank"
promote:
description: "promote a player one rank"
setowner:
description: "transfer team ownership to a member"
errors:
target-is-not-member: "&c That player is not part of your team!"
name-is-the-owner: "&a [name] is now the area owner!"
you-are-the-owner: "&a You are now the area owner!"
ban:
description: "ban a player from your area"
cannot-ban-more-players: "&c You reached the ban limit, you cannot ban any more players."
owner-banned-you: "&b [name]&c banned you from their area!"
you-are-banned: "&b You are banned from this area!"
unban:
description: "unban a player from your area"
you-are-unbanned: "&b [name]&a unbanned you from their area!"
banlist:
noone: "&a No one is banned on this area"
settings:
description: "display area settings"
# Admin command /sgadmin
admin:
team:
add:
name-has-island: "&c [name] has an area. Unregister or delete them first!"
setowner:
description: "transfers area ownership to the player"
already-owner: "&c Player is already the owner of this area!"
range:
description: "Admin area range command"
display:
description: "Show/hide area range indicators"
hint: |-
&c Red Barrier icons &f show the current protected range limit.
&7 Gray Particles &f show the max limit.
&a Green Particles &f show the default protected range if the protection range differs from it.
set:
description: "Sets the area protected range"
reset:
description: "Resets the protected range to the world default"
register:
parameters: "<player>"
description: "register player to unowned area you are in"
registered-island: "&a Registered player to area at [xyz]."
already-owned: "&c Area is already owned by another player!"
no-island-here: "&c There is no player area here. Confirm to make one."
in-deletion: "&c This space is currently being regenerated. Try later."
unregister:
description: "unregister owner from an area, but keep area blocks as-is"
unregistered-island: "&a Unregistered player from area at [xyz]."
info:
description: "get info on where you are or on player"
no-island: "&c You are not in a registered area right now..."
island-location: "Area location: [xyz]"
island-coords: "Area coordinates: [xz1] to [xz2]"
is-spawn: "Area is a spawn island"
setrange:
description: "set the range of player's area"
range-updated: "Area range updated to [number]"
tp:
description: "teleport to a player's area"
getrank:
description: "get a player's rank in their area"
rank-is: "&a Rank is [rank] in their area."
setrank:
description: "set a player's rank in their area"
setspawn:
description: "set an area as spawn for this world"
already-spawn: "&c This area is already a spawn!"
no-island-here: "&c There is no registered area here."
confirmation: "&c Are you sure you want to set this area as the spawn for this world?"
delete:
description: "deletes a player and regenerates their area"
deleted-island: "&a Area at &e [xyz] &a has been successfully regenerated."
protection:
flags:
ELYTRA:
description: "Toggle use"
ENDERMAN_GRIEFING:
description: |-
&a Endermen can remove
&a blocks
ENTER_EXIT_MESSAGES:
description: "Display entry and exit messages"
island: "[name]'s protected area"
name: "Enter/Exit messages"
now-entering: '&a Now entering &b [name]&a .'
now-entering-your-island: '&a Now entering your area.'
now-leaving: '&a Now leaving &b [name]&a .'
now-leaving-your-island: '&a Now leaving your area.'
GEO_LIMIT_MOBS:
description: |-
&a Remove mobs that go
&a outside protected
&a player space
name: "&e Limit mobs to player area"
ISLAND_RESPAWN:
description: |-
&a Players respawn
&a in their area
name: "Area respawn"
LOCK:
name: "Lock player area"
OFFLINE_REDSTONE:
description: |-
&a When disabled, redstone
&a will not operate in areas
&a where all members are offline.
&a May help reduce lag.
PISTON_PUSH:
description: |-
&a Allow pistons to push
&a blocks outside a player's area
PVP_OVERWORLD:
description: |-
&c Enable/Disable PVP
&c in protected area.
REMOVE_MOBS:
description: |-
&a Remove monsters when
&a teleporting to an area
PREVENT_TELEPORT_WHEN_FALLING:
description: |-
&a Prevent players from teleporting
&a if they are falling.
hint: "&c You cannot teleport while you are falling!"
locked: "&c This area is locked!"
protected: "&c Area protected: [description]"
panel:
PROTECTION:
title: "&6 Protection"
description: |-
&a Protection settings
&a for this area
SETTING:
description: |-
&a General settings
&a for this area