Skip to content

Commit

Permalink
Merge branch 'development' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Syrent committed Aug 30, 2023
2 parents 12dfd60 + f12c38e commit 1bafb42
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 264 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/hangar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
java-version: 17
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Generate NMS Components
run: ./gradlew generateNmsComponents
- name: Cache Gradle dependencies
uses: actions/cache@v2
with:
Expand All @@ -31,6 +33,6 @@ jobs:
run: ./gradlew build
- name: Publish
env:
HANGAR_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}
HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}
HANGAR_BUILD_CHANNEL: Snapshot
run: ./gradlew build publishPluginPublicationToHangar --stacktrace
49 changes: 29 additions & 20 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
import io.papermc.hangarpublishplugin.model.Platforms
import org.jetbrains.gradle.ext.settings
import org.jetbrains.gradle.ext.taskTriggers
Expand All @@ -8,10 +7,10 @@ import java.util.concurrent.Executors
import java.io.ByteArrayOutputStream

plugins {
kotlin("jvm") version "1.9.0"
kotlin("jvm") version "1.9.10"
id("maven-publish")
id("java")
id("com.github.johnrengelman.shadow") version "7.1.2"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7"
id("org.screamingsandals.nms-mapper") version "1.4.5"
id("xyz.jpenilla.run-paper") version "2.1.0"
Expand Down Expand Up @@ -96,6 +95,8 @@ dependencies {

implementation("com.jeff_media:SpigotUpdateChecker:3.0.3")

implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")

annotationProcessor("com.velocitypowered:velocity-api:3.1.1")
}

Expand Down Expand Up @@ -129,6 +130,7 @@ publishing {
val extraDependencies = mapOf(
"CMI.jar" to "https://www.zrips.net/wp-content/uploads/2021/09/CMI9.0.0.0API.jar",
"NexEngine.jar" to "https://github.com/nulli0n/NexEngine-spigot/releases/download/v2.2.11/NexEngine.jar",
"SunLight.jar" to "https://www.dropbox.com/scl/fi/mmu7g32vj6oitkja65cws/SunLight-3.9.4.jar?rlkey=tqxgcy80yccxh80yzl24ubs7b&dl=1",
"ServerListPlus.jar" to "https://ci.codemc.io/job/Minecrell/job/ServerListPlus/lastSuccessfulBuild/artifact/Velocity/build/libs/ServerListPlus-3.5.1-SNAPSHOT-Velocity.jar",
)

Expand All @@ -141,20 +143,6 @@ tasks {
folia.registerTask()
}

val relocate = task<ConfigureShadowRelocation>("relocateShadowJar") {
target = shadowJar.get()
prefix = "ir.syrent.velocityvanish"
this.target.apply {
relocate("net.kyori.", "net.kyori.")
}
}

shadowJar {
dependsOn(relocate)
exclude("META-INF/**")
minimize()
}

compileJava {
options.encoding = Charsets.UTF_8.name()
}
Expand Down Expand Up @@ -189,16 +177,37 @@ tasks {
ex.awaitTermination(10, TimeUnit.SECONDS)
}

/*build {
shadowJar {
dependsOn(extraDeps)
archiveClassifier.set("")
exclude("META-INF/**")
from("LICENSE")
minimize()

relocate("io.papermc.lib", "ir.syrent.velocityvanish.dependencies.io.papermc.lib")
relocate("io.leangen", "ir.syrent.velocityvanish.dependencies.io.leangen")
relocate("org.bstats", "ir.syrent.velocityvanish.dependencies.org.bstats")
relocate("com.google.code.gson", "ir.syrent.velocityvanish.dependencies.com.google.code.gson")
relocate("com.cryptomorin", "ir.syrent.velocityvanish.dependencies.com.github.cryptomorin")
relocate("cloud.commandframework", "ir.syrent.velocityvanish.dependencies.cloud.commandframework")
relocate("kotlin", "ir.syrent.velocityvanish.dependencies.kotlin")
relocate("com.jeff_media", "ir.syrent.velocityvanish.dependencies.com.jeff_media")
relocate("org.jetbrains", "ir.syrent.velocityvanish.dependencies.org.jetbrains")
relocate("org.intellij", "ir.syrent.velocityvanish.dependencies.org.intellij")
}

build {
dependsOn(shadowJar)
}*/
}
}


java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}

artifacts.archives(tasks.shadowJar)

