Skip to content

Forge build merges client mixins into common section, crashing dedicated servers #28

@MauveAvenger

Description

@MauveAvenger

Bug Description

The Forge build does not preserve the "client" section in
playerengine.mixins.json. Client-only mixins are merged into the main
"mixins" array, causing dedicated servers to crash.

Source vs Built Jar

Source (common/src/main/resources/playerengine.mixins.json):

"client": [                                                                   
  "ClientBlockBreakMixin",                                                    
  "ClientConnectionAccessor",                                                 
  "PlayerCollidesWithEntityMixin"                                             
],                                                                            
"mixins": [                                                                   
  "EntityAccessor",                                                           
  ...                                                                         
]                                                                             
                                                                              
Built Forge Jar (after build):                                                
"client": [],                                                                 
"mixins": [                                                                   
  "ClientBlockBreakMixin",      // <-- should be client only!                 
  "ClientConnectionAccessor",   // <-- should be client only!                 
  "PlayerCollidesWithEntityMixin", // <-- should be client only!              
  "EntityAccessor",                                                           
  ...                                                                         
]                                                                             
                                                                              
Crash Log                                                                     
                                                                              
[main/FATAL] [mixin/]: Mixin apply for mod playerengine failed                
playerengine.mixins.json:PlayerCollidesWithEntityMixin from mod playerengine  
-> net.minecraft.world.entity.player.Player: InvalidMixinException            
ClassMetadataNotFoundException ... net/minecraft/client/player/LocalPlayer    
                                                                              
Environment                                                                   
                                                                              
- Minecraft 1.20.1                                                            
- Forge 47.4.0                                                                
- PlayerEngine 1.0.0                                                          
                                                                              
Suggested Fix                                                                 
                                                                              
Either use @Environment(EnvType.CLIENT) annotations on client mixins, or      
ensure the Architectury/Loom build preserves the client/server mixin          
separation.                                                                   
                 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions