Merge pull request #3 from thetrouper/experimental

Experimental
This commit is contained in:
TheTrouper
2025-02-23 21:08:42 -06:00
committed by GitHub
373 changed files with 6153 additions and 431147 deletions

3
.gitignore vendored
View File

@@ -1 +1,4 @@
/.idea/
/build/
/.gradle/
/bin/

Binary file not shown.

0
.gradle/8.5/fileChanges/last-build.bin Executable file → Normal file
View File

BIN
.gradle/file-system.probe Executable file → Normal file

Binary file not shown.

1
.idea/gradle.xml generated
View File

@@ -5,6 +5,7 @@
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />

3
.idea/modules.xml generated
View File

@@ -2,8 +2,9 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/'me.trouper'.CleanSentinel.main.iml" filepath="$PROJECT_DIR$/.idea/modules/'me.trouper'.CleanSentinel.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/Sentinel.iml" filepath="$PROJECT_DIR$/.idea/modules/Sentinel.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/Sentinel.main.iml" filepath="$PROJECT_DIR$/.idea/modules/Sentinel.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/Sentinel.test.iml" filepath="$PROJECT_DIR$/.idea/modules/Sentinel.test.iml" />
</modules>
</component>
</project>

View File

@@ -11,8 +11,4 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

4
.idea/vcs.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>
</project>

View File

@@ -1,5 +1,9 @@
import java.nio.file.Files
import java.nio.file.Paths
plugins {
id 'java'
id("com.github.johnrengelman.shadow") version "8.1.1"
}
group = project.group
@@ -24,19 +28,27 @@ repositories {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
name = "papermc"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
maven {
url = uri("https://repo.codemc.io/repository/maven-releases/")
}
maven {
url = uri("https://repo.codemc.io/repository/maven-snapshots/")
}
}
dependencies {
compileOnly 'io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT'
compileOnly 'com.comphenix.protocol:ProtocolLib:5.1.0'
compileOnly "io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT"
implementation 'com.google.code.gson:gson:2.10.1'
implementation files("libs/PDK-1.4.0.jar")
implementation 'org.ow2.asm:asm-commons:9.5'
implementation files("deps/PDK-1.4.0.jar")
implementation "com.github.retrooper:packetevents-spigot:2.7.0"
}
def targetJavaVersion = 21
@@ -77,3 +89,60 @@ compileJava.options.encoding("UTF-8")
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
tasks.shadowJar {
relocate("com.github.retrooper.packetevents", "me.trouper.sentinel.packetevents.api")
relocate("io.github.retrooper.packetevents", "me.trouper.sentinel.packetevents.impl")
}
task obfuscate(type: JavaExec) {
// Specify the main class in the obfuscator JAR (if required)
// Path to the obfuscator JAR
classpath = files('obf/grunt-main.jar')
// Arguments to pass to the obfuscator (e.g., input and output directories)
args = [
'--config', '.\\obf\\config.json'
]
}
task copyLibs {
doLast {
// Define the source directory (Gradle cache) and the target directory
def sourceDir = Paths.get("C:/Users/crvic/.gradle/caches/modules-2/files-2.1")
def targetDir = Paths.get("${buildDir}/../deps") // Output directory
// Create the target directory if it doesn't exist
if (!Files.exists(targetDir)) {
Files.createDirectories(targetDir)
}
// Recursively traverse the source directory and copy JAR files
Files.walk(sourceDir)
.filter { Files.isRegularFile(it) && it.toString().endsWith(".jar") }
.forEach { jarFile ->
// Extract the file name (without the directory structure)
def fileName = jarFile.fileName.toString()
// Define the target file path (flat structure)
def targetFile = targetDir.resolve(fileName)
// Handle duplicate file names (if any)
if (Files.exists(targetFile)) {
println "Skipping duplicate file: ${fileName}"
return
}
// Copy the JAR file to the target directory
Files.copy(jarFile, targetFile)
println "Copied: ${jarFile} -> ${targetFile}"
}
println "All JAR files have been extracted to: ${targetDir}"
}
}
test {
useJUnitPlatform()
}

Some files were not shown because too many files have changed in this diff Show More