fun executeGitCommand(vararg command: String): String {
val byteOut = ByteArrayOutputStream()
exec {
Expand Down Expand Up @@ -227,7 +236,7 @@ hangarPublish {
publications.register("plugin") {
version.set(suffixedVersion)
channel.set(System.getenv("HANGAR_BUILD_CHANNEL") ?: "Snapshot")
changelog.set(changelogContent)
changelog.set(System.getenv("HANGAR_CHANGELOG") ?: changelogContent)
id.set(slug)
apiKey.set(System.getenv("HANGAR_API_TOKEN"))

Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ plugin-name=VelocityVanish
# Hangar properties
paperVersion=1.8.9-1.20.1
foliaVersion=1.19.4-1.20.1
velocityVersion=3.2
velocityVersion=3.2

# Gradle options
org.gradle.jvmargs=-XX\:MaxHeapSize\=2048m -Xmx2048m
1 change: 0 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
DEFAULT_JVM_OPTS='"-Xmx1024m" "-Xms1024m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
Expand Down
2 changes: 1 addition & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set APP_HOME=%DIRNAME%
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
set DEFAULT_JVM_OPTS="-Xmx1024m" "-Xms1024m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* <p>
* This class is a reflection accessor for net.minecraft.world.effect.MobEffect
*
* @since 2023-06-27 17:01:01
* @since 2023-08-30 15:38:06
*/
public class MobEffectAccessor {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* <p>
* This class is a reflection accessor for net.minecraft.world.effect.MobEffectInstance
*
* @since 2023-06-27 17:01:01
* @since 2023-08-30 15:38:06
*/
public class MobEffectInstanceAccessor {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ class VelocityVanishSpigot : RUoMPlugin() {
BlockPlaceListener(this)
PlayerGameModeChangeListener(this)
if (DependencyManager.sayanChatHook.exists) {
PlayerMentionListener(this)
if (!velocitySupport) PrivateMessageListener(this)
// PlayerMentionListener(this)
// if (!velocitySupport) PrivateMessageListener(this)
}
if (ServerVersion.supports(12)) {
TabCompleteListener(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ class VanishManager(
denyPush(player)
}

if (DependencyManager.proCosmeticsHook.exists) {
/*if (DependencyManager.proCosmeticsHook.exists) {
Ruom.runSync({
try {
DependencyManager.proCosmeticsHook.proCosmetics.userManager?.getUser(player.uniqueId)?.unequipCosmetics(true)
} catch (e: Exception) {
Ruom.warn("Failed to un-equip cosmetics for player ${player.name}, is ProCosmetics up to date?")
}
}, 20)
}
}*/

if (DependencyManager.squareMapHook.exists) {
DependencyManager.squareMapHook.squareMap.playerManager().hide(player.uniqueId, true)
Expand Down Expand Up @@ -344,13 +344,13 @@ class VanishManager(
allowPush(player)
}

if (DependencyManager.proCosmeticsHook.exists) {
/*if (DependencyManager.proCosmeticsHook.exists) {
try {
DependencyManager.proCosmeticsHook.proCosmetics.userManager?.getUser(player.uniqueId)?.equipLastCosmetics(true)
} catch (e: Exception) {
Ruom.warn("Failed to equip cosmetics for player ${player.name}, is ProCosmetics up to date?")
}
}
}*/

if (DependencyManager.squareMapHook.exists) {
DependencyManager.squareMapHook.squareMap.playerManager().show(player.uniqueId, true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ object DependencyManager {

var protocolLibHook: ProtocolLibHook
private set
var proCosmeticsHook: ProCosmeticsHook
private set
/*var proCosmeticsHook: ProCosmeticsHook
private set*/
var placeholderAPIHook: PlaceholderAPIHook
private set
var sayanChatHook: SayanChatHook
Expand Down Expand Up @@ -46,10 +46,10 @@ object DependencyManager {
this.register()
}
}
ProCosmeticsHook("ProCosmetics").apply {
/*ProCosmeticsHook("ProCosmetics").apply {
this.register()
proCosmeticsHook = this
}
}*/
PlaceholderAPIHook(VelocityVanishSpigot.instance, "PlaceholderAPI").apply {
this.register()
placeholderAPIHook = this
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
package ir.syrent.velocityvanish.spigot.hook
import se.file14.procosmetics.ProCosmetics
Expand All @@ -21,4 +22,4 @@ class ProCosmeticsHook constructor(name: String) : Dependency(name) {
)
}
}
}*/
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ir.syrent.velocityvanish.spigot.hook

import se.file14.procosmetics.api.ProCosmeticsProvider
import xyz.jpenilla.squaremap.api.Squaremap
import xyz.jpenilla.squaremap.api.SquaremapProvider

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
package ir.syrent.velocityvanish.spigot.listener
import ir.syrent.velocityvanish.spigot.VelocityVanishSpigot
Expand All @@ -22,4 +23,4 @@ class PlayerMentionListener(
event.isCancelled = true
}
}
}
}*/
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
package ir.syrent.velocityvanish.spigot.listener
import ir.syrent.velocityvanish.spigot.VelocityVanishSpigot
Expand All @@ -22,4 +23,4 @@ class PrivateMessageListener(
event.isCancelled = true
}
}
}
}*/

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1bafb42

Please sign in to comment.