Skip to content
Open
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Please note that these spigots are supported through public APIs.
- ImanitySpigot
- AzuriteSpigot
- FoxSpigot
- KnockbackManager (Plugin)

## Installation

Expand Down
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies {
implementation(project(":impl:carbon-legacy"))
implementation(project(":impl:imanity"))
implementation(project(":impl:foxspigot"))
implementation(project(":impl:knockbackmanager"))
implementation(project(":impl:azurite"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import xyz.refinedev.api.knockback.carbon.CarbonLegacyHook;
import xyz.refinedev.api.knockback.foxspigot.FoxSpigotHook;
import xyz.refinedev.api.knockback.imanity.ImanityHook;
import xyz.refinedev.api.knockback.knockbackmanager.KnockbackManagerHook;

import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -37,6 +38,7 @@ public void init() {
this.registerHook(new ImanityHook());
this.registerHook(new AzuriteHook());
this.registerHook(new FoxSpigotHook());
this.registerHook(new KnockbackManagerHook());

this.hook = this.detect();
if (this.hook == null) {
Expand Down
12 changes: 12 additions & 0 deletions impl/knockbackmanager/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
id("java")
}

group = "xyz.refinedev.api"
version = "1.0.0"

dependencies {
compileOnly(project(":api"))
// KnockbackManager API dependency
compileOnly(files("../lib/KnockbackManager-1.13.4.jar"))
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package xyz.refinedev.api.knockback.knockbackmanager;

import me.dw1e.kbm.KnockbackManager;
import me.dw1e.kbm.api.KnockbackManagerAPI;

import org.bukkit.entity.Player;

import org.jetbrains.annotations.NotNull;

import xyz.refinedev.api.knockback.KnockbackHook;

/**
* <p>
* This code is the property of Refine Development.<br>
* Copyright © 2025, All Rights Reserved.<br>
* </p>
*
* @author KLxier (Refinedev.org: thehale_dc)
* @version KnockbackAPI
* @since 2026/5/3
*/
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modify the copyright warning to the correct date and author

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has been corrected in the subsequent submission just now.

public class KnockbackManagerHook implements KnockbackHook {

@Override
public String getName() {
return "KnockbackManager";
}

@Override
public boolean isApplicable() {
return applicable;
}

@Override
public void setKnockback(@NotNull Player player, @NotNull String knockbackProfile) {
KnockbackManagerAPI kbmAPI = KnockbackManager.getInstance().getAPI();
kbmAPI.setKBFile(player, knockbackProfile);
}

private static boolean applicable;
static {
try {
Class.forName("me.dw1e.kbm.KnockbackManager");
applicable = true;
} catch (ClassNotFoundException e) {
applicable = false;
}
}
}
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ include("impl:carbon")
findProject(":impl:carbon")?.name = "carbon"
include("impl:carbon-legacy")
findProject(":impl:carbon-legacy")?.name = "carbon-legacy"
include("impl:knockbackmanager")
findProject(":impl:knockbackmanager")?.name = "knockbackmanager"