ldtteam / Domum-Ornamentum

GNU General Public License v3.0
10 stars 25 forks source link

[CRASH + Player Corruption] No Enum Constant - V1.20.1-1.0.184-BETA #238

Open Shadowner opened 3 weeks ago

Shadowner commented 3 weeks ago

Instant crash + Player Data file corruption for v1.20.1-1.0.184-BETA

Context : I was using Forgematica (Litematic) to place a schematic using types, and it corrupted my entire player data file

I think that this is the same problem in #157

Time: 2024-06-17 23:31:04
Description: Unexpected error

java.lang.IllegalArgumentException: No enum constant com.ldtteam.domumornamentum.block.types.TrapdoorType.
    at java.lang.Enum.valueOf(Enum.java:273) ~[?:?] {re:mixin}
    at com.ldtteam.domumornamentum.block.types.TrapdoorType.valueOf(TrapdoorType.java:10) ~[domum_ornamentum-1.20.1-1.0.184-BETA-universal.jar%23663!/:1.20.1-1.0.184-BETA] {re:classloading}
    at com.ldtteam.domumornamentum.block.decorative.PanelBlock.m_5573_(PanelBlock.java:124) ~[domum_ornamentum-1.20.1-1.0.184-BETA-universal.jar%23663!/:1.20.1-1.0.184-BETA] {re:classloading}
    at com.ldtteam.domumornamentum.client.render.ModelGhostRenderer.renderGhost(ModelGhostRenderer.java:88) ~[domum_ornamentum-1.20.1-1.0.184-BETA-universal.jar%23663!/:1.20.1-1.0.184-BETA] {re:classloading}
    at com.ldtteam.domumornamentum.client.event.handlers.MateriallyTexturedBlockPreviewRenderHandler.renderGhost(MateriallyTexturedBlockPreviewRenderHandler.java:50) ~[domum_ornamentum-1.20.1-1.0.184-BETA-universal.jar%23663!/:1.20.1-1.0.184-BETA] {re:classloading}
    at com.ldtteam.domumornamentum.client.event.handlers.MateriallyTexturedBlockPreviewRenderHandler.renderMateriallyTexturedBlockPreview(MateriallyTexturedBlockPreviewRenderHandler.java:43) ~[domum_ornamentum-1.20.1-1.0.184-BETA-universal.jar%23663!/:1.20.1-1.0.184-BETA] {re:classloading}
    at com.ldtteam.domumornamentum.client.event.handlers.MateriallyTexturedBlockPreviewRenderHandler.onRenderLevelStage(MateriallyTexturedBlockPreviewRenderHandler.java:25) ~[domum_ornamentum-1.20.1-1.0.184-BETA-universal.jar%23663!/:1.20.1-1.0.184-BETA] {re:classloading}
    at com.ldtteam.domumornamentum.client.event.handlers.__MateriallyTexturedBlockPreviewRenderHandler_onRenderLevelStage_RenderLevelStageEvent.invoke(.dynamic) ~[domum_ornamentum-1.20.1-1.0.184-BETA-universal.jar%23663!/:1.20.1-1.0.184-BETA] {re:classloading,pl:eventbus:B}
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2389!/:?] {}

Here is a screen of the NBT that made my Player Data File corrupted if it can help ! (Still have the complete file if needed) image

Raycoms commented 3 weeks ago

You cannot place Domum blocks via commands as those would be lacking necessary data.

Nightenom commented 3 weeks ago

You can place them as long as they will have both BETag and 'type' blockstate tag, we will look into providing more crash-less experience, but as said you have to provide the data else you will get garbage/random looking block. Indeed a dupe of #157

Thodor12 commented 3 weeks ago

Also duplicate of #234 and #237

Shadowner commented 3 weeks ago

Totally agree, but this bug might hide some scenarios like :

a simple security as a default material or fallback item might be a simple fix to this problem.

(Still theory I don't have the time to watch the source code)

Nightenom commented 1 week ago

Fixed in 1.20.4 and newer by using vanilla logic, in 1.20.1 and earlier it should be easily fixable - just might need fix on more than this crash place