mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-29 13:00:17 +02:00
fix(mapper): story boost state
This commit is contained in:
parent
87030eca7e
commit
a8c4c1ce3e
@ -3,8 +3,6 @@ package me.rhunk.snapmapper.impl
|
||||
import me.rhunk.snapmapper.AbstractClassMapper
|
||||
import me.rhunk.snapmapper.MapperContext
|
||||
import me.rhunk.snapmapper.ext.findConstString
|
||||
import me.rhunk.snapmapper.ext.getStaticConstructor
|
||||
import me.rhunk.snapmapper.ext.isEnum
|
||||
|
||||
class StoryBoostStateMapper : AbstractClassMapper() {
|
||||
override fun run(context: MapperContext) {
|
||||
@ -13,9 +11,7 @@ class StoryBoostStateMapper : AbstractClassMapper() {
|
||||
if (firstConstructor.parameters.size != 3) continue
|
||||
if (firstConstructor.parameterTypes[1] != "J" || firstConstructor.parameterTypes[2] != "J") continue
|
||||
|
||||
val storyBoostEnumClass = context.getClass(firstConstructor.parameterTypes[0]) ?: continue
|
||||
if (!storyBoostEnumClass.isEnum()) continue
|
||||
if (storyBoostEnumClass.getStaticConstructor()?.implementation?.findConstString("NeedSubscriptionCannotSubscribe") != true) continue
|
||||
if (clazz.methods.firstOrNull { it.name == "toString" }?.implementation?.findConstString("StoryBoostState", contains = true) != true) continue
|
||||
|
||||
context.addMapping("StoryBoostStateClass", clazz.type.replace("L", "").replace(";", ""))
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user