mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-10-20 14:16:26 -04:00
feat: AppleSkin compat for dex scanner mode
This commit is contained in:
@@ -73,6 +73,7 @@
|
||||
- Bees now grow Apricorns and the Galarica Nut Bush, which were in the bee growables tag but never handled, and correctly spend their nectar when they do
|
||||
- Saccharine Leaves can now be bone mealed
|
||||
- Fixed party overlay not hiding when player opens the pokedex scanner
|
||||
- Added compat for AppleSkin
|
||||
|
||||
### Developer
|
||||
- Bumped NeoForge to `21.1.195` to get access to MixinExtras `0.5` and the expressions annotation
|
||||
|
||||
@@ -85,6 +85,9 @@ dependencies {
|
||||
|
||||
minecraftServerLibraries(libs.icu4j)
|
||||
|
||||
// AppleSkin stores api under `api` classifier in their coordinates
|
||||
// Because of that, we cannot just add it to integrations bundle
|
||||
modCompileOnly(variantOf(libs.appleskin.api.fabric) { classifier("api") })
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.fabric.client.integration.appleskin
|
||||
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import squeek.appleskin.api.AppleSkinApi
|
||||
import squeek.appleskin.api.event.HUDOverlayEvent
|
||||
|
||||
object AppleSkinClientEventHandler: AppleSkinApi {
|
||||
override fun registerEvents() {
|
||||
HUDOverlayEvent.Exhaustion.EVENT.register(::checkIsScanning)
|
||||
HUDOverlayEvent.Saturation.EVENT.register(::checkIsScanning)
|
||||
HUDOverlayEvent.HealthRestored.EVENT.register(::checkIsScanning)
|
||||
HUDOverlayEvent.HungerRestored.EVENT.register(::checkIsScanning)
|
||||
}
|
||||
|
||||
private fun checkIsScanning(e: HUDOverlayEvent) {
|
||||
if (CobblemonClient.pokedexUsageContext.scanningGuiOpen) {
|
||||
e.isCanceled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,9 @@
|
||||
],
|
||||
"modmenu": [
|
||||
"com.cobblemon.mod.fabric.client.integration.modmenu.CobblemonModMenu"
|
||||
],
|
||||
"appleskin": [
|
||||
"com.cobblemon.mod.fabric.client.integration.appleskin.AppleSkinClientEventHandler"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
|
||||
@@ -37,6 +37,9 @@ repositories {
|
||||
//JEI
|
||||
maven("https://maven.blamejared.com/")
|
||||
maven("https://maven.parchmentmc.org")
|
||||
|
||||
// AppleSkin
|
||||
maven("https://maven.ryanliptak.com/")
|
||||
}
|
||||
|
||||
license {
|
||||
|
||||
@@ -16,6 +16,7 @@ moddev = "1.0.11"
|
||||
# Common
|
||||
molang = "1.1.20"
|
||||
jei-api = "19.22.1.316"
|
||||
appleskin-api = "mc1.21-3.0.5"
|
||||
|
||||
# Graal
|
||||
graal = "22.3.0"
|
||||
@@ -85,6 +86,7 @@ jei-fabric = { group = "mezz.jei", name = "jei-1.21.1-fabric", version.ref = "je
|
||||
fabric-debugutils = { group = "maven.modrinth", name = "debugutils", version.ref = "debugutils-fabric"}
|
||||
mod-menu = { group = "com.terraformersmc", name = "modmenu", version.ref = "mod-menu" }
|
||||
c2me-fabric = { group = "maven.modrinth", name = "c2me-fabric", version.ref = "c2me-fabric" }
|
||||
appleskin-api-fabric = { group = "squeek.appleskin", name = "appleskin-fabric", version.ref = "appleskin-api" }
|
||||
|
||||
# NeoForge
|
||||
neoforge-api = { group = "net.neoforged", name = "neoforge", version.ref = "neoforge" }
|
||||
@@ -92,6 +94,7 @@ neo-kotlin-forge = { group = "thedarkcolour", name = "kotlinforforge-neoforge",
|
||||
neoforge-debugutils = { group = "maven.modrinth", name = "debugutils", version.ref = "debugutils-forge"}
|
||||
jei-neoforge = { group = "mezz.jei", name = "jei-1.21.1-neoforge", version.ref = "jei-api"}
|
||||
c2me-neoforge = { group = "maven.modrinth", name = "c2me-neoforge", version.ref = "c2me-neoforge" }
|
||||
appleskin-api-neoforge = { group = "squeek.appleskin", name = "appleskin-neoforge", version.ref = "appleskin-api" }
|
||||
|
||||
# Data Storage
|
||||
mongo-driver-core = { group = "org.mongodb", name = "mongodb-driver-core", version.ref = "mongo" }
|
||||
|
||||
@@ -68,6 +68,9 @@ dependencies {
|
||||
bundle(it)
|
||||
}
|
||||
|
||||
// AppleSkin stores api under `api` classifier in their coordinates
|
||||
// Because of that, we cannot just add it to integrations bundle
|
||||
modCompileOnly(variantOf(libs.appleskin.api.neoforge) { classifier("api") })
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
+6
@@ -8,11 +8,13 @@
|
||||
|
||||
package com.cobblemon.mod.neoforge.client
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.platform.events.ClientEntityEvent
|
||||
import com.cobblemon.mod.common.platform.events.ClientPlayerEvent
|
||||
import com.cobblemon.mod.common.platform.events.ClientTickEvent
|
||||
import com.cobblemon.mod.common.platform.events.PlatformEvents
|
||||
import com.cobblemon.mod.common.platform.events.RenderEvent
|
||||
import com.cobblemon.mod.neoforge.client.integration.appleskin.AppleSkinClientEventHandler
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.multiplayer.ClientLevel
|
||||
import net.neoforged.api.distmarker.Dist
|
||||
@@ -31,6 +33,10 @@ object NeoForgeClientPlatformEventHandler {
|
||||
|
||||
fun register() {
|
||||
NeoForge.EVENT_BUS.register(this)
|
||||
|
||||
if (Cobblemon.implementation.isModInstalled("appleskin")) {
|
||||
AppleSkinClientEventHandler.register()
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.neoforge.client.integration.appleskin
|
||||
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import net.neoforged.bus.api.SubscribeEvent
|
||||
import net.neoforged.neoforge.common.NeoForge
|
||||
import squeek.appleskin.api.event.HUDOverlayEvent
|
||||
|
||||
object AppleSkinClientEventHandler {
|
||||
fun register() {
|
||||
NeoForge.EVENT_BUS.register(this)
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
fun onHudLayerEvent(e: HUDOverlayEvent) {
|
||||
if (CobblemonClient.pokedexUsageContext.scanningGuiOpen) {
|
||||
e.isCanceled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user