Skip to content

Commit 555a33c

Browse files
authored
Merge pull request #2788 from BentoBoxWorld/develop
Release 3.11.1
2 parents 20e88a9 + 77bd4e8 commit 555a33c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+261
-248
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
- name: Build and analyze
3838
env:
3939
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
40-
run: ./gradlew build sonar --info
40+
run: ./gradlew build test jacocoTestReport sonar --info

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# BentoBox
22

33
[![Discord](https://img.shields.io/discord/272499714048524288.svg?logo=discord)](https://discord.bentobox.world)
4-
[![Build Status](https://ci.codemc.io/job/BentoBoxWorld/job/BentoBox-Gradle/badge/icon)](https://ci.codemc.io/job/BentoBoxWorld/job/BentoBox-Gradle/)
4+
[![Build Status](https://ci.codemc.io/job/BentoBoxWorld/job/BentoBox/badge/icon)](https://ci.codemc.io/job/BentoBoxWorld/job/BentoBox/)
55
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BentoBox&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_BentoBox)
66
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BentoBox&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_BentoBox)
77
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BentoBox&metric=security_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_BentoBox)

build.gradle.kts

Lines changed: 59 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArt
4646
group = "world.bentobox" // From <groupId>
4747

4848
// Base properties from <properties>
49-
val buildVersion = "3.11.0"
49+
val buildVersion = "3.11.1"
5050
val buildNumberDefault = "-LOCAL" // Local build identifier
5151
val snapshotSuffix = "-SNAPSHOT" // Indicates development/snapshot version
5252

@@ -93,6 +93,22 @@ val vaultVersion = "1.7.1"
9393
val levelVersion = "2.21.3"
9494
val placeholderapiVersion = "2.11.7"
9595
val myworldsVersion = "1.19.3-v1"
96+
val awaitilityVersion = "4.2.2"
97+
val mythicDistVersion = "5.9.5"
98+
val multiverseCore5Version = "5.0.0-SNAPSHOT"
99+
val multiverseCore4Version = "4.3.16"
100+
val langUtilsVersion = "3.2.2"
101+
val slimefun4Version = "RC-37"
102+
val itemsAdderVersion = "4.0.2-beta-release-11"
103+
val fancyNpcsVersion = "2.4.4"
104+
val znpcsplusApiVersion = "2.0.0-SNAPSHOT"
105+
val fancyHologramsVersion = "2.4.1"
106+
val commonsLangVersion = "2.6"
107+
val jaxbApiVersion = "2.3.0"
108+
val gsonRecordTypeAdapterFactoryVersion = "0.3.0"
109+
val jdtAnnotationVersion = "2.2.600"
110+
val multilibVersion = "1.1.13"
111+
val oraxenVersion = "1.193.1"
96112

97113
// Store versions in extra properties for resource filtering (used in plugin.yml, config.yml)
98114
extra["java.version"] = javaVersion
@@ -176,59 +192,40 @@ dependencies {
176192
testImplementation("org.junit.jupiter:junit-jupiter-api")
177193
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
178194
testRuntimeOnly("org.junit.platform:junit-platform-launcher:$junitVersion")
179-
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion") // Mocking framework
195+
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion")
180196
testImplementation("org.mockito:mockito-core:$mockitoVersion")
181-
testImplementation("com.github.MockBukkit:MockBukkit:$mockBukkitVersion") // Bukkit mock server
182-
testImplementation("org.awaitility:awaitility:4.2.2") // Async testing helper
183-
testImplementation("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT") // Paper API for tests
197+
testImplementation("com.github.MockBukkit:MockBukkit:$mockBukkitVersion")
198+
testImplementation("org.awaitility:awaitility:$awaitilityVersion")
199+
testImplementation("io.papermc.paper:paper-api:$paperVersion")
184200
testImplementation("com.github.MilkBowl:VaultAPI:$vaultVersion")
185201
testImplementation("me.clip:placeholderapi:$placeholderapiVersion")
202+
testImplementation("commons-lang:commons-lang:$commonsLangVersion")
186203

187-
// --- Provided/Compile-Only Dependencies: Available at compile time but provided by server ---
188-
// These are NOT shaded into the final JAR (the server provides them at runtime)
189-
//compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT") // Bukkit/Spigot/Paper API
190-
paperweight.paperDevBundle("1.21.10-R0.1-SNAPSHOT")
191-
192-
// Spigot NMS - Used for internal Minecraft code (chunk deletion and pasting)
204+
// --- Compile Only Dependencies: Provided by the server at runtime ---
193205
compileOnly("org.spigotmc:spigot:$spigotVersion") {
194-
exclude(group = "org.spigotmc", module = "spigot-api") // Already provided by Paper
206+
exclude(group = "org.spigotmc", module = "spigot-api")
195207
}
196-
197-
// Optional plugins that may be installed on the server
198208
compileOnly("org.mongodb:mongodb-driver:$mongodbVersion")
199-
compileOnly("com.zaxxer:HikariCP:$hikaricpVersion") // Database connection pooling
200-
compileOnly("com.github.MilkBowl:VaultAPI:$vaultVersion") // Economy/permission API
201-
compileOnly("me.clip:placeholderapi:$placeholderapiVersion") // Placeholder API
209+
compileOnly("com.zaxxer:HikariCP:$hikaricpVersion")
210+
compileOnly("com.github.MilkBowl:VaultAPI:$vaultVersion")
211+
compileOnly("me.clip:placeholderapi:$placeholderapiVersion")
202212
compileOnly("com.bergerkiller.bukkit:MyWorlds:$myworldsVersion") {
203213
exclude(group = "org.spigotmc", module = "spigot-api")
204214
}
205-
compileOnly("io.lumine:Mythic-Dist:5.9.5") // Mythic Mobs
206-
compileOnly("org.mvplugins.multiverse.core:multiverse-core:5.0.0-SNAPSHOT")
207-
compileOnly("com.onarandombox.multiversecore:multiverse-core:4.3.16") {
215+
compileOnly("io.lumine:Mythic-Dist:$mythicDistVersion")
216+
compileOnly("org.mvplugins.multiverse.core:multiverse-core:$multiverseCore5Version")
217+
compileOnly("com.onarandombox.multiversecore:multiverse-core:$multiverseCore4Version") {
208218
exclude(group = "org.spigotmc", module = "spigot-api")
209219
}
210-
compileOnly("com.github.apachezy:LangUtils:3.2.2")
211-
compileOnly("com.github.Slimefun:Slimefun4:RC-37") // Slimefun custom items
212-
compileOnly("dev.lone:api-itemsadder:4.0.2-beta-release-11") // ItemsAdder custom items
213-
compileOnly("de.oliver:FancyNpcs:2.4.4") // NPC plugin
214-
compileOnly("lol.pyr:znpcsplus-api:2.0.0-SNAPSHOT") // Alternative NPC plugin
215-
compileOnly("de.oliver:FancyHolograms:2.4.1") // Hologram plugin
216-
compileOnly("world.bentobox:level:2.21.3-SNAPSHOT") // BentoBox Level addon
217-
218-
// Apache Commons Lang - utility library
219-
compileOnly("commons-lang:commons-lang:2.6")
220-
testImplementation("commons-lang:commons-lang:2.6")
221-
222-
// --- Implementation Dependencies: Shaded into final JAR ---
223-
// These are embedded in the final JAR since they're not commonly available
224-
implementation("org.bstats:bstats-bukkit:$bstatsVersion") // Plugin metrics
225-
implementation("javax.xml.bind:jaxb-api:2.3.0") // XML serialization
226-
implementation("com.github.Marcono1234:gson-record-type-adapter-factory:0.3.0") // JSON serialization
227-
implementation("org.eclipse.jdt:org.eclipse.jdt.annotation:2.2.600") // Nullability annotations
228-
implementation("com.github.puregero:multilib:1.1.13") // Multi-library support
229-
230-
// Oraxen with custom exclusions (embed only what we need)
231-
compileOnly("io.th0rgal:oraxen:1.193.1") {
220+
compileOnly("com.github.apachezy:LangUtils:$langUtilsVersion")
221+
compileOnly("com.github.Slimefun:Slimefun4:$slimefun4Version")
222+
compileOnly("dev.lone:api-itemsadder:$itemsAdderVersion")
223+
compileOnly("de.oliver:FancyNpcs:$fancyNpcsVersion")
224+
compileOnly("lol.pyr:znpcsplus-api:$znpcsplusApiVersion")
225+
compileOnly("de.oliver:FancyHolograms:$fancyHologramsVersion")
226+
compileOnly("world.bentobox:level:$levelVersion-SNAPSHOT")
227+
compileOnly("commons-lang:commons-lang:$commonsLangVersion")
228+
compileOnly("io.th0rgal:oraxen:$oraxenVersion") {
232229
exclude(group = "me.gabytm.util", module = "actions-spigot")
233230
exclude(group = "org.jetbrains", module = "annotations")
234231
exclude(group = "com.ticxo", module = "PlayerAnimator")
@@ -238,9 +235,19 @@ dependencies {
238235
exclude(group = "org.bstats", module = "bstats-bukkit")
239236
exclude(group = "com.jeff-media", module = "custom-block-data")
240237
exclude(group = "com.jeff-media", module = "persistent-data-serializer")
241-
exclude(group = "com.jeff_media", module = "MorePersistentDataTypes")
238+
exclude(group = "com.jeff-media", module = "MorePersistentDataTypes")
242239
exclude(group = "gs.mclo", module = "java")
243240
}
241+
242+
// --- Implementation Dependencies: Shaded into final JAR ---
243+
implementation("org.bstats:bstats-bukkit:$bstatsVersion")
244+
implementation("javax.xml.bind:jaxb-api:$jaxbApiVersion")
245+
implementation("com.github.Marcono1234:gson-record-type-adapter-factory:$gsonRecordTypeAdapterFactoryVersion")
246+
implementation("org.eclipse.jdt:org.eclipse.jdt.annotation:$jdtAnnotationVersion")
247+
implementation("com.github.puregero:multilib:$multilibVersion")
248+
249+
// --- Paperweight Development Bundle (Provided by plugin development tools) ---
250+
paperweight.paperDevBundle(paperVersion)
244251
}
245252

246253
paperweight {
@@ -276,15 +283,15 @@ tasks.processResources {
276283
// This allows version info to be read at runtime by the plugin
277284
filesMatching(listOf("plugin.yml", "config.yml")) {
278285
filter { line ->
279-
line.replace("\${mysql.version}", mysqlVersion)
280-
.replace("\${mariadb.version}", mariadbVersion)
281-
.replace("\${postgresql.version}", postgresqlVersion)
282-
.replace("\${mongodb.version}", mongodbVersion)
283-
.replace("\${hikaricp.version}", hikaricpVersion)
284-
.replace("\${build.number}", finalBuildNumber)
285-
.replace("\${project.version}", project.version.toString())
286-
.replace("\${project.description}", project.description ?: "")
287-
.replace("\${revision}", project.version.toString())
286+
line.replace($$"${mysql.version}", mysqlVersion)
287+
.replace($$"${mariadb.version}", mariadbVersion)
288+
.replace($$"${postgresql.version}", postgresqlVersion)
289+
.replace($$"${mongodb.version}", mongodbVersion)
290+
.replace($$"${hikaricp.version}", hikaricpVersion)
291+
.replace($$"${build.number}", finalBuildNumber)
292+
.replace($$"${project.version}", project.version.toString())
293+
.replace($$"${project.description}", project.description ?: "")
294+
.replace($$"${revision}", project.version.toString())
288295
}
289296
}
290297

src/main/java/world/bentobox/bentobox/BStats.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private void registerPlayersPerServerChart() {
157157
int players = this.connectedPlayerSet.size();
158158
this.connectedPlayerSet.clear();
159159

160-
if (players <= 0) return "0";
160+
if (players == 0) return "0";
161161
else if (players <= 10) return "1-10";
162162
else if (players <= 30) return "11-30";
163163
else if (players <= 50) return "31-50";

src/main/java/world/bentobox/bentobox/BentoBox.java

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
import org.apache.commons.lang3.exception.ExceptionUtils;
1111
import org.bukkit.Bukkit;
12-
import org.bukkit.event.EventHandler;
1312
import org.bukkit.event.Listener;
14-
import org.bukkit.event.server.ServerCommandEvent;
1513
import org.bukkit.generator.ChunkGenerator;
1614
import org.bukkit.plugin.PluginManager;
1715
import org.bukkit.plugin.java.JavaPlugin;
@@ -72,6 +70,8 @@
7270
*/
7371
public class BentoBox extends JavaPlugin implements Listener {
7472

73+
private static final String PANELS = "panels";
74+
7575
private static BentoBox instance;
7676

7777
// Databases
@@ -149,7 +149,7 @@ public void onEnable(){
149149
saveConfig();
150150

151151
// Set up click timeout
152-
lastClick = new ExpiringMap<Pair<UUID, String>, Boolean>(getSettings().getClickCooldownMs(), TimeUnit.MILLISECONDS);
152+
lastClick = new ExpiringMap<>(getSettings().getClickCooldownMs(), TimeUnit.MILLISECONDS);
153153

154154
// Start Database managers
155155
playersManager = new PlayersManager(this);
@@ -194,7 +194,7 @@ public void onEnable(){
194194
completeSetup(loadTime);
195195
} catch (Exception e) {
196196
fireCriticalError(e.getMessage(), "");
197-
e.printStackTrace();
197+
logStacktrace(e);
198198
}
199199
});
200200
}
@@ -374,18 +374,6 @@ public void onDisable() {
374374

375375
}
376376

377-
@EventHandler
378-
public void onServerStop(ServerCommandEvent e) {
379-
/* This is no longer needed as with https://github.com/Multiverse/Multiverse-Core/releases/tag/4.3.12 (or maybe earlier) the issue
380-
* is fixed where the generator was not remembered across reboots.
381-
*/
382-
/*
383-
if (islandWorldManager != null && (e.getCommand().equalsIgnoreCase("stop") || e.getCommand().equalsIgnoreCase("restart"))) {
384-
// Unregister any MV worlds if () {
385-
//islandWorldManager.registerWorldsToMultiverse(false);
386-
}*/
387-
}
388-
389377
/**
390378
* Returns the player manager
391379
* @return the player manager
@@ -502,27 +490,27 @@ public boolean loadSettings() {
502490
}
503491
log("Saving default panels...");
504492

505-
if (!Files.exists(Path.of(this.getDataFolder().getPath(), "panels", "island_creation_panel.yml"))) {
493+
if (!Files.exists(Path.of(this.getDataFolder().getPath(), PANELS, "island_creation_panel.yml"))) {
506494
log("Saving default island_creation_panel...");
507495
this.saveResource("panels/island_creation_panel.yml", false);
508496
}
509497

510-
if (!Files.exists(Path.of(this.getDataFolder().getPath(), "panels", "language_panel.yml"))) {
498+
if (!Files.exists(Path.of(this.getDataFolder().getPath(), PANELS, "language_panel.yml"))) {
511499
log("Saving default language_panel...");
512500
this.saveResource("panels/language_panel.yml", false);
513501
}
514502

515-
if (!Files.exists(Path.of(this.getDataFolder().getPath(), "panels", "island_homes_panel.yml"))) {
503+
if (!Files.exists(Path.of(this.getDataFolder().getPath(), PANELS, "island_homes_panel.yml"))) {
516504
log("Saving default island_homes_panel...");
517505
this.saveResource("panels/island_homes_panel.yml", false);
518506
}
519507

520-
if (!Files.exists(Path.of(this.getDataFolder().getPath(), "panels", "team_invite_panel.yml"))) {
508+
if (!Files.exists(Path.of(this.getDataFolder().getPath(), PANELS, "team_invite_panel.yml"))) {
521509
log("Saving default team_invite_panel...");
522510
this.saveResource("panels/team_invite_panel.yml", false);
523511
}
524512

525-
if (!Files.exists(Path.of(this.getDataFolder().getPath(), "panels", "team_panel.yml"))) {
513+
if (!Files.exists(Path.of(this.getDataFolder().getPath(), PANELS, "team_panel.yml"))) {
526514
log("Saving default team_panel...");
527515
this.saveResource("panels/team_panel.yml", false);
528516
}
@@ -673,11 +661,11 @@ public boolean isShutdown() {
673661
* @return false if they can click and the timeout is started, otherwise true.
674662
*/
675663
public boolean onTimeout(User user, Panel panel) {
676-
if (lastClick.containsKey(new Pair<UUID, String>(user.getUniqueId(), panel.getName()))) {
664+
if (lastClick.containsKey(new Pair<>(user.getUniqueId(), panel.getName()))) {
677665
user.notify("general.errors.slow-down");
678666
return true;
679667
}
680-
lastClick.put(new Pair<UUID, String>(user.getUniqueId(), panel.getName()), true);
668+
lastClick.put(new Pair<>(user.getUniqueId(), panel.getName()), true);
681669
return false;
682670
}
683671
}

src/main/java/world/bentobox/bentobox/api/addons/Addon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public File saveResource(String jarResource, File destinationFolder, boolean rep
324324
"The embedded resource '" + jarResource + "' cannot be found in " + jar.getName());
325325
}
326326
} catch (IOException e) {
327-
e.printStackTrace();
327+
BentoBox.getInstance().logStacktrace(e);
328328
BentoBox.getInstance().logError(
329329
"Could not save from jar file. From " + jarResource + " to " + destinationFolder.getAbsolutePath());
330330
}

src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* Each addon is loaded with its own {@link AddonClassLoader}, which allows for
3232
* class isolation and management. This loader also facilitates inter-addon
3333
* class sharing by coordinating with the {@link AddonsManager}.
34-
*
34+
* <p>
3535
* This approach is now rarely used as most addons are now Plugin-based and so are loaded by the server as plugins.
3636
*
3737
* @author tastybento, ComminQ

src/main/java/world/bentobox/bentobox/api/addons/package-info.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/**
22
* This package contains classes and interfaces related to BentoBox addons.
3-
*
3+
* <p>
44
* Addons are modular extensions that enhance BentoBox functionality. Game-specific
55
* addons (e.g., BSkyBlock, AcidIsland) as well as generic addons (e.g., Challenges, Warps)
66
* are supported by this system. Developers can create custom addons to introduce
77
* new features or gamemodes.
8-
*
8+
* <p>
99
* Since BentoBox was created, server tech has changed and code remapping is done and that
1010
* is usually only applied when a Plugin is loaded, so developers should use Pladdons
1111
* which are a wrapper for Addons in a Plugin.
12-
*
12+
* <p>
1313
* Key components:
1414
* - AddonLoader: Manages the lifecycle of addons.
1515
* - AddonConfig: Handles addon-specific configurations.

0 commit comments

Comments
 (0)