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

[1.12.2] [Issue?] Block-Constructor (Void Member) #237

Open
accessdenied0 opened this issue Apr 29, 2021 · 3 comments
Open

[1.12.2] [Issue?] Block-Constructor (Void Member) #237

accessdenied0 opened this issue Apr 29, 2021 · 3 comments

Comments

@accessdenied0
Copy link

Dear ContentTweaker Team,

I'm not sure if this Mod is still under maintenance for 1.12.2, but I feel like I should report this:

I got an issue with the Block-Constructor.

Everything works fine, but soon I try to stack Commands to create dynamic a set of blocks, I get issues with certain members.

VanillaFactory.createBlock("basic_example_block", <blockmaterial:iron>).setBlockSoundType(<soundtype:iron>).setToolLevel(2).setEntitySpawnable(false).register();

even it is defined in the documentation as valid member, the construction fails with the output "void has no member"

The issue seem to be with a few commands, but I only know for certain it for:
setBlockSoundType()
setGlowing()

Probably there are more.

I didn't test it in depth with Items and other members, but the Item-constructor has an issue with "setGlowing", too

Maybe I do something wrong, or the member is called differently,

but I would like to avoid variables for each item for dynamic (dummy/crafting items) generation.

I thank in advance for any input and help

@accessdenied0 accessdenied0 changed the title [1.12.2] [Issue?] Block-Constructor [1.12.2] [Issue?] Block-Constructor (Void Member) Apr 29, 2021
@SkySom
Copy link
Member

SkySom commented Apr 29, 2021

You didn't provide your script.

@accessdenied0
Copy link
Author

accessdenied0 commented Apr 29, 2021

I did.

#loader contenttweaker

[...]
VanillaFactory.createBlock("basic_example_block", <blockmaterial:iron>).setBlockSoundType(<soundtype:iron>).setToolLevel(2).setEntitySpawnable(false).register();
[...]

There is nothing more to it, because if changed like this...

'VanillaFactory.createBlock("basic_example_block", <blockmaterial:iron>).register();

it works.

For the sake of doubt I add it anyway.

democat3457 added a commit to democat3457/ContentTweaker that referenced this issue Sep 13, 2021
Fixes CraftTweaker#237 

Although the issue isn't really a bug, I can see the use in having a chain-style return to allow for more efficient code. (So this is more of a feature suggestion)
@democat3457
Copy link

democat3457 commented Sep 17, 2021

not a bug - you have to make an extra variable

sorry, i couldnt get the pr to pass :/

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

Successfully merging a pull request may close this issue.

3 participants