PluginBugs / Issues-CinematicStudio

Repository used to keep track of issues of my plugin CinematicsStudio
1 stars 0 forks source link

API - `CutsceneStopEvent$Cause` issue #14

Closed srnyx closed 1 year ago

srnyx commented 1 year ago

Terms

Discord tag (optional)

srnyx#0001

What happened?

When comparing CutsceneStopEvent#getCause and a CutsceneStopEvent$Cause, my IDE gets a little angry:

Operator '!=' cannot be applied to 'dev.lone.cinematicstudio.api.events.CutsceneStopEvent.Cause', 'dev.lone.cinematicstudio.api.events.CutsceneStopEvent$Cause'

THIS IS ONLY VISUAL! The plugin still compiles and works. The event also works as intended when fired. This probably means it's more of an IDE issue. However, I think it's a simple fix on your end by just not using the $ character for CutsceneStopEvent$Cause, and instead just naming it Cause.

Steps to reproduce the issue

  1. Add CutsceneStopEvent event handler
  2. Compare a CutsceneStopEvent$Cause with CutsceneStopEvent#getCause
  3. Observe warning

CinematicsStudio Version

1.4.3-r5

Screenshots/Videos

img

LoneDev6 commented 1 year ago

Will be checked

LoneDev6 commented 1 year ago

image Works just fine.

 <dependency>
    <groupId>libs</groupId>
    <artifactId>CinematicStudio</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>your path here/CinematicStudio.jar</systemPath>
</dependency>

The $ character you're talking about is just how java handles inner classes. https://stackoverflow.com/questions/11388840/java-compiled-classes-contain-dollar-signs

LoneDev6 commented 1 year ago

This might be because of how Proguard handles classes relocation. I'll provide a fix for this.

srnyx commented 1 year ago
 <dependency>
    <groupId>libs</groupId>
    <artifactId>CinematicStudio</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>your path here/CinematicStudio.jar</systemPath>
</dependency>

I'm using Gradle Kotlin DSL, like this:

dependencies {
    compileOnly(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
}

And then I have the CinematicStudio JAR file in the libs folder. So not sure if that changes anything. This dependency thing works fine for other APIs/libraries that I have in the libs folder too.

LoneDev6 commented 1 year ago

Update and check please