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

Cosmic Reach Model Editor plugin #506

Merged
merged 12 commits into from
Apr 30, 2024
Merged

Conversation

zHoeshin
Copy link
Contributor

Add the Cosmic Reach Model Editor plugin to the list of Blockbench plugins

plugins.json Outdated Show resolved Hide resolved
@Malik12tree
Copy link
Contributor

Please make use of originalJavaBlockCond, To clarify again, the original condition might be changed within Blockbench or by other plugins. Instead, use the saved condition within your new condition. This will protect your plugin from breaking Blockbench or other plugins in the future.

@zHoeshin
Copy link
Contributor Author

@Malik12tree , I'm not sure what you mean? The condition gets set back to originalJavaBlockCond on unload(). Did you expect me to change java_block condition to the following code?

(mode) => {
    if (mode.cuboids) return true;
    return originalJavaBlockCond(model);
}

Please note, I cannot avoid modufying the original condition. To make sure the open_model() action(baritem) works correctly, I have to prevent the java_block's condition from giving false positives.
The only way I'm able not to change the condition is to not support the open_model() action at all, which is a major inconvenience when working with models.

@Malik12tree
Copy link
Contributor

Yeah of course! But only to give your plugin more availability in case the original condition (model.parent || model.elements || model.textures) changes, instead of hard coding it in your code, just change it to call the original condition. It will behave exactly as it's behaving now, only less subject to break things in the future.

(mode) => {
    return !mode.cuboids && originalJavaBlockCond(model);
}

@zHoeshin
Copy link
Contributor Author

@Malik12tree , the issue's long ago fixed

@Malik12tree
Copy link
Contributor

@zHoeshin Yeah totally aware. Jannis is the only person that can merge pull requests in this repo, sometimes pull requests may take long if he's busy

@JannisX11
Copy link
Owner

Thanks for your help @Malik12tree !

There are two breaking issure remaining:

  • Codec.java_block does not exist. Use Codecs.java_block instead in the 2 places where it's misspelled
  • plugins.json has a trailing comma, as you can seen from the automatic check above

I would also strongly recommend to add icons to your model format and your actions.
Once this is fixed, you may update the creation date field to the current date so it'll show up as new.

@JannisX11
Copy link
Owner

The new icons are not working correctly.
It's a good practice to always test all the changes that you make.
image

@JannisX11 JannisX11 merged commit 5408d87 into JannisX11:master Apr 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants