Package valorless.rarespawns.compilers
Class AbilityCompiler
java.lang.Object
valorless.rarespawns.compilers.Compiler
valorless.rarespawns.compilers.AbilityCompiler
AbilityCompiler handles the execution of dynamically compiled ability classes.
It provides methods to invoke abilities by their ID, passing necessary parameters.
Also includes a cleanup method to remove temporary source files after compilation.
-
Field Summary
Fields inherited from class valorless.rarespawns.compilers.Compiler
bukkit, classpath, compiler, entityData, fileManager, nms, rarespawns, seperator, server, valorlessutils -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCleans up temporary .java files created during the compilation process.static voiduseAbility(String id, EntityData data, org.bukkit.entity.LivingEntity entity) Executes the cached ability code by invoking its 'execute' method.Methods inherited from class valorless.rarespawns.compilers.Compiler
compileAndCacheCode, getBukkit, getEntityData, getNMS, getPluginClasspath, getPluginJar
-
Constructor Details
-
AbilityCompiler
public AbilityCompiler()
-
-
Method Details
-
useAbility
public static void useAbility(String id, EntityData data, org.bukkit.entity.LivingEntity entity) throws Exception Executes the cached ability code by invoking its 'execute' method.- Parameters:
id- The ability ID (class name).data- The EntityData to pass to the ability.entity- The LivingEntity to pass to the ability.- Throws:
Exception- If the class cannot be found or executed.
-
cleanupTemporaryFiles
public static void cleanupTemporaryFiles()Cleans up temporary .java files created during the compilation process. This method deletes all .java files in the 'abilities/compiled' directory. The compiled .class files are retained for use.
-