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

Fix Charging Bench #2

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions .github/workflows/javadocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Javadocs

on:
push:
paths:
- 'src/**'
- 'pom.xml'

permissions:
contents: read

jobs:
build:
name: Maven build
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '17'
java-package: jdk
architecture: x64

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build Javadocs
run: mvn javadoc:javadoc
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/.idea/
/.vscode/
/data-storage/
/javadocs/

dependency-reduced-pom.xml

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@

<configuration>
<reportOutputDirectory>${project.basedir}</reportOutputDirectory>
<destDir>docs</destDir>
<destDir>javadocs</destDir>

<doctitle>Slimefun4 - Javadocs</doctitle>
<windowtitle>Slimefun4 - Javadocs</windowtitle>
Expand Down Expand Up @@ -344,7 +344,7 @@
<dependency>
<groupId>com.github.baked-libs.dough</groupId>
<artifactId>dough-api</artifactId>
<version>0130f8d9ce</version>
<version>baf2d79f62</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void onExecute(@Nonnull CommandSender sender, @Nonnull String[] args) {
.append(")").color(ChatColor.GRAY);
}

builder.append("\n");
builder.append("\n").event((HoverEvent) null);
// @formatter:on

if (Slimefun.getMetricsService().getVersion() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Thread newThread(Runnable r) {
* This is a much better alternative to using
* {@link BukkitScheduler#runTaskAsynchronously(org.bukkit.plugin.Plugin, Runnable)}
* as this will show not only the plugin but a useful name.
* By default, Bukkit will use "Craft Scheduler Thread - <x> - <plugin>" which is nice to show the plugin but
* By default, Bukkit will use "Craft Scheduler Thread - {@literal <x>} - {@literal <plugin>}" which is nice to show the plugin but
* it's impossible to track exactly what thread that is.
*
* @param plugin The {@link JavaPlugin} that is creating this thread
Expand All @@ -60,7 +60,7 @@ public void newThread(JavaPlugin plugin, String name, Runnable runnable) {
* This is a much better alternative to using
* {@link BukkitScheduler#runTaskTimerAsynchronously(org.bukkit.plugin.Plugin, Runnable, long, long)}
* as this will show not only the plugin but a useful name.
* By default, Bukkit will use "Craft Scheduler Thread - <x> - <plugin>" which is nice to show the plugin but
* By default, Bukkit will use "Craft Scheduler Thread - {@literal <x>} - {@literal <plugin>}" which is nice to show the plugin but
* it's impossible to track exactly what thread that is.
*
* @param plugin The {@link JavaPlugin} that is creating this thread
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,20 @@ void testEventIsFired() {
activateAnvilTalisman(true, true);
server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true);
server.getPluginManager().clearEvents();

// Assert the normal talisman does not activate in the ender chest
activateAnvilTalisman(false, true);
try {
server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true);
} catch (AssertionError ignored) {
return; // This is expected; the event should not have fired
}
server.getPluginManager().clearEvents();
Assertions.assertThrows(
AssertionError.class,
() -> server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true)
);

// Assert the ender talisman does not activate in the inventory
try {
activateAnvilTalisman(true, false);
server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true);
} catch (AssertionError ignored) {
return; // This is expected; the event should not have fired
}
server.getPluginManager().clearEvents();
activateAnvilTalisman(true, false);
Assertions.assertThrows(
AssertionError.class,
() -> server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true)
);
}

@Test
Expand Down