-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
Refactor salt disk feature to call vanilla placement method. #7968
Refactor salt disk feature to call vanilla placement method. #7968
Conversation
|
||
public final BlockState state; | ||
public final RuleBasedBlockStateProvider stateProvider; | ||
public final IntProvider radius; | ||
public final IntSupplier halfHeight; |
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.
This file changed to match the vanilla config as closely as possible. The only remaining difference is the IntSupplier
since I am not aware of any clean approach towards making configured_feature/salt.json
pull in the Mekanism config value for halfHeight
.
} | ||
} | ||
return placed; | ||
ResizableDiskConfig config = context.config(); |
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.
If my understanding of escape analysis is correct, the following instantiations should be stack-allocated if the function is called often enough to be optimized by the JVM.
I will try to look at this when I get a chance, out of curiosity though so when I do get to testing it, what mod are you testing it with? |
Simply Improved Terrain, 1.20(.1) alpha All The Mods 9 (with Mekanism already present, and the above mod added) |
Love this, it is great having less duplicate code as it makes porting easier. Did a couple minor cleaning related things to this PR so that more of the stuff can be overridden by changing the configured feature rather than just changing the config, and also fixed salt spawning outside of water as it seems MC moved it from being hardcoded like our copy had it to being a placement modifier |
Changes proposed in this pull request:
The surface salt deposit placements currently use a copy of the vanilla code. This causes them not to pick up changes made by other mods that try to break up the monotony of (or otherwise change) the shapes of the vanilla disks:
By reworking the disk feature in Mekanism to call the vanilla code, the changes are now picked up:
Without the mods in question present, Mekanism behaves as it did before: