Class BukkitJavaVersionCheckTransformer
java.lang.Object
eu.cloudnetservice.wrapper.transform.bukkit.BukkitJavaVersionCheckTransformer
- All Implemented Interfaces:
ClassTransformer
@Internal
public final class BukkitJavaVersionCheckTransformer
extends Object
implements ClassTransformer
BukkitJavaVersionCheckTransformer relies on preview features of the Java platform:
BukkitJavaVersionCheckTransformerrefers 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 that removes all java version checks done by Bukkit.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classA code transformer that removes all java version checks from the CraftBukkit main class.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_MAIN
- See Also:
-
CNI_CRAFT_BUKKIT_MAIN
- See Also:
-
CNI_SYSTEM
- See Also:
-
CNI_PRINT_STREAM
- See Also:
-
CD_PRINT_STREAM
-
-
Constructor Details
-
BukkitJavaVersionCheckTransformer
public BukkitJavaVersionCheckTransformer()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.
-
BukkitJavaVersionCheckTransformerwhen preview features are enabled.