Clean up forge gradle script, apply the chorus plant fix to forge/fabric world.

This commit is contained in:
wizjany 2021-12-02 14:43:49 -05:00
parent a8656c5f24
commit 46de95ff3c
3 changed files with 15 additions and 13 deletions

View File

@ -487,6 +487,9 @@ public boolean generateTree(TreeType type, EditSession editSession, BlockVector3
ConfiguredFeature<?, ?> generator = createTreeFeatureGenerator(type);
ServerLevel world = (ServerLevel) getWorld();
ServerChunkCache chunkManager = world.getChunkSource();
if (type == TreeType.CHORUS_PLANT) {
position = position.add(0, 1, 0);
}
return generator != null && generator.place(
world, chunkManager.getGenerator(), random,
FabricAdapter.toBlockPos(position)

View File

@ -17,12 +17,13 @@
}
val forgeVersion = "38.0.10"
val apiClasspath = configurations.create("apiClasspath")
apiClasspath.isCanBeResolved = true
configurations.api.get().extendsFrom(apiClasspath)
val apiClasspath = configurations.create("apiClasspath") {
isCanBeResolved = true
extendsFrom(configurations.api.get())
}
dependencies {
"apiClasspath"(project(":worldedit-core"))
"api"(project(":worldedit-core"))
"implementation"(platform("org.apache.logging.log4j:log4j-bom:2.14.1") {
because("Mojang provides Log4J at 2.14.1")
})
@ -31,10 +32,7 @@
}
configure<UserDevExtension> {
mappings(mapOf(
"channel" to "official",
"version" to minecraftVersion
))
mappings("official", minecraftVersion)
accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
@ -46,14 +44,12 @@
))
workingDirectory = project.file("run").canonicalPath
source(sourceSets["main"])
lazyToken("minecraft_classpath") {
apiClasspath.resolve().joinToString(File.pathSeparator) { it.absolutePath }
}
}
create("client", runConfig)
create("server", runConfig)
all {
lazyToken("minecraft_classpath") {
apiClasspath.copyRecursive().resolve().joinToString(File.pathSeparator) { it.absolutePath }
}
}
}
}

View File

@ -484,6 +484,9 @@ public boolean generateTree(TreeType type, EditSession editSession, BlockVector3
ConfiguredFeature<?, ?> generator = createTreeFeatureGenerator(type);
ServerLevel world = getWorld();
ServerChunkCache chunkManager = world.getChunkSource();
if (type == TreeType.CHORUS_PLANT) {
position = position.add(0, 1, 0);
}
return generator != null && generator.place(
world, chunkManager.getGenerator(), random, ForgeAdapter.toBlockPos(position)
);