Access Wideners
Access wideners allow you to loosen the access limits of classes, methods, and fields.
Currently, access wideners can only be used on classes from NMS or craftbukkit. To use access wideners in your addon, create a file called <addon_id>.accesswidener
in src/main/resources
.
After adding entries to your access widener file run IntelliJ's gradle sync (or _oriInstallJar
if it doesn't work, or _oriInstall
to also generate sources) to apply them to your compile-time classpath.
File format
The file must start with the following line:
Comments
Then, each line that isn't blank or a comment is an instruction to widen the access of a class, method, or field:
Classes
access
: eitheraccessible
orextendable
accessible
(make public)extendable
(make public and remove final)
class name
: fully qualified internal name of the class, i.e. using/
instead of.
and$
for inner classes
Methods
access
: eitheraccessible
orextendable
accessible
(make public and final if private)extendable
(make protected and remove final, also make class extendable)
class name
fully qualified internal name of the owner class, i.e. using/
instead of.
and$
for inner classesmethod name
: name of the methodmethod descriptor
: the method descriptor
Fields
access
: eitheraccessible
ormutable
accessible
(make public)mutable
(remove final)
class name
fully qualified internal name of the owner class, i.e. using/
instead of.
and$
for inner classesfield name
: name of the fieldfield descriptor
: the field descriptor