Skip to content

Commit e4d6a1a

Browse files
authored
Merge pull request #83 from BentoBoxWorld/develop
Version 2.6.0
2 parents ef08a3d + c51c1b5 commit e4d6a1a

13 files changed

Lines changed: 948 additions & 360 deletions

File tree

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.DS_Store

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
- uses: actions/checkout@v3
1515
with:
1616
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
17-
- name: Set up JDK 17
17+
- name: Set up JDK 21
1818
uses: actions/setup-java@v3
1919
with:
2020
distribution: 'adopt'
21-
java-version: 17
21+
java-version: 21
2222
- name: Cache SonarCloud packages
2323
uses: actions/cache@v3
2424
with:

pom.xml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@
5858
<!-- Non-minecraft related dependencies -->
5959
<powermock.version>2.0.9</powermock.version>
6060
<!-- More visible way how to change dependency versions -->
61-
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
62-
<bentobox.version>2.0.0-SNAPSHOT</bentobox.version>
61+
<spigot.version>1.21-R0.1-SNAPSHOT</spigot.version>
62+
<bentobox.version>2.4.0-SNAPSHOT</bentobox.version>
6363
<!-- Revision variable removes warning about dynamic version -->
6464
<revision>${build.version}-SNAPSHOT</revision>
6565
<!-- Do not change unless you want different name for local builds. -->
6666
<build.number>-LOCAL</build.number>
6767
<!-- This allows to change between versions. -->
68-
<build.version>2.5.0</build.version>
68+
<build.version>2.6.0</build.version>
6969

7070
<sonar.projectKey>BentoBoxWorld_Boxed</sonar.projectKey>
7171
<sonar.organization>bentobox-world</sonar.organization>
@@ -178,7 +178,36 @@
178178
<version>${spigot.version}</version>
179179
<scope>provided</scope>
180180
</dependency>
181-
181+
<dependency>
182+
<groupId>org.spigotmc.....</groupId>
183+
<artifactId>spigot</artifactId>
184+
<version>1.21-R0.1-SNAPSHOT</version>
185+
<scope>provided</scope>
186+
</dependency>
187+
<dependency>
188+
<groupId>org.spigotmc....</groupId>
189+
<artifactId>spigot</artifactId>
190+
<version>1.20.6-R0.1-SNAPSHOT</version>
191+
<scope>provided</scope>
192+
</dependency>
193+
<dependency>
194+
<groupId>org.spigotmc.</groupId>
195+
<artifactId>spigot</artifactId>
196+
<version>1.20.3-R0.1-SNAPSHOT</version>
197+
<scope>provided</scope>
198+
</dependency>
199+
<dependency>
200+
<groupId>org.spigotmc..</groupId>
201+
<artifactId>spigot</artifactId>
202+
<version>1.20.2-R0.1-SNAPSHOT</version>
203+
<scope>provided</scope>
204+
</dependency>
205+
<dependency>
206+
<groupId>org.spigotmc...</groupId>
207+
<artifactId>spigot</artifactId>
208+
<version>1.20.1-R0.1-SNAPSHOT</version>
209+
<scope>provided</scope>
210+
</dependency>
182211
</dependencies>
183212

184213
<build>

src/main/java/world/bentobox/boxed/Settings.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.bukkit.GameMode;
1212
import org.bukkit.entity.EntityType;
1313

14+
import world.bentobox.bentobox.BentoBox;
1415
import world.bentobox.bentobox.api.configuration.ConfigComment;
1516
import world.bentobox.bentobox.api.configuration.ConfigEntry;
1617
import world.bentobox.bentobox.api.configuration.StoreAt;
@@ -106,6 +107,7 @@ public class Settings implements WorldSettings {
106107
private int ticksPerMonsterSpawns = -1;
107108

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

src/main/java/world/bentobox/boxed/listeners/EnderPearlListener.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@ public void onPlayerTeleport(PlayerTeleportEvent e) {
4545
) {
4646
return;
4747
}
48-
48+
4949
User u = User.getInstance(e.getPlayer());
5050
// If the to-location is outside the box, cancel it
5151
if (e.getTo() != null) {
52-
Island i = addon.getIslands().getIsland(e.getFrom().getWorld(), u);
53-
if (i == null || !i.onIsland(e.getTo())) {
54-
u.sendMessage("boxed.general.errors.no-teleport-outside");
55-
e.setCancelled(true);
56-
}
52+
addon.getIslands().getIslandAt(e.getTo()).ifPresent(i -> {
53+
if (!i.onIsland(e.getTo())) {
54+
u.sendMessage("boxed.general.errors.no-teleport-outside");
55+
e.setCancelled(true);
56+
}
57+
});
5758
}
5859
}
5960

@@ -77,7 +78,7 @@ public void onEnderPearlLand(ProjectileHitEvent e) {
7778
if (is == null) {
7879
return; // Nothing to do
7980
}
80-
81+
8182
// Get the box that the player is in
8283
addon.getIslands().getIslandAt(u.getLocation()).ifPresent(fromIsland -> {
8384
// Check that it is their box

0 commit comments

Comments
 (0)