-
Notifications
You must be signed in to change notification settings - Fork 95
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
feat: Minestom platform #485
base: ver/6.6.0
Are you sure you want to change the base?
feat: Minestom platform #485
Conversation
This commit is in preparation of multi-layered worldgen with minestom
Removed Feature caching since it was buggy asf
I'm done here for now! Please leave a code review and try it out! If you have any questions or notes about my implementation, please let me know here or in discord! |
platforms/minestom/src/main/java/com/dfsek/terra/minestom/TerraMinestomExample.java
Outdated
Show resolved
Hide resolved
common/api/src/main/java/com/dfsek/terra/api/block/BlockType.java
Outdated
Show resolved
Hide resolved
platforms/minestom/build.gradle.kts
Outdated
|
||
tasks.getByName("run").setProperty("workingDir", file("./run")) | ||
|
||
addonDir(project.file("./run/terra/addons"), tasks.named("run").get()) |
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.
afaik somewhere you need to depend on the installAddons
task.
see:
Terra/platforms/fabric/build.gradle.kts
Lines 47 to 55 in 0a952cf
tasks { | |
remapJar { | |
dependsOn("installAddons") | |
injectAccessWidener.set(true) | |
inputFile.set(shadowJar.get().archiveFile) | |
archiveFileName.set("${rootProject.name.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}-fabric-${project.version}.jar") | |
} | |
} |
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.
Should be fixed by the latest commit
platforms/minestom/src/main/java/com/dfsek/terra/minestom/MinestomPlatform.java
Outdated
Show resolved
Hide resolved
import org.slf4j.LoggerFactory; | ||
|
||
|
||
public class GeneratedChunkCache { |
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.
Why is this needed?
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.
Minestom does not implement separate stages between terrain and feature generation as of now. This is needed to store terrain for "ungenerated" chunks for feature generation, since we can't just load them via minestom
import net.minestom.server.coordinate.Pos; | ||
|
||
|
||
public class DeferredMinestomEntity implements Entity { |
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.
Why is this needed?
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.
During World generation, no entities can be placed in minestom. This uses the async chunk loading api to create the entities after the world is loaded
...rms/minestom/src/main/java/com/dfsek/terra/minestom/world/MinestomChunkGeneratorWrapper.java
Outdated
Show resolved
Hide resolved
platforms/minestom/src/main/java/com/dfsek/terra/minestom/MinestomPlatform.java
Outdated
Show resolved
Hide resolved
import java.util.function.Function; | ||
|
||
|
||
public class TerraMinestomWorldBuilder { |
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.
Why do we have this?
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.
The TerraMinestomWorld
class has a lot of parameters. Since Minestom is not configured like bukkit, all worlds need to be created through the API. This makes it easier to create a world. See the provided example for more details
508856d
to
a70f61f
Compare
a70f61f
to
7711e67
Compare
Pull Request
Description
This PR implements the terra platform for minestom. You can read more about how this port works on my blog or by looking at the code :)
I just want to get this out here even if it is not complete to get some early feedback on my code. So if you think I should do something different, please let me know!
Closes #113
Changelog
Checklist
Mandatory checks
ver/
prefix)or is a branch that is intended to be merged into a version branch.
CONTRIBUTING.md
document in the root of the git repository.
Types of changes
Compatibility
Documentation
I'll add docs to the TerraDocs-Repo when this is done
Testing
Licensing
release it under GPLv3.
released under GPLv3 or a compatible license.