From 76fbe7f724f7a70078b62fca7c96b90629a023ae Mon Sep 17 00:00:00 2001
From: "version-bump[github-action]"
<41898282+version-bump[github-action]@users.noreply.github.com>
Date: Thu, 13 Mar 2025 20:16:56 +0000
Subject: [PATCH 01/17] Bump version from 1.4.0 to 1.4.0-SNAPSHOT0
---
MiniGamesBox API/pom.xml | 2 +-
MiniGamesBox Classic/pom.xml | 2 +-
MiniGamesBox Database/pom.xml | 2 +-
MiniGamesBox Inventory/pom.xml | 2 +-
MiniGamesBox Utils/pom.xml | 2 +-
pom.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/MiniGamesBox API/pom.xml b/MiniGamesBox API/pom.xml
index 283d3fa8..66b28068 100644
--- a/MiniGamesBox API/pom.xml
+++ b/MiniGamesBox API/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0
+ 1.4.0-SNAPSHOT0
4.0.0
diff --git a/MiniGamesBox Classic/pom.xml b/MiniGamesBox Classic/pom.xml
index 7c834b6a..6c09b045 100644
--- a/MiniGamesBox Classic/pom.xml
+++ b/MiniGamesBox Classic/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0
+ 1.4.0-SNAPSHOT0
4.0.0
diff --git a/MiniGamesBox Database/pom.xml b/MiniGamesBox Database/pom.xml
index 3220ec10..f3c29200 100644
--- a/MiniGamesBox Database/pom.xml
+++ b/MiniGamesBox Database/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0
+ 1.4.0-SNAPSHOT0
4.0.0
diff --git a/MiniGamesBox Inventory/pom.xml b/MiniGamesBox Inventory/pom.xml
index 26113cf6..a679f697 100644
--- a/MiniGamesBox Inventory/pom.xml
+++ b/MiniGamesBox Inventory/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0
+ 1.4.0-SNAPSHOT0
4.0.0
diff --git a/MiniGamesBox Utils/pom.xml b/MiniGamesBox Utils/pom.xml
index f66aa4da..f29e9d93 100644
--- a/MiniGamesBox Utils/pom.xml
+++ b/MiniGamesBox Utils/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0
+ 1.4.0-SNAPSHOT0
4.0.0
diff --git a/pom.xml b/pom.xml
index 6042701d..f66d727b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
plugily.projects
minigamesbox
- 1.4.0
+ 1.4.0-SNAPSHOT0
pom
From e77b4d3d19235aa8ad4310dfd9c111c6e000c061 Mon Sep 17 00:00:00 2001
From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com>
Date: Tue, 25 Mar 2025 17:49:16 +0100
Subject: [PATCH 02/17] Ensure UTF-8 compiling
---
.github/building/pom.xml | 25 ++++++++++++++++++++-----
pom.xml | 1 +
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/.github/building/pom.xml b/.github/building/pom.xml
index d5c50f61..a9c3c79d 100644
--- a/.github/building/pom.xml
+++ b/.github/building/pom.xml
@@ -24,7 +24,7 @@
plugily.projects
minigamesbox
- 1.3.17-SNAPSHOT4
+ 1.4.0-SNAPSHOT0
pom
@@ -101,21 +101,32 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.10.1
+ 3.14.0
${java.version}
${java.version}
+ UTF-8
org.apache.maven.plugins
maven-site-plugin
- 3.12.0
+ 3.21.0
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ 3.1.4
+
+
+ org.apache.maven.plugins
+ maven-project-info-reports-plugin
+ 3.9.0
org.jacoco
jacoco-maven-plugin
- 0.8.8
+ 0.8.12
true
@@ -153,8 +164,12 @@
- plugily-projects
+ Release
https://maven.plugily.xyz/releases
+
+ Snapshot
+ https://maven.plugily.xyz/snapshots
+
diff --git a/pom.xml b/pom.xml
index f66d727b..a9c3c79d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -105,6 +105,7 @@
${java.version}
${java.version}
+ UTF-8
From f4916663e86744e442cd3e74a34fa86564982ce7 Mon Sep 17 00:00:00 2001
From: "version-bump[github-action]"
<41898282+version-bump[github-action]@users.noreply.github.com>
Date: Tue, 25 Mar 2025 16:49:23 +0000
Subject: [PATCH 03/17] Bump version from 1.4.0-SNAPSHOT0 to 1.4.0-SNAPSHOT1
---
MiniGamesBox API/pom.xml | 2 +-
MiniGamesBox Classic/pom.xml | 2 +-
MiniGamesBox Database/pom.xml | 2 +-
MiniGamesBox Inventory/pom.xml | 2 +-
MiniGamesBox Utils/pom.xml | 2 +-
pom.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/MiniGamesBox API/pom.xml b/MiniGamesBox API/pom.xml
index 66b28068..7c476c8e 100644
--- a/MiniGamesBox API/pom.xml
+++ b/MiniGamesBox API/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT0
+ 1.4.0-SNAPSHOT1
4.0.0
diff --git a/MiniGamesBox Classic/pom.xml b/MiniGamesBox Classic/pom.xml
index 6c09b045..7fda6bfe 100644
--- a/MiniGamesBox Classic/pom.xml
+++ b/MiniGamesBox Classic/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT0
+ 1.4.0-SNAPSHOT1
4.0.0
diff --git a/MiniGamesBox Database/pom.xml b/MiniGamesBox Database/pom.xml
index f3c29200..4f695b6b 100644
--- a/MiniGamesBox Database/pom.xml
+++ b/MiniGamesBox Database/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT0
+ 1.4.0-SNAPSHOT1
4.0.0
diff --git a/MiniGamesBox Inventory/pom.xml b/MiniGamesBox Inventory/pom.xml
index a679f697..8c1776e6 100644
--- a/MiniGamesBox Inventory/pom.xml
+++ b/MiniGamesBox Inventory/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT0
+ 1.4.0-SNAPSHOT1
4.0.0
diff --git a/MiniGamesBox Utils/pom.xml b/MiniGamesBox Utils/pom.xml
index f29e9d93..95030f85 100644
--- a/MiniGamesBox Utils/pom.xml
+++ b/MiniGamesBox Utils/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT0
+ 1.4.0-SNAPSHOT1
4.0.0
diff --git a/pom.xml b/pom.xml
index a9c3c79d..034aeed0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
plugily.projects
minigamesbox
- 1.4.0-SNAPSHOT0
+ 1.4.0-SNAPSHOT1
pom
From 326bc15a25fdb8a997b9f9247a0dff1391ae2806 Mon Sep 17 00:00:00 2001
From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com>
Date: Tue, 25 Mar 2025 20:02:56 +0100
Subject: [PATCH 04/17] Fixed messageIssueColor does not repeat after value on
string
---
.../minigamesbox/classic/arena/PluginArenaManager.java | 1 +
.../classic/handlers/language/MessageBuilder.java | 4 ++++
.../handlers/setup/categories/PluginCountableCategory.java | 1 +
3 files changed, 6 insertions(+)
diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/PluginArenaManager.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/PluginArenaManager.java
index 83219702..29ab980a 100644
--- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/PluginArenaManager.java
+++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/PluginArenaManager.java
@@ -198,6 +198,7 @@ private boolean canJoinArenaAndMessage(Player player, IPluginArena arena) {
return false;
}
String perm = plugin.getPluginNamePrefixLong() + ".join.";
+ plugin.getDebugger().debug("[{0}] Initial perm is <{1}> of name <{2}>", arena.getId(), perm, plugin.getPluginNamePrefixLong());
if(!(player.hasPermission(perm.replace("", "*")) || player.hasPermission(perm.replace("", arena.getId())))) {
MessageBuilder denyMessage = new MessageBuilder("IN_GAME_JOIN_NO_PERMISSION").asKey().player(player).value(perm.replace("", arena.getId()));
if(plugin.getConfigPreferences().getOption("BUNGEEMODE")) {
diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/language/MessageBuilder.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/language/MessageBuilder.java
index b0374256..980d807b 100644
--- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/language/MessageBuilder.java
+++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/language/MessageBuilder.java
@@ -117,18 +117,21 @@ public MessageBuilder prefix(String prefix) {
public MessageBuilder player(Player player) {
this.player = player;
+ colorChatIssue();
formatPlayer();
return this;
}
public MessageBuilder value(String value) {
this.value = value;
+ colorChatIssue();
formatValue();
return this;
}
public MessageBuilder integer(int integer) {
this.integer = integer;
+ colorChatIssue();
formatInteger();
return this;
}
@@ -138,6 +141,7 @@ public MessageBuilder arena(IPluginArena arena) {
return this;
}
this.arena = arena;
+ colorChatIssue();
formatArena();
return this;
}
diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/setup/categories/PluginCountableCategory.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/setup/categories/PluginCountableCategory.java
index a8fd7d73..dadcca70 100644
--- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/setup/categories/PluginCountableCategory.java
+++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/setup/categories/PluginCountableCategory.java
@@ -47,6 +47,7 @@ public void addItems(NormalFastInv gui) {
CountItem minimumPlayers = new CountItem(setupInventory, new ItemBuilder(XMaterial.COAL.parseMaterial()), "Minimum Players", "How many players are needed to start the lobby countdown?", "minimumplayers");
itemList.add(minimumPlayers);
gui.setItem((getInventoryLine() * 9) + 1, minimumPlayers);
+ // could be added minimum players check
CountItem maximumPlayers = new CountItem(setupInventory, new ItemBuilder(XMaterial.REDSTONE_BLOCK.parseMaterial()), "Maximum Players", "How many players can the arena hold?", "maximumplayers");
itemList.add(maximumPlayers);
gui.setItem((getInventoryLine() * 9) + 2, maximumPlayers);
From 2e5d4ed136346eca417d819f645c08d8b0fa2a60 Mon Sep 17 00:00:00 2001
From: "version-bump[github-action]"
<41898282+version-bump[github-action]@users.noreply.github.com>
Date: Tue, 25 Mar 2025 19:39:34 +0000
Subject: [PATCH 05/17] Bump version from 1.4.0-SNAPSHOT1 to 1.4.0-SNAPSHOT2
---
MiniGamesBox API/pom.xml | 2 +-
MiniGamesBox Classic/pom.xml | 2 +-
MiniGamesBox Database/pom.xml | 2 +-
MiniGamesBox Inventory/pom.xml | 2 +-
MiniGamesBox Utils/pom.xml | 2 +-
pom.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/MiniGamesBox API/pom.xml b/MiniGamesBox API/pom.xml
index 7c476c8e..b009596e 100644
--- a/MiniGamesBox API/pom.xml
+++ b/MiniGamesBox API/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT1
+ 1.4.0-SNAPSHOT2
4.0.0
diff --git a/MiniGamesBox Classic/pom.xml b/MiniGamesBox Classic/pom.xml
index 7fda6bfe..d7fd2118 100644
--- a/MiniGamesBox Classic/pom.xml
+++ b/MiniGamesBox Classic/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT1
+ 1.4.0-SNAPSHOT2
4.0.0
diff --git a/MiniGamesBox Database/pom.xml b/MiniGamesBox Database/pom.xml
index 4f695b6b..a3551c54 100644
--- a/MiniGamesBox Database/pom.xml
+++ b/MiniGamesBox Database/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT1
+ 1.4.0-SNAPSHOT2
4.0.0
diff --git a/MiniGamesBox Inventory/pom.xml b/MiniGamesBox Inventory/pom.xml
index 8c1776e6..69d9cbee 100644
--- a/MiniGamesBox Inventory/pom.xml
+++ b/MiniGamesBox Inventory/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT1
+ 1.4.0-SNAPSHOT2
4.0.0
diff --git a/MiniGamesBox Utils/pom.xml b/MiniGamesBox Utils/pom.xml
index 95030f85..4748170b 100644
--- a/MiniGamesBox Utils/pom.xml
+++ b/MiniGamesBox Utils/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT1
+ 1.4.0-SNAPSHOT2
4.0.0
diff --git a/pom.xml b/pom.xml
index 034aeed0..d7350d12 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
plugily.projects
minigamesbox
- 1.4.0-SNAPSHOT1
+ 1.4.0-SNAPSHOT2
pom
From 391775339d10fdd7fddd6d755649e41f1fcc8ae7 Mon Sep 17 00:00:00 2001
From: Tigerpanzer02 <37453987+Tigerpanzer02@users.noreply.github.com.>
Date: Sat, 5 Apr 2025 15:03:31 +0200
Subject: [PATCH 06/17] Provide ScoreboardLines with Player to reduce doupled
code in subprojects
---
.../api/arena/managers/IPluginScoreboardManager.java | 2 +-
.../classic/arena/managers/PluginScoreboardManager.java | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/MiniGamesBox API/src/main/java/plugily/projects/minigamesbox/api/arena/managers/IPluginScoreboardManager.java b/MiniGamesBox API/src/main/java/plugily/projects/minigamesbox/api/arena/managers/IPluginScoreboardManager.java
index 514d967c..bf71e104 100644
--- a/MiniGamesBox API/src/main/java/plugily/projects/minigamesbox/api/arena/managers/IPluginScoreboardManager.java
+++ b/MiniGamesBox API/src/main/java/plugily/projects/minigamesbox/api/arena/managers/IPluginScoreboardManager.java
@@ -37,7 +37,7 @@ public interface IPluginScoreboardManager {
/**
* Get Lines from the language.yml according to arena state
*/
- List getScoreboardLines();
+ List getScoreboardLines(Player player);
/**
* Update lines with defined placeholders
diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/managers/PluginScoreboardManager.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/managers/PluginScoreboardManager.java
index 0bf6fcd8..9e873018 100644
--- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/managers/PluginScoreboardManager.java
+++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/managers/PluginScoreboardManager.java
@@ -70,7 +70,7 @@ public boolean hasLinesMaxLength() {
};
board.updateTitle(boardTitle);
- board.updateLines(formatScoreboardLines(getScoreboardLines(), player));
+ board.updateLines(formatScoreboardLines(getScoreboardLines(player), player));
boardMap.put(user.getUniqueId(), board);
@@ -78,7 +78,7 @@ public boolean hasLinesMaxLength() {
@Override
public void updateScoreboards() {
- boardMap.values().forEach(fastBoard -> fastBoard.updateLines(formatScoreboardLines(getScoreboardLines(), fastBoard.getPlayer())));
+ boardMap.values().forEach(fastBoard -> fastBoard.updateLines(formatScoreboardLines(getScoreboardLines(fastBoard.getPlayer()), fastBoard.getPlayer())));
}
@Override
@@ -93,7 +93,7 @@ public void stopAllScoreboards() {
}
@Override
- public List getScoreboardLines() {
+ public List getScoreboardLines(Player player) {
return new ArrayList<>(plugin.getLanguageManager().getLanguageList(arena.getArenaState() == IArenaState.FULL_GAME ? "Scoreboard.Content.Starting"
: "Scoreboard.Content." + arena.getArenaState().getFormattedName()));
}
From 858b0fed25d1ee935b4ba68e40d341d950b0781f Mon Sep 17 00:00:00 2001
From: Tigerpanzer02 <37453987+Tigerpanzer02@users.noreply.github.com.>
Date: Sat, 5 Apr 2025 15:15:49 +0200
Subject: [PATCH 07/17] By default for lower 1.13 versions remove special chars
from Scoreboard lines
---
.../managers/PluginScoreboardManager.java | 27 +++++++++++++------
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/managers/PluginScoreboardManager.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/managers/PluginScoreboardManager.java
index 9e873018..38e56895 100644
--- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/managers/PluginScoreboardManager.java
+++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/managers/PluginScoreboardManager.java
@@ -58,14 +58,7 @@ public void createScoreboard(IUser user) {
FastBoard board = new FastBoard(player) {
@Override
public boolean hasLinesMaxLength() {
- if(Bukkit.getPluginManager().isPluginEnabled("ViaVersion")) {
- try {
- return Via.getAPI().getPlayerVersion(getPlayer()) < ProtocolVersion.v1_13.getVersion();
- } catch(Exception ignored) {
- //Not using ViaVersion 4 or unable to get ViaVersion return LegacyBoard!
- }
- }
- return !ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_13);
+ return isLinesMaxLength(getPlayer());
}
};
@@ -101,10 +94,28 @@ public List getScoreboardLines(Player player) {
@Override
public List formatScoreboardLines(List lines, Player player) {
List formattedLines = new ArrayList<>();
+ if(isLinesMaxLength(player)) {
+ List linesWithoutSpecialChars = new ArrayList<>();
+ for(String line : lines) {
+ linesWithoutSpecialChars.add(line.replace("■ ", "").replace("|", ""));
+ }
+ lines = linesWithoutSpecialChars;
+ }
for(String line : lines) {
formattedLines.add(new MessageBuilder(line).player(player).arena(arena).build());
}
return formattedLines;
}
+ private boolean isLinesMaxLength(Player player) {
+ if(Bukkit.getPluginManager().isPluginEnabled("ViaVersion")) {
+ try {
+ return Via.getAPI().getPlayerVersion(player) < ProtocolVersion.v1_13.getVersion();
+ } catch(Exception ignored) {
+ //Not using ViaVersion 4 or unable to get ViaVersion return LegacyBoard!
+ }
+ }
+ return !ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_13);
+ }
+
}
From 2b6ca301cce0789db774531fc9fc6ab4baa9b846 Mon Sep 17 00:00:00 2001
From: "version-bump[github-action]"
<41898282+version-bump[github-action]@users.noreply.github.com>
Date: Sat, 5 Apr 2025 13:16:16 +0000
Subject: [PATCH 08/17] Bump version from 1.4.0-SNAPSHOT2 to 1.4.0-SNAPSHOT3
---
MiniGamesBox API/pom.xml | 2 +-
MiniGamesBox Classic/pom.xml | 2 +-
MiniGamesBox Database/pom.xml | 2 +-
MiniGamesBox Inventory/pom.xml | 2 +-
MiniGamesBox Utils/pom.xml | 2 +-
pom.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/MiniGamesBox API/pom.xml b/MiniGamesBox API/pom.xml
index b009596e..55980af7 100644
--- a/MiniGamesBox API/pom.xml
+++ b/MiniGamesBox API/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT2
+ 1.4.0-SNAPSHOT3
4.0.0
diff --git a/MiniGamesBox Classic/pom.xml b/MiniGamesBox Classic/pom.xml
index d7fd2118..337239aa 100644
--- a/MiniGamesBox Classic/pom.xml
+++ b/MiniGamesBox Classic/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT2
+ 1.4.0-SNAPSHOT3
4.0.0
diff --git a/MiniGamesBox Database/pom.xml b/MiniGamesBox Database/pom.xml
index a3551c54..2138ead6 100644
--- a/MiniGamesBox Database/pom.xml
+++ b/MiniGamesBox Database/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT2
+ 1.4.0-SNAPSHOT3
4.0.0
diff --git a/MiniGamesBox Inventory/pom.xml b/MiniGamesBox Inventory/pom.xml
index 69d9cbee..61cfb1ca 100644
--- a/MiniGamesBox Inventory/pom.xml
+++ b/MiniGamesBox Inventory/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT2
+ 1.4.0-SNAPSHOT3
4.0.0
diff --git a/MiniGamesBox Utils/pom.xml b/MiniGamesBox Utils/pom.xml
index 4748170b..50f66ae5 100644
--- a/MiniGamesBox Utils/pom.xml
+++ b/MiniGamesBox Utils/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT2
+ 1.4.0-SNAPSHOT3
4.0.0
diff --git a/pom.xml b/pom.xml
index d7350d12..fd8ec488 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
plugily.projects
minigamesbox
- 1.4.0-SNAPSHOT2
+ 1.4.0-SNAPSHOT3
pom
From c03c723d8b455c9dbc64a0061feadbfdc13bdb62 Mon Sep 17 00:00:00 2001
From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com>
Date: Thu, 1 May 2025 19:38:06 +0200
Subject: [PATCH 09/17] Fixed player names in statistics/Leaderboard module are
replaced by papi placeholders instead of our player placeholder which caused
empty player names
---
.../classic/commands/arguments/game/LeaderboardArgument.java | 3 ++-
.../classic/handlers/hologram/LeaderboardHologram.java | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/commands/arguments/game/LeaderboardArgument.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/commands/arguments/game/LeaderboardArgument.java
index e50dd9df..327adc45 100644
--- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/commands/arguments/game/LeaderboardArgument.java
+++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/commands/arguments/game/LeaderboardArgument.java
@@ -85,11 +85,12 @@ private void printLeaderboard(CommandSender sender, IStatisticType statisticType
}
private String formatMessage(String statisticName, String playerName, int position, int value) {
- String message = new MessageBuilder("LEADERBOARD_TYPE_CHAT_TOP_FORMAT").asKey().build();
+ String message = new MessageBuilder("LEADERBOARD_TYPE_CHAT_TOP_FORMAT").asKey().getRaw();
message = message.replace("%number%", Integer.toString(position));
message = message.replace("%player%", playerName);
message = message.replace("%value%", Integer.toString(value));
message = message.replace("%user_statistic%", statisticName);
+ message = new MessageBuilder(message).build();
return message;
}
diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/hologram/LeaderboardHologram.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/hologram/LeaderboardHologram.java
index 00f6cb7b..1aff27b5 100644
--- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/hologram/LeaderboardHologram.java
+++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/handlers/hologram/LeaderboardHologram.java
@@ -72,8 +72,9 @@ public void updateHologram() {
String text;
if(i < reverseKeys.size()) {
UUID uuid = reverseKeys.get(i);
- text = new MessageBuilder("LEADERBOARD_TYPE_HOLOGRAM_FORMAT").asKey().integer(i + 1).value(String.valueOf(values.get(uuid))).build();
+ text = new MessageBuilder("LEADERBOARD_TYPE_HOLOGRAM_FORMAT").asKey().integer(i + 1).value(String.valueOf(values.get(uuid))).getRaw();
text = text.replace("%player%", getPlayerNameSafely(uuid));
+ text = new MessageBuilder(text).build();
} else {
text = new MessageBuilder("LEADERBOARD_TYPE_HOLOGRAM_EMPTY_FORMAT").asKey().integer(i + 1).build();
}
From d38fac718848619a3c77edadf3c24ecad7fe2a93 Mon Sep 17 00:00:00 2001
From: "version-bump[github-action]"
<41898282+version-bump[github-action]@users.noreply.github.com>
Date: Thu, 1 May 2025 17:38:32 +0000
Subject: [PATCH 10/17] Bump version from 1.4.0-SNAPSHOT3 to 1.4.0-SNAPSHOT4
---
MiniGamesBox API/pom.xml | 2 +-
MiniGamesBox Classic/pom.xml | 2 +-
MiniGamesBox Database/pom.xml | 2 +-
MiniGamesBox Inventory/pom.xml | 2 +-
MiniGamesBox Utils/pom.xml | 2 +-
pom.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/MiniGamesBox API/pom.xml b/MiniGamesBox API/pom.xml
index 55980af7..73eb5e61 100644
--- a/MiniGamesBox API/pom.xml
+++ b/MiniGamesBox API/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT3
+ 1.4.0-SNAPSHOT4
4.0.0
diff --git a/MiniGamesBox Classic/pom.xml b/MiniGamesBox Classic/pom.xml
index 337239aa..6866ab3d 100644
--- a/MiniGamesBox Classic/pom.xml
+++ b/MiniGamesBox Classic/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT3
+ 1.4.0-SNAPSHOT4
4.0.0
diff --git a/MiniGamesBox Database/pom.xml b/MiniGamesBox Database/pom.xml
index 2138ead6..42b7ccad 100644
--- a/MiniGamesBox Database/pom.xml
+++ b/MiniGamesBox Database/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT3
+ 1.4.0-SNAPSHOT4
4.0.0
diff --git a/MiniGamesBox Inventory/pom.xml b/MiniGamesBox Inventory/pom.xml
index 61cfb1ca..c37418e5 100644
--- a/MiniGamesBox Inventory/pom.xml
+++ b/MiniGamesBox Inventory/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT3
+ 1.4.0-SNAPSHOT4
4.0.0
diff --git a/MiniGamesBox Utils/pom.xml b/MiniGamesBox Utils/pom.xml
index 50f66ae5..6847a14c 100644
--- a/MiniGamesBox Utils/pom.xml
+++ b/MiniGamesBox Utils/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT3
+ 1.4.0-SNAPSHOT4
4.0.0
diff --git a/pom.xml b/pom.xml
index fd8ec488..e60773e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
plugily.projects
minigamesbox
- 1.4.0-SNAPSHOT3
+ 1.4.0-SNAPSHOT4
pom
From 603265d62a25d4e61223d5cb57c07c22c219eb3d Mon Sep 17 00:00:00 2001
From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com>
Date: Thu, 1 May 2025 23:15:19 +0200
Subject: [PATCH 11/17] Fixed InventoryManager saving if player got items with
attributes, now they get cleaned beforehand the attributes get saved!
---
.../serialization/InventorySerializer.java | 71 ++++++++++---------
1 file changed, 38 insertions(+), 33 deletions(-)
diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/utils/serialization/InventorySerializer.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/utils/serialization/InventorySerializer.java
index ab3dee43..0e3cab52 100644
--- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/utils/serialization/InventorySerializer.java
+++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/utils/serialization/InventorySerializer.java
@@ -75,39 +75,6 @@ public static boolean saveInventoryToFile(JavaPlugin plugin, Player player) {
FileConfiguration invConfig = YamlConfiguration.loadConfiguration(invFile);
- invConfig.set("ExperienceProgress", player.getExp());
- invConfig.set("ExperienceLevel", player.getLevel());
- invConfig.set("Current health", player.getHealth());
- invConfig.set("Food", player.getFoodLevel());
- invConfig.set("Saturation", player.getSaturation());
- invConfig.set("Fire ticks", player.getFireTicks());
- invConfig.set("GameMode", player.getGameMode().name());
- invConfig.set("Allow flight", player.getAllowFlight());
- invConfig.set("Flight speed", player.getFlySpeed());
- invConfig.set("Walk speed", player.getWalkSpeed());
-
- invConfig.set("Size", inventory.getSize());
- invConfig.set("Max stack size", inventory.getMaxStackSize());
- Collection activeEffects = player.getActivePotionEffects();
- List activePotions = new ArrayList<>(activeEffects.size());
-
- double maxHealth = VersionUtils.getMaxHealth(player);
-
- for(PotionEffect potion : activeEffects) {
- activePotions.add(potion.getType().getName() + "#" + potion.getDuration() + "#" + potion.getAmplifier());
- if(potion.getType().equals(XPotion.HEALTH_BOOST.getPotionEffectType())) {
- // Health boost effect gives +2 hearts per level, health is counted in half hearts so amplifier * 4
- maxHealth -= (potion.getAmplifier() + 1) * 4;
- }
- }
- invConfig.set("Active potion effects", activePotions);
- invConfig.set("Max health", maxHealth);
-
- org.bukkit.entity.HumanEntity holder = inventory.getHolder();
- if(holder instanceof Player) {
- invConfig.set("Holder", holder.getName());
- }
-
ItemStack[] invContents = inventory.getContents();
for(int i = 0; i < invContents.length; i++) {
ItemStack itemInInv = invContents[i];
@@ -136,6 +103,7 @@ public static boolean saveInventoryToFile(JavaPlugin plugin, Player player) {
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_9)) {
invConfig.set("Offhand", inventory.getItemInOffHand());
+ inventory.setItemInOffHand(null);
}
ItemStack[] armorContents = inventory.getArmorContents();
@@ -146,6 +114,43 @@ public static boolean saveInventoryToFile(JavaPlugin plugin, Player player) {
}
}
+ inventory.clear();
+ inventory.setArmorContents(null);
+
+
+ invConfig.set("ExperienceProgress", player.getExp());
+ invConfig.set("ExperienceLevel", player.getLevel());
+ invConfig.set("Current health", player.getHealth());
+ invConfig.set("Food", player.getFoodLevel());
+ invConfig.set("Saturation", player.getSaturation());
+ invConfig.set("Fire ticks", player.getFireTicks());
+ invConfig.set("GameMode", player.getGameMode().name());
+ invConfig.set("Allow flight", player.getAllowFlight());
+ invConfig.set("Flight speed", player.getFlySpeed());
+ invConfig.set("Walk speed", player.getWalkSpeed());
+
+ invConfig.set("Size", inventory.getSize());
+ invConfig.set("Max stack size", inventory.getMaxStackSize());
+ Collection activeEffects = player.getActivePotionEffects();
+ List activePotions = new ArrayList<>(activeEffects.size());
+
+ double maxHealth = VersionUtils.getMaxHealth(player);
+
+ for(PotionEffect potion : activeEffects) {
+ activePotions.add(potion.getType().getName() + "#" + potion.getDuration() + "#" + potion.getAmplifier());
+ if(potion.getType().equals(XPotion.HEALTH_BOOST.getPotionEffectType())) {
+ // Health boost effect gives +2 hearts per level, health is counted in half hearts so amplifier * 4
+ maxHealth -= (potion.getAmplifier() + 1) * 4;
+ }
+ }
+ invConfig.set("Active potion effects", activePotions);
+ invConfig.set("Max health", maxHealth);
+
+ org.bukkit.entity.HumanEntity holder = inventory.getHolder();
+ if(holder instanceof Player) {
+ invConfig.set("Holder", holder.getName());
+ }
+
invConfig.save(invFile);
plugin.getLogger().log(Level.INFO, "Saved inventory of {0}", player.getName());
return true;
From 70c4b12b7cb954b95959741564e7820dbdf1060f Mon Sep 17 00:00:00 2001
From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com>
Date: Thu, 1 May 2025 23:15:41 +0200
Subject: [PATCH 12/17] Updated XSeries
---
MiniGamesBox API/pom.xml | 2 +-
MiniGamesBox Classic/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/MiniGamesBox API/pom.xml b/MiniGamesBox API/pom.xml
index 73eb5e61..7fbbc7c3 100644
--- a/MiniGamesBox API/pom.xml
+++ b/MiniGamesBox API/pom.xml
@@ -53,7 +53,7 @@
com.github.cryptomorin
XSeries
- 13.0.0
+ 13.2.0
provided
true
diff --git a/MiniGamesBox Classic/pom.xml b/MiniGamesBox Classic/pom.xml
index 6866ab3d..1c4f8111 100644
--- a/MiniGamesBox Classic/pom.xml
+++ b/MiniGamesBox Classic/pom.xml
@@ -87,7 +87,7 @@
com.github.cryptomorin
XSeries
- 13.0.0
+ 13.2.0
compile
true
From 77a3631d901b92dd03ab0a6e681fae3bc82feda3 Mon Sep 17 00:00:00 2001
From: "version-bump[github-action]"
<41898282+version-bump[github-action]@users.noreply.github.com>
Date: Thu, 1 May 2025 21:16:03 +0000
Subject: [PATCH 13/17] Bump version from 1.4.0-SNAPSHOT4 to 1.4.0-SNAPSHOT5
---
MiniGamesBox API/pom.xml | 2 +-
MiniGamesBox Classic/pom.xml | 2 +-
MiniGamesBox Database/pom.xml | 2 +-
MiniGamesBox Inventory/pom.xml | 2 +-
MiniGamesBox Utils/pom.xml | 2 +-
pom.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/MiniGamesBox API/pom.xml b/MiniGamesBox API/pom.xml
index 7fbbc7c3..919f60b0 100644
--- a/MiniGamesBox API/pom.xml
+++ b/MiniGamesBox API/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT4
+ 1.4.0-SNAPSHOT5
4.0.0
diff --git a/MiniGamesBox Classic/pom.xml b/MiniGamesBox Classic/pom.xml
index 1c4f8111..75ce0565 100644
--- a/MiniGamesBox Classic/pom.xml
+++ b/MiniGamesBox Classic/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT4
+ 1.4.0-SNAPSHOT5
4.0.0
diff --git a/MiniGamesBox Database/pom.xml b/MiniGamesBox Database/pom.xml
index 42b7ccad..a8d767bb 100644
--- a/MiniGamesBox Database/pom.xml
+++ b/MiniGamesBox Database/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT4
+ 1.4.0-SNAPSHOT5
4.0.0
diff --git a/MiniGamesBox Inventory/pom.xml b/MiniGamesBox Inventory/pom.xml
index c37418e5..d70a0586 100644
--- a/MiniGamesBox Inventory/pom.xml
+++ b/MiniGamesBox Inventory/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT4
+ 1.4.0-SNAPSHOT5
4.0.0
diff --git a/MiniGamesBox Utils/pom.xml b/MiniGamesBox Utils/pom.xml
index 6847a14c..e5c27688 100644
--- a/MiniGamesBox Utils/pom.xml
+++ b/MiniGamesBox Utils/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT4
+ 1.4.0-SNAPSHOT5
4.0.0
diff --git a/pom.xml b/pom.xml
index e60773e3..45a1da1a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
plugily.projects
minigamesbox
- 1.4.0-SNAPSHOT4
+ 1.4.0-SNAPSHOT5
pom
From 55ba5385fc0e4513eb44158eaea1ec290aaf13bb Mon Sep 17 00:00:00 2001
From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com>
Date: Thu, 1 May 2025 23:33:53 +0200
Subject: [PATCH 14/17] Updated Fastboard to support 1.21.5 Fixed 1.21.5 server
issues
---
.../minigamesbox/classic/preferences/ConfigOption.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/preferences/ConfigOption.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/preferences/ConfigOption.java
index 4d2b6caa..95541452 100644
--- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/preferences/ConfigOption.java
+++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/preferences/ConfigOption.java
@@ -62,7 +62,8 @@ public class ConfigOption implements IConfigOption {
options.put("EXTERNAL_PARTIES", new ConfigOption("Parties.External", true, true));
- options.put("PARTIES", new ConfigOption("Parties.Own", false, true));
+ //todo not implemented yet!!!
+ options.put("OWN_PARTIES", new ConfigOption("Parties.Own", false, true));
options.put("FALL_DAMAGE", new ConfigOption("Damage.Fall", false, true));
options.put("DROWNING_DAMAGE", new ConfigOption("Damage.Drowning", false, true));
options.put("FIRE_DAMAGE", new ConfigOption("Damage.Fire", false, true));
From b48a04dccfb3355d61a51c4eac50f603d6093a6e Mon Sep 17 00:00:00 2001
From: "version-bump[github-action]"
<41898282+version-bump[github-action]@users.noreply.github.com>
Date: Thu, 1 May 2025 21:34:14 +0000
Subject: [PATCH 15/17] Bump version from 1.4.0-SNAPSHOT5 to 1.4.0-SNAPSHOT6
---
MiniGamesBox API/pom.xml | 2 +-
MiniGamesBox Classic/pom.xml | 2 +-
MiniGamesBox Database/pom.xml | 2 +-
MiniGamesBox Inventory/pom.xml | 2 +-
MiniGamesBox Utils/pom.xml | 2 +-
pom.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/MiniGamesBox API/pom.xml b/MiniGamesBox API/pom.xml
index 919f60b0..9514055a 100644
--- a/MiniGamesBox API/pom.xml
+++ b/MiniGamesBox API/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT5
+ 1.4.0-SNAPSHOT6
4.0.0
diff --git a/MiniGamesBox Classic/pom.xml b/MiniGamesBox Classic/pom.xml
index 75ce0565..c1a266bd 100644
--- a/MiniGamesBox Classic/pom.xml
+++ b/MiniGamesBox Classic/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT5
+ 1.4.0-SNAPSHOT6
4.0.0
diff --git a/MiniGamesBox Database/pom.xml b/MiniGamesBox Database/pom.xml
index a8d767bb..f322f4ff 100644
--- a/MiniGamesBox Database/pom.xml
+++ b/MiniGamesBox Database/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT5
+ 1.4.0-SNAPSHOT6
4.0.0
diff --git a/MiniGamesBox Inventory/pom.xml b/MiniGamesBox Inventory/pom.xml
index d70a0586..41361d87 100644
--- a/MiniGamesBox Inventory/pom.xml
+++ b/MiniGamesBox Inventory/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT5
+ 1.4.0-SNAPSHOT6
4.0.0
diff --git a/MiniGamesBox Utils/pom.xml b/MiniGamesBox Utils/pom.xml
index e5c27688..8aed9f24 100644
--- a/MiniGamesBox Utils/pom.xml
+++ b/MiniGamesBox Utils/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT5
+ 1.4.0-SNAPSHOT6
4.0.0
diff --git a/pom.xml b/pom.xml
index 45a1da1a..634b616d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
plugily.projects
minigamesbox
- 1.4.0-SNAPSHOT5
+ 1.4.0-SNAPSHOT6
pom
From 677dd851104e8bb549dc2c16f9987b47bdb2658a Mon Sep 17 00:00:00 2001
From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com>
Date: Thu, 1 May 2025 23:40:47 +0200
Subject: [PATCH 16/17] Removed PagedFastInv as PaginatedFastInv now available
---
.../inventory/paged/PagedFastInv.java | 184 ------------------
1 file changed, 184 deletions(-)
delete mode 100644 MiniGamesBox Inventory/src/main/java/plugily/projects/minigamesbox/inventory/paged/PagedFastInv.java
diff --git a/MiniGamesBox Inventory/src/main/java/plugily/projects/minigamesbox/inventory/paged/PagedFastInv.java b/MiniGamesBox Inventory/src/main/java/plugily/projects/minigamesbox/inventory/paged/PagedFastInv.java
deleted file mode 100644
index b4877aa1..00000000
--- a/MiniGamesBox Inventory/src/main/java/plugily/projects/minigamesbox/inventory/paged/PagedFastInv.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * MiniGamesBox - Library box with massive content that could be seen as minigames core.
- * Copyright (C) 2023 Plugily Projects - maintained by Tigerpanzer_02 and contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package plugily.projects.minigamesbox.inventory.paged;
-
-import org.bukkit.event.inventory.InventoryType;
-import plugily.projects.minigamesbox.inventory.common.RefreshableFastInv;
-import plugily.projects.minigamesbox.inventory.common.item.ClickableItem;
-import plugily.projects.minigamesbox.inventory.common.item.ItemMap;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.BiFunction;
-
-/**
- * A multi-paged inventory.
- * Register the plugin via {@link fr.mrmicky.fastinv.FastInvManager#register(org.bukkit.plugin.Plugin)} before creating any inventory.
- *
- * @author HSGamer
- */
-public class PagedFastInv extends RefreshableFastInv {
- private final List pages = new ArrayList<>();
- private final AtomicInteger currentPage = new AtomicInteger(0);
- private BiFunction lastLineSequence = null;
-
- public PagedFastInv(int size) {
- super(size);
- }
-
- public PagedFastInv(int size, String title) {
- super(size, title);
- }
-
- public PagedFastInv(InventoryType type) {
- super(type);
- }
-
- public PagedFastInv(InventoryType type, String title) {
- super(type, title);
- }
-
- @Override
- protected ItemMap getItemMap() {
- int page = getCurrentPage();
- if (page < 0) {
- return ItemMap.EMPTY;
- }
- ItemMap map = getPage(page);
- if (lastLineSequence == null) {
- return map;
- }
-
- // Clone the map and apply the last line sequence
- ItemMap cloneMap = new ItemMap(map);
- int inventorySize = getInventory().getSize();
- int startSlot = inventorySize - getSlotsPerLine();
- for (int slot = startSlot; slot < inventorySize; slot++) {
- ClickableItem item = lastLineSequence.apply(slot - startSlot, cloneMap.getItem(slot));
- if (item != null) {
- cloneMap.setItem(slot, item);
- }
- }
- return cloneMap;
- }
-
- private int getActualPage(int page) {
- if (pages.isEmpty()) {
- return -1;
- }
- int maxPage = getMaxPage();
- return (page + maxPage) % maxPage;
- }
-
- /**
- * Get the current page, starting from 0
- *
- * @return current page, or -1 if no pages have been added
- */
- public int getCurrentPage() {
- return getActualPage(currentPage.get());
- }
-
- /**
- * Set the current page
- *
- * @param page the page
- */
- public void setCurrentPage(int page) {
- currentPage.set(page);
- }
-
- /**
- * Get the page for displaying.
- * It's actually {@link #getCurrentPage()} but starting from 1.
- *
- * @return the display page
- */
- public int getDisplayPage() {
- return getCurrentPage() + 1;
- }
-
- /**
- * Get the maximum number of pages
- *
- * @return the maximum number of pages
- */
- public int getMaxPage() {
- return pages.size();
- }
-
- /**
- * Get the item map for the given page
- *
- * @param page the page
- * @return the item map
- */
- public ItemMap getPage(int page) {
- int actualPage = getActualPage(page);
- if (actualPage < 0) {
- throw new IllegalStateException("No pages have been added to this inventory.");
- }
- return pages.get(actualPage);
- }
-
- /**
- * Create a new page
- *
- * @return the item map for that new page
- */
- public ItemMap createNewPage() {
- ItemMap map = new ItemMap();
- pages.add(map);
- return map;
- }
-
- /**
- * Remove the page
- *
- * @param page the page
- */
- public void removePage(int page) {
- int actualPage = getActualPage(page);
- if (actualPage < 0) {
- throw new IllegalStateException("No pages have been added to this inventory.");
- }
- pages.remove(actualPage);
- }
-
- /**
- * Get the page list
- *
- * @return the list of all item map
- */
- public List getPages() {
- return pages;
- }
-
- /**
- * Set the last line sequence.
- * This is used to add items to the last line of the inventory.
- * You can use it to add next-page and previous-page buttons.
- *
- * @param lastLineSequence the last line sequence, gives the hotbar slot (0-8) and the item of the slot and returns the item to add
- */
- public void setLastLineSequence(BiFunction lastLineSequence) {
- this.lastLineSequence = lastLineSequence;
- }
-}
From 0f7045b0ab212175c73d24a1741b645ab3f64e01 Mon Sep 17 00:00:00 2001
From: "version-bump[github-action]"
<41898282+version-bump[github-action]@users.noreply.github.com>
Date: Thu, 1 May 2025 21:41:26 +0000
Subject: [PATCH 17/17] Bump version from 1.4.0-SNAPSHOT6 to 1.4.0-SNAPSHOT7
---
MiniGamesBox API/pom.xml | 2 +-
MiniGamesBox Classic/pom.xml | 2 +-
MiniGamesBox Database/pom.xml | 2 +-
MiniGamesBox Inventory/pom.xml | 2 +-
MiniGamesBox Utils/pom.xml | 2 +-
pom.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/MiniGamesBox API/pom.xml b/MiniGamesBox API/pom.xml
index 9514055a..e7291b97 100644
--- a/MiniGamesBox API/pom.xml
+++ b/MiniGamesBox API/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT6
+ 1.4.0-SNAPSHOT7
4.0.0
diff --git a/MiniGamesBox Classic/pom.xml b/MiniGamesBox Classic/pom.xml
index c1a266bd..7a045e29 100644
--- a/MiniGamesBox Classic/pom.xml
+++ b/MiniGamesBox Classic/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT6
+ 1.4.0-SNAPSHOT7
4.0.0
diff --git a/MiniGamesBox Database/pom.xml b/MiniGamesBox Database/pom.xml
index f322f4ff..137bc97d 100644
--- a/MiniGamesBox Database/pom.xml
+++ b/MiniGamesBox Database/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT6
+ 1.4.0-SNAPSHOT7
4.0.0
diff --git a/MiniGamesBox Inventory/pom.xml b/MiniGamesBox Inventory/pom.xml
index 41361d87..a5ec027e 100644
--- a/MiniGamesBox Inventory/pom.xml
+++ b/MiniGamesBox Inventory/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT6
+ 1.4.0-SNAPSHOT7
4.0.0
diff --git a/MiniGamesBox Utils/pom.xml b/MiniGamesBox Utils/pom.xml
index 8aed9f24..2397e598 100644
--- a/MiniGamesBox Utils/pom.xml
+++ b/MiniGamesBox Utils/pom.xml
@@ -23,7 +23,7 @@
minigamesbox
plugily.projects
- 1.4.0-SNAPSHOT6
+ 1.4.0-SNAPSHOT7
4.0.0
diff --git a/pom.xml b/pom.xml
index 634b616d..35b74d1d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
plugily.projects
minigamesbox
- 1.4.0-SNAPSHOT6
+ 1.4.0-SNAPSHOT7
pom