Array support for find + ResurrectHome: View Server Home Button on Server Guide (#2283)

This commit is contained in:
Nuckyz 2024-04-09 17:09:23 -03:00 committed by GitHub
parent dc4c678aa3
commit 5636f9d979
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 131 additions and 23 deletions

View file

@ -186,7 +186,8 @@ function patchFactories(factories: Record<string | number, (module: { exports: a
const executePatch = traceFunction(`patch by ${patch.plugin}`, (match: string | RegExp, replace: string) => code.replace(match, replace));
if (patch.predicate && !patch.predicate()) continue;
if (code.includes(patch.find)) {
// we change all patch.find to array in plugins/index
if ((patch.find as string[]).every(f => code.includes(f))) {
patchedBy.add(patch.plugin);
const previousMod = mod;