Skip to content

Commit bb4e2ea

Browse files
authored
Merge pull request #2899 from BentoBoxWorld/develop
Release 3.13.0
2 parents 802dba3 + 0d9d5a4 commit bb4e2ea

File tree

67 files changed

+21411
-18632
lines changed

Some content is hidden

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

67 files changed

+21411
-18632
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Publish to Modrinth
2+
3+
# Triggers when you publish a GitHub Release
4+
on:
5+
release:
6+
types: [published]
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Release tag to publish (e.g. 3.12.1)'
11+
required: true
12+
type: string
13+
changelog:
14+
description: 'Changelog / release notes (markdown)'
15+
required: false
16+
type: string
17+
18+
jobs:
19+
publish:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
24+
steps:
25+
# 1. Check out the repository at the release tag
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
# 2. Set up Java 21 (required by BentoBox's build)
30+
- name: Set up Java 21
31+
uses: actions/setup-java@v4
32+
with:
33+
java-version: '21'
34+
distribution: 'temurin'
35+
36+
# 3. Cache Gradle dependencies to speed up builds
37+
- name: Cache Gradle packages
38+
uses: actions/cache@v4
39+
with:
40+
path: |
41+
~/.gradle/caches
42+
~/.gradle/wrapper
43+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }}
44+
restore-keys: ${{ runner.os }}-gradle-
45+
46+
# 4. Build the shaded JAR
47+
# GIT_BRANCH=origin/master tells the build script to produce a clean
48+
# version number (e.g. 3.12.0) without -LOCAL-SNAPSHOT suffixes.
49+
- name: Build with Gradle
50+
run: ./gradlew shadowJar --no-daemon
51+
env:
52+
GIT_BRANCH: origin/master
53+
54+
# 5. Upload the JAR to Modrinth
55+
#
56+
# Prerequisites — add these secrets in your GitHub repo settings
57+
# (Settings → Secrets and variables → Actions):
58+
#
59+
# MODRINTH_TOKEN — personal access token from https://modrinth.com/settings/pats
60+
# (scope: "Create versions")
61+
# MODRINTH_PROJECT_ID — your Modrinth project ID, visible on your project page
62+
# under the three-dot menu ("Copy ID")
63+
#
64+
- name: Publish to Modrinth
65+
uses: cloudnode-pro/modrinth-publish@v2
66+
with:
67+
token: ${{ secrets.MODRINTH_TOKEN }}
68+
project: ${{ secrets.MODRINTH_PROJECT_ID }}
69+
70+
# Use the release tag, or the manually supplied tag when triggered via workflow_dispatch
71+
version: ${{ github.event.release.tag_name || inputs.tag }}
72+
73+
# Use the GitHub release body, or the manually supplied changelog for workflow_dispatch
74+
changelog: ${{ github.event.release.body || inputs.changelog }}
75+
76+
# Release channel — auto-detected from version string:
77+
# *-alpha → alpha, *-beta → beta, anything else → release
78+
# Override here if needed: release | beta | alpha
79+
# channel: release
80+
81+
# BentoBox is a Paper plugin
82+
loaders: |-
83+
paper
84+
purpur
85+
86+
# Minecraft versions this release supports.
87+
# Update this list when you start supporting newer or older MC versions.
88+
# You can use exact versions (1.21.1) or patterns (1.21.x not supported by this action).
89+
game-versions: |-
90+
1.21.5
91+
1.21.6
92+
1.21.7
93+
1.21.8
94+
1.21.9
95+
1.21.10
96+
1.21.11
97+
26.1
98+
26.1.1
99+
100+
# Path to the built JAR — the Shadow plugin produces BentoBox-<version>.jar
101+
# Note: glob patterns are not supported; use the release tag directly.
102+
files: build/libs/BentoBox-${{ github.event.release.tag_name || inputs.tag }}.jar

build.gradle.kts

Lines changed: 1 addition & 1 deletion
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.12.0"
49+
val buildVersion = "3.13.0"
5050
val buildNumberDefault = "-LOCAL" // Local build identifier
5151
val snapshotSuffix = "-SNAPSHOT" // Indicates development/snapshot version
5252

