A mod for 1.12.2+ that creates smooth terrain in Minecraft
LGPL-3.0 License
A mod for 1.12.2+ by Cadiboo that creates smooth terrain in Minecraft. Website CurseForge Page
Note: NoCubes is not feature complete and is still very much in development.
See also the project's TODO list, Trello board and TV Show
This feature works regardless of if the server has the mod installed or not.
Here's how Minecraft's rendering system works:
Here's where NoCubes comes in:
This feature only works when both the client and server have NoCubes installed.
NoCubes changes Minecraft's terrain collisions to be smooth too (i.e. you can walk on the smooth terrain, rather than on the original cubes).
Here's how Minecraft's rendering system works:
NoCubes changes the shape that the collision system sees for each block:
This approach is wasteful because the mesh generator is being called for the same area multiple times rather than once for the whole nearby area. Work is being done to fix this.
Reading the above you might've started wondering "What is a mesh generator?". Mesh generators (aka isosurface extractors) are the underlying technology that makes NoCubes work. A mesh generator is an algorithm (NoCubes supports multiple different ones) that takes a field (aka area) of voxels (aka cubes/blocks) and turns them into faces (quads/squares or triangles). Here are some links:
Isosurface extraction isn't the only way of procedurally generating a mesh though, Wave Function Collapse is another very interesting approach that gives artists much more control over the final product:
OptiFine is a bit hard to work with To get it running in your development environment:
NoCubes/run/mods/
To be able to also compile against OptiFine (do the above steps first):
gradle.properties
.NoCubes/run/mods/
and select 'Extract', put the resulting extracted jar somewhere outside the mods
folderNoCubes
folder for the project folderNoCubes/libs/
Note: You can replace the normal OptiFine jar with the extracted (non-deobfuscated) one in NoCubes/run/mods/
(this may speed up OptiFine's loading time)
NoCubes' OptiFine compatibility should not be shipped to production compiled directly against OptiFine's classes because it can crash if OptiFine isn't present. Instead, the code should be converted to Reflection. Using Reflection has the added benefit of allowing the same NoCubes jar to support multiple versions of OptiFine.
It's possible to get Forge to do most of the work by adding the following code to build.gradle
.
repositories {
flatDir {
dirs 'run/mods'
}
}
dependencies {
// OptiFine is the first dependency because so that we can compile against its version of vanilla's classes, not Forge's
// Needs a group classifier even though it's not used, this can be anything, I used 'undefined'
compileOnly fg.deobf('undefined:OptiFine_1.16.5_HD_U_G8_pre12_MOD.jar:')
//... other dependencies like Forge
}
However, this doesn't fully work because Forge doesn't apply my ATs to OptiFine's classes :( It's probably possible to run AccessTransformers ourselves against the deobfed OptiFine dependency, but I can't figure out how