BackupCup / hexed

Calamity's Enchantment System ported into Minecraft
Other
1 stars 0 forks source link

Celebration Enchantment Crash #1

Closed RogueEnderman closed 5 months ago

RogueEnderman commented 5 months ago

When using the Celebration crossbow enchantment, a firework is generated with custom data, which causes a crash when attempting to fire it. This may be due to the random color created by the firework generation.

image Each firework star generated with a "Custom" color, which could be causing the crash.

The associated crash is caused by this error: Error: java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Float (java.lang.Double and java.lang.Float are in module java.base of loader 'bootstrap')

When using the /data command to view the nbt data of the item, I observed that the explosion color in this firework contains a negative value, in decimal, which is not supported to my knowledge

Screenshot 2024-04-19 160930

Note the negative values in the color fields. All 16 default Minecraft colors use a positive value, and decimal values for color cannot be negative, which is a likely cause for the crash.

BackupCup commented 5 months ago

Thank you for creating an issue about that! The negative colors while aren't the cause of the crash (as the crash states, the mod tries to convert a data type of Double to a data type of Float and that causes the crash), they are causing the hex to not look correctly at least. Both the crash and the negative color values have been fixed already and the fix will be included in the new version.