simple minecraft plugin init

This commit is contained in:
Muhammad Tamir
2025-06-19 18:28:54 +07:00
parent d2689db3a2
commit 19676c31bb
3 changed files with 47 additions and 40 deletions

View File

@@ -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 {
// Apply the groovy plugin to also add support for Groovy (needed for Spock)
groovy
java
id("com.github.johnrengelman.shadow") version "8.1.1"
}
// Apply the application plugin to add support for building a CLI application in Java.
application
group = "org.yuemi"
version = "1.0-SNAPSHOT"
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
// Use the latest Groovy version for Spock testing
testImplementation(libs.groovy)
// 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)
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
implementation("org.eclipse.jgit:org.eclipse.jgit:6.6.0.202305301015-r")
}
// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
// Disable default JAR task
tasks.jar {
enabled = false
}
application {
// Define the main class for the application.
mainClass = "org.yuemi.App"
// Configure shadowJar
tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
archiveBaseName.set("Git-Craft")
archiveClassifier.set("")
archiveVersion.set("")
}
// Make build depend on shadowJar
tasks.named("build") {
dependsOn("shadowJar")
}

View File

@@ -1,14 +1,15 @@
/*
* This source file was generated by the Gradle 'init' task
*/
package org.example;
package org.yuemi;
public class App {
public String getGreeting() {
return "Hello World!";
import org.bukkit.plugin.java.JavaPlugin;
public class App extends JavaPlugin {
@Override
public void onEnable() {
getLogger().info("Yuemi Git Plugin enabled.");
}
public static void main(String[] args) {
System.out.println(new App().getGreeting());
@Override
public void onDisable() {
getLogger().info("Yuemi Git Plugin disabled.");
}
}

View 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