fix briefcase not saving items correctly
@@ -8,7 +8,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.util.NonNullList;
+import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.util.Constants;
+import net.minecraftforge.fml.DistExecutor;
public class BriefcaseInventory implements IInventory {
@@ -61,7 +63,7 @@ public class BriefcaseInventory implements IInventory {
}
tag.put("ItemInventory", items);
- SecurityCraft.channel.sendToServer(new UpdateNBTTagOnServer(briefcase));
+ DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> SecurityCraft.channel.sendToServer(new UpdateNBTTagOnServer(briefcase)));
}
@Override
