Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.4.0 #2414

Merged
merged 63 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
6949432
1.20.5 compatibility. Not all backward compatibility done
tastybento Apr 29, 2024
63cc0a0
Fix compatibility for 1.20.6
tastybento Apr 30, 2024
e33823d
Fix tests
tastybento Apr 30, 2024
15335eb
Add NMS for latest
tastybento Apr 30, 2024
b1418c1
Update README.md
tastybento May 1, 2024
09ede87
Write the Blueprint bundle meta data to admin info
tastybento May 2, 2024
3e4ff33
Merge pull request #2349 from BentoBoxWorld/Blueprint_Bundle_Info
tastybento May 2, 2024
744665a
Merge branch 'develop' into 1.20.5_compatibility
tastybento May 2, 2024
01a8055
Merge pull request #2348 from BentoBoxWorld/1.20.5_compatibility
tastybento May 4, 2024
a55c514
Shift Github Build Script to Java 21
tastybento May 5, 2024
5afd454
Update Slimefun
tastybento May 5, 2024
b1fe76c
Multipaper (#2343)
tastybento May 5, 2024
61e7c22
Add a hook for Multipaper (#2354)
tastybento May 6, 2024
d889179
JavaDoc fixes and fix for Particle enums
tastybento May 6, 2024
b8e1f33
Fixes #2352 obsidian scooping NPE (#2358)
tastybento May 8, 2024
4a0d44c
Implement new API for ItemsAdder item deletion (#2353)
tastybento May 11, 2024
52a280d
Remove an unused Map in cache. (#2361)
tastybento May 11, 2024
83698c2
Purges based on team members all being offline for too long (#2362)
tastybento May 11, 2024
d288528
2356 better deletion (#2364)
tastybento May 11, 2024
24d81da
Update to latest 1.20.6 API for PlayerDeathEvent
tastybento May 11, 2024
aad50ea
Just use null.
tastybento May 11, 2024
f478065
Downgrade to 1.20.5 to get tests to pass.
tastybento May 11, 2024
f536a13
Back to 1.20.6
tastybento May 13, 2024
45e5621
Update README.md
tastybento May 17, 2024
7126e83
Admin command updates (#2367)
tastybento May 17, 2024
290158e
Allow NPC's to hit players (#2368)
tastybento May 18, 2024
99717f5
Reduces storage of Island objects in the cache #2360 (#2369)
tastybento May 19, 2024
2fc3396
Remove debug code that slipped in.
tastybento May 19, 2024
d701b7e
Uses Bukkit version method instead of class names (#2370)
tastybento May 19, 2024
50276cb
Abstract out getting and setting islands by ID
tastybento May 19, 2024
8aba736
Fixes breaking rooted dirt exploit (#2371)
tastybento May 19, 2024
e2d9c2c
Avoids loading islands into cache unless they are needed. (#2373)
tastybento May 24, 2024
888b485
Fixes #2376
tastybento May 24, 2024
885d244
Fixes creeper ignation by visitors (#2375)
BONNe May 24, 2024
ef58838
Fixes #2378 where an unknown UUID was yielding null instead of "" (#2…
tastybento May 24, 2024
5e5707f
Fixes #2377, was not accounting for unknown UUIDs (#2380)
tastybento May 24, 2024
ca15740
Fixes a bunch of items related to making the cache smaller (#2383)
tastybento May 26, 2024
8b0a5a3
Do not load all players just to get a name.
tastybento May 27, 2024
60fa603
Fix tests
tastybento May 27, 2024
35704b3
Update zh-CN.yml (#2386)
tastybento May 27, 2024
ee3b0bf
Update en-US.yml (#2387)
tastybento May 27, 2024
1fd4a90
Protect pumpkins from being sheared (#2388)
tastybento May 27, 2024
fc9b002
Sends messages only once to all players on the island (#2389)
tastybento May 27, 2024
8e68349
Add way to bypass code during testing, if required.
tastybento Jun 1, 2024
475f637
Added defensive code for JUnit testing
tastybento Jun 1, 2024
01dcd6e
Adds more options around getting islands and caching (#2394)
tastybento Jun 1, 2024
250c795
Fixes for Island cache issues
tastybento Jun 1, 2024
affb0c2
Added %[gamemode]_visited_island_rank% #2390 (#2395)
tastybento Jun 1, 2024
961a35b
Corrected translation errors (#2391)
huguyt Jun 2, 2024
d831722
Shift to using ConcurrentHashMap (#2397)
tastybento Jun 2, 2024
f68af55
Remove concurrent hashmap because it cannot handle null values.
tastybento Jun 3, 2024
0938df8
Added API methods for direct database loads and saves #2396 (#2398)
tastybento Jun 3, 2024
156c3da
Add command to teleport users. (#2399)
tastybento Jun 3, 2024
86e5a02
Fix for #2402 player record was deleted on quit (#2403)
tastybento Jun 10, 2024
9656427
Support nms pasting (#2406)
tastybento Jun 14, 2024
d23f15f
Rework tests to not break so much with constant definitions (#2407)
tastybento Jun 15, 2024
894b063
Split out the Paper-only event
tastybento Jun 15, 2024
09c5cbb
Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.g…
tastybento Jun 15, 2024
2f9e3c4
Better migration of databases relates to #2404 (#2411)
tastybento Jun 19, 2024
24fa4fe
Fix for #2413 - support for 1.20.1
tastybento Jun 24, 2024
534fd67
feat: new flag - handle tamed animals (#2412)
TreemanKing Jun 24, 2024
58937d6
Add 1.21 compatibility
tastybento Jun 29, 2024
59fd8d9
Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.g…
tastybento Jun 29, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Discord](https://img.shields.io/discord/272499714048524288.svg?logo=discord)](https://discord.bentobox.world)
[![Build Status](https://ci.codemc.org/buildStatus/icon?job=BentoBoxWorld/BentoBox)](https://ci.codemc.org/job/BentoBoxWorld/job/BentoBox/)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BentoBox&metric=ncloc)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_BentoBox)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BentoBox&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_BentoBox)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BentoBox&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_BentoBox)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_BentoBox&metric=security_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_BentoBox)
Expand Down Expand Up @@ -112,9 +111,10 @@ repositories {
}

dependencies {
compileOnly 'world.bentobox:bentobox:PUT-VERSION-HERE'
compileOnly 'world.bentobox:bentobox:PUT-VERSION-HERE-SNAPSHOT'
}
```
**Note:** Due to a Gradle issue with versions for Maven, you need to use -SNAPSHOT at the end.

### History

Expand Down
55 changes: 42 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
<postgresql.version>42.2.18</postgresql.version>
<hikaricp.version>5.0.1</hikaricp.version>
<!-- More visible way to change dependency versions -->
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
<spigot.version>1.20.5-R0.1-SNAPSHOT</spigot.version>
<!-- Might differ from the last Spigot release for short periods
of time -->
<paper.version>1.20.4-R0.1-SNAPSHOT</paper.version>
<paper.version>1.20.6-R0.1-SNAPSHOT</paper.version>
<bstats.version>3.0.0</bstats.version>
<vault.version>1.7.1</vault.version>
<placeholderapi.version>2.10.9</placeholderapi.version>
Expand All @@ -88,7 +88,7 @@
<!-- 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.3.0</build.version>
<build.version>2.4.0</build.version>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<server.jars>${project.basedir}/lib</server.jars>
Expand Down Expand Up @@ -145,6 +145,10 @@
</pluginRepositories>

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
Expand All @@ -153,10 +157,6 @@
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>placeholderapi-repo</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
Expand Down Expand Up @@ -195,6 +195,11 @@
<name>Lumine Releases</name>
<url>https://mvn.lumine.io/repository/maven-public/</url>
</repository>
<!-- For Multipaper -->
<repository>
<id>clojars</id>
<url>https://repo.clojars.org/</url>
</repository>
</repositories>

<dependencies>
Expand Down Expand Up @@ -223,13 +228,25 @@
<version>3.11.1</version>
<scope>test</scope>
</dependency>
<!-- Spigot API -->
<!-- Spigot API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<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>
Expand Down Expand Up @@ -354,16 +371,23 @@
<dependency>
<groupId>com.github.Slimefun</groupId>
<artifactId>Slimefun4</artifactId>
<version>RC-36</version>
<version>RC-37</version>
<scope>provided</scope>
</dependency>
<!-- ItemsAdder -->
<dependency>
<groupId>com.github.LoneDev6</groupId>
<artifactId>api-itemsadder</artifactId>
<version>3.6.1</version>
<version>3.6.3-beta-14</version>
<scope>provided</scope>
</dependency>
<!-- Multipaper -->
<dependency>
<groupId>com.github.puregero</groupId>
<artifactId>multilib</artifactId>
<version>1.1.13</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -486,9 +510,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.1-SNAPSHOT</version>
<version>3.4.0</version>
<configuration>
<minimizeJar>true</minimizeJar>
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
Expand All @@ -500,9 +525,13 @@
</relocation>
<relocation>
<pattern>io.papermc.lib</pattern>
<shadedPattern>world.bentobox.bentobox.paperlib</shadedPattern> <!-- Replace this -->
<shadedPattern>world.bentobox.bentobox.paperlib</shadedPattern>
</relocation>
<relocation>
<pattern>com.github.puregero.multilib</pattern>
<shadedPattern>world.bentobox.bentobox.multilib</shadedPattern>
</relocation>
</relocations>
</relocations>
<artifactSet>
<excludes>
<exclude>org.apache.maven.shared:*</exclude>
Expand Down
24 changes: 0 additions & 24 deletions src/main/java/world/bentobox/bentobox/BStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
import org.bstats.charts.SimpleBarChart;
import org.bstats.charts.SimplePie;
import org.bstats.charts.SingleLineChart;
import org.bukkit.Bukkit;

import world.bentobox.bentobox.api.addons.GameModeAddon;
import world.bentobox.bentobox.api.flags.Flag;

/**
* @author Poslovitch
Expand Down Expand Up @@ -59,7 +57,6 @@ private void registerCustomMetrics() {
registerGameModeAddonsChart();
registerHooksChart();
registerPlayersPerServerChart();
registerFlagsDisplayModeChart();

// Single Line charts
registerIslandsCountChart();
Expand Down Expand Up @@ -171,27 +168,6 @@ private void registerPlayersPerServerChart() {
}));
}

/**
* Sends the "flags display mode" of all the online players.
* @since 1.6.0
*/
private void registerFlagsDisplayModeChart() {
metrics.addCustomChart(new AdvancedPie("flagsDisplayMode", () -> {
Map<String, Integer> values = new HashMap<>();

Bukkit.getOnlinePlayers().forEach(player -> {
Flag.Mode mode = plugin.getPlayers().getFlagsDisplayMode(player.getUniqueId());
if (values.containsKey(mode.name())) {
values.put(mode.name(), values.get(mode.name()) + 1);
} else {
values.put(mode.name(), 1);
}
});

return values;
}));
}

/**
* Sends the enabled addons (except GameModeAddons) of this server as bar chart.
* @since 1.17.1
Expand Down
26 changes: 10 additions & 16 deletions src/main/java/world/bentobox/bentobox/BentoBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import world.bentobox.bentobox.commands.BentoBoxCommand;
import world.bentobox.bentobox.database.DatabaseSetup;
import world.bentobox.bentobox.hooks.ItemsAdderHook;
import world.bentobox.bentobox.hooks.MultipaperHook;
import world.bentobox.bentobox.hooks.MultiverseCoreHook;
import world.bentobox.bentobox.hooks.MyWorldsHook;
import world.bentobox.bentobox.hooks.MythicMobsHook;
Expand All @@ -37,6 +38,7 @@
import world.bentobox.bentobox.listeners.JoinLeaveListener;
import world.bentobox.bentobox.listeners.PanelListenerManager;
import world.bentobox.bentobox.listeners.PrimaryIslandListener;
import world.bentobox.bentobox.listeners.SeedWorldMakerListener;
import world.bentobox.bentobox.listeners.StandardSpawnProtectionListener;
import world.bentobox.bentobox.listeners.teleports.EntityTeleportListener;
import world.bentobox.bentobox.listeners.teleports.PlayerTeleportListener;
Expand Down Expand Up @@ -102,6 +104,8 @@ public class BentoBox extends JavaPlugin implements Listener {

@Override
public void onEnable(){
setInstance(this);

if (!ServerCompatibility.getInstance().checkCompatibility().isCanLaunch()) {
// The server's most likely incompatible.
// Show a warning
Expand All @@ -123,7 +127,6 @@ public void onEnable(){

// Save the default config from config.yml
saveDefaultConfig();
setInstance(this);
// Load Flags
flagsManager = new FlagsManager(this);

Expand Down Expand Up @@ -184,6 +187,9 @@ public void onEnable(){

private void completeSetup(long loadTime) {
final long enableStart = System.currentTimeMillis();

hooksManager.registerHook(new MultipaperHook());

hooksManager.registerHook(new VaultHook());

// MythicMobs
Expand All @@ -210,20 +216,6 @@ private void completeSetup(long loadTime) {
return;
}

// Save islands & players data every X minutes
Bukkit.getScheduler().runTaskTimer(instance, () -> {
if (!playersManager.isSaveTaskRunning()) {
playersManager.saveAll(true);
} else {
getLogger().warning("Tried to start a player data save task while the previous auto save was still running!");
}
if (!islandsManager.isSaveTaskRunning()) {
islandsManager.saveAll(true);
} else {
getLogger().warning("Tried to start a island data save task while the previous auto save was still running!");
}
}, getSettings().getDatabaseBackupPeriod() * 20 * 60L, getSettings().getDatabaseBackupPeriod() * 20 * 60L);

// Make sure all flag listeners are registered.
flagsManager.registerListeners();

Expand Down Expand Up @@ -323,6 +315,8 @@ private void registerListeners() {
manager.registerEvents(islandDeletionManager, this);
// Primary Island Listener
manager.registerEvents(new PrimaryIslandListener(this), this);
// Seed world chunk generator
manager.registerEvents(new SeedWorldMakerListener(this), this);
}

@Override
Expand Down Expand Up @@ -433,7 +427,7 @@ public FlagsManager getFlagsManager() {
* @return the ranksManager
* @deprecated Just use {@code RanksManager.getInstance()}
*/
@Deprecated(since = "2.0.0")
@Deprecated(since = "2.0.0", forRemoval = true)
public RanksManager getRanksManager() {
return RanksManager.getInstance();
}
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/world/bentobox/bentobox/api/addons/Addon.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.event.Listener;

import com.github.puregero.multilib.MultiLib;

import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.addons.request.AddonRequestHandler;
import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.bentobox.managers.IslandsManager;
import world.bentobox.bentobox.managers.PlayersManager;
import world.bentobox.bentobox.util.Util;

/**
* Add-on class for BentoBox. Extend this to create an add-on. The operation
Expand All @@ -45,6 +48,10 @@ public abstract class Addon {

protected Addon() {
state = State.DISABLED;
if (!Util.inTest()) {
// If the config is updated, update the config.
MultiLib.onString(getPlugin(), "bentobox-config-update", v -> this.reloadConfig());
}
}

/**
Expand Down Expand Up @@ -275,7 +282,7 @@ public File saveResource(String jarResource, File destinationFolder, boolean rep
}
// There are two options, use the path of the resource or not
File outFile = new File(destinationFolder,
jarResource.replaceAll("/", Matcher.quoteReplacement(File.separator)));
jarResource.replaceAll("/", Matcher.quoteReplacement(File.separator)));

if (noPath) {
outFile = new File(destinationFolder, outFile.getName());
Expand Down Expand Up @@ -396,7 +403,7 @@ public PlayersManager getPlayers() {
public IslandsManager getIslands() {
return getPlugin().getIslands();
}

/**
* Get Islands Manager
* @return Islands manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;

import com.github.puregero.multilib.MultiLib;

import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.configuration.WorldSettings;
import world.bentobox.bentobox.util.Util;
Expand Down Expand Up @@ -129,7 +131,10 @@ public Optional<CompositeCommand> getAdminCommand() {
* in-game and need to be saved.
* @since 1.4.0
*/
public abstract void saveWorldSettings();
public void saveWorldSettings() {
// Inform other servers
MultiLib.notify("bentobox-config-update", "");
}

/**
* Defines if the game mode uses the latest {@link ChunkGenerator} API or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void onLoad() {
String parentFolder = getFile().getParent();
if (parentFolder == null || !parentFolder.endsWith(ADDONS_FOLDER)) {
// Jar is in the wrong place. Let's move it
moveJar();
//moveJar();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,11 @@ protected boolean hasSubCommands(boolean ignoreHelp) {

/**
* Convenience method to check if a user has a team.
* Consider checking the island itself {@link Island#inTeam(UUID)}
*
* @param world - the world to check
* @param user - the User
* @return true if player is in a team
* @see Consider checking the island itself {@link Island#inTeam(UUID)}
*/
protected boolean inTeam(World world, User user) {
return plugin.getIslands().inTeam(world, user.getUniqueId());
Expand Down
Loading
Loading