src/main/java/world/bentobox/bentobox/api/commands/admin/conversations/NamePrompt.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ public NamePrompt(BentoBox plugin, @NonNull Island island, @NonNull User user, S
3434
@Override
3535
@NonNull
3636
public String getPromptText(@NonNull ConversationContext context) {
37-
return user.getTranslation("commands.island.renamehome.enter-new-name");
37+
// Send via User to properly render MiniMessage/legacy formatting,
38+
// since Bukkit's conversation API sends raw text without formatting.
39+
user.sendRawMessage(user.getTranslation("commands.island.renamehome.enter-new-name"));
40+
return "";
3841
}
3942

4043
@Override

src/main/java/world/bentobox/bentobox/api/commands/island/conversations/ConfirmPrompt.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ public ConfirmPrompt(@NonNull User user, BentoBox plugin, String instructions, S
3535
@Override
3636
@NonNull
3737
public String getPromptText(@NonNull ConversationContext context) {
38-
return user.getTranslation(instructions);
38+
// Send via User to properly render MiniMessage/legacy formatting,
39+
// since Bukkit's conversation API sends raw text without formatting.
40+
user.sendRawMessage(user.getTranslation(instructions));
41+
return "";
3942
}
4043

4144
@Override

src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamGUI.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,25 +214,34 @@ private void createClickHandler(PanelItemBuilder builder, @NonNull List<ActionRe
214214
*/
215215
private void createDescription(PanelItemBuilder builder) {
216216
RanksManager.getInstance().getRanks().forEach((reference, score) -> {
217+
String rankName = user.getTranslation(reference);
217218
if (rankView == RanksManager.OWNER_RANK && score > RanksManager.VISITOR_RANK
218219
&& score <= RanksManager.OWNER_RANK) {
219-
builder.description(user.getTranslation("protection.panel.flag-item.allowed-rank")
220-
+ user.getTranslation(reference));
220+
builder.description(getRankTranslation("protection.panel.flag-item.allowed-rank", rankName));
221221
} else if (score > RanksManager.VISITOR_RANK && score < rankView) {
222-
builder.description(user.getTranslation("protection.panel.flag-item.blocked-rank")
223-
+ user.getTranslation(reference));
222+
builder.description(getRankTranslation("protection.panel.flag-item.blocked-rank", rankName));
224223
} else if (score <= RanksManager.OWNER_RANK && score > rankView) {
225-
builder.description(user.getTranslation("protection.panel.flag-item.blocked-rank")
226-
+ user.getTranslation(reference));
224+
builder.description(getRankTranslation("protection.panel.flag-item.blocked-rank", rankName));
227225
} else if (score == rankView) {
228-
builder.description(user.getTranslation("protection.panel.flag-item.allowed-rank")
229-
+ user.getTranslation(reference));
226+
builder.description(getRankTranslation("protection.panel.flag-item.allowed-rank", rankName));
230227
}
231228
});
232229
builder.description(user.getTranslation("commands.island.team.gui.buttons.rank-filter.description"));
233230

234231
}
235232

233+
/**
234+
* Gets a rank translation, supporting both MiniMessage format (with [rank] placeholder)
235+
* and legacy format (without placeholder, rank name concatenated at end).
236+
*/
237+
private String getRankTranslation(String key, String rankName) {
238+
String translation = user.getTranslation(key, TextVariables.RANK, rankName);
239+
if (!translation.contains(rankName)) {
240+
translation = user.getTranslation(key) + rankName;
241+
}
242+
return translation;
243+
}
244+
236245
/**
237246
* Create invited button panel item.
238247
*

src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamInviteGUI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ class InviteNamePrompt extends StringPrompt {
267267
@Override
268268
@NonNull
269269
public String getPromptText(@NonNull ConversationContext context) {
270-
return user.getTranslation("commands.island.team.invite.gui.enter-name");
270+
user.sendRawMessage(user.getTranslation("commands.island.team.invite.gui.enter-name"));
271+
return "";
271272
}
272273

273274
@Override

src/main/java/world/bentobox/bentobox/api/flags/Flag.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,20 +485,33 @@ private PanelItemBuilder createProtectionFlag(BentoBox plugin, User user, Island
485485
TextVariables.DESCRIPTION, user.getTranslation(getDescriptionReference())));
486486

487487
RanksManager.getInstance().getRanks().forEach((reference, score) -> {
488-
488+
String rankName = user.getTranslation(reference);
489489
if (score > RanksManager.BANNED_RANK && score < y) {
490-
pib.description(user.getTranslation("protection.panel.flag-item.blocked-rank") + user.getTranslation(reference));
490+
pib.description(getRankTranslation(user, "protection.panel.flag-item.blocked-rank", rankName));
491491
} else if (score <= RanksManager.OWNER_RANK && score > y) {
492-
pib.description(user.getTranslation("protection.panel.flag-item.allowed-rank") + user.getTranslation(reference));
492+
pib.description(getRankTranslation(user, "protection.panel.flag-item.allowed-rank", rankName));
493493
} else if (score == y) {
494-
pib.description(user.getTranslation("protection.panel.flag-item.minimal-rank") + user.getTranslation(reference));
494+
pib.description(getRankTranslation(user, "protection.panel.flag-item.minimal-rank", rankName));
495495
}
496496
});
497497
}
498498

499499
return pib;
500500
}
501501

502+
/**
503+
* Gets a rank translation, supporting both MiniMessage format (with [rank] placeholder)
504+
* and legacy format (without placeholder, rank name concatenated at end).
505+
*/
506+
private String getRankTranslation(User user, String key, String rankName) {
507+
String translation = user.getTranslation(key, TextVariables.RANK, rankName);
508+
// If [rank] placeholder was not in the locale string (legacy format),
509+
// the rank name won't appear in the result — fall back to concatenation
510+
if (!translation.contains(rankName)) {
511+
translation = user.getTranslation(key) + rankName;
512+
}
513+
return translation;
514+
}
502515

503516
/**
504517
* @return the mode

src/main/java/world/bentobox/bentobox/api/panels/Panel.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
import org.bukkit.inventory.InventoryHolder;
1212
import org.eclipse.jdt.annotation.NonNull;
1313

14+
import net.kyori.adventure.text.Component;
1415
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
1516
import world.bentobox.bentobox.api.user.User;
1617
import world.bentobox.bentobox.database.objects.Island;
1718
import world.bentobox.bentobox.listeners.PanelListenerManager;
19+
import world.bentobox.bentobox.util.Util;
1820
import world.bentobox.bentobox.util.heads.HeadGetter;
1921
import world.bentobox.bentobox.util.heads.HeadRequester;
2022

@@ -82,18 +84,18 @@ protected void makePanel(String name, Map<Integer, PanelItem> items, int size, U
8284
/**
8385
* @since 1.7.0
8486
*/
85-
@SuppressWarnings("deprecation")
8687
protected void makePanel(String name, Map<Integer, PanelItem> items, int size, User user, PanelListener listener,
8788
Type type) {
8889
this.name = name;
8990
this.items = items;
9091

91-
// Create panel
92+
// Create panel with Component-based title
93+
Component title = name != null ? Util.parseMiniMessageOrLegacy(name) : Component.empty();
9294
switch (type) {
93-
case INVENTORY -> inventory = Bukkit.createInventory(null, fixSize(size), name);
94-
case HOPPER -> inventory = Bukkit.createInventory(null, InventoryType.HOPPER, name);
95-
case DROPPER -> inventory = Bukkit.createInventory(null, InventoryType.DROPPER, name);
96-
case ANVIL -> inventory = Bukkit.createInventory(null, InventoryType.ANVIL, name);
95+
case INVENTORY -> inventory = Bukkit.createInventory(null, fixSize(size), title);
96+
case HOPPER -> inventory = Bukkit.createInventory(null, InventoryType.HOPPER, title);
97+
case DROPPER -> inventory = Bukkit.createInventory(null, InventoryType.DROPPER, title);
98+
case ANVIL -> inventory = Bukkit.createInventory(null, InventoryType.ANVIL, title);
9799
}
98100

99101
// Fill the inventory and return

src/main/java/world/bentobox/bentobox/api/panels/PanelItem.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
1414
import world.bentobox.bentobox.api.user.User;
15+
import world.bentobox.bentobox.util.Util;
1516

1617
/**
1718
* Represents an item in a {@link Panel}
@@ -75,7 +76,9 @@ public List<String> getDescription() {
7576
public void setDescription(List<String> description) {
7677
this.description = description;
7778
if (meta != null) {
78-
meta.setLore(description);
79+
meta.lore(description.stream()
80+
.map(Util::parseMiniMessageOrLegacy)
81+
.toList());
7982
icon.setItemMeta(meta);
8083
}
8184
}
@@ -87,7 +90,7 @@ public String getName() {
8790
public void setName(String name) {
8891
this.name = name;
8992
if (meta != null) {
90-
meta.setDisplayName(name);
93+
meta.displayName(name != null ? Util.parseMiniMessageOrLegacy(name) : null);
9194
icon.setItemMeta(meta);
9295
}
9396
}

src/main/java/world/bentobox/bentobox/api/panels/builders/PanelBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class PanelBuilder {
2727
private World world;
2828

2929
public PanelBuilder name(String name) {
30-
this.name = Util.translateColorCodes(name);
30+
this.name = name;
3131
return this;
3232
}
3333

0 commit comments

Comments
 (0)