Initial commit
This commit is contained in:
commit
e27509b723
8 files changed
+165
No files matched your search
+12
@@ -0,0 +1,12 @@
|
||||
.gradle/
|
||||
/.idea/
|
||||
build/
|
||||
bin/
|
||||
|
||||
# Visual Studio Code
|
||||
|
||||
.settings/
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.vscode/
|
||||
@@ -0,0 +1,41 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply(plugin = "java")
|
||||
group = "me.dreamerzero.example"
|
||||
version = "1.0.0"
|
||||
description = "Template-Expansion"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
shadow(project(":example-velocity"))
|
||||
shadow(project(":example-paper"))
|
||||
}
|
||||
|
||||
subprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://jitpack.io")
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.github.4drian3d:MiniPlaceholders:1.0.0")
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
archiveFileName.set("Example-Expansion.jar")
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
configurations = listOf(project.configurations.shadow.get())
|
||||
}
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
plugins {
|
||||
id("net.minecrell.plugin-yml.bukkit") version "0.5.1"
|
||||
id("xyz.jpenilla.run-paper") version "1.0.6"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
val pluginVersion = version
|
||||
|
||||
bukkit {
|
||||
main = "me.dreamerzero.example.paper.PaperPlugin"
|
||||
apiVersion = "1.18"
|
||||
authors = listOf("4drian3d")
|
||||
depend = listOf("MiniPlaceholders")
|
||||
version = pluginVersion as String
|
||||
}
|
||||
|
||||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
|
||||
tasks {
|
||||
compileJava {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
|
||||
options.release.set(17)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package me.dreamerzero.example.paper;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import me.dreamerzero.miniplaceholders.api.Expansion;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||
|
||||
public final class PaperPlugin extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onEnable(){
|
||||
this.getSLF4JLogger().info("Starting Example Expansion for Paper");
|
||||
|
||||
Expansion.builder("example")
|
||||
.filter(Player.class)
|
||||
.audiencePlaceholder("name", (aud, queue, ctx) -> Tag.selfClosingInserting(Component.text(((Player)aud).getName())))
|
||||
.build()
|
||||
.register();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
rootProject.name = "example-parent"
|
||||
|
||||
include("example-paper")
|
||||
include("example-velocity")
|
||||
|
||||
project(":example-velocity").projectDir = file("velocity")
|
||||
project(":example-paper").projectDir = file("paper")
|
||||
@@ -0,0 +1,6 @@
|
||||
dependencies {
|
||||
compileOnly("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")
|
||||
annotationProcessor("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")
|
||||
}
|
||||
|
||||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
@@ -0,0 +1,46 @@
|
||||
package me.dreamerzero.example.velocity;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.velocitypowered.api.event.Subscribe;
|
||||
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
||||
import com.velocitypowered.api.plugin.Plugin;
|
||||
import com.velocitypowered.api.plugin.Dependency;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import me.dreamerzero.miniplaceholders.api.Expansion;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||
|
||||
@Plugin(
|
||||
name = "Example-Expansion",
|
||||
id = "exampleexpansion",
|
||||
version = "1.0.0",
|
||||
authors = {"4drian3d"},
|
||||
dependencies = {
|
||||
@Dependency(
|
||||
id = "miniplaceholders",
|
||||
optional = false)
|
||||
}
|
||||
)
|
||||
public final class VelocityPlugin {
|
||||
private final Logger logger;
|
||||
|
||||
@Inject
|
||||
public VelocityPlugin(Logger logger) {
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onProxyInitialize(ProxyInitializeEvent event) {
|
||||
logger.info("Starting Example Expansion for Velocity");
|
||||
|
||||
Expansion.builder("example")
|
||||
.filter(Player.class)
|
||||
.audiencePlaceholder("name", (aud,queue, ctx) -> Tag.selfClosingInserting(Component.text(((Player)aud).getUsername())))
|
||||
.build()
|
||||
.register();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user