Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove assumptions about the concrete type of builders #958

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

ChiefArug
Copy link
Contributor

Description

Removes assumptions about the concrete type of builders as they are not always true due to CustomBuilderObject

Example Script

Any use of event.createCustom for items or block entities, like so:

const $UniversalBucketItem = Java.loadClass('de.cech12.bucketlib.api.item.UniversalBucketItem');

StartupEvents.registry('item', e => {
    e.createCustom('fluid_cell', () => new $UniversalBucketItem(
        new $UniversalBucketItem.Properties()
            .stacksTo(64)
            .disableEntityObtaining()
            .disableMilking()
        )
    );
});

Other details

Original report and example script from the discord: support-1.21 - crash when trying to create a world due to event.createCustom
Other usages found and reviewed with regex Builder\) [a-zA-Z$]+

@LatvianModder LatvianModder merged commit 631975d into KubeJS-Mods:main Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants