Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.DS_Store
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
java-version: 21
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
Expand Down
37 changes: 33 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
<!-- 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.0.0-SNAPSHOT</bentobox.version>
<spigot.version>1.21-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.4.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>2.5.0</build.version>
<build.version>2.6.0</build.version>

<sonar.projectKey>BentoBoxWorld_Boxed</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
Expand Down Expand Up @@ -178,7 +178,36 @@
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.spigotmc.....</groupId>
<artifactId>spigot</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc....</groupId>
<artifactId>spigot</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc.</groupId>
<artifactId>spigot</artifactId>
<version>1.20.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc..</groupId>
<artifactId>spigot</artifactId>
<version>1.20.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc...</groupId>
<artifactId>spigot</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/world/bentobox/boxed/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.bukkit.GameMode;
import org.bukkit.entity.EntityType;

import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.configuration.ConfigComment;
import world.bentobox.bentobox.api.configuration.ConfigEntry;
import world.bentobox.bentobox.api.configuration.StoreAt;
Expand Down Expand Up @@ -106,6 +107,7 @@ public class Settings implements WorldSettings {
private int ticksPerMonsterSpawns = -1;

@ConfigComment("Radius of player area. (So distance between player starting spots is twice this)")
@ConfigComment("MUST BE A FACTOR OF 16. If not, it will be rounded to be one.")
@ConfigComment("It is the same for every dimension : Overworld, Nether and End.")
@ConfigEntry(path = "world.area-radius", needsReset = true)
private int islandDistance = 320;
Expand Down Expand Up @@ -494,6 +496,11 @@ public Difficulty getDifficulty() {
*/
@Override
public int getIslandDistance() {
if (islandDistance % 16 != 0) {
islandDistance = islandDistance - (islandDistance % 16);
BentoBox.getInstance()
.logWarning("Boxed: Area radius is not a factor of 16. Rounding to " + islandDistance);
}
return islandDistance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ public void onPlayerTeleport(PlayerTeleportEvent e) {
) {
return;
}

User u = User.getInstance(e.getPlayer());
// If the to-location is outside the box, cancel it
if (e.getTo() != null) {
Island i = addon.getIslands().getIsland(e.getFrom().getWorld(), u);
if (i == null || !i.onIsland(e.getTo())) {
u.sendMessage("boxed.general.errors.no-teleport-outside");
e.setCancelled(true);
}
addon.getIslands().getIslandAt(e.getTo()).ifPresent(i -> {
if (!i.onIsland(e.getTo())) {
u.sendMessage("boxed.general.errors.no-teleport-outside");
e.setCancelled(true);
}
});
}
}

Expand All @@ -77,7 +78,7 @@ public void onEnderPearlLand(ProjectileHitEvent e) {
if (is == null) {
return; // Nothing to do
}

// Get the box that the player is in
addon.getIslands().getIslandAt(u.getLocation()).ifPresent(fromIsland -> {
// Check that it is their box
Expand Down
Loading