MinecraftDev icon indicating copy to clipboard operation
MinecraftDev copied to clipboard

Support for Nukkit Plugins

Open DeathGOD7 opened this issue 2 years ago • 2 comments

Minecraft Development for IntelliJ plugin version

2023.2-1.6.6

Description of the feature request

Add support for making a project of the nukkit plugin.

DeathGOD7 avatar Jun 26 '23 14:06 DeathGOD7

Do you have any documentation on this?

Mysterious-Dev avatar Jun 26 '23 15:06 Mysterious-Dev

Nukkit Wiki : https://cloudburstmc.org/wiki/nukkit

Gradle (build.gradle) file :

plugins {
	id 'java'
}

group = 'com.github.deathgod7'
version = '1.0-SNAPSHOT'

repositories {
	mavenCentral()
	maven {
		name = "nukkit-release"
		url = "https://repo.opencollab.dev/maven-releases"
	}
	maven {
		name = "nukkit-snapshot"
		url = "https://repo.opencollab.dev/maven-snapshots/"
	}
}

dependencies {
	//noinspection VulnerableLibrariesLocal
	compileOnly "cn.nukkit:nukkit:1.0-SNAPSHOT"
}

def targetJavaVersion = 8
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
	}
}


Main Class File

package com.github.deathgod7.unexpectedspawnnukkit;

import cn.nukkit.plugin.PluginBase;

public final class UnexpectedSpawn extends PluginBase {

    @Override
    public void onEnable() {
        // Plugin startup logic

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}

And to note, it's not in maven-releases but in maven-snapshots. Repo Browser : https://repo.opencollab.dev/#/

DeathGOD7 avatar Jun 26 '23 22:06 DeathGOD7