Dynamic save version id

This commit is contained in:
nea
2023-05-04 15:42:55 +02:00
parent bcd86e2822
commit 4053a2995e
2 changed files with 20 additions and 18 deletions

View File

@@ -12,6 +12,7 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlin.io.path.absolutePathString import kotlin.io.path.absolutePathString
import kotlin.io.path.writer import kotlin.io.path.writer
import net.minecraft.SharedConstants
import net.minecraft.client.resource.language.I18n import net.minecraft.client.resource.language.I18n
import net.minecraft.datafixer.Schemas import net.minecraft.datafixer.Schemas
import net.minecraft.datafixer.TypeReferences import net.minecraft.datafixer.TypeReferences
@@ -22,6 +23,7 @@ import net.minecraft.nbt.NbtOps
import net.minecraft.text.Text import net.minecraft.text.Text
import net.minecraft.util.Identifier import net.minecraft.util.Identifier
import moe.nea.notenoughupdates.NotEnoughUpdates import moe.nea.notenoughupdates.NotEnoughUpdates
import moe.nea.notenoughupdates.mixins.accessor.AccessorDataFixTypes
import moe.nea.notenoughupdates.util.LegacyTagParser import moe.nea.notenoughupdates.util.LegacyTagParser
import moe.nea.notenoughupdates.util.appendLore import moe.nea.notenoughupdates.util.appendLore
@@ -46,7 +48,7 @@ object ItemCache : IReloadable {
TypeReferences.ITEM_STACK, TypeReferences.ITEM_STACK,
Dynamic(NbtOps.INSTANCE, this), Dynamic(NbtOps.INSTANCE, this),
-1, -1,
2975 SharedConstants.getGameVersion().saveVersion.id
).value as NbtCompound ).value as NbtCompound
} catch (e: Exception) { } catch (e: Exception) {
if (isFlawless) if (isFlawless)

View File

@@ -1,20 +1,20 @@
{ {
"required": true, "required": true,
"plugin": "moe.nea.notenoughupdates.init.MixinPlugin", "plugin": "moe.nea.notenoughupdates.init.MixinPlugin",
"package": "moe.nea.notenoughupdates.mixins", "package": "moe.nea.notenoughupdates.mixins",
"compatibilityLevel": "JAVA_16", "compatibilityLevel": "JAVA_16",
"client": [ "client": [
"MixinDownloadingTerrainScreen", "MixinDownloadingTerrainScreen",
"MixinMessageHandler", "MixinMessageHandler",
"MixinMinecraft", "MixinMinecraft",
"MixinWorldRenderer", "MixinWorldRenderer",
"accessor.AccessorHandledScreen", "accessor.AccessorHandledScreen",
"devenv.DisableCommonPacketWarnings" "devenv.DisableCommonPacketWarnings"
], ],
"mixins": [ "mixins": [
"devenv.DisableInvalidFishingHook" "devenv.DisableInvalidFishingHook"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1
} }
} }