fix curios inventory replicate bug

This commit is contained in:
mlus 2024-04-23 21:27:02 +08:00
parent 50648a217d
commit 0dfab35b25

View File

@ -32,8 +32,12 @@ public class ModsSupport {
itemHandler.ifPresent(handler -> {
for (int i = 0; i < handler.getSlots(); i++) {
try {
if (curios.get(i) == null) continue;
handler.getEquippedCurios().setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ","))));
if (curios.get(i) == null){
handler.getEquippedCurios().setStackInSlot(i,ItemStack.EMPTY);
}else{
handler.getEquippedCurios().setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ","))));
}
} catch (CommandSyntaxException e) {
throw new RuntimeException(e);
}