-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add a CustomShape override, for changing shape based on blockstates. #902
Open
Tcat2000
wants to merge
10
commits into
KubeJS-Mods:2001
Choose a base branch
from
Tcat2000:2001
base: 2001
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b82854f
Finished adding a custom shape override callback
Tcat2000 a288cd5
Finished adding a custom shape override callback
Tcat2000 bfced0c
Finished adding a custom shape override callback
Tcat2000 21cd081
Reworked the system to be more performant.
Tcat2000 0e9fe07
Removed debug println-s
Tcat2000 059dad7
Removed old ShapeOverrideCallbackJS.java file, as it was no longer used.
Tcat2000 720366d
Fixed a bug.
Tcat2000 3af3049
Fixed critical a bug.
Tcat2000 fed002e
Reverted version change for personal builds (did not mean to commit)
Tcat2000 07554e1
GetShapeMap now uses a stream for more optimal value checking.
Tcat2000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mods/Vanilla typically use arrays to store shapes as each blockstate property value can be simplified down to an index.
I don't think that is feasible here, but it should be an IdentityHashMap and use BlockStates (because only one BlockState instance exists per combination of property values) as keys so that is has slightly better performance from use == rather than equals().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will look into that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide more details? I don't understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh whoops, I was reffering to the other shapeMap, here: https://github.com/KubeJS-Mods/KubeJS/pull/902/files#diff-0f8f0bc1e2c3614534f9f872111eca48e7d4e71d68c067e5db4e51506975e32bR102
Making that a Map<BlockState, VoxelShape> then when you initialize it making a
new IdentityHashMap<>()
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like, how do I get all of the different blockstates, I played around with the code, but could not find how to do this. Or just pass on this one, how do I get this pr reviewed to add it to the real thing? Is there anything I need to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be methods on Block for getting blockstates. Like I said, this comment was meant to be on the other shapeMap in the BasicBlockJS class where you do actually have access to those.
As for getting this added to KJS that could happen anytime Lat or Max feels like it, but that likely wont happen while there are pending reviews from other people. Sometimes PRs can stay open for a while with no activity as Lat doesn't touch Github much and he generally deals with feature PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright