Opening Chest Crash
PCRGaming opened this issue ยท 18 comments
Minecraft Version
1.20.x
Mod Loader Version
0.14.24
Mod Version
1.3.0
Describe the Issue
Opening a chest immediately crashed the world
latest.log
crash-2023-11-21_13.56.06-client.txt
Do you use any other mods except the required ones?
Yes
Fixed with the solution of @Simiux on latest version.
Seems like another mod makes the multimap immutable which is not optimal, vanilla behavior is a mutable map.
Which ever mod does that, it should get changed.
Fixed with the solution of @Simiux on latest version. Seems like another mod makes the multimap immutable which is not optimal, vanilla behavior is a mutable map. Which ever mod does that, it should get changed.
wdym the "solution of Simiux" ?
it was me who gave the solution lol
I have not yet attempted to reproduce without any other mods, however I will do so later.
I know which item in particular is causing this (is fully reproducible), and will do a binary search for the minimum set of mods later.
I have not yet attempted to reproduce without any other mods, however I will do so later.
I know which item in particular is causing this
The crash happens when hovering over specific items, I havent been able to know what the item's NBT tags are and whether they cause the crash
I'm experiencing the same error, so I've implemented a temporary fix for myself. This is probably not the best solution, but it's a temporary workaround for me.
diff --git a/src/main/java/draylar/tiered/mixin/client/ItemStackClientMixin.java b/src/main/java/draylar/tiered/mixin/client/ItemStackClientMixin.java
index ff93fa6..618e6d2 100644
--- a/src/main/java/draylar/tiered/mixin/client/ItemStackClientMixin.java
+++ b/src/main/java/draylar/tiered/mixin/client/ItemStackClientMixin.java
@@ -1,5 +1,7 @@
package draylar.tiered.mixin.client;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;
import draylar.tiered.Tiered;
@@ -41,6 +43,7 @@ import java.util.Map;
@Environment(EnvType.CLIENT)
@Mixin(ItemStack.class)
public abstract class ItemStackClientMixin {
+ private static final Logger logger = LoggerFactory.getLogger(ItemStackClientMixin.class);
@Shadow
public abstract NbtCompound getOrCreateSubNbt(String key);
@@ -201,7 +204,11 @@ public abstract class ItemStackClientMixin {
int var8, EquipmentSlot equipmentSlot, Multimap multimap) {
if (this.isTiered && !multimap.isEmpty() && equipmentSlot == EquipmentSlot.OFFHAND && this.getAttributeModifiers(EquipmentSlot.MAINHAND) != null
&& !this.getAttributeModifiers(EquipmentSlot.MAINHAND).isEmpty()) {
- multimap.clear();
+ try {
+ multimap.clear();
+ } catch (UnsupportedOperationException e) {
+ logger.warn("Tried to clear multimap with contents {}, but could not modify multimap.", multimap, e);
+ }
}
}
I'm experiencing the same error, so I've implemented a temporary fix for myself. This is probably not the best solution, but it's a temporary workaround for me.
diff --git a/src/main/java/draylar/tiered/mixin/client/ItemStackClientMixin.java b/src/main/java/draylar/tiered/mixin/client/ItemStackClientMixin.java index ff93fa6..618e6d2 100644 --- a/src/main/java/draylar/tiered/mixin/client/ItemStackClientMixin.java +++ b/src/main/java/draylar/tiered/mixin/client/ItemStackClientMixin.java @@ -1,5 +1,7 @@ package draylar.tiered.mixin.client; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.collect.LinkedListMultimap; import com.google.common.collect.Multimap; import draylar.tiered.Tiered; @@ -41,6 +43,7 @@ import java.util.Map; @Environment(EnvType.CLIENT) @Mixin(ItemStack.class) public abstract class ItemStackClientMixin { + private static final Logger logger = LoggerFactory.getLogger(ItemStackClientMixin.class); @Shadow public abstract NbtCompound getOrCreateSubNbt(String key); @@ -201,7 +204,11 @@ public abstract class ItemStackClientMixin { int var8, EquipmentSlot equipmentSlot, Multimap multimap) { if (this.isTiered && !multimap.isEmpty() && equipmentSlot == EquipmentSlot.OFFHAND && this.getAttributeModifiers(EquipmentSlot.MAINHAND) != null && !this.getAttributeModifiers(EquipmentSlot.MAINHAND).isEmpty()) { - multimap.clear(); + try { + multimap.clear(); + } catch (UnsupportedOperationException e) { + logger.warn("Tried to clear multimap with contents {}, but could not modify multimap.", multimap, e); + } } }
I'd love to learn how you did this I'm having the same issue. Somehow no one else in my family does
@Simiux I just cloned the repo, edit the code with that patch I sent, and then recompiled it
here is how to do that:
- make sure you have a java jdk and git installed
- open a terminal, and clone the repo
cd
into repo folder- copy that text and save it as
tiered-crash-fix.patch
in that folder - run
git apply tiered-crash-fix.patch
to apply it - run
gradlew.bat build
for windows or./gradlew build
for linux/macos - you can now copy the mod from
build/libs/
into your mods folder.
@solonovamax hey man dope, It took a bit of punching around, but I ended up being able to fix it, the bows don't crash me anymore. Thanks for the code, absolute machine.
I believe it may possibly be zenith, but I am unsure.
I'm probably gonna investigate a bit more, later, if I don't forgor again
Ran into this issue with Zenith and confirmed by removing the durability attribute added to the items nbt data to fix the crash. Crash is the same issue in getToolTipMix method in the getItemStackMixin class under tiered/src/main/java/draylar/tiered/mixin/client
Having the same issue with bow-type weapons from the mod "Spellbound Weapons", the blowgun in particular. I also believe tools modified by the mod "Golden Age Combat" causes this bug as well. After disabling Golden Age Combat/TieredZ, I was able to use the tools that had been "balanced" by Golden Age Combat; However, using both mods always seems to crash when attempting to display the tooltip bar.