From 416c51e2696ab06beb2d312bbd002178a5ca678f Mon Sep 17 00:00:00 2001
From: "Plamen K. Kosseff"
Date: Fri, 10 Dec 2021 12:35:28 +0200
Subject: [PATCH] update 1.14 too
---
changelog.md | 5 +++--
description/description.md | 4 ----
.../main/java/org/anti_ad/mc/common/vanilla/alias/item.kt | 4 ++++
.../java/org/anti_ad/mc/ipnext/item/ItemTypeExtensions.kt | 5 ++++-
settings.gradle.kts | 3 ++-
5 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/changelog.md b/changelog.md
index 44acc8fd..33a01ba3 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,9 +1,10 @@
### 1.2.1
-- fixes mode matching/all not moving all expected items.
-- fixed handling of overstacked items. Now we will just leave them in place.
+- fixes throw matching/all not dropping all expected items.
+- "fixed" handling of overstacked items. Now we will just leave them in place.
- forge 1.18 support looks stable enough
+- fabric 1.14 gets an update because of the first fix. If no other major problems are found this will be the last update.
diff --git a/description/description.md b/description/description.md
index c142ca08..75a5ae07 100644
--- a/description/description.md
+++ b/description/description.md
@@ -58,10 +58,6 @@ If you speak another language and would like to help to translate it, you can do
If you're a Kotlin developer and want to contribute, please see [the source](https://github.com/blackd/Inventory-Profiles)
-## Thanks
-
-Thanks to **jsminda**, the original author of [Inventory Profile](https://github.com/jsnimda/Inventory-Profiles)
-
## License
This mod is distributed under [MIT license](https://github.com/blackd/Inventory-Profiles/blob/all-in-one/LICENSE)
diff --git a/platforms/fabric-1.14/src/main/java/org/anti_ad/mc/common/vanilla/alias/item.kt b/platforms/fabric-1.14/src/main/java/org/anti_ad/mc/common/vanilla/alias/item.kt
index 84ca24ba..801913d2 100644
--- a/platforms/fabric-1.14/src/main/java/org/anti_ad/mc/common/vanilla/alias/item.kt
+++ b/platforms/fabric-1.14/src/main/java/org/anti_ad/mc/common/vanilla/alias/item.kt
@@ -1,7 +1,9 @@
package org.anti_ad.mc.common.vanilla.alias
import net.minecraft.command.arguments.NbtPathArgumentType
+import net.minecraft.enchantment.Enchantment
import net.minecraft.enchantment.EnchantmentHelper
+import net.minecraft.enchantment.Enchantments
import net.minecraft.entity.effect.StatusEffectInstance
import net.minecraft.item.Item
import net.minecraft.item.ItemGroup
@@ -52,6 +54,8 @@ typealias StringNbtReader = StringNbtReader // JsonToNBT.getTagFromJson = String
// ============
typealias EnchantmentHelper = EnchantmentHelper
+typealias Enchantment = Enchantment
+typealias Enchantments = Enchantments
// ============
// potion
diff --git a/platforms/fabric-1.14/src/main/java/org/anti_ad/mc/ipnext/item/ItemTypeExtensions.kt b/platforms/fabric-1.14/src/main/java/org/anti_ad/mc/ipnext/item/ItemTypeExtensions.kt
index 5bf71e36..ce107ffa 100644
--- a/platforms/fabric-1.14/src/main/java/org/anti_ad/mc/ipnext/item/ItemTypeExtensions.kt
+++ b/platforms/fabric-1.14/src/main/java/org/anti_ad/mc/ipnext/item/ItemTypeExtensions.kt
@@ -1,8 +1,8 @@
package org.anti_ad.mc.ipnext.item
-
import org.anti_ad.mc.common.Log
import org.anti_ad.mc.common.extensions.ifTrue
+import org.anti_ad.mc.common.vanilla.alias.Enchantment
import org.anti_ad.mc.common.vanilla.alias.EnchantmentHelper
import org.anti_ad.mc.common.vanilla.alias.Identifier
import org.anti_ad.mc.common.vanilla.alias.ItemGroup
@@ -98,6 +98,9 @@ inline val ItemType.enchantmentsScore: Double
acc + if (enchantment.isCursed) -0.001 else level.toDouble() / enchantment.maximumLevel
} // cursed enchantments +0 scores
+inline val ItemType.enchantments: MutableMap
+ get() = EnchantmentHelper.getEnchantments(vanillaStack)
+
inline val ItemType.isDamageable: Boolean
get() = vanillaStack.isDamageable
inline val ItemType.maxDamage: Int
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 289407ee..57b66853 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -12,9 +12,10 @@ if (JavaVersion.current() >= JavaVersion.VERSION_16) {
include("platforms:fabric-1.16")
include("platforms:fabric-1.15")
include("platforms:forge-1.16")
+include("platforms:fabric-1.14")
if (System.getenv("IPN_COMPILE_ALL") != null) {
- include("platforms:fabric-1.14")
+
}