Class PaperConfigTransformer
java.lang.Object
eu.cloudnetservice.wrapper.transform.bukkit.PaperConfigTransformer
- All Implemented Interfaces:
ClassTransformer
PaperConfigTransformer relies on preview features of the Java platform:
PaperConfigTransformerrefers to one or more preview APIs:ClassTransform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A transformer implementation that disables the
stackableBuckets method on old Paper versions. This is due to
the fact that the method uses illegal reflection in the attempt to set a final field which is not possible anymore on
newer java versions.- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.cloudnetservice.wrapper.transform.ClassTransformer
ClassTransformer.TransformWillingness -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance of this transformer, usually done via SPI. -
Method Summary
Modifier and TypeMethodDescriptionclassTransformWillingness(@NonNull String internalClassName) Checks if this class transformer is willing to transform the class with the given internal name.Provides the class transform that will be used to transform the class data.
-
Field Details
-
MN_STACKABLE_BUCKETS
- See Also:
-
CNI_PAPER_CONFIG
- See Also:
-
-
Constructor Details
-
PaperConfigTransformer
public PaperConfigTransformer()Constructs a new instance of this transformer, usually done via SPI.
-
-
Method Details
-
provideClassTransform
Provides the class transform that will be used to transform the class data. This method should only be called if a prior check toClassTransformer.classTransformWillingness(String)did not indicate a rejection of the class.- Specified by:
provideClassTransformin interfaceClassTransformer- Returns:
- the class transform to apply to the target class.
-
classTransformWillingness
@NonNull public @NonNull ClassTransformer.TransformWillingness classTransformWillingness(@NonNull @NonNull String internalClassName) Checks if this class transformer is willing to transform the class with the given internal name. If this method is not returning a rejection status, theClassTransformer.provideClassTransform()PREVIEW method is called and the transform gets applied to the target class.- Specified by:
classTransformWillingnessin interfaceClassTransformer- Parameters:
internalClassName- the internal class name of the class being checked for transformation.- Returns:
- the willingness of transformation for the class with the given name.
-
PaperConfigTransformerwhen preview features are enabled.