Quilt Loader 1
Loading...
Searching...
No Matches
net.fabricmc.api.Environment Interface Reference

Applied to declare that the annotated element is present only in the specified environment. More...

Public Member Functions

EnvType value ()
 Returns the environment type that the annotated element is only present in.

Detailed Description

Applied to declare that the annotated element is present only in the specified environment.

Use with caution, as Fabric-loader will remove the annotated element in a mismatched environment!

When the annotated element is removed, bytecode associated with the element will not be removed. For example, if a field is removed, its initializer code will not, and will cause an error on execution.

If an overriding method has this annotation and its overridden method doesn't, unexpected behavior may happen. If an overridden method has this annotation while the overriding method doesn't, it is safe, but the method can be used from the overridden class only in the specified environment.

See also
EnvironmentInterface
Deprecated
Please use one of quilt's annotations: either ClientOnly or DedicatedServerOnly.

The documentation for this interface was generated from the following file:
  • src/fabric/api/java/net/fabricmc/api/Environment.java