-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2ee6afa
Showing
53 changed files
with
4,801 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
libraries/* linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.idea/ | ||
|
||
bin | ||
|
||
.gradle | ||
**/build/ | ||
!src/**/build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
!gradle-wrapper.jar | ||
|
||
# Avoid ignore Gradle wrappper properties | ||
!gradle-wrapper.properties | ||
|
||
# Cache of project | ||
.gradletasknamecache | ||
|
||
# Eclipse Gradle plugin generated files | ||
# Eclipse Core | ||
.project | ||
# JDT-specific (Eclipse Java Development Tools) | ||
.classpath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": ".." | ||
}, | ||
{ | ||
"path": "../libraries/spigotjsongen" | ||
} | ||
], | ||
"settings": { | ||
"java.compile.nullAnalysis.mode": "automatic", | ||
"java.configuration.updateBuildConfiguration": "automatic", | ||
"rust-analyzer.linkedProjects": [ | ||
"./native/Cargo.toml", | ||
"./libraries/blackbox-rs/Cargo.toml", | ||
"./examples/block_break_event/Cargo.toml", | ||
"./libraries/blackbox-rs/Cargo.toml" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": ".." | ||
}, | ||
{ | ||
"path": "../libraries/blackbox-rs" | ||
}, | ||
{ | ||
"path": "../libraries/spigotjsongen" | ||
} | ||
], | ||
"settings": { | ||
"java.compile.nullAnalysis.mode": "automatic", | ||
"java.configuration.updateBuildConfiguration": "automatic", | ||
"rust-analyzer.linkedProjects": [ | ||
"./native/Cargo.toml", | ||
"./examples/block_break_event/Cargo.toml", | ||
"./libraries/blackbox-rs/Cargo.toml", | ||
"./Cargo.toml" | ||
], | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.autopep8" | ||
}, | ||
"python.formatting.provider": "none" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"java.compile.nullAnalysis.mode": "automatic", | ||
"files.autoGuessEncoding": true, | ||
"files.encoding": "utf8", | ||
"java.jdt.ls.vmargs": "-Dfile.encoding=UTF-8", | ||
"javac-linter.javac": "javac -Dfile.encoding=UTF-8", | ||
"java.configuration.updateBuildConfiguration": "automatic", | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.autopep8" | ||
}, | ||
"python.formatting.provider": "none", | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# BlackBox | ||
|
||
BlackBox is a Minecraft plugin that will allow you to write plugins in many other compiled languages besides Java. It does what you could do with JNI, but it handles all the Minecraft stuff for you automatically, so you don't even have to use Java's tooling ever again. Because JNI can be very unruley to work with, its developed alongside a [Rust library](https://github.com/BlackBoxMC/blackbox-rs/), and a C++ library is planned, although it is low priority. | ||
|
||
The repo is licensed under AGPL. I understand this may is a controversional, but I've put too much work into this project to risk somebody bringing it into closed source (and GPL is useless since this is a plugin). I'd like to make it clear that I don't care about your users knowing their rights, I don't care about GitHub forks or etc. violating the license, and I don't think a lot of the loopholes against the AGPL apply here. All I care about is if you modify the plugin, I'd like to see the source. | ||
|
||
--- | ||
|
||
**This plugin is made knowing why this hasn't been done before and why you might not want to do it.** | ||
|
||
- Distributing plugins made this way becomes much harder. | ||
- You technically lose performance since JNI calls are slow (...they take about 15ms on a good machine but this might matter in some scenarios) | ||
- You lose the ability to link to, and therefore create addons for, other plugins, unless you want to fork this repo and add support for the plugin in question (I am considering adding support in the helper library for the most popular plugins). | ||
|
||
**It's assumed that you don't care.** This is for the people who are sick of Java, never want to work with Gradle or IntelliJ ever again, and just want to use a language that they actually like (assuming they dislike Java). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
plugins { | ||
id 'com.github.johnrengelman.shadow' version '7.1.0' | ||
id 'kr.entree.spigradle' version '2.2.4' | ||
id 'io.freefair.lombok' version '6.3.0' | ||
id 'java' | ||
id 'jacoco' | ||
id 'idea' | ||
} | ||
|
||
group = 'net.ioixd' | ||
version = '1.0-SNAPSHOT' | ||
|
||
compileJava { | ||
options.compilerArgs += ["-h", file("include")] | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' | ||
|
||
// As of Gradle 5.1, you can limit this to only those | ||
// dependencies you expect from it | ||
content { | ||
includeGroup 'org.bukkit' | ||
includeGroup 'org.spigotmc' | ||
} | ||
} | ||
maven { | ||
name = "sonatype" | ||
url = "https://oss.sonatype.org/content/groups/public/" | ||
} | ||
} | ||
dependencies { | ||
implementation "org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT" | ||
implementation "io.github.classgraph:classgraph:4.8.160" | ||
implementation "org.reflections:reflections:0.10.2" | ||
implementation "io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT" | ||
|
||
implementation "org.slf4j:slf4j-api:2.0.7" | ||
implementation "org.eclipse.aether:aether-api:1.1.0" | ||
} | ||
|
||
|
||
shadowJar { | ||
dependencies { | ||
include(dependency("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")) | ||
include(dependency("io.github.classgraph:classgraph:4.8.160")) | ||
} | ||
} | ||
|
||
tasks.build.dependsOn(shadowJar) | ||
tasks.prepareSpigotPlugins.dependsOn(shadowJar) | ||
|
||
|
||
def targetJavaVersion = 17 | ||
java { | ||
def javaVersion = JavaVersion.toVersion(targetJavaVersion) | ||
sourceCompatibility = javaVersion | ||
targetCompatibility = javaVersion | ||
if (JavaVersion.current() < javaVersion) { | ||
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { | ||
options.release = targetJavaVersion | ||
} | ||
} | ||
|
||
processResources { | ||
def props = [version: version] | ||
inputs.properties props | ||
filteringCharset 'UTF-8' | ||
filesMatching('plugin.yml') { | ||
expand props | ||
} | ||
} | ||
defaultTasks 'shadowJar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
cd native | ||
|
||
rustup target add x86_64-pc-windows-gnu | ||
cargo build --release --target x86_64-pc-windows-gnu | ||
cp ../native/target/x86_64-pc-windows-gnu/release/native.dll ../src/main/resources/native.dll | ||
rustup target add x86_64-unknown-linux-gnu | ||
cargo build --release --target x86_64-unknown-linux-gnu | ||
cp ../native/target/x86_64-unknown-linux-gnu/release/libnative.so ../src/main/resources/libnative.so | ||
|
||
cd .. | ||
|
||
./gradlew shadowJar |
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.