Skip to content

Commit

Permalink
fix: Classloader errors from oraxen because it also shades creative r…
Browse files Browse the repository at this point in the history
…esourcepack API alongside Idofront
  • Loading branch information
0ffz committed Dec 11, 2024
1 parent 06125fe commit 541377e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 40 deletions.
11 changes: 5 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ dependencies {
compileOnly(packyLibs.guiy)

compileOnly(idofrontLibs.minecraft.plugin.modelengine)
compileOnly(idofrontLibs.minecraft.plugin.oraxen)
compileOnly(idofrontLibs.minecraft.plugin.mythic.crucible)
compileOnly(idofrontLibs.creative.api)
compileOnly(idofrontLibs.creative.serializer.minecraft)
Expand Down Expand Up @@ -85,11 +84,11 @@ paper {
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
joinClasspath = true
}
register("Oraxen") {
required = false
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
joinClasspath = true
}
// register("Oraxen") {
// required = false
// load = PaperPluginDescription.RelativeLoadOrder.BEFORE
// joinClasspath = true
// }
register("MythicCrucible") {
required = false
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import com.mineinabyss.packy.listener.TemplateLoadTriggers.unregisterTemplateHan
import com.ticxo.modelengine.api.events.ModelRegistrationEvent
import com.ticxo.modelengine.api.generator.ModelGenerator
import io.lumine.mythiccrucible.events.MythicCrucibleGeneratePackEvent
import io.th0rgal.oraxen.OraxenPlugin
import io.th0rgal.oraxen.api.events.OraxenPackPreUploadEvent
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.bukkit.event.EventHandler
Expand Down Expand Up @@ -128,38 +126,6 @@ sealed interface LoadTrigger {
}
}

@Serializable
@SerialName("Oraxen")
data object OraxenTrigger : LoadTrigger {
override fun registerLoadHandler(template: PackyTemplate) {
if (!Plugins.isEnabled("Oraxen")) return

val id = template.id
unregisterTemplateHandlers()
val listener = object : Listener {
@EventHandler
fun OraxenPackPreUploadEvent.onOraxenPackPreUpload() {
packy.logger.w("Oraxen loadTrigger detected...")
isCancelled = true
val oraxenPack = OraxenPlugin.get().resourcePack?.file?.takeIf { it.exists() }
?: return packy.logger.e("Oraxen-pack is missing, skipping loadTrigger for $id-template")
oraxenPack.copyTo(template.path.toFile(), true)

template.clearFromCache()
packy.logger.s("Copying Oraxen-pack for $id-template")

if (packy.config.packSquash.enabled) {
packy.logger.i("Starting PackSquash process for $id-template...")
PackySquash.squashPackyTemplate(template)
packy.logger.s("Finished PackSquash process for $id-template")
}
}
}
template.triggerListener = listener
packy.plugin.listeners(listener)
}
}

fun PackyTemplate.clearFromCache() {
when {
required -> packy.plugin.createPackyContext()
Expand Down

0 comments on commit 541377e

Please sign in to comment.