Skip to content

Commit

Permalink
feat: add Vulcan support and other anticheat dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MC-XiaoHei committed May 1, 2024
1 parent 0f3cfc0 commit fc6d28b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ version = "1.1.5"

repositories {
mavenLocal()
maven("https://jitpack.io/")
maven("https://maven.aliyun.com/repository/public")
mavenCentral()
maven("https://oss.sonatype.org/content/groups/public/")
Expand All @@ -24,8 +25,13 @@ repositories {
}

dependencies {
//anticheat dependencies
compileOnly(files("libs/ThemisAPI_0.15.3.jar"))
compileOnly(files("libs/Matrix_7.7.32A.jar"))
compileOnly(files("libs/VulcanAPI.jar"))
compileOnly("com.github.MWHunter:GrimAPI:2.3.62")
compileOnly("com.github.Elikill58:Negativity:v2-SNAPSHOT")
//other dependencies
implementation("com.moandjiezana.toml:toml4j:0.7.2")
compileOnly("top.leavesmc.leaves:leaves-api:1.20.4-R0.1-SNAPSHOT")
implementation("dev.jorel:commandapi-bukkit-shade:9.3.0")
Expand Down
Binary file added libs/VulcanAPI.jar
Binary file not shown.
1 change: 1 addition & 0 deletions src/main/java/cn/xor7/iseeyou/ConfigData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ data class OutdatedRecordRetentionConfig(
data class RecordSuspiciousPlayerConfig(
var enableThemisIntegration: Boolean = false,
var enableMatrixIntegration: Boolean = false,
var enableVulcanIntegration: Boolean = false,
var recordMinutes: Long = 5,
var recordPath: String = "replay/suspicious/\${name}@\${uuid}",
)
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/cn/xor7/iseeyou/ISeeYou.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cn.xor7.iseeyou
import cn.xor7.iseeyou.anticheat.AntiCheatListener
import cn.xor7.iseeyou.anticheat.listeners.MatrixListener
import cn.xor7.iseeyou.anticheat.listeners.ThemisListener
import cn.xor7.iseeyou.anticheat.listeners.VulcanListener
import cn.xor7.iseeyou.anticheat.suspiciousPhotographers
import dev.jorel.commandapi.CommandAPI
import dev.jorel.commandapi.CommandAPIBukkitConfig
Expand Down Expand Up @@ -90,6 +91,10 @@ class ISeeYou : JavaPlugin(), CommandExecutor {
if (Bukkit.getPluginManager().isPluginEnabled("Matrix") ||
toml!!.data.recordSuspiciousPlayer.enableMatrixIntegration
) Bukkit.getPluginManager().registerEvents(MatrixListener(), this)

if (Bukkit.getPluginManager().isPluginEnabled("Vulcan") ||
toml!!.data.recordSuspiciousPlayer.enableVulcanIntegration
) Bukkit.getPluginManager().registerEvents(VulcanListener(), this)
}

private fun registerCommand() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package cn.xor7.iseeyou.anticheat.listeners

import cn.xor7.iseeyou.anticheat.AntiCheatListener
import com.gmail.olexorus.themis.api.ActionEvent
import me.frep.vulcan.api.event.VulcanPunishEvent
import me.rerere.matrix.api.events.PlayerViolationEvent
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener

class VulcanListener : Listener {
@EventHandler
fun onPunish(e: VulcanPunishEvent) = AntiCheatListener.onAntiCheatAction(e.player)
}
3 changes: 3 additions & 0 deletions src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ dependencies:
load: BEFORE
required: false
Matrix:
load: BEFORE
required: false
Vulcan:
load: BEFORE
required: false

0 comments on commit fc6d28b

Please sign in to comment.