[1.18.2/1.9.1] Preset Load Does Not Work as Expected [Fabric]
Neonis00 opened this issue ยท 4 comments
Describe the bug
NPC's loaded using preset are not the NPC's that were saved.
Error is produced in log.
Platform(s)
- Fabric
- Forge
Environment(s)
- Singleplayer
- Server
Versions
- Minecraft 1.18.2
- Taterzens 1.9.1
To Reproduce
Steps to reproduce the behavior:
- Launch server/client.
- Create NPC
- Run command, "/npc preset save [name]"
- Run command, "/npc preset load [name]"
Expected behavior
Expected behavior is NPC's created using the preset feature should correctly load based on settings saved in .json
Logs
Error Log: https://pastebin.com/VbuWKwb1
Error Log
`[11:07:07] [Render thread/INFO]: [CHAT] Taterzen has been exported to FacelessGuard.json. [11:07:21] [Server thread/INFO]: [STDERR]: java.lang.UnsupportedOperationException: Trying to add tag of type 1 to list of 6 [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2499.method_10531(class_2499.java:278) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2499.add(class_2499.java:12) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.AbstractList.add(AbstractList.java:111) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2509.method_10665(class_2509.java:388) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2509.createList(class_2509.java:26) [11:07:21] [Server thread/INFO]: [STDERR]: at com.mojang.serialization.DynamicOps.convertList(DynamicOps.java:250) [11:07:21] [Server thread/INFO]: [STDERR]: at com.mojang.serialization.JsonOps.convertTo(JsonOps.java:45) [11:07:21] [Server thread/INFO]: [STDERR]: at com.mojang.serialization.JsonOps.convertTo(JsonOps.java:24) [11:07:21] [Server thread/INFO]: [STDERR]: at com.mojang.serialization.DynamicOps.lambda$convertMap$27(DynamicOps.java:255) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2509.method_10655(class_2509.java:301) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2509.createMap(class_2509.java:26) [11:07:21] [Server thread/INFO]: [STDERR]: at com.mojang.serialization.DynamicOps.convertMap(DynamicOps.java:254) [11:07:21] [Server thread/INFO]: [STDERR]: at com.mojang.serialization.JsonOps.convertTo(JsonOps.java:42) [11:07:21] [Server thread/INFO]: [STDERR]: at org.samo_lego.taterzens.api.TaterzensAPI.loadPresetTag(TaterzensAPI.java:88) [11:07:21] [Server thread/INFO]: [STDERR]: at org.samo_lego.taterzens.npc.TaterzenNPC.loadFromPresetFile(TaterzenNPC.java:943) [11:07:21] [Server thread/INFO]: [STDERR]: at org.samo_lego.taterzens.api.TaterzensAPI.loadTaterzenFromPreset(TaterzensAPI.java:63) [11:07:21] [Server thread/INFO]: [STDERR]: at org.samo_lego.taterzens.commands.PresetCommand.loadTaterzenFromPreset(PresetCommand.java:54) [11:07:21] [Server thread/INFO]: [STDERR]: at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:263) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2170.redirect$zzl000$performCommand(class_2170.java:547) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2170.method_9249(class_2170.java:264) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3244.method_14370(class_3244.java:1253) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3244.method_31286(class_3244.java:1237) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3244.method_12048(class_3244.java:1220) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2797.method_12115(class_2797.java:30) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2797.method_11054(class_2797.java:7) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2600.method_11072(class_2600.java:22) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3738.run(class_3738.java:18) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_1255.method_18859(class_1255.java:157) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_4093.method_18859(class_4093.java:23) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_24306(MinecraftServer.java:808) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_18859(MinecraftServer.java:165) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_1255.method_16075(class_1255.java:131) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:790) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_16075(MinecraftServer.java:784) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_1255.method_18857(class_1255.java:140) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:769) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:701) [11:07:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:273) [11:07:21] [Server thread/INFO]: [STDERR]: at java.base/java.lang.Thread.run(Thread.java:833) [11:07:21] [Render thread/INFO]: [CHAT] Taterzen was successfully loaded from FacelessGuard.json.`Additional context
Saved Preset:
Loaded Preset:
Preset JSON: https://pastebin.com/qcRkbPgB
FacelessGuard.json
```{ "Brain": { "memories": {} }, "HurtByTimestamp": 0, "Attributes": [ { "Base": 2.0, "Name": "minecraft:generic.armor" }, { "Base": 3.25, "Name": "minecraft:generic.attack_damage" }, { "Base": 0.0, "Name": "minecraft:generic.armor_toughness" }, { "Base": 0.2505, "Name": "minecraft:generic.movement_speed" }, { "Base": 0.0, "Name": "minecraft:generic.knockback_resistance" } ], "Invulnerable": 0, "FallFlying": 0, "PortalCooldown": 0, "AbsorptionAmount": 0.0, "FallDistance": 0.0, "TaterzenNPCTag": { "Messages": [], "Behaviour": "FRIENDLY", "BungeeCommands": [], "BodyRotations": { "XRot": 0.0, "YRot": 10.870438 }, "AllowSwimming": 1, "skin": { "signature": "BxUZH5Xq+EeNuE3qZ96I2UrRTvlKoCMwOPfuswJ1WLUq5c/TPjYM+1zSDhbz308HduU//fWw036jUSvVJoiMvOHHgplvAAPVT4OY8GJBap84UDOEby6I3lteHvr58C04OSj1ZI0yLHjkqgV/ucxYtul0E45Y3dkmcfYPe6Wjf3Hkf/10AnQz6HW7dBbY8Up708YkRtEcESORv8JnmGYwGLS2ZR8f7tgTjsZ6SOJxvTBdLae0HDdeWgDV4RYieqifCtZ1k7MQ8UUt5GTMNqAoRy3EYp/msU7Ni9pLUx9mWeORMGf0ujejfYaVpK5BcxvoETbz26hxqkgaywkUVxfXFGD9nZpmu3c9rostHwGQNgUoH0XX0+S4VperWcWFWsBzdKOaCWvFLQPfbgh+uAntEdQMAjKqyEKTms/rMF+BPSLL+wOxZ9Np8T1qv3QhILWcfumLwowSj8sPPxJTakpvnXrj2Ke5mSFD/+Ox7p3AYBM6eIGFuSwMDPEFdrces7LXmvkR62x7FdrFxCf8gX+lUkDgkiAsCOYe3wvsMyb0Sq1Zfm5tjmb6fYaoRJYUX5CSR3baJAdKsvYKB5atF0F1TrYd++GS2UpYyAOy6dEyAS7stqeHI3kqGmx8dTj1Nbmh82fIeCrJ22B5DSGEK/QCylgC9RvjszikZDu4dhBE2Qg=", "value": "ewogICJ0aW1lc3RhbXAiIDogMTY1MjYzMDUyNzQ3OCwKICAicHJvZmlsZUlkIiA6ICIxN2Q0ODA1ZDRmMTA0YTA5OWRiYzJmNzYzMDNjYmRkZiIsCiAgInByb2ZpbGVOYW1lIiA6ICJnaWZ0bWV0b25uZXMiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjY0YzlhZDVjYjIzZWY5OGM0ODg5NDAxNjM0MWY4Zjc4OGY4YzM3ZWNlMzM3OGFkOGQ5NGE2ZWM4ZTk5MjdlZCIKICAgIH0KICB9Cn0=" }, "PermissionLevel": 4, "SkinLayers": 127, "PathTargets": [], "MinCommandInteractionTime": 0, "LockedBy": [ -1299222177, -1884339865, -1252007822, -1567585759 ], "Follow": { "Type": "NONE" }, "AllowFlight": 0, "Pose": "STANDING", "Commands": [], "movement": "LOOK", "Tags": { "SneakNameType": 0, "AllowFlight": 0, "AllowSounds": 0, "AllowRiding": 0, "JumpAttack": 1, "DropsAllowed": 0, "Leashable": 0, "Pushable": 0 }, "Professions": [] }, "DeathTime": 0, "PersistenceRequired": 1, "Health": 20.0, "LeftHanded": 0, "Air": 300, "OnGround": 1, "HandItems": [ { "id": "minecraft:netherite_sword", "Count": 1, "tag": { "durable": 0.20000000298023224, "Damage": 147, "Enchantments": [ { "lvl": 2, "id": "fabricenchantments:ice_aspect" }, { "lvl": 3, "id": "minecraft:unbreaking" } ], "Tiered": { "Tier": "tiered:epic" } } }, { "id": "basicshields:netherite_shield", "Count": 1, "tag": { "durable": 0.4000000059604645, "Damage": 91, "Enchantments": [ { "lvl": 3, "id": "minecraft:unbreaking" } ], "Tiered": { "Tier": "tiered:mercy" } } } ], "CustomName": "{\"text\":\"Faceless Guard\"}", "Fire": -1, "ArmorItems": [ { "id": "minecraft:netherite_boots", "Count": 1, "tag": { "durable": 0.20000000298023224, "Damage": 129, "Enchantments": [ { "lvl": 3, "id": "minecraft:unbreaking" }, { "lvl": 4, "id": "minecraft:fire_protection" } ], "Tiered": { "Tier": "tiered:epic" } } }, { "id": "minecraft:netherite_leggings", "Count": 1, "tag": { "durable": 0.20000000298023224, "Damage": 138, "Enchantments": [ { "lvl": 3, "id": "minecraft:unbreaking" } ], "Tiered": { "Tier": "tiered:epic" } } }, { "id": "minecraft:netherite_chestplate", "Count": 1, "tag": { "durable": 0.10000000149011612, "Damage": 125, "Enchantments": [ { "lvl": 3, "id": "minecraft:unbreaking" }, { "lvl": 3, "id": "minecraft:protection" }, { "lvl": 4, "id": "fabricenchantments:tank" } ], "Tiered": { "Tier": "tiered:epic" } } }, { "id": "minecraft:netherite_helmet", "Count": 1, "tag": { "durable": 0.30000001192092896, "Damage": 126, "Enchantments": [ { "lvl": 4, "id": "minecraft:protection" }, { "lvl": 1, "id": "minecraft:aqua_affinity" }, { "lvl": 3, "id": "minecraft:unbreaking" } ], "Tiered": { "Tier": "tiered:legendary" } } } ], "CanPickUpLoot": 1, "HurtTime": 0, "AABB": [ -342.3166389886398, 64.0, 4.536935529905202, -341.71663896479794, 65.79999995231628, 5.13693555374706 ], "CustomNameVisible": 1 } ```.
I cannot reproduce this only with taterzens installed ๐ค ...
Okay, so, I did some testing just now.
Looks like whatever this is in the preset config, is the cause:
It seems that this is added to the config when "Debugify" is installed.
These are the mods I was running during my test:
Just for reference, I am running on Fabric Loader 0.14.5.
I tested preset creation with and without Debugify, and either new preset or overwritten preset will change depending on if Debugify is installed or not.
Preset will work when saved without Debugify, and will not work when saved with Debugify.