mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-27 06:20:05 +00:00
Merge pull request #314 from PolyhedralDev/ver/6.0.1
Patch version 6.0.1
This commit is contained in:
5 files changed
+20
-12
No files matched your search
@@ -12,6 +12,7 @@ import kotlin.streams.asStream
|
|||||||
* Configures a directory where addons will be put.
|
* Configures a directory where addons will be put.
|
||||||
*/
|
*/
|
||||||
fun Project.addonDir(dir: File, task: Task) {
|
fun Project.addonDir(dir: File, task: Task) {
|
||||||
|
task.dependsOn("compileAddons")
|
||||||
task.doFirst {
|
task.doFirst {
|
||||||
dir.parentFile.mkdirs()
|
dir.parentFile.mkdirs()
|
||||||
matchingAddons(dir) {
|
matchingAddons(dir) {
|
||||||
|
|||||||
@@ -7,16 +7,19 @@ import java.nio.file.Files
|
|||||||
import java.nio.file.StandardCopyOption
|
import java.nio.file.StandardCopyOption
|
||||||
import org.gradle.api.DefaultTask
|
import org.gradle.api.DefaultTask
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.api.Task
|
||||||
import org.gradle.api.plugins.BasePluginExtension
|
import org.gradle.api.plugins.BasePluginExtension
|
||||||
import org.gradle.jvm.tasks.Jar
|
import org.gradle.jvm.tasks.Jar
|
||||||
import org.gradle.kotlin.dsl.apply
|
import org.gradle.kotlin.dsl.apply
|
||||||
import org.gradle.kotlin.dsl.configure
|
import org.gradle.kotlin.dsl.configure
|
||||||
|
import org.gradle.kotlin.dsl.creating
|
||||||
import org.gradle.kotlin.dsl.extra
|
import org.gradle.kotlin.dsl.extra
|
||||||
import org.gradle.kotlin.dsl.get
|
import org.gradle.kotlin.dsl.get
|
||||||
import org.gradle.kotlin.dsl.named
|
import org.gradle.kotlin.dsl.named
|
||||||
import org.yaml.snakeyaml.DumperOptions
|
import org.yaml.snakeyaml.DumperOptions
|
||||||
import org.yaml.snakeyaml.Yaml
|
import org.yaml.snakeyaml.Yaml
|
||||||
|
|
||||||
|
|
||||||
fun Project.configureDistribution() {
|
fun Project.configureDistribution() {
|
||||||
apply(plugin = "com.github.johnrengelman.shadow")
|
apply(plugin = "com.github.johnrengelman.shadow")
|
||||||
|
|
||||||
@@ -29,13 +32,17 @@ fun Project.configureDistribution() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val installAddons = tasks.create("installAddons") {
|
val compileAddons = tasks.create("compileAddons") {
|
||||||
group = "terra"
|
|
||||||
forSubProjects(":common:addons") {
|
forSubProjects(":common:addons") {
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
dependsOn(getJarTask())
|
dependsOn(getJarTask())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val installAddons = tasks.create("installAddons") {
|
||||||
|
group = "terra"
|
||||||
|
dependsOn(compileAddons)
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
// https://github.com/johnrengelman/shadow/issues/111
|
// https://github.com/johnrengelman/shadow/issues/111
|
||||||
@@ -44,18 +51,18 @@ fun Project.configureDistribution() {
|
|||||||
FileSystems.newFileSystem(dest, mapOf("create" to "false"), null).use { fs ->
|
FileSystems.newFileSystem(dest, mapOf("create" to "false"), null).use { fs ->
|
||||||
forSubProjects(":common:addons") {
|
forSubProjects(":common:addons") {
|
||||||
val jar = getJarTask()
|
val jar = getJarTask()
|
||||||
|
|
||||||
println("Packaging addon ${jar.archiveFileName.get()} to $dest. size: ${jar.archiveFile.get().asFile.length() / 1024}KB")
|
println("Packaging addon ${jar.archiveFileName.get()} to $dest. size: ${jar.archiveFile.get().asFile.length() / 1024}KB")
|
||||||
|
|
||||||
val boot = if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "bootstrap/" else ""
|
val boot = if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "bootstrap/" else ""
|
||||||
val addonPath = fs.getPath("/addons/$boot${jar.archiveFileName.get()}");
|
val addonPath = fs.getPath("/addons/$boot${jar.archiveFileName.get()}");
|
||||||
|
|
||||||
if(!Files.exists(addonPath)) {
|
if (!Files.exists(addonPath)) {
|
||||||
Files.createDirectories(addonPath.parent)
|
Files.createDirectories(addonPath.parent)
|
||||||
Files.createFile(addonPath)
|
Files.createFile(addonPath)
|
||||||
Files.copy(jar.archiveFile.get().asFile.toPath(), addonPath, StandardCopyOption.REPLACE_EXISTING)
|
Files.copy(jar.archiveFile.get().asFile.toPath(), addonPath, StandardCopyOption.REPLACE_EXISTING)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,7 +127,7 @@ fun Project.configureDistribution() {
|
|||||||
relocate("com.dfsek.paralithic", "com.dfsek.terra.lib.paralithic")
|
relocate("com.dfsek.paralithic", "com.dfsek.terra.lib.paralithic")
|
||||||
relocate("org.json", "com.dfsek.terra.lib.json")
|
relocate("org.json", "com.dfsek.terra.lib.json")
|
||||||
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
|
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
|
||||||
|
|
||||||
finalizedBy(installAddons)
|
finalizedBy(installAddons)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ public class EqualsStatement extends BinaryOperation<Object, Boolean> {
|
|||||||
return FastMath.abs(l.doubleValue() - r.doubleValue()) <= EPSILON;
|
return FastMath.abs(l.doubleValue() - r.doubleValue()) <= EPSILON;
|
||||||
}
|
}
|
||||||
|
|
||||||
return left.equals(rightUnwrapped);
|
return leftUnwrapped.equals(rightUnwrapped);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -99,7 +99,7 @@ public class StructureScript implements Structure, Keyed<StructureScript> {
|
|||||||
.registerFunction("rotationDegrees", new ZeroArgFunctionBuilder<>(arguments -> arguments.getRotation().getDegrees(),
|
.registerFunction("rotationDegrees", new ZeroArgFunctionBuilder<>(arguments -> arguments.getRotation().getDegrees(),
|
||||||
Returnable.ReturnType.NUMBER))
|
Returnable.ReturnType.NUMBER))
|
||||||
.registerFunction("print",
|
.registerFunction("print",
|
||||||
new UnaryStringFunctionBuilder(string -> LOGGER.debug("[TerraScript:{}] {}", id, string)))
|
new UnaryStringFunctionBuilder(string -> LOGGER.info("[TerraScript:{}] {}", id, string)))
|
||||||
.registerFunction("abs", new UnaryNumberFunctionBuilder(number -> FastMath.abs(number.doubleValue())))
|
.registerFunction("abs", new UnaryNumberFunctionBuilder(number -> FastMath.abs(number.doubleValue())))
|
||||||
.registerFunction("pow2", new UnaryNumberFunctionBuilder(number -> FastMath.pow2(number.doubleValue())))
|
.registerFunction("pow2", new UnaryNumberFunctionBuilder(number -> FastMath.pow2(number.doubleValue())))
|
||||||
.registerFunction("pow", new BinaryNumberFunctionBuilder(
|
.registerFunction("pow", new BinaryNumberFunctionBuilder(
|
||||||
|
|||||||
+2
-2
@@ -54,7 +54,7 @@ public class NMSChunkGeneratorDelegate extends ChunkGenerator {
|
|||||||
private final long seed;
|
private final long seed;
|
||||||
|
|
||||||
private final Map<ConcentricRingsStructurePlacement, Lazy<List<ChunkCoordIntPair>>> h = new Object2ObjectArrayMap<>();
|
private final Map<ConcentricRingsStructurePlacement, Lazy<List<ChunkCoordIntPair>>> h = new Object2ObjectArrayMap<>();
|
||||||
|
private static final Lazy<List<ChunkCoordIntPair>> EMPTY = Lazy.lazy(List::of);
|
||||||
|
|
||||||
|
|
||||||
public NMSChunkGeneratorDelegate(ChunkGenerator vanilla, ConfigPack pack, NMSBiomeProvider biomeProvider, long seed) {
|
public NMSChunkGeneratorDelegate(ChunkGenerator vanilla, ConfigPack pack, NMSBiomeProvider biomeProvider, long seed) {
|
||||||
@@ -154,7 +154,7 @@ public class NMSChunkGeneratorDelegate extends ChunkGenerator {
|
|||||||
@Override
|
@Override
|
||||||
public List<ChunkCoordIntPair> a(ConcentricRingsStructurePlacement concentricringsstructureplacement) {
|
public List<ChunkCoordIntPair> a(ConcentricRingsStructurePlacement concentricringsstructureplacement) {
|
||||||
this.i();
|
this.i();
|
||||||
return this.h.get(concentricringsstructureplacement).value();
|
return this.h.getOrDefault(concentricringsstructureplacement, EMPTY).value();
|
||||||
}
|
}
|
||||||
|
|
||||||
private volatile boolean rings = false;
|
private volatile boolean rings = false;
|
||||||
|
|||||||
Reference in new issue
Block a user