Skip to content

Commit

Permalink
Merge pull request #358 from BentoBoxWorld/develop
Browse files Browse the repository at this point in the history
Updated release
  • Loading branch information
tastybento authored Nov 17, 2024
2 parents 4438c36 + 6c52618 commit a92df39
Show file tree
Hide file tree
Showing 14 changed files with 1,368 additions and 770 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,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
32 changes: 16 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,30 @@
<system>GitHub</system>
<url>https://github.com/BentoBoxWorld/Challenges/issues</url>
</issueManagement>

<distributionManagement>
<repository>
<id>bentoboxworld</id>
<url>https://repo.codemc.org/repository/bentoboxworld/</url>
</repository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<java.version>21</java.version>
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
<spigot.version>1.21.3-R0.1-SNAPSHOT</spigot.version>
<spigot-annotations.version>1.2.3-SNAPSHOT</spigot-annotations.version>
<bentobox.version>2.1.0</bentobox.version>
<bentobox.version>2.7.1-SNAPSHOT</bentobox.version>
<level.version>2.6.3</level.version>
<vault.version>1.7</vault.version>
<panelutils.version>1.2.0</panelutils.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. -->
<build.version>1.3.1</build.version>
<build.version>1.4.0</build.version>
<build.number>-LOCAL</build.number>
<!-- Sonar Cloud -->
<sonar.projectKey>BentoBoxWorld_Challenges</sonar.projectKey>
Expand Down Expand Up @@ -83,17 +90,6 @@
</profile>
</profiles>

<distributionManagement>
<snapshotRepository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.org/repository/maven-snapshots</url>
</snapshotRepository>
<repository>
<id>codemc-releases</id>
<url>https://repo.codemc.org/repository/maven-releases</url>
</repository>
</distributionManagement>

<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
Expand All @@ -108,6 +104,10 @@
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
</repository>
<!-- CodeMC Repo for BentoBox -->
<repository>
<id>bentoboxworld</id>
<url>https://repo.codemc.io/repository/bentoboxworld/</url>
</repository>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.io/repository/maven-public</url>
Expand Down Expand Up @@ -231,7 +231,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.1-SNAPSHOT</version>
<version>3.6.0</version>
<configuration>
<minimizeJar>true</minimizeJar>
<artifactSet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public boolean execute(User user, String label, List<String> args)

return true;
}
this.showHelp(this, user);
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ public String getFriendlyName()
*/
public ItemStack getIcon()
{
if (icon == null) {
icon = new ItemStack(Material.PAPER);
}
return icon.clone();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,32 +113,36 @@ public class ChallengesManager
* This comparator orders challenges by their level, order and name.
*/
private final Comparator<Challenge> challengeComparator = (o1, o2) -> {
// Get the levels
ChallengeLevel o1Level = this.getLevel(o1.getLevel());
ChallengeLevel o2Level = this.getLevel(o2.getLevel());

if (o1Level == null && o2Level == null)
{
// Handle null levels consistently
if (o1Level == null && o2Level == null) {
// Both levels are null, compare by order
return Integer.compare(o1.getOrder(), o2.getOrder());
}
else if (o1Level == null)
{
} else if (o1Level == null) {
// If o1 level is null, it should be ordered lower
return -1;
}
else if (o2Level == null)
{
} else if (o2Level == null) {
// If o2 level is null, it should be ordered lower
return 1;
}
else if (o1Level.equals(o2Level))
{

// If both levels are non-null, compare their orders
int levelComparison = Integer.compare(o1Level.getOrder(), o2Level.getOrder());

// If levels are the same, compare by challenge order
if (levelComparison == 0) {
return Integer.compare(o1.getOrder(), o2.getOrder());
}
else
{
return Integer.compare(o1Level.getOrder(), o2Level.getOrder());
}

// Return the level comparison result
return levelComparison;
};



// ---------------------------------------------------------------------
// Section: Constructor
// ---------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ public String getPromptText(@NotNull ConversationContext conversationContext)
withFirstPrompt(confirmationPrompt).
withLocalEcho(false).
withTimeout(90).
// Use null value in consumer to detect if user has abandoned conversation.
addConversationAbandonedListener(ConversationUtils.getAbandonListener(consumer, user))
.
buildConversation(user.getPlayer()).
begin();
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/world/bentobox/challenges/web/WebManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ public void requestEntryGitHubData(User user, World world, LibraryEntry entry)
if (this.plugin.getSettings().isLogGithubDownloadData())
{
this.plugin.log("Could not connect to GitHub.");
this.plugin.log(
"JSON files can be found at https://github.com/BentoBoxWorld/weblink/tree/master/challenges/library");
user.sendRawMessage("Could not connect to GitHub.");
user.sendRawMessage(
"JSON files can be found at https://github.com/BentoBoxWorld/weblink/tree/master/challenges/library");
}
}
catch (Exception e)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/addon.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Challenges
main: world.bentobox.challenges.ChallengesAddon
version: ${version}${build.number}
api-version: 1.17
api-version: 2.7.1
repository: 'BentoBoxWorld/Challenges'
metrics: true

Expand Down
Loading

0 comments on commit a92df39

Please sign in to comment.