-
Notifications
You must be signed in to change notification settings - Fork 20
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
Move more data into sections, world height implementation #20
Conversation
c-custom world height =o? |
Some sort of. It will require some more work - splitting chunk section rendering and some changes in light code |
You should probably move your test stuff to the testmod workspace instead. |
True, I will fix this in next commit |
hm does the last commit means i can try it =o? |
Yes, you can try it if you want |
Should world height be per-dimensional or per-world? Current implementation is per-world |
Per dimension would be cool |
Dimensional would be preferred, or even better, both, though I'm not sure of a use-case for the latter. |
Maybe the world one is the default, which dimensions can override? |
Yea, likely something like that. |
hm custom dimension height |
This actually makes it per-dimensional. There is no reason to store both values for world and dimension, so there can be only dimensional height with default value of 128. If this will be done as interface - any mod can implement it and change height into desirable one. It will be also possible for mods to change vanilla height with mixins as mixins can override interface functions of another mixins. It will be not to hard to implement as each chunk already ask a world for section count, so now it will ask dimension about that |
Mobs are now spawning on any world height, items works correctly, the last visible issue that is not fixed yet is light. I'm not sure why it is not completely correct (looks like there are more hardcoded constants somewhere in the code), so any help is welcome P.S.: I optimised some parts of light calculations. They are not source if the issue, but light should work faster than in vanilla for any sections count Edit: I forgot about move height from level to dimension, but this is not harderst part |
StAPI now can support per-dimensional height, and any dimension can define custom height limit. Example for custom dimension: public class CoolDimension extends Dimension implements StationDimension {
@Override
short getDefaultLevelHeight() {
return 256;
}
// Other code
} Example for vanilla dimension (with Mixin): @Mixin(Overworld.class)
public class OverworldMixin implements StationDimension {
@Override
short getDefaultLevelHeight() {
return 256;
}
} I found a strange bug when Nether with vanilla generator will cause infinity world loading, when generator is custom this will not happen. I'm not sure why this happens, looks like it is not dependent from world height as it will stuck on vanilla height range too |
wonder how will it work with aether |
I fixed that. The reason was that Nether generator is different from Overworld and tried to directly put blocks byte data into chunks. As chunks have only states that failed and resulted as empty chunks. Now this is fixed |
I think that this PR is ready for review |
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.
Wrong import rules?
I think I've submitted this review wrong. |
Let's just use vanilla import rules then
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.
Pointed out some minor issues, but otherwise the PR is ready to be merged.
.../src/main/java/net/modificationstation/stationapi/mixin/flattening/MixinLevelProperties.java
Outdated
Show resolved
Hide resolved
.../src/main/java/net/modificationstation/stationapi/mixin/flattening/MixinLevelProperties.java
Show resolved
Hide resolved
...ttening-v0/src/main/java/net/modificationstation/stationapi/impl/level/DimensionStorage.java
Outdated
Show resolved
Hide resolved
…ationapi/mixin/flattening/MixinLevelProperties.java Co-authored-by: mineLdiver <[email protected]>
Seems good, merging. |
This small PR will make possible to change level height. It includes:
Bonus: short world (height set to 80 blocks with NBT Explorer):