Skip to content

Updating mod to 1.0.26 causes regex usage to break#68

Description

@hechang27-sprt

Issue type:

  • 馃悰 Bug
tegratedscripting.d.ts" />

// const matchImport = /^apotheosis:gem$|^reliquary:witch_hat$|^irons_spellbooks:scroll$|^minecraft:tipped_arrow$|^supplementaries:quiver$|^trophymanager:trophy$|^aether:.+_gloves/
// `matchImport.test(itemId)` causes the bug

const filter = new Set([
    "apotheosis:gem",
    "reliquary:witch_hat",
    "irons_spellbooks:scroll",
    "minecraft:tipped_arrow",
    "supplementaries:quiver",
    "trophymanager:trophy",
])

/**
 * 
 * @param {import("../../integratedscripting").ValueItemstack} item 
 */
function filterDrops(item) {
    const tags = item.tags();
    const itemId = idContext.ops.uniquely_namedUniqueName(item);
    
    return matchImport.test(itemId) || tags.some((tag) => tag === "c:armors" || tag === "c:tools");
    // return filter.has(itemId) || tags.some((tag) => tag === "c:armors" || tag === "c:tools");
}

Short description:

Using regex in js code causes error in the screenshot. This bug only appeared when I updated to ATM 8.0 / Integrated Scripting 1.0.26. Regex worked fine on 1.0.24.

Image

Steps to reproduce the problem:

  1. ...

Expected behaviour:


Versions:

  • This mod: Integrated Scripting 1.0.26
  • Minecraft: 1.21.1
  • Mod loader version: Neoforge 21.1.247

Log file:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions