Skip to content

Commit

Permalink
RTM2.4.10-29の対応
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Mar 3, 2020
1 parent 0766ff6 commit 17ee70a
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 72 deletions.
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,15 @@ dependencies {

shade "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
shade group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.1.0'
//*
/*
compile files(new File(projectDir, "mods/RTM2.4.7-26_forge-1.12.2-14.23.2.2611.jar"),
new File(projectDir, "mods/NGTLib2.4.6-23_forge-1.12.2-14.23.2.2611.jar"))
//*/
//* /
compileOnly files(new File(projectDir, "mods/RTM2.4.5-24_forge-1.12.2-14.23.2.2611.jar"),
new File(projectDir, "mods/NGTLib2.4.4-21_forge-1.12.2-14.23.2.2611.jar"))
//*/
compileOnly files(new File(projectDir, "mods/RTM2.4.10-29_forge-1.12.2-14.23.2.2611.jar"),
new File(projectDir, "mods/NGTLib2.4.9-26_forge-1.12.2-14.23.2.2611.jar"))
// */
}

Expand Down Expand Up @@ -122,4 +125,4 @@ compileKotlin {
kotlinOptions {
//freeCompilerArgs = ["-XXLanguage:+InlineClasses"]
}
}
}
22 changes: 1 addition & 21 deletions com.anatawa12.fixRtm.fixRtm.api.iml

Large diffs are not rendered by default.

30 changes: 5 additions & 25 deletions com.anatawa12.fixRtm.fixRtm.main.iml

Large diffs are not rendered by default.

22 changes: 1 addition & 21 deletions com.anatawa12.fixRtm.fixRtm.test.iml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions fixRtm.ipr
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
</list>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="1.8" />
Expand Down
23 changes: 22 additions & 1 deletion src/main/java/com/anatawa12/fixRtm/asm/MultiModelObject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,25 @@ class MultiModelObject(vararg val bases: IModelNGT) : IModelNGT {
override fun getType(): FileType = type

override fun getDrawMode(): Int = 4
}

private val _size by lazy {
var nx: Float = Float.POSITIVE_INFINITY
var ny: Float = Float.POSITIVE_INFINITY
var nz: Float = Float.POSITIVE_INFINITY
var px: Float = Float.NEGATIVE_INFINITY
var py: Float = Float.NEGATIVE_INFINITY
var pz: Float = Float.NEGATIVE_INFINITY

for (size in bases.map { it.size }) {
nx = minOf(nx, size[0])
ny = minOf(ny, size[1])
nz = minOf(nz, size[2])
px = maxOf(px, size[3])
py = maxOf(py, size[4])
pz = maxOf(pz, size[5])
}

floatArrayOf(nx, ny, nz, px, py, pz)
}
override fun getSize(): FloatArray = _size
}
11 changes: 10 additions & 1 deletion src/main/java/com/anatawa12/fixRtm/dummies/DummyModelObject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ class DummyModelObject(val aabb: AxisAlignedBB,

override fun getDrawMode(): Int = 4

override fun getSize(): FloatArray = floatArrayOf(
aabb.minX.toFloat(),
aabb.minY.toFloat(),
aabb.minZ.toFloat(),
aabb.maxX.toFloat(),
aabb.maxY.toFloat(),
aabb.maxZ.toFloat()
)

companion object {
val resourceLocation = ResourceLocation("fix-rtm", "textures/ajwm5.png")
lateinit var baseImage: BufferedImage
Expand All @@ -164,4 +173,4 @@ class DummyModelObject(val aabb: AxisAlignedBB,
val material = Material(0, resourceLocation)
val materials = mapOf(DummyModelPackManager.getDummyName("") to Material(0, null))
}
}
}

0 comments on commit 17ee70a

Please sign in to comment.