Skip to content

Add system property to disable environment stripping in development environments#1154

Open
DrexHD wants to merge 4 commits into
FabricMC:masterfrom
DrexHD:feat/disable-strip-env
Open

Add system property to disable environment stripping in development environments#1154
DrexHD wants to merge 4 commits into
FabricMC:masterfrom
DrexHD:feat/disable-strip-env

Conversation

@DrexHD

@DrexHD DrexHD commented Jul 6, 2026

Copy link
Copy Markdown
Member

This PR disables environment stripping of mods outside of development environment. This now matches the behavior of minecraft classes, which are only stripped inside the development environment to prevent developers from accidentally using classes from the wrong environment.

Additionally it adds a system property to disable environment stripping in development environments for developers that know/can ensure that the classes they are using will be available!

Why?
I do have legitimate use cases for using classes from the "wrong" side. I am using client side classes in server environment for "rendering" entity animations. This allows me to patch mods to run server side only, see https://www.youtube.com/watch?v=Cqef5lmJlk4, where I patched cobblemon (without having to manually copy their client side classes). I do make sure the minecraft client classes are added to the classpath myself.

Without these changes development of mod patches requires a custom fork of fabric-loader and using classes from mods, which use environment annotation doesn't work outside of development environment.
These changes requires explicit opt-in, because this behavior is not desired for the majority of users!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant