Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
feat: run as Paper plugin on Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Apr 5, 2024
1 parent a5a6f8f commit e9036bd
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 10 deletions.
10 changes: 0 additions & 10 deletions bukkit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
plugins {
id 'xyz.jpenilla.run-paper' version '2.2.3'
}

dependencies {
implementation project(path: ':common')

Expand Down Expand Up @@ -40,10 +36,4 @@ shadowJar {
}

minimize()
}

tasks {
runServer {
minecraftVersion('1.20.4')
}
}
41 changes: 41 additions & 0 deletions paper/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
plugins {
id 'xyz.jpenilla.run-paper' version '2.2.3'
}

dependencies {
implementation project(':bukkit')
compileOnly project(':common')

compileOnly 'io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT'
compileOnly 'org.bstats:bstats-bukkit:3.0.2'
compileOnly 'org.jetbrains:annotations:24.1.0'
}

shadowJar {
relocate 'net.william278.profanitycheckerapi', 'net.william278.huskchat.libraries.profanitycheckerapi'
relocate 'net.william278.desertwell', 'net.william278.huskchat.libraries.desertwell'
relocate 'de.themoep', 'net.william278.huskchat.libraries'
relocate 'dev.vankka', 'net.william278.huskchat.libraries'
relocate 'de.exlll', 'net.william278.huskchat.libraries'
relocate 'org.snakeyaml.engine', 'net.william278.huskchat.libraries.snakeyaml.engine'
relocate 'org.json', 'net.william278.huskchat.libraries.json'

relocate 'org.apache', 'net.william278.huskchat.libraries'
relocate 'org.jetbrains', 'net.william278.huskchat.libraries'
relocate 'org.intellij', 'net.william278.huskchat.libraries'
relocate 'org.bstats', 'net.william278.huskchat.libraries.bstats'
relocate 'space.arim', 'net.william278.huskchat.libraries.morepaperlib'

minimize()
}

tasks {
runServer {
minecraftVersion('1.20.4')

downloadPlugins {
url("https://download.luckperms.net/1526/bukkit/loader/LuckPerms-Bukkit-5.4.113.jar")
url("https://ci.lucko.me/job/spark/399/artifact/spark-bukkit/build/libs/spark-1.10.58-bukkit.jar")
}
}
}
24 changes: 24 additions & 0 deletions paper/src/main/java/net/william278/huskchat/PaperHuskChat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package net.william278.huskchat;

import net.kyori.adventure.audience.Audience;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

import java.util.UUID;

public class PaperHuskChat extends BukkitHuskChat {

@NotNull
@Override
public Audience getAudience(@NotNull UUID user) {
final Player player = getServer().getPlayer(user);
return player == null || !player.isOnline() ? Audience.empty() : player;
}

@Override
@NotNull
public Audience getConsole() {
return getServer().getConsoleSender();
}

}
22 changes: 22 additions & 0 deletions paper/src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'HuskChat'
description: '${description}'
author: 'William278'
website: 'https://william278.net/'
main: 'net.william278.huskchat.PaperHuskChat'
version: '${version}'
api-version: '1.19'
folia-supported: true
dependencies:
server:
LuckPerms:
load: BEFORE
join-classpath: true
required: false
PlaceholderAPI:
load: BEFORE
join-classpath: true
required: false
Spicord:
load: BEFORE
join-classpath: true
required: false
1 change: 1 addition & 0 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ dependencies {
implementation project(path: ':bungee', configuration: 'shadow')
implementation project(path: ':velocity', configuration: 'shadow')
implementation project(path: ':bukkit', configuration: 'shadow')
implementation project(path: ':paper', configuration: 'shadow')
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ include(
'bungee',
'velocity',
'bukkit',
'paper',
'plugin'
)

0 comments on commit e9036bd

Please sign in to comment.