Skip to content

Commit

Permalink
Merge pull request #231 from KevinDaGame/feat/update_schematic4j
Browse files Browse the repository at this point in the history
Update schematic4j, fixing a breaking bug with large schematics
  • Loading branch information
KevinDaGame authored Dec 16, 2023
2 parents eb5f504 + 1b900d8 commit de02683
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package com.github.kevindagame.util.schematic

import com.github.kevindagame.VoxelSniper
import net.sandrohc.schematic4j.SchematicUtil
import net.sandrohc.schematic4j.schematic.types.SchematicPosInteger
import net.sandrohc.schematic4j.SchematicLoader

import java.io.File

object SchematicReader {

private fun readSchematic(file: File): VoxelSchematic {
val schematic = SchematicUtil.load(file)
val schematic = SchematicLoader.load(file)
val voxelSchematicBuilder = VoxelSchematicBuilder()

voxelSchematicBuilder.name = file.nameWithoutExtension

for (y in 0 until schematic.height) {
for (x in 0 until schematic.width) {
for (z in 0 until schematic.length) {
val pos = SchematicPosInteger(x, y, z)
val block = schematic.getBlock(pos)
for (y in 0 until schematic.height()) {
for (x in 0 until schematic.width()) {
for (z in 0 until schematic.length()) {

val block = schematic.block(x,y,z)
voxelSchematicBuilder.addBlock(x.toDouble(), y.toDouble(), z.toDouble(), block)
}
}
Expand Down
7 changes: 2 additions & 5 deletions buildSrc/src/main/kotlin/voxel-core.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ repositories {
maven {
url = uri("https://repo.maven.apache.org/maven2/")
}
maven {
url = uri("https://jitpack.io")
}
}

val shadowNoRuntime by configurations.creating {
Expand All @@ -42,8 +39,8 @@ dependencies {
shadow("net.kyori:adventure-text-serializer-legacy:4.13.1")

implementation(kotlin("stdlib-jdk8"))
implementation("com.github.SandroHc:schematic4j:0.1.0-SNAPSHOT") {
exclude("org.slf4j", "")
implementation("net.sandrohc:schematic4j:1.1.0") {
exclude("org.checkerframework", "")
}
shadowNoRuntime("com.google.code.gson:gson:2.10.1")
shadow("org.yaml:snakeyaml:1.33")
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ plugins {
include("VoxelSniperCore")
include("VoxelSniperSpigot")
include("VoxelSniperForge")
include("VoxelSniperFabric")
//include("VoxelSniperFabric")

0 comments on commit de02683

Please sign in to comment.