Problem
So, the codebase has multiple instances where Resource IDs are directly used in places where only final objects can be used. This introduces compile-time errors as Resource IDs are not final anymore in newer versions. (Ref) These instances are:
const vals (constant values) are being assigned with Resource IDs.
- Also using Resource IDs in switch case statements results in the same.
Proposed Solution
- Remove const and annotate the field with
@JvmField which results in generated bytecode being similar to latter. (Cross-Verified Ref).
- Replace switch with if-else where resource IDs are used. (Ref)
This proposed solution works on my machine AS Giraffe 2022.3.1 Patch 1 and would gladly open a PR if required.
Problem
So, the codebase has multiple instances where Resource IDs are directly used in places where only final objects can be used. This introduces compile-time errors as Resource IDs are not final anymore in newer versions. (Ref) These instances are:
const vals (constant values) are being assigned with Resource IDs.Proposed Solution
@JvmFieldwhich results in generated bytecode being similar to latter. (Cross-Verified Ref).This proposed solution works on my machine AS Giraffe 2022.3.1 Patch 1 and would gladly open a PR if required.