EngineHub / CommandHelper

Rapid scripting and command aliases for Minecraft owners
https://methodscript.com
Other
119 stars 71 forks source link

Add priority to event prefilters. #1378

Closed LadyCailin closed 8 months ago

LadyCailin commented 8 months ago

This allows for prefilters to be processed in order of least to highest complexity, leading to more efficient processing of events that don't match. For instance, matching a regex is more expensive than matching a boolean, so we check the boolean first, and if it doesn't match, then we don't try the regex match, whether or not it would match. General prefilter types have been given a default complexity, but as every prefilter is different, it's also possible for individual overrides to provide a custom priority instead.