From 536c959f4726eb183e586995b0ad0f6212890c97 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 10 Feb 2023 19:04:29 +0700 Subject: [PATCH] Update code to reflect newer kotlin version --- README.md | 11 ++++++----- .../ru/dbotthepony/mc/otm/OverdriveThatMatters.java | 4 ++-- src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c153ece08..c702f104a 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,20 @@ Minecraft mod with science fiction style, about matter, and energy, combined. ### Required mods -* [Kotlin for Forge](https://www.curseforge.com/minecraft/mc-mods/kotlin-for-forge) or have Kotlin standard library in classpath +* [Kotlin for Forge](https://www.curseforge.com/minecraft/mc-mods/kotlin-for-forge) or have Kotlin standard library in classpath (at least 1.8.0 is required) +* [Koremods](https://beta.curseforge.com/minecraft/mc-mods/koremods) ### Recommended mods * [Ferrite Core](https://www.curseforge.com/minecraft/mc-mods/ferritecore), reduces memory usage * In case of Overdrive That Matters, ***greatly*** reduces JVM heap bloat caused by model data being duplicated -### Supported mods +### Mods with special compatibility code -* [Mekanism](https://www.curseforge.com/minecraft/mc-mods/Mekanism) (full duplex Mekanism Joules support, QIO) -* [Curios](https://www.curseforge.com/minecraft/mc-mods/curios) (GUI support, technical inventory access) -* [Cosmetic Armor Reworked](https://www.curseforge.com/minecraft/mc-mods/cosmetic-armor-reworked) (GUI support, technical inventory access) * [JEI](https://www.curseforge.com/minecraft/mc-mods/jei) +* [Mekanism](https://www.curseforge.com/minecraft/mc-mods/Mekanism) +* [Curios](https://www.curseforge.com/minecraft/mc-mods/curios) +* [Cosmetic Armor Reworked](https://www.curseforge.com/minecraft/mc-mods/cosmetic-armor-reworked) ---- diff --git a/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java b/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java index e14fd89a5..dc2768d39 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java +++ b/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java @@ -76,8 +76,8 @@ public final class OverdriveThatMatters { } private static void checkIfKotlinIsInstalled() { - if (!KotlinVersion.CURRENT.isAtLeast(1, 6, 10)) { - throw new UnsupportedClassVersionError("Installed kotlin version is " + KotlinVersion.CURRENT + ", when at least 1.6.10 is required."); + if (!KotlinVersion.CURRENT.isAtLeast(1, 8, 0)) { + throw new UnsupportedClassVersionError("Installed kotlin version is " + KotlinVersion.CURRENT + ", when at least 1.8.0 is required."); } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt index f744436af..6a5fae9fe 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt @@ -252,7 +252,7 @@ inline fun MutableList>.forValidRefs(fn: (T) -> Unit) { } val ComponentContents.key: String - get() = (this as? TranslatableContents ?: throw ClassCastException("$this is not a TranslatableContents"))?.key + get() = (this as? TranslatableContents ?: throw ClassCastException("$this is not a TranslatableContents")).key fun > BlockState.getValueNullable(prop: Property): T? { if (hasProperty(prop)) {