mirror of
https://github.com/NekoMonci12/Git-Craft.git
synced 2025-12-19 23:09:15 +00:00
simple minecraft plugin init
This commit is contained in:
@@ -1,45 +1,38 @@
|
|||||||
/*
|
|
||||||
* This file was generated by the Gradle 'init' task.
|
|
||||||
*
|
|
||||||
* This generated file contains a sample Java application project to get you started.
|
|
||||||
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.12/userguide/building_java_projects.html in the Gradle documentation.
|
|
||||||
*/
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
// Apply the groovy plugin to also add support for Groovy (needed for Spock)
|
java
|
||||||
groovy
|
id("com.github.johnrengelman.shadow") version "8.1.1"
|
||||||
|
}
|
||||||
|
|
||||||
// Apply the application plugin to add support for building a CLI application in Java.
|
group = "org.yuemi"
|
||||||
application
|
version = "1.0-SNAPSHOT"
|
||||||
|
|
||||||
|
java {
|
||||||
|
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// Use Maven Central for resolving dependencies.
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven("https://repo.papermc.io/repository/maven-public/")
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Use the latest Groovy version for Spock testing
|
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
|
||||||
testImplementation(libs.groovy)
|
implementation("org.eclipse.jgit:org.eclipse.jgit:6.6.0.202305301015-r")
|
||||||
|
|
||||||
// Use the awesome Spock testing and specification framework even with Java
|
|
||||||
testImplementation(libs.spock.core)
|
|
||||||
testImplementation(libs.junit)
|
|
||||||
|
|
||||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
|
||||||
|
|
||||||
// This dependency is used by the application.
|
|
||||||
implementation(libs.guava)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply a specific Java toolchain to ease working on different environments.
|
// Disable default JAR task
|
||||||
java {
|
tasks.jar {
|
||||||
toolchain {
|
enabled = false
|
||||||
languageVersion = JavaLanguageVersion.of(21)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
// Configure shadowJar
|
||||||
// Define the main class for the application.
|
tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
|
||||||
mainClass = "org.yuemi.App"
|
archiveBaseName.set("Git-Craft")
|
||||||
|
archiveClassifier.set("")
|
||||||
|
archiveVersion.set("")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make build depend on shadowJar
|
||||||
|
tasks.named("build") {
|
||||||
|
dependsOn("shadowJar")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/*
|
package org.yuemi;
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
public class App {
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
public String getGreeting() {
|
|
||||||
return "Hello World!";
|
public class App extends JavaPlugin {
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
getLogger().info("Yuemi Git Plugin enabled.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
@Override
|
||||||
System.out.println(new App().getGreeting());
|
public void onDisable() {
|
||||||
|
getLogger().info("Yuemi Git Plugin disabled.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
app/src/main/resources/plugin.yml
Normal file
13
app/src/main/resources/plugin.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
name: GitCraft
|
||||||
|
main: org.yuemi.App
|
||||||
|
authors:
|
||||||
|
- NekoMonci12
|
||||||
|
version: 1.0
|
||||||
|
api-version: 1.21
|
||||||
|
commands:
|
||||||
|
gitclone:
|
||||||
|
description: Clones a Git repository
|
||||||
|
gitcommit:
|
||||||
|
description: Commits all changes
|
||||||
|
gitpush:
|
||||||
|
description: Pushes to remote
|
||||||
Reference in New Issue
Block